SlideShare una empresa de Scribd logo
1 de 67
The History Of
                 Programming Languages




Chapter Twenty-Four   Modern Programming Languages   1
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       2
Babylon
     s Cuneiform writing was used in the Babylon,
       founded by Hammurabi around 1790 BC
     s Many Babylonian clay tablets survive:
           –   poems and stories
           –   contracts and records
           –   astronomy
           –   math, base 60
A famous Babylonian math tablet
(Plimpton 322) involving Pythagorean
triples, a2+b2=c2 -- with a mistake!
Chapter Twenty-Four       Modern Programming Languages   3
Babylonian Numbers
     s The two Babylonian digits for “1” and
       “10”, written together, signify a number
       base 60
     s The exponent is not given; the reader must
       figure it out from the context 0
                               1
                                          1 × 60 + 10 × 60 = 70
                      1,10 =              1 × 600 + 10 × 60 −1 = 1 1 6

                                          1 × 60i +1 + 10 × 60i


Chapter Twenty-Four            Modern Programming Languages              4
A Babylonian Program
     s   Written language to describe computational
         procedures:
              A cistern.
              The length equals the height.
              A certain volume of dirt has been excavated.
              The cross-sectional area plus this volume comes to 1,10.
              The length is 30. What is the width?
              You should multiply the length, 30, by …

                                          Translation by Donald Knuth


Chapter Twenty-Four           Modern Programming Languages               5
Programming Language
     s No variables
     s Instead, numbers serve as a running
       example of the procedure being described
     s “This is the procedure”
     s Programming is among the earliest uses to
       which written language was put




Chapter Twenty-Four   Modern Programming Languages   6
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       7
Baghdad
     s Near ancient Babylon
     s Founded around 762
     s A great center of scholarship, art and poetry
     s 780-850: Mohammed Al-Khorezmi, a court
       mathematician, lived and wrote
     s Two little books…




Chapter Twenty-Four   Modern Programming Languages     8
Algebra
     s Kitâ al-jabr wa'l-muqabâla
     s Translated into Latin, spread throughout
       Europe
     s Used as a mathematics text in Europe for
       eight hundred years




Chapter Twenty-Four   Modern Programming Languages   9
Algorithms
     s The original is lost
     s Latin translation: Algorthmi de numero
       Indorum
     s Algorithms for computing with Hindu
       numerals: base-10 positional system with 0
     s A new technology (data structure and
       algorithms)
     s Strongly influenced medieval European
       mathematics
Chapter Twenty-Four   Modern Programming Languages   10
Other Early Written Algorithms
     s Euclid, 300 BC: an algorithm for
       computing the GCD of two numbers
     s Alexander de Villa Dei, 1220 AD: Canto de
       Algorismo, algorithms in Latin verse
     s Not programming languages: natural
       language (even poetry) plus mathematics



Chapter Twenty-Four   Modern Programming Languages   11
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       12
Augusta Ada
     s Daughter of George Gordon, Lord Byron
     s Early 1800’s in England (as elsewhere)
       women were generally denied education,
       especially math and science
     s Ada studied math with a private tutor (as an
       antidote to feared Byronic tendencies)
     s Married at 19 (Lady Lovelace), 3 children



Chapter Twenty-Four   Modern Programming Languages    13
Charles Babbage
     s English mathematician
     s Inventor of mechanical computers:
           –   Difference Engine, construction started but not
               completed (until a 1991 reconstruction)
           –   Analytical Engine, never built

           I wish to God these calculations had been executed by steam!

                                      Charles Babbage, 1821


Chapter Twenty-Four          Modern Programming Languages                 14
Analytical Engine
     s Processing unit (the Mill)
     s Memory (the Store)
     s Programmable (punched cards)
     s Iteration, conditional branching, pipelining,
       many I/O devices




Chapter Twenty-Four   Modern Programming Languages     15
Sketch of the Analytical Engine
     s A paper by Luigi Menabrea
     s Published 1843
     s Translated, with explanatory notes, by
       A.A.L.
     s Algorithms in a real programming
       language: the machine language of punched
       cards for the Analytical Engine

Chapter Twenty-Four   Modern Programming Languages   16
Not Just For Numbers
     The bounds of arithmetic were however outstepped the
     moment the idea of applying the cards had occurred; and
     the Analytical Engine does not occupy common ground
     with mere "calculating machines." … In enabling
     mechanism to combine together general symbols in
     successions of unlimited variety and extent, a uniting link
     is established between the operations of matter and the
     abstract mental processes of the most abstract branch of
     mathematical science.
                                                        A.A.L.



Chapter Twenty-Four      Modern Programming Languages              17
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       18
Konrad Zuse
     s Built a mechanical computer in his parents’
       living room in Berlin in 1936: the Z1
     s Metal strips and pins—very different from
       Babbage’s wheelwork
     s Programmable using punched tapes
     s Binary floating point numbers with an
       explicit exponent

Chapter Twenty-Four   Modern Programming Languages   19
Early Development
     s   More computers:
           –   Z2 experimented with relays for the ALU
           –   Z3: all-relay technology (the first electronic
               programmable digital computer)
           –   Z4: envisioned as a commercial system
     s Most designs and prototypes destroyed in
       the war
     s 1945: Zuse flees Berlin with wife and Z4

Chapter Twenty-Four        Modern Programming Languages         20
Plankalkül
     s In 1945/46, Zuse completed the design of a
       programming language: the Plankalkül
     s Many advanced ideas:
           –   Assignment, expressions, subscripts
           –   Constructed types: from primitive (bit) other
               types are constructed: integers, reals, arrays, etc.
           –   Conditional execution, loops, subroutines
           –   Assertions
     s   Many example programs: sorting, graphs,
         numeric algorithms, syntax analysis, chess
