DOC PREVIEW
Berkeley COMPSCI 164 - Motivation and design

This preview shows page 1-2-15-16-17-32-33 out of 33 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

A brief survey of programming languages: motivation and design/ continuedLife beyond Fortran (1959), Algol (1960), Lisp 1.5 (1960), Cobol (1961)Even more, Algol, CobolAre they really different?Are they really different?A closer look at FortranA closer look at FortranA closer look at FortranA closer look at FortranA closer look at FortranA closer look at COBOLA closer look at Algol (60)A closer look at Algol (60)A closer look at LispSome other spots along the timelineWhat is the best programming language?Possible objectives for programming languageOther characterizationsOther characterizationsOther characterizationsOther characterizationsStudying history of PL can contribute to ..Example programs in a few languagesExample programs FORTHExample programs Logic (e.g. prolog)Example programs FortranExample programs LISPExample programs LISPExample programs LISPExample programs LISPMore example programs LISPWhy the external LISP is almost arbitrarySummaryProf Fateman CS 164 Lecture 3 1A brief survey of programming languages: motivation and design/ continuedLecture 3Prof Fateman CS 164 Lecture 3 2Life beyond Fortran (1959), Algol (1960), Lisp 1.5 (1960), Cobol (1961)“Significant” languages, commercial and/or intellectualCOBOL (1961, 66, .. PL/I),BASIC (1964) significantly "interactive" at Dartmouth Univ; (Algol-like languages: PL/I, Pascal, Algol 68, B, C, C++, Modula, Scheme (1975), Ada, Java, C#),String-processing languages (snobol I-IV, tcl, Perl), Functional languages (APL, ML, Haskell, Logo, Lisp), Visual programming, Descendents of Fortran, 1959 (I,II, IV, 66, PL/I, 77, 90).Stack languages (IPL, FORTH, PostScript)Logic programming (Prolog)OOP (Simula67, Smalltalk, C++, CLOS/lisp)Interactive Math (Matlab, Maple, Mathematica, MathCAD)Prof Fateman CS 164 Lecture 3 3Even more, Algol, CobolThere are other languages as well, especially in particularapplication areas (e.g. controlling machine tools, telescopes, controlling computer jobs, generating reports from databases) but certainly many languages that intend to address a general audience. There is also a journal of the history of programming languages, and a number of survey books.And there are newsgroups: comp.lang.*There are over 100 language groups, some subdividedfurther (C++, Java, Lisp))Prof Fateman CS 164 Lecture 3 4Are they really different?If I've missed your favorite programming language,sorry.There is a tendency for each of us to think that all programming languages must look pretty much like the first programming language learned. E.g. everything is like Basic. orPascal. or C.When you learned Scheme, did you change your mind?So is everything essentially like Java or essentially like Lisp?Yes and no.. Programming languages that look quite different include snobol, prolog, postscript...Prof Fateman CS 164 Lecture 3 5Are they really different?We will see that the most visible part of a language, its syntax, is almost the first thing removed by a compiler. So much so that after eliminating the “syntactic sugar” many languages are nearly identical. There are still issues that transcend superficial language differences beyond the syntax:Variables, memory, scope, the balance between few primitives + extension vs. many built-in features, security, and other notions (much later on in this course).Prof Fateman CS 164 Lecture 3 6A closer look at FortranIf we look at the first Fortran (= Formula Translator)from a modern perspective it seems terribly restricted(IF, DO, GOTO). But the goals of the Fortran project at IBM were toproduce efficient code because it was believed thatthe only way to succeed versus assembler was toproduce fast code. This was false, but in 1959, who could tell...Prof Fateman CS 164 Lecture 3 7A closer look at FortranOther restrictions forced by reality of IBM 704 computer:Any compiler had to run on machines that were tiny andslow by our standards.We can explain the 3-way IF by a machine instruction on IBM 704IF(a) 1,2,3Prof Fateman CS 164 Lecture 3 8A closer look at Fortran"One of the 704's unusual features was that core storage used signed magnitude, the arithmetic unit used 2's complement, and the index registers used 1's complement. When FORTRAN was implemented on the IBM product that replaced the 704, 7094 etc. series, the 3 way branching ifwent to the wrong place when testing negative zero.(It branched negative, as opposed to branching to zero). "Prof Fateman CS 164 Lecture 3 9A closer look at FortranStatement numbers as targets for GOTOs or branchesi,j,k... n started integer variables. N23 was an integer.other letters started floats. X43 was a float.No other declarations.Easy to make mistakes by misspelling. One way around this is to require humans totype everything at least twice (=declarations), as in Java.Prof Fateman CS 164 Lecture 3 10A closer look at FortranFortran had weak input and output; not as bad as Algolwhich had NO input/output.Fortran was a significant step up from what went before…there were symbolic assemblers and some ‘higher level’tools – for example, packages that implemented floating point instructions as macros.Prof Fateman CS 164 Lecture 3 11A closer look at COBOLCOBOL (1960) (Common Business Oriented Language) by contrast to Fortran was (and still is) almost ALL input/output. Big features: provided for records of characters and numbers. Written by a committee under government sponsorship, COBOL became an important standard, and is still widely used. We’ve never taught much about it here, even though the university payroll may rely on it.Prof Fateman CS 164 Lecture 3 12A closer look at Algol (60)Algol 60 (Algorithmic Language) was a very influential language, a quantum leap over its predecessors (and many of its successors!). The Algol 60 Report, first used BNF: a formal grammatical presentation of the syntax of the language. Combined with natural language semantic descriptions, the Report was a breakthrough in defining a programming language. (There is an attempt to follow this route in the Java Language Specification.)Call by value and call by name.NO Input/Output. Recursion (it was not in Fortran).Prof Fateman CS 164 Lecture 3 13A closer look at Algol (60)There were many attempts to clean up the trouble spots and include extra features like I/O. The most commonly used was probably Pascal (1968). Another re-design, Algol 68 had limited appeal (too complex) and never caught on.Pascal/(Pascal named for Blaise


View Full Document

Berkeley COMPSCI 164 - Motivation and design

Documents in this Course
Lecture 8

Lecture 8

40 pages

Load more
Download Motivation and design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Motivation and design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Motivation and design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?