A Brief Description and Comparison of Programming Languages FORTRAN, ALGOL, COBOL, and LISP 1.5 from a Critical Standpoint
Total Page:16
File Type:pdf, Size:1020Kb
https://ntrs.nasa.gov/search.jsp?R=19720025540 2018-03-05T17:43:28+00:00Z NATIONAL AERONAUTICS AND SPACE ADMINISTRATION Technical Memorandum 33-566 A Brief Description and Comparison of Programming Languages FORTRAN, ALGOL, COBOL, PLII, and LISP 1.5 From a Critical Standpoint F. P. Mathur JET PROPULSION LABORATORY CALIFORNIA INSTITUTE OF TECHNOLOGY PASADENA, CALIFORNIA September 15, 1972 Reproduced by NATIONAL TECHNICAL INFORMATION SERVICE U S Department of Commerce Springfield VA 22151 TECHNICAL REPORT STANDARD TITLE PAGE I. Report No. 33-566 2. Government Accession No. 3. Recipient's Catalog No. 4. Title and Subtitle 5. Report Date A BRIEF DESCRIPTION AND COMPARISON OF PROGRAMMING September 15, 1972 LANGUAGES FORTRAN, ALGOL, COBOL, PL/I, AND LISP 6. Performing Organization Code 1.5 FROM A CRITICAL STANDPOINT 7. Author(s) 8. Performing Organization Report No. F. P. Mathur 9. Performing Organization Name and Address 10. Work Unit No. JET PROPULSION LABORATORY California Institute of Technology 11. Contract or Grant No. 4800 Oak Grove Drive NAS 7-100 Pasadena, California 91103 13. Type of Report and Period Covered Technical Memorandum 12. Sponsoring Agency Name and Address NATIONAL AERONAUTICS AND SPACE ADMINISTRATION Washington, D.C. 20546 14. Sponsoring Agency Code 15. Supplementary Notes 16. Abstract Several common higher level program languages are described. FORTRAN, ALGOL, COBOL, PL/I, and LISP 1.5 are summarized and compared. FORTRAN is the most widely used scientific programming language. ALGOL is a more powerful language for scientific programming. COBOL is used for most commercial programming applications. LISP 1.5 is primarily a list-processing language. PL/I attempts to combine the desirable features of FORTRAN, ALGOL, and COBOL into a single language. 17. Key Words (Selected by Author(s)) 18. Distribution Statement Computer Applications and Equipment Unclassified -- Unlimited Computer Programs 19. Security Classif. (of this report) 20. Security Classif. (of this page) 21. No. of Pages 22. Price Unclassified Unclassified 13 T HOW TO FILL OUT THE TECHNICAL REPORT STANDARD TITLE PAGE Make items 1, 4, 5, 9, 12, and 13 agree with the corresponding information on the report cover. Use all capital letters for title (item 4). Leave items 2, 6, and ~14 blank. Complete the remaining items as follows: 3. Recipient's Catalog No. Reserved for use by report recipients. 7. Author(s). Include corresponding information from the report cover. In addition, list the affiliation of an author if it differs from that of the performing organization. 8. Performing Organization Report No. Insert if performing organization wishes to assign this number. 10. Work Unit No. Use the agency-wide code (for example, 923-50-10-06-72), which uniquely identifies the work unit under which the work was authorized. Non-NASA performing organizations will leave this blank. 11. Insert the number of the contract or grant under which the report was pre pared. 15. Supplementary Notes. Enter information not included elsewhere but useful, such as: Prepared in cooperation with... Translation of (or by)... Presented at conference of... To be published in... 16. Abstract. Include a brief (not to exceed 200 words) factual summary of the most significant information contained in the report. If possible, the abstract of a classified report should be unclassified. If the report contains a significant bibliography or literature survey, mention it here. 17. Key Words. Insert terms or short phrases selected by the author that identify the principal subjects covered in the report, and that are sufficiently specific and precise to be used for cataloging. 18. Distribution Statement. Enter one of the authorized statements used to denote releasability to the public or a limitation on dissemination for reasons other than security of defense information. Authorized statements are "Unclassified-Unlimited, " "U.S. Government and Contractors only, " "U. S. Government Agencies only, " and "NASA and NASA Contractors only." 19. Security Classification (of report). NOTE: Reports carrying a security classification will require additional markings giving security and down- grading information as specified by the Security Requirements Checklist and the DoD Industrial Security Manual (DoD 5220. 22-M). 20. Security Classification (of this page). NOTE: Because this page may be used in preparing announcements, bibliographies, and data banks, it should be unclassified if possible. If a classification is required, indicate sepa- rately the classification of the title and the abstract by following these items with either "(U)" for unclassified, or "(C)" or "(S)" as applicable for classified items. 21. No. of Pages. Insert the number of pages. 22. Price. Insert the price set by the Clearinghouse for Federal Scientific and Technical Information or the Government Printing Office, if known. I- NATIONAL AERONAUTICS AND SPACE ADMINISTRATION Technical Memorandum 33-566 A Brief Description and Comparison of Programming Languages FORTRAN, ALGOL, COBOL, PLII, and LISP 1.5 From a Critical Standpoint F. P. Mathur JET PROPULSION LABORATORY CALIFORNIA INSTITUTE OF TECHNOLOGY PASADENA, CALIFORNIA September 15, 1972 ( Prepared Under Contract No. NAS-7-100 National Aeronautics and Space Administration Preface The work described in this report was performed by the Astrionics Divi- sion of the Jet Propulsion Laboratory. JPL TECHNICAL MEMORANDUM 33-566 iii PRECEDING PAGE BLANK NOT FILMEf Contents I. Introduction ........... 1 II. Basic Philosophy of Programming Languages 2 III. Metalanguages .......... 2 IV. FORTRAN (Formula Translation). V. ALGOL (Arithmetic Language). 4 VI. COBOL (Common Business Language) 5 VII. LISP 1.5 (List Processing Language) . 7 VIII. PL/I (Programming Language I) 8 IX. Conclusion ............ ...... .......10 References ..... ...10 Bibliography . ..... ...12 Figures 1. Process of compiling an object program 11 JPL TECHNICAL MEMORANDUM 33-566 Preceding page blank v Abstract Several common higher level program languages are described. FORTRAN, ALGOL, COBOL, PL/I, and LISP 1.5 are summarized and compared. FOR- TRAN is the most widely used scientific programming language. ALGOL is a more powerful language for scientific programming. COBOL is used for most commercial programming applications. LISP 1.5 is primarily a list-pro- cessing language. PL/I attempts to combine the desirable features of FOR- TRAN, ALGOL, and COBOL into a single language. vi JPL TECHNICAL MEMORANDUM 33-566 A Brief Description and Comparison of Programming Languages FORTRAN, ALGOL, COBOL, PL/I, and LISP 1.5 From a Critical Standpoint I. Introduction lated into an object program that is in machine language - the binary language in which a computer basically Explicit procedures, namely, algorithms or programs operates. The process of compiling an object program for the solution of mathematically structurable prob- from a source program is shown in Fig. 1. lems, require a notation and syntactic structure for their description. Such systems of notation are called In the early days of computers, all programming was programming languages. done in machine language. From the standpoint of the computer, the machine language programming is the The solution of a problem by means of computer facil- most efficient; however, it requires that the program- ity consists of explicitly delineating the steps or com- mer be familiar with the internal organization and de- mands that a computer should follow in order to pro- sign of the computer. As computer applications became duce the solution. The computer must be instructed in widespread, higher level languages were developed the manner in which it must expect to receive the data that separated the user from the designer and became to be acted upon. This data and the format of the solu- more user oriented. At first these languages were oriented tions must be presented to the computer in a prescribed toward the scientist programmer and were strictly for manner. Though the computer is incapable of formulat- scientific applications. As computer applications broad- ing these procedures, its forte lies in following the com- ened toward data processing and business-type appli- mands with great speed. cations, business-oriented languages came into being. As a next step these two main, though basically diver- The algorithm, which may be in the form of a flow gent, orientations were and are being incorporated with- chart, and the data are coded in the source language in the same language. The success of truly general-pur- (the subject of this paper) and inputed to a compiler pose languages as measured by widespread acceptance where it is compiled, assembled, and effectively trans- is yet to be seen. JPL TECHNICAL MEMORANDUM 33-566 1 II. Basic Philosophy of Programming Languages This metalanguage employs four characters which are unrelated to, and distinct from, the programming lan- A significant difference between natural languages guage under description. These are the metalinguistic and programming languages is, that due to the nonin- brackets '<' and '>' which are used to enclose names of telligent nature of the computer, no ambiguities in the things about which the metalanguage is talking,' programming language may exist. The language must which means "is," and 'i' which means "or," Thus be context free; hence, it is not subject to growth and spontaneous development. <digit> ::= 0111213141516171819 The ideal problem-oriented source language designed for wide use must possess the characteristics