Chapter Twenty-Four        Modern Programming Languages           21
The Notation
     s   Main line with three underneath:
           –   V: variable number
           –   K: subscript
           –   S: optional comment (showing types)
     s   V0[Z1]+=1 looks like:
                      V          Z        + 1         ⇒ V          Z
               V      0          1                      0          1
               K
               S      m×1·n      1·n          1·n            m×1·n 1·n
Chapter Twenty-Four           Modern Programming Languages               22
Looks Influential…
     s …but it was not: it was not published until
       1972, and few people knew of it
     s Never implemented: far beyond the state of
       the art in hardware or software at the time
     s Many of Zuse’s ideas were reinvented by
       others



Chapter Twenty-Four   Modern Programming Languages   23
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       24
The Labor Of Programming
     s Programming has always been hard
     s In the early days of large-scale digital
       computers, it was labor-intensive
     s Hard to appreciate now, how much tedious
       work was involved then




Chapter Twenty-Four   Modern Programming Languages   25
The Good Old Days
     In the early years of programming languages, the most
     frequent phrase we heard was that the only way to program a
     computer was in octal. Of course a few years later a few
     people admitted that maybe you could use assembly
     language…. I have here a copy of the manual for Mark I. I
     think most of you would be totally flabbergasted if you were
     faced with programming a computer, using a Mark I manual.
     All it gives you are the codes. From there on you're on your
     own to write a program. We were not programmers in those
     days. The word had not yet come over from England. We
     were "coders."
                      Rear Admiral Dr. Grace Murray Hopper

Chapter Twenty-Four       Modern Programming Languages              26
Wish List
     s Floating point: coders had to keep track of
       the exponent manually (Babylonian style)
     s Relative addressing: coders kept notebooks
       of subroutines, but the codes had to be
       adjusted by hand for the absolute addresses
     s Array subscripting help
     s Something easier to remember than octal
       opcodes

Chapter Twenty-Four   Modern Programming Languages   27
Early Aids
     s Assemblers
     s Programming tools:
           –   Short Code, John Mauchly, 1949 (interpreted)
           –   A-0, A-1, A-2, Grace Hopper, 1951-1953 (like
               macro libraries)
           –   Speedcoding, John Backus, 1954 (interpreted)
     s   People began to see that saving programmer
         time was important

Chapter Twenty-Four       Modern Programming Languages        28
Fortran
 s    The first popular high-level programming language
 s    A team led by John Backus at IBM
 s    "The IBM Mathematical FORmula TRANslating
      System: FORTRAN", 1954:
       –   supposed to take six months -- took two years
       –   supposed to eliminate coding errors and debugging
       –   supposed to generate efficient code, comparable with hand-
           written code -- very successful at this
       –   closely tied to the IBM 704 architecture

Chapter Twenty-Four       Modern Programming Languages             29
Separate Compilation
     s First Fortran: no separate compilation
     s Compiling “large” programs – a few
       hundred lines – was impractical, since
       compilation time approached 704 MTTF
     s Fortran II added separate compilation
     s Later Fortrans evolved with platform
       independence: no more PAUSE statement!
                I don't know what the language of the year 2000 will
                look like, but I know it will be called FORTRAN.
                          C.A.R. Hoare

Chapter Twenty-Four           Modern Programming Languages             30
Fortran's Influence
     s Many languages followed, but all designers
       learned from Fortran
     s Fortran team pioneered many techniques of
       scanning, parsing, register allocation, code
       generation, and optimization




Chapter Twenty-Four   Modern Programming Languages    31
John Backus
     s   Many contributions to programming
         languages: Fortran, Algol 58 and 60, BNF,
         FP (a purely functional language)
         My point is this: while it was perhaps natural and inevitable that
         languages like FORTRAN and its successors should have developed
         out of the concept of the von Neumann computer as they did, the fact
         that such languages have dominated our thinking for twenty years is
         unfortunate. It is unfortunate because their long-standing familiarity
         will make it hard for us to understand and adopt new programming
         styles which one day will offer far greater intellectual and
         computation power.
                                                             John Backus, 1978

Chapter Twenty-Four           Modern Programming Languages                        32
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       33
Lisp
     s   AI conference at Dartmouth, 1956: McCarthy,
         Minsky, Newell, Simon
     s   Newell, Shaw and Simon demonstrate Logic
         Theorist, a reasoning program written in IPL
         (Information Processing Language)
     s   IPL had support for linked lists, and caught
         McCarthy’s attention
     s   He wanted a language for AI projects, but not IPL:
         too low-level and machine-specific


Chapter Twenty-Four    Modern Programming Languages       34
Early AI Language Efforts
     s   An IBM group (consulting McCarthy) developed
         FLPL: Fortran List Processing Language
     s   McCarthy had a wish list, developed while writing
         AI programs (chess and differential calculus)
           –   Conditional expressions
           –   Recursion
           –   Higher-order functions (like ML’s map)
           –   Garbage collection
     s   FLPL wasn’t the answer for McCarthy’s group at
         MIT in 1958…

Chapter Twenty-Four         Modern Programming Languages     35
Lisp’s Unusual Syntax
     s   A Lisp program is a list representing an AST:
             (+ a (* b c))
     s   The plan was to use some Fortran-like notation
     s   But McCarthy wrote a paper showing a simple
         Lisp interpreter in Lisp: a function called eval
     s   To avoid syntax issues, he used the list-AST form,
         both for eval’s input and for eval itself
     s   This eval, hand-translated into assembly
         language, became the first implementation of Lisp


Chapter Twenty-Four    Modern Programming Languages           36
Lisp’s Unusual Syntax
     s   The group never gave up the idea of compiling
         from some Fortran-like syntax
     s   But they never got around to it either
     s   In later years, people often tried to compile Lisp
         from a Fortran- or Algol-like syntax
     s   None of them caught on
     s   There are advantages to having programs and data
         use the same syntax, as we saw with Prolog


Chapter Twenty-Four    Modern Programming Languages           37
Lisp Evolution
     s   Quickly became, and remains, the most popular
         language for AI applications
     s   Before 1980: many dialects in use:
           –   Each AI research group had its own dialect
           –   In the 1970’s, a number of Lisp machines were
               developed, each with its own dialect
     s   Today: some standardization:
           –   Common Lisp: a large language and API
           –   Scheme: a smaller and simpler dialect

Chapter Twenty-Four         Modern Programming Languages       38
Lisp Influence
     s   The second-oldest general-purpose programming
         language still in use
     s   Some ideas, like the conditional expression and
         recursion, were adopted by Algol and later by
         many other imperative languages
     s   The function-oriented approach influenced
         modern functional languages like ML
     s   Garbage collection is increasingly common in
         many different language families


Chapter Twenty-Four    Modern Programming Languages        39
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       40
Algol
     s   In 1957, languages were proliferating
           –   In the US, computer manufacturers were developing
               platform-specific languages like IBM’s Fortran
           –   In Europe, a number of languages had been designed
               by different research groups: Plankalkül and others
     s   Algol was intended to stop this proliferation
           –   It would be the one universal, international, machine-
               independent language for expressing scientific
               algorithms
     s   In 1958, an international committee (!) was
         formed to come up with the design

Chapter Twenty-Four         Modern Programming Languages                41
The Algols
     s Eventually, three major designs: Algol 58,
       Algol 60, and Algol 68
     s Developed by increasingly large (!)
       international committees




Chapter Twenty-Four   Modern Programming Languages   42
The Good News
     s   Virtually all languages after 1958 used ideas
         pioneered by the Algol designs:
                s     Compound statements: begin statements end
                s     Free-format lexical structure
                s     BNF definition of syntax
                s     Local variables with block scope
                s     Static typing with explicit type declarations
                s     Nested if-then-else
                s     Call by value (and call by name)
                s     Recursive subroutines and conditional expressions (ex Lisp)
                s     Dynamic arrays
                s     First-class procedures
                s     User-defined operators

Chapter Twenty-Four               Modern Programming Languages                      43
Issue: Phrase-Level Control
     s   Early languages used label-oriented control:
                      GO TO 27
                      IF (A-B) 5,6,7
     s   Algol languages had good phrase-level control,
         like the if and while we saw in Java, plus
         switch, for, until, etc.
     s   A debate about the relative merits began to heat up
     s   Edsgar Dijkstra’s famous letter in 1968, “Go to
         statement considered harmful,” proposed
         eliminating label-oriented control completely

Chapter Twenty-Four     Modern Programming Languages       44
Structured Programming
     s   Using phrase-level control instead of labels was
         called structured programming
     s   There was a long debate: many programmers
         found it difficult at first to do without labels
     s   Now, the revolution is over:
           –   Some languages (like Java) eliminated go to
           –   Others (like C++) still have it
           –   But programmers rarely use it, even when permitted
     s   The revolution was triggered (or at least fueled)
         by the Algol designs

Chapter Twenty-Four         Modern Programming Languages            45
Issue: Orthogonality
     s   The Algol designs avoided special cases:
           –   Free-formal lexical structure
           –   No arbitrary limits:
                s Any number of characters in a name
                s Any number of dimensions for an array

           –   And orthogonality: every meaningful
               combination of primitive concepts is legal—no
               special forbidden combinations to remember


Chapter Twenty-Four        Modern Programming Languages        46
Example
                                             Integers     Arrays   Procedures
             Passing as a parameter
             Storing in a variable
             Storing in an array
             Returning from a procedure

     s   Each combination not permitted is a special case
         that must be remembered by the programmer
     s   By Algol 68, all combinations above are legal
     s   Just a sample of its orthogonality—few modern
         languages take this principle as far as Algol

Chapter Twenty-Four                Modern Programming Languages                 47
The Bad News
     s   The Algol languages were not as widely used as
         had been hoped
           –   Algol 58, extended to Jovial
           –   Algol 60 used for publication of algorithms, and
               implemented and used fairly widely outside U.S.
     s   Some possible reasons:
           –   They neglected I/O
           –   They were considered complicated and difficult to learn
           –   They included a few mistakes, like by-name parameters
           –   They had no corporate sponsor (IBM chose to stick
               with Fortran)
Chapter Twenty-Four         Modern Programming Languages             48
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       49
Before Smalltalk: Simula
     s   Kristen Nygaard and Ole-Johan Dahl, Norwegian
         Computing Center, 1961
     s   Simula I: an special-purpose Algol extension for
         programming simulations: airplanes at an airport,
         customers at a bank, etc.
     s   Simula 67: a general-purpose language with
         classes, objects, inheritance
     s   Co-routines rather than methods



Chapter Twenty-Four    Modern Programming Languages          50
Smalltalk
     s   Alan Kay, Xerox PARC, 1972
     s   Inspired by Simula, Sketchpad, Logo, cellular
         biology, etc.
     s   Smalltalk is more object-oriented than most of its
         more popular descendants
     s   Everything is an object: variables, constants,
         activation records, classes, etc.
     s   All computation is performed by objects sending
         and receiving messages: 1+2*3


Chapter Twenty-Four    Modern Programming Languages           51
A Design Philosophy
     s   Commit to a few simple ideas, then find the most
         elegant language design from there:
           –   Lists, recursion, eval: Lisp
           –   Objects, message-passing: Smalltalk
           –   Resolution-based inference: Prolog
     s   Hallmarks:
           –   Initial implementation is easy
           –   Easy to modify the language
           –   Programming feels like custom language design

Chapter Twenty-Four         Modern Programming Languages       52
Smalltalk’s Influence
     s   The Simula languages and Smalltalk inspired a
         generation of object-oriented languages
     s   Smalltalk still has a small but active user
         community
     s   Most later OO languages concentrate more on
         runtime efficiency:
           –   Most use static typing (Smalltalk uses dynamic)
           –   Most include non-object primitive types as well as
               objects

Chapter Twenty-Four         Modern Programming Languages            53
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       54
Prolog
     s   Alan Robinson, 1965: resolution-based theorem
         proving
           –   Resolution is the basic Prolog step
           –   But Prolog did not follow easily or immediately
     s   Robert Kowalski, Edinburgh, 1971: an efficient
         resolution-based technique, SL-resolution
     s   Alain Colmerauer and Philippe Roussel,
         Marseilles, 1972: Prolog (programmation en
         logique)
           –   For the automated deduction part of an AI project in
               natural language understanding

Chapter Twenty-Four         Modern Programming Languages              55
Prolog Evolution
     s   1973 version:
           –   Eliminated special backtracking controls (introducing
               the cut operation instead)
           –   Eliminated occurs-check
     s   David Warren, 1977: efficient compiled Prolog,
         the Warren Abstract Machine
     s   (For many languages—Smalltalk, Prolog, ML—
         techniques for efficient compilation were critical
         contributions)

Chapter Twenty-Four         Modern Programming Languages               56
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       57
ML
     s   Robin Milner, Edinburgh, 1974
     s   LCF: a tool for developing machine-assisted
         construction of formal logical proofs
     s   ML was designed as the implementation language
         for LCF
     s   Strong typing, parametric polymorphism, and type
         inference were in the first designs
     s   Remained closely tied to LCF development for
         several years


Chapter Twenty-Four   Modern Programming Languages          58
Issue: Formal Semantics
     s The definition of Standard ML includes a
       formal semantics (a natural semantics)
     s This was part of the initial design, not (as is
       more common) added after implementation
     s Fits with the intended application: to trust
       the proofs produced by LCF, you must trust
       the language in which LCF is implemented


Chapter Twenty-Four   Modern Programming Languages       59
ML Evolution
     s   Luca Cardelli, 1980: efficient compiled ML
     s   1983: draft standard ML published
     s   Additions: pattern-matching, modules, named
         records, exception handling, streams
     s   Dialects:
           –   Standard ML (SML), the one we used
           –   Lazy ML: ML with lazy evaluation strategy
           –   Caml: An ML dialect that diverged before the addition
               of modules
           –   OCaml: Caml with object-oriented constructs

Chapter Twenty-Four         Modern Programming Languages               60
s   24.2 Prehistory of programming languages
          –   The story of the programmers of Babylon
          –   The story of Mohammed Al-Khorezmi
          –   The story of Augusta Ada, Countess of Lovelace
    s   24.3 Early programming languages
          –   The story of the Plankalkül
          –   The story of Fortran
          –   The story of Lisp
          –   The story of Algol
          –   The story of Smalltalk
    s   24.4 Our languages
          –   The story of Prolog
          –   The story of ML
          –   The story of Java
Chapter Twenty-Four         Modern Programming Languages       61
A Long Lineage
                      An even larger language than Algol 60, adding
                      features for business data processing.
    Algol 60          Christopher Strachey et. al., 1962-1966

                      “Basic CPL.” Vastly simplified. Typeless:
      CPL             manipulates untyped machine words. Introduced
                      the C-family array idea: A[I], written in BCPL as
                      A!I, is the same as a reference to the word at
      BCPL            address A+I.
                      Martin Richards (a student of Strachey), 1967

                      An even simpler language, developed for systems
         B
                      programming for the first Unix systems at Bell Labs.
                       Included compound assignments (a+=b), borrowed
                      from Algol 68.
                      Ken Thompson, 1969
Chapter Twenty-Four      Modern Programming Languages                        62
A Long Lineage, Continued
                      Extension of B (originally, “NB”) to take advantage
                      of more hardware (PDP-11). Type system, macro
         B            preprocessor, I/O library, etc. Used to reimplement
                      the Unix kernel, and spread widely with Unix.
                      Dennis Ritchie et. al., 1971-1973
         C


      C++             Originally a C preprocessor adding object-oriented
                      features to C: “C with Classes”. Added dynamic
                      dispatch, overloaded operators and function names,
       Java           multiple inheritance, templates, exception handling.
                      Became and remains one of the most widely used
                      languages.
                      Bjarne Stroustrup, 1984

Chapter Twenty-Four      Modern Programming Languages                        63
Java
     s   James Gosling, Sun Microsystems
     s   1991: Oak: a language for ubiquitous computers in
         networked consumer technology
           –   Like C++, but smaller and simpler
           –   More secure and strongly typed
           –   More platform independent
     s   1995: renamed Java, retargeted for the Web
           –   Incorporated into web browsers
           –   Platform-independent active content for web pages


Chapter Twenty-Four         Modern Programming Languages           64
Nonlinear Lineage
     s Not just a straight line from CPL
     s Java also has:
           –   Garbage collection (ex Lisp)
           –   Concurrency (ex Mesa)
           –   Packages (ex Modula)
     s   But nothing new: it was intended to be a
         production language, not a research
         language

Chapter Twenty-Four       Modern Programming Languages   65
Conclusion: The Honor Roll
     s   Some programming language pioneers who have
         won the Turing award:
                s     Alan Perlis, John McCarthy, Edsger Dijkstra, Donald Knuth,
                      Dana Scott, John Backus, Robert Floyd, Kenneth Iverson,
                      C.A.R. Hoare, Dennis Ritchie, Niklaus Wirth, John Cocke,
                      Robin Milner, Kristen Nygaard, Ole-Johan Dahl
     s   These very bright people had to work very hard on
         things that now seem easy, such as:
           –   Local variables with block scope
           –   Using phrase-level control instead of go to
     s   Before becoming perfectly obvious to everyone,
         these things were unknown and unguessed

Chapter Twenty-Four               Modern Programming Languages                     66
Conclusion
     s   Is the evolution of programming languages nearly
         done, or have we as far again to go?
     s   Maybe all the important discoveries have been
         made, and language evolution will now slow and
         converge
     s   Or maybe we will have the pleasure of seeing new
         ideas, now unknown and unguessed, become
         perfectly obvious to everyone
     s   Enjoy!


Chapter Twenty-Four   Modern Programming Languages          67

Más contenido relacionado

Similar a The History of Programming Languages: From Ancient Babylonian to Modern

Similar a The History of Programming Languages: From Ancient Babylonian to Modern (14)

Geek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming Languages
 
GeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming LanguagesGeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming Languages
 
Pascal programming language
Pascal programming languagePascal programming language
Pascal programming language
 
A history of (Nordic) compilers and autocodes
A history of (Nordic) compilers and autocodesA history of (Nordic) compilers and autocodes
A history of (Nordic) compilers and autocodes
 
Paradigms
ParadigmsParadigms
Paradigms
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
 
History of Computer
History of ComputerHistory of Computer
History of Computer
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
Evolution of Programming Languages.pdf
Evolution of Programming Languages.pdfEvolution of Programming Languages.pdf
Evolution of Programming Languages.pdf
 
The History Of Call The 60s
The History Of Call The 60sThe History Of Call The 60s
The History Of Call The 60s
 
History of the computer
History of the computerHistory of the computer
History of the computer
 
Assignment of History of Computer(F21-1872).pdf
Assignment of History of Computer(F21-1872).pdfAssignment of History of Computer(F21-1872).pdf
Assignment of History of Computer(F21-1872).pdf
 
History of Programming Language
History of Programming LanguageHistory of Programming Language
History of Programming Language
 
Computer History
Computer HistoryComputer History
Computer History
 

Último

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

The History of Programming Languages: From Ancient Babylonian to Modern

  • 1. The History Of Programming Languages Chapter Twenty-Four Modern Programming Languages 1
  • 2. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 2
  • 3. Babylon s Cuneiform writing was used in the Babylon, founded by Hammurabi around 1790 BC s Many Babylonian clay tablets survive: – poems and stories – contracts and records – astronomy – math, base 60 A famous Babylonian math tablet (Plimpton 322) involving Pythagorean triples, a2+b2=c2 -- with a mistake! Chapter Twenty-Four Modern Programming Languages 3
  • 4. Babylonian Numbers s The two Babylonian digits for “1” and “10”, written together, signify a number base 60 s The exponent is not given; the reader must figure it out from the context 0 1 1 × 60 + 10 × 60 = 70 1,10 = 1 × 600 + 10 × 60 −1 = 1 1 6 1 × 60i +1 + 10 × 60i Chapter Twenty-Four Modern Programming Languages 4
  • 5. A Babylonian Program s Written language to describe computational procedures: A cistern. The length equals the height. A certain volume of dirt has been excavated. The cross-sectional area plus this volume comes to 1,10. The length is 30. What is the width? You should multiply the length, 30, by … Translation by Donald Knuth Chapter Twenty-Four Modern Programming Languages 5
  • 6. Programming Language s No variables s Instead, numbers serve as a running example of the procedure being described s “This is the procedure” s Programming is among the earliest uses to which written language was put Chapter Twenty-Four Modern Programming Languages 6
  • 7. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 7
  • 8. Baghdad s Near ancient Babylon s Founded around 762 s A great center of scholarship, art and poetry s 780-850: Mohammed Al-Khorezmi, a court mathematician, lived and wrote s Two little books… Chapter Twenty-Four Modern Programming Languages 8
  • 9. Algebra s Kitâ al-jabr wa'l-muqabâla s Translated into Latin, spread throughout Europe s Used as a mathematics text in Europe for eight hundred years Chapter Twenty-Four Modern Programming Languages 9
  • 10. Algorithms s The original is lost s Latin translation: Algorthmi de numero Indorum s Algorithms for computing with Hindu numerals: base-10 positional system with 0 s A new technology (data structure and algorithms) s Strongly influenced medieval European mathematics Chapter Twenty-Four Modern Programming Languages 10
  • 11. Other Early Written Algorithms s Euclid, 300 BC: an algorithm for computing the GCD of two numbers s Alexander de Villa Dei, 1220 AD: Canto de Algorismo, algorithms in Latin verse s Not programming languages: natural language (even poetry) plus mathematics Chapter Twenty-Four Modern Programming Languages 11
  • 12. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 12
  • 13. Augusta Ada s Daughter of George Gordon, Lord Byron s Early 1800’s in England (as elsewhere) women were generally denied education, especially math and science s Ada studied math with a private tutor (as an antidote to feared Byronic tendencies) s Married at 19 (Lady Lovelace), 3 children Chapter Twenty-Four Modern Programming Languages 13
  • 14. Charles Babbage s English mathematician s Inventor of mechanical computers: – Difference Engine, construction started but not completed (until a 1991 reconstruction) – Analytical Engine, never built I wish to God these calculations had been executed by steam! Charles Babbage, 1821 Chapter Twenty-Four Modern Programming Languages 14
  • 15. Analytical Engine s Processing unit (the Mill) s Memory (the Store) s Programmable (punched cards) s Iteration, conditional branching, pipelining, many I/O devices Chapter Twenty-Four Modern Programming Languages 15
  • 16. Sketch of the Analytical Engine s A paper by Luigi Menabrea s Published 1843 s Translated, with explanatory notes, by A.A.L. s Algorithms in a real programming language: the machine language of punched cards for the Analytical Engine Chapter Twenty-Four Modern Programming Languages 16
  • 17. Not Just For Numbers The bounds of arithmetic were however outstepped the moment the idea of applying the cards had occurred; and the Analytical Engine does not occupy common ground with mere "calculating machines." … In enabling mechanism to combine together general symbols in successions of unlimited variety and extent, a uniting link is established between the operations of matter and the abstract mental processes of the most abstract branch of mathematical science. A.A.L. Chapter Twenty-Four Modern Programming Languages 17
  • 18. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 18
  • 19. Konrad Zuse s Built a mechanical computer in his parents’ living room in Berlin in 1936: the Z1 s Metal strips and pins—very different from Babbage’s wheelwork s Programmable using punched tapes s Binary floating point numbers with an explicit exponent Chapter Twenty-Four Modern Programming Languages 19
  • 20. Early Development s More computers: – Z2 experimented with relays for the ALU – Z3: all-relay technology (the first electronic programmable digital computer) – Z4: envisioned as a commercial system s Most designs and prototypes destroyed in the war s 1945: Zuse flees Berlin with wife and Z4 Chapter Twenty-Four Modern Programming Languages 20
  • 21. Plankalkül s In 1945/46, Zuse completed the design of a programming language: the Plankalkül s Many advanced ideas: – Assignment, expressions, subscripts – Constructed types: from primitive (bit) other types are constructed: integers, reals, arrays, etc. – Conditional execution, loops, subroutines – Assertions s Many example programs: sorting, graphs, numeric algorithms, syntax analysis, chess Chapter Twenty-Four Modern Programming Languages 21
  • 22. The Notation s Main line with three underneath: – V: variable number – K: subscript – S: optional comment (showing types) s V0[Z1]+=1 looks like: V Z + 1 ⇒ V Z V 0 1 0 1 K S m×1·n 1·n 1·n m×1·n 1·n Chapter Twenty-Four Modern Programming Languages 22
  • 23. Looks Influential… s …but it was not: it was not published until 1972, and few people knew of it s Never implemented: far beyond the state of the art in hardware or software at the time s Many of Zuse’s ideas were reinvented by others Chapter Twenty-Four Modern Programming Languages 23
  • 24. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 24
  • 25. The Labor Of Programming s Programming has always been hard s In the early days of large-scale digital computers, it was labor-intensive s Hard to appreciate now, how much tedious work was involved then Chapter Twenty-Four Modern Programming Languages 25
  • 26. The Good Old Days In the early years of programming languages, the most frequent phrase we heard was that the only way to program a computer was in octal. Of course a few years later a few people admitted that maybe you could use assembly language…. I have here a copy of the manual for Mark I. I think most of you would be totally flabbergasted if you were faced with programming a computer, using a Mark I manual. All it gives you are the codes. From there on you're on your own to write a program. We were not programmers in those days. The word had not yet come over from England. We were "coders." Rear Admiral Dr. Grace Murray Hopper Chapter Twenty-Four Modern Programming Languages 26
  • 27. Wish List s Floating point: coders had to keep track of the exponent manually (Babylonian style) s Relative addressing: coders kept notebooks of subroutines, but the codes had to be adjusted by hand for the absolute addresses s Array subscripting help s Something easier to remember than octal opcodes Chapter Twenty-Four Modern Programming Languages 27
  • 28. Early Aids s Assemblers s Programming tools: – Short Code, John Mauchly, 1949 (interpreted) – A-0, A-1, A-2, Grace Hopper, 1951-1953 (like macro libraries) – Speedcoding, John Backus, 1954 (interpreted) s People began to see that saving programmer time was important Chapter Twenty-Four Modern Programming Languages 28
  • 29. Fortran s The first popular high-level programming language s A team led by John Backus at IBM s "The IBM Mathematical FORmula TRANslating System: FORTRAN", 1954: – supposed to take six months -- took two years – supposed to eliminate coding errors and debugging – supposed to generate efficient code, comparable with hand- written code -- very successful at this – closely tied to the IBM 704 architecture Chapter Twenty-Four Modern Programming Languages 29
  • 30. Separate Compilation s First Fortran: no separate compilation s Compiling “large” programs – a few hundred lines – was impractical, since compilation time approached 704 MTTF s Fortran II added separate compilation s Later Fortrans evolved with platform independence: no more PAUSE statement! I don't know what the language of the year 2000 will look like, but I know it will be called FORTRAN. C.A.R. Hoare Chapter Twenty-Four Modern Programming Languages 30
  • 31. Fortran's Influence s Many languages followed, but all designers learned from Fortran s Fortran team pioneered many techniques of scanning, parsing, register allocation, code generation, and optimization Chapter Twenty-Four Modern Programming Languages 31
  • 32. John Backus s Many contributions to programming languages: Fortran, Algol 58 and 60, BNF, FP (a purely functional language) My point is this: while it was perhaps natural and inevitable that languages like FORTRAN and its successors should have developed out of the concept of the von Neumann computer as they did, the fact that such languages have dominated our thinking for twenty years is unfortunate. It is unfortunate because their long-standing familiarity will make it hard for us to understand and adopt new programming styles which one day will offer far greater intellectual and computation power. John Backus, 1978 Chapter Twenty-Four Modern Programming Languages 32
  • 33. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 33
  • 34. Lisp s AI conference at Dartmouth, 1956: McCarthy, Minsky, Newell, Simon s Newell, Shaw and Simon demonstrate Logic Theorist, a reasoning program written in IPL (Information Processing Language) s IPL had support for linked lists, and caught McCarthy’s attention s He wanted a language for AI projects, but not IPL: too low-level and machine-specific Chapter Twenty-Four Modern Programming Languages 34
  • 35. Early AI Language Efforts s An IBM group (consulting McCarthy) developed FLPL: Fortran List Processing Language s McCarthy had a wish list, developed while writing AI programs (chess and differential calculus) – Conditional expressions – Recursion – Higher-order functions (like ML’s map) – Garbage collection s FLPL wasn’t the answer for McCarthy’s group at MIT in 1958… Chapter Twenty-Four Modern Programming Languages 35
  • 36. Lisp’s Unusual Syntax s A Lisp program is a list representing an AST: (+ a (* b c)) s The plan was to use some Fortran-like notation s But McCarthy wrote a paper showing a simple Lisp interpreter in Lisp: a function called eval s To avoid syntax issues, he used the list-AST form, both for eval’s input and for eval itself s This eval, hand-translated into assembly language, became the first implementation of Lisp Chapter Twenty-Four Modern Programming Languages 36
  • 37. Lisp’s Unusual Syntax s The group never gave up the idea of compiling from some Fortran-like syntax s But they never got around to it either s In later years, people often tried to compile Lisp from a Fortran- or Algol-like syntax s None of them caught on s There are advantages to having programs and data use the same syntax, as we saw with Prolog Chapter Twenty-Four Modern Programming Languages 37
  • 38. Lisp Evolution s Quickly became, and remains, the most popular language for AI applications s Before 1980: many dialects in use: – Each AI research group had its own dialect – In the 1970’s, a number of Lisp machines were developed, each with its own dialect s Today: some standardization: – Common Lisp: a large language and API – Scheme: a smaller and simpler dialect Chapter Twenty-Four Modern Programming Languages 38
  • 39. Lisp Influence s The second-oldest general-purpose programming language still in use s Some ideas, like the conditional expression and recursion, were adopted by Algol and later by many other imperative languages s The function-oriented approach influenced modern functional languages like ML s Garbage collection is increasingly common in many different language families Chapter Twenty-Four Modern Programming Languages 39
  • 40. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 40
  • 41. Algol s In 1957, languages were proliferating – In the US, computer manufacturers were developing platform-specific languages like IBM’s Fortran – In Europe, a number of languages had been designed by different research groups: Plankalkül and others s Algol was intended to stop this proliferation – It would be the one universal, international, machine- independent language for expressing scientific algorithms s In 1958, an international committee (!) was formed to come up with the design Chapter Twenty-Four Modern Programming Languages 41
  • 42. The Algols s Eventually, three major designs: Algol 58, Algol 60, and Algol 68 s Developed by increasingly large (!) international committees Chapter Twenty-Four Modern Programming Languages 42
  • 43. The Good News s Virtually all languages after 1958 used ideas pioneered by the Algol designs: s Compound statements: begin statements end s Free-format lexical structure s BNF definition of syntax s Local variables with block scope s Static typing with explicit type declarations s Nested if-then-else s Call by value (and call by name) s Recursive subroutines and conditional expressions (ex Lisp) s Dynamic arrays s First-class procedures s User-defined operators Chapter Twenty-Four Modern Programming Languages 43
  • 44. Issue: Phrase-Level Control s Early languages used label-oriented control: GO TO 27 IF (A-B) 5,6,7 s Algol languages had good phrase-level control, like the if and while we saw in Java, plus switch, for, until, etc. s A debate about the relative merits began to heat up s Edsgar Dijkstra’s famous letter in 1968, “Go to statement considered harmful,” proposed eliminating label-oriented control completely Chapter Twenty-Four Modern Programming Languages 44
  • 45. Structured Programming s Using phrase-level control instead of labels was called structured programming s There was a long debate: many programmers found it difficult at first to do without labels s Now, the revolution is over: – Some languages (like Java) eliminated go to – Others (like C++) still have it – But programmers rarely use it, even when permitted s The revolution was triggered (or at least fueled) by the Algol designs Chapter Twenty-Four Modern Programming Languages 45
  • 46. Issue: Orthogonality s The Algol designs avoided special cases: – Free-formal lexical structure – No arbitrary limits: s Any number of characters in a name s Any number of dimensions for an array – And orthogonality: every meaningful combination of primitive concepts is legal—no special forbidden combinations to remember Chapter Twenty-Four Modern Programming Languages 46
  • 47. Example Integers Arrays Procedures Passing as a parameter Storing in a variable Storing in an array Returning from a procedure s Each combination not permitted is a special case that must be remembered by the programmer s By Algol 68, all combinations above are legal s Just a sample of its orthogonality—few modern languages take this principle as far as Algol Chapter Twenty-Four Modern Programming Languages 47
  • 48. The Bad News s The Algol languages were not as widely used as had been hoped – Algol 58, extended to Jovial – Algol 60 used for publication of algorithms, and implemented and used fairly widely outside U.S. s Some possible reasons: – They neglected I/O – They were considered complicated and difficult to learn – They included a few mistakes, like by-name parameters – They had no corporate sponsor (IBM chose to stick with Fortran) Chapter Twenty-Four Modern Programming Languages 48
  • 49. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 49
  • 50. Before Smalltalk: Simula s Kristen Nygaard and Ole-Johan Dahl, Norwegian Computing Center, 1961 s Simula I: an special-purpose Algol extension for programming simulations: airplanes at an airport, customers at a bank, etc. s Simula 67: a general-purpose language with classes, objects, inheritance s Co-routines rather than methods Chapter Twenty-Four Modern Programming Languages 50
  • 51. Smalltalk s Alan Kay, Xerox PARC, 1972 s Inspired by Simula, Sketchpad, Logo, cellular biology, etc. s Smalltalk is more object-oriented than most of its more popular descendants s Everything is an object: variables, constants, activation records, classes, etc. s All computation is performed by objects sending and receiving messages: 1+2*3 Chapter Twenty-Four Modern Programming Languages 51
  • 52. A Design Philosophy s Commit to a few simple ideas, then find the most elegant language design from there: – Lists, recursion, eval: Lisp – Objects, message-passing: Smalltalk – Resolution-based inference: Prolog s Hallmarks: – Initial implementation is easy – Easy to modify the language – Programming feels like custom language design Chapter Twenty-Four Modern Programming Languages 52
  • 53. Smalltalk’s Influence s The Simula languages and Smalltalk inspired a generation of object-oriented languages s Smalltalk still has a small but active user community s Most later OO languages concentrate more on runtime efficiency: – Most use static typing (Smalltalk uses dynamic) – Most include non-object primitive types as well as objects Chapter Twenty-Four Modern Programming Languages 53
  • 54. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 54
  • 55. Prolog s Alan Robinson, 1965: resolution-based theorem proving – Resolution is the basic Prolog step – But Prolog did not follow easily or immediately s Robert Kowalski, Edinburgh, 1971: an efficient resolution-based technique, SL-resolution s Alain Colmerauer and Philippe Roussel, Marseilles, 1972: Prolog (programmation en logique) – For the automated deduction part of an AI project in natural language understanding Chapter Twenty-Four Modern Programming Languages 55
  • 56. Prolog Evolution s 1973 version: – Eliminated special backtracking controls (introducing the cut operation instead) – Eliminated occurs-check s David Warren, 1977: efficient compiled Prolog, the Warren Abstract Machine s (For many languages—Smalltalk, Prolog, ML— techniques for efficient compilation were critical contributions) Chapter Twenty-Four Modern Programming Languages 56
  • 57. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 57
  • 58. ML s Robin Milner, Edinburgh, 1974 s LCF: a tool for developing machine-assisted construction of formal logical proofs s ML was designed as the implementation language for LCF s Strong typing, parametric polymorphism, and type inference were in the first designs s Remained closely tied to LCF development for several years Chapter Twenty-Four Modern Programming Languages 58
  • 59. Issue: Formal Semantics s The definition of Standard ML includes a formal semantics (a natural semantics) s This was part of the initial design, not (as is more common) added after implementation s Fits with the intended application: to trust the proofs produced by LCF, you must trust the language in which LCF is implemented Chapter Twenty-Four Modern Programming Languages 59
  • 60. ML Evolution s Luca Cardelli, 1980: efficient compiled ML s 1983: draft standard ML published s Additions: pattern-matching, modules, named records, exception handling, streams s Dialects: – Standard ML (SML), the one we used – Lazy ML: ML with lazy evaluation strategy – Caml: An ML dialect that diverged before the addition of modules – OCaml: Caml with object-oriented constructs Chapter Twenty-Four Modern Programming Languages 60
  • 61. s 24.2 Prehistory of programming languages – The story of the programmers of Babylon – The story of Mohammed Al-Khorezmi – The story of Augusta Ada, Countess of Lovelace s 24.3 Early programming languages – The story of the Plankalkül – The story of Fortran – The story of Lisp – The story of Algol – The story of Smalltalk s 24.4 Our languages – The story of Prolog – The story of ML – The story of Java Chapter Twenty-Four Modern Programming Languages 61
  • 62. A Long Lineage An even larger language than Algol 60, adding features for business data processing. Algol 60 Christopher Strachey et. al., 1962-1966 “Basic CPL.” Vastly simplified. Typeless: CPL manipulates untyped machine words. Introduced the C-family array idea: A[I], written in BCPL as A!I, is the same as a reference to the word at BCPL address A+I. Martin Richards (a student of Strachey), 1967 An even simpler language, developed for systems B programming for the first Unix systems at Bell Labs. Included compound assignments (a+=b), borrowed from Algol 68. Ken Thompson, 1969 Chapter Twenty-Four Modern Programming Languages 62
  • 63. A Long Lineage, Continued Extension of B (originally, “NB”) to take advantage of more hardware (PDP-11). Type system, macro B preprocessor, I/O library, etc. Used to reimplement the Unix kernel, and spread widely with Unix. Dennis Ritchie et. al., 1971-1973 C C++ Originally a C preprocessor adding object-oriented features to C: “C with Classes”. Added dynamic dispatch, overloaded operators and function names, Java multiple inheritance, templates, exception handling. Became and remains one of the most widely used languages. Bjarne Stroustrup, 1984 Chapter Twenty-Four Modern Programming Languages 63
  • 64. Java s James Gosling, Sun Microsystems s 1991: Oak: a language for ubiquitous computers in networked consumer technology – Like C++, but smaller and simpler – More secure and strongly typed – More platform independent s 1995: renamed Java, retargeted for the Web – Incorporated into web browsers – Platform-independent active content for web pages Chapter Twenty-Four Modern Programming Languages 64
  • 65. Nonlinear Lineage s Not just a straight line from CPL s Java also has: – Garbage collection (ex Lisp) – Concurrency (ex Mesa) – Packages (ex Modula) s But nothing new: it was intended to be a production language, not a research language Chapter Twenty-Four Modern Programming Languages 65
  • 66. Conclusion: The Honor Roll s Some programming language pioneers who have won the Turing award: s Alan Perlis, John McCarthy, Edsger Dijkstra, Donald Knuth, Dana Scott, John Backus, Robert Floyd, Kenneth Iverson, C.A.R. Hoare, Dennis Ritchie, Niklaus Wirth, John Cocke, Robin Milner, Kristen Nygaard, Ole-Johan Dahl s These very bright people had to work very hard on things that now seem easy, such as: – Local variables with block scope – Using phrase-level control instead of go to s Before becoming perfectly obvious to everyone, these things were unknown and unguessed Chapter Twenty-Four Modern Programming Languages 66
  • 67. Conclusion s Is the evolution of programming languages nearly done, or have we as far again to go? s Maybe all the important discoveries have been made, and language evolution will now slow and converge s Or maybe we will have the pleasure of seeing new ideas, now unknown and unguessed, become perfectly obvious to everyone s Enjoy! Chapter Twenty-Four Modern Programming Languages 67