Modern Programming Languages - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Modern Programming Languages

Description:

– PowerPoint PPT presentation

Number of Views:895
Avg rating:3.0/5.0
Slides: 29
Provided by: sjinf
Category:

less

Transcript and Presenter's Notes

Title: Modern Programming Languages


1
Modern Programming Languages
2
Computation
  • Computation is an abstract and subtle mental
    notion
  • With a concrete realization by a machine
  • Causing electrons/photons to change
    states/configurations
  • There are mathematical models of information
    Computation
  • We could perhaps benefit from a philosophy of
    computation
  • Effective transformation of inputs to outputs
  • For the class of Turing computable functions
  • effective procedures ? algorithms
  • Symbolic (syntactic) rewriting based on
    well-defined rules (semantic) to compute an
    answer (pragmatics)
  • mlgtfun gcd(m,n) if m 0 then n else gcd(n
    mod m, m)
  • mlgtgcd(712,332)
  • answer is 4
  • A reconfiguration of bits (information) in the
    memory of some kind of abstract or real machine
  • Which are then interpreted relative to some model
    of computation

3
Algorithm
  • The Art of Computer Programming (TAOCP), Vol. 1
    Fundamental Algorithms by D.E.Knuth
  • Euclid of alexandria (BC 325 BC 265), Egypt
  • Euclids Elements GCD algorithm
  • Abu Jafar Muhammad ibn Musa Al-Khawarizmi (about
    780 850), lived in Baghdad, Persia

4
Recent history
  • Formal models of computation 1900 1936
  • Churchs Thesis all represent same class of
    computations
  • Freges concept script
  • Churchs ?-calculus
  • Kleenes recursive functions
  • Turings abstract Computing machine
  • Currys combinatory logic
  • Posts production system
  • Principal notations for describing computations
  • TM alphabet of tape symbols, r/w tape, set of
    states, state transition functions, imperative
    control mechanism
  • T (Q, S, I, q0 ,F) (q0 , q1 , q2 , q3 ,
    q4,0, 1, q0 , q4)
  • Not programmer friendly
  • ?-calculus ?-terms, abstractions, and reduction
    rules
  • Expression evaluation by parameter substitutions
    reduction
  • (?x.x1) 2 ? 21 ? 3
  • Lacks many practical features for programming a
    real computer

5
Logic, Turing Machine ?-calculus
  • Churchs thesis tells us that all these
    formalisms describe the same class of
    mathematical objects
  • i.e., the class o computable functions
  • Choose the formalism best suited to the problem
  • Turing Machines ? imperative programming
  • Focus on explicit state transitions and
    assignment
  • ?-calculus ? functional programming
  • Pure expression evaluation and no assignment
  • Predicate Logic ? logic programming
  • Horn clause resolution

6
Formalisms that have persisted
  • Predicate logic
  • Gottlöb Frege, 18481925
  • Computation by logic deduction
  • Formal basis for proof theory automated theorem
    proving
  • ?-calculus
  • Alonzo Church, 19031995
  • Formal basis for all functional languages,
    semantics type theory
  • Turing Machines
  • Alan Turing, 19121954
  • Formal basis for computational complexity theory
  • Recursive Functions Automata
  • Stephen Kleene, 19091994
  • Formal basis for meta-mathematical theories
  • Regular Expressions, Finite State machines,
    Push-Down Automata

7
Formalisms that have faded
  • Combinatory logic
  • Haskell Curry, 19001982
  • Post Production Systems
  • Emil Post, 18971954

8
What is a programming language?
  • A Formal notation for specifying an infinite
    number of computations
  • Always requires an unambiguous syntax for the
    language
  • Specified by a finite context-free grammar
  • Should have a well-defined compositional
    semantics for each syntactic construct in the
    language
  • Axiomatic vs. denotational vs. operational vs.
    ad-hoc
  • Often requires a practical implementation
    pragmatics
  • General purpose language vs. domain specific
    language
  • Implementation on a real machine vs. a virtual
    machine
  • Efficiency vs. portability
  • Transition vs. compilation vs. interpretation
  • C was originally translated to C by
    B.Stroustrups cfront translator
  • Gnus g was the first native-code C compiler
    (Michael Tieman)
  • Java Originally used a byte-code interpreter, but
    then hust-in-time(JIT) compilers appeared, and
    now native code compilers are commonly used for
    greater run-time efficiency (Gosling, Ungar,
    Bothner)
  • LISP, Scheme and most functional languages are
    interpreted by a virtual machine, but code is
    often pre-compiled to byte codes for efficiency

9
Programming Paradigms
  • Procedural/Imperative Programming
  • FORTRAN, ALGOL, Pascal, C,
  • Functional/Applicative Programming
  • LISP, Scheme, ML, Haskell,
  • Logic/Declarative Programming
  • PROLOG,
  • Object-oriented Programming
  • C, Java, C,
  • Hybrids
  • Concurrent, parallel, dataflow, intensional,
    domain specific,
  • Scripting, extension languages,

10
Key language milestones
  • Assembly languages
  • Invented by machine designers in the early 1950s
  • Shift from binary machine codes to mnemonics
  • First occurrence of reusable macros subroutines
  • FORTRAN FORmula TRANslation
  • Designed by John Backus at IBM in the mid-1050s
  • First high-level algebraic language with a
    compiler
  • LISP LISt Processor
  • Designed by John McCarthy in 1958
  • First language to be based on the theory of
    recursive functions
  • Influenced by Churchs ?-calculus notation
  • Major influence on all subsequent functional
    languages
  • As well as on Smalltalk

11
FORTRAN
  • John Backus (1924 )
  • Turing Award 1977
  • On FORTRAN We did not know what we wanted and
    how to do it. It just sort of grew. The first
    struggle was over what the language would look
    like. Then how to parse expressions - it was a
    big problem and what we did looks astonishingly
    clumsy now....
  • BNF The syntax and semantics of the proposed
    international algebraic language of the Zuerich
    ACM-GRAMM conference. ICIP Paris, June 1959.
  • Influenced by Chomskys work on context-free
    grammar

syntax rule rule identifier ""
expression expression term "" term
term factor factor factor
identifier quoted_symbol "(" expression ")"
"" expression "" "" expression ""
identifier letter letter digit
quoted_symbol """ any_character """
12
LISP
  • John McCarthy (1927 )
  • 1971 Turing Award
  • In the course of its development the LISP system
    went through several stages of simplification and
    eventually came to be based on a scheme for
    representing the partial recursive functions of a
    certain class of symbolic expressions.
  • Recursive Functions of Symbolic Expressions and
    their Computation by Machine (Part I). CACM,
    April 1960.

13
The roots of modern languages
  • AlGOL 60 International Algorithmic Language
  • Designed by IFIP WorkingGroup 2.1 in 1958-1960
  • Earlier version IAL, ALGOL 58
  • John Backus, Peter Naur, John NcCarthy, Alan
    Perlis others
  • Formally specified syntax using Backus-Naur Form
    (BNF)
  • Significant influence on all of todays modern
    languages
  • Introduced explicit variable type declarations,
    block structure (begin-end), nested lexical
    scopes recursive procedures
  • Pascal, Modula, Ada, C, C and Java are direct
    descendants of ALGOL
  • Scheme adopted lexical scoping from ALGOL
  • Revised Report on the Algorithmic Language Algol
    60
  • Revised5 Report on the Algorithmic Language
    Scheme
  • Simula 67 first object-oriented language
  • Designed by Ole-Johan Dahl and Kristen Nygaard
  • Influenced all subsequent OO programming
    languages
  • Objects classes
  • Inheritance (subtyping) virtual methods
    (subtype polymorphism)
  • Note parametric polymorphism (generics) came
    from CLU

14
ALGOL 60
  • Backus, Mccarthy
  • Alan Perlis, 19221990
  • 1966 turing award (1st)
  • Syntatic sugar causes cancer of the semi-colons
  • Peter Naur (1928 )
  • Editor Revised Report on the Algorithmic
    Language Algol 60
  • BNF used as a meta-language for ormally
    describing the valid syntatic phrases of the
    language

15
Simula
  • Ole-Johan Dahl (1932 2002)
  • Kristen Nygaard (1926 2002)
  • Joint 2001 Turing Award
  • Joint 2002 von Neumann Medal
  • Simula I (1962-1965) and Simula 67 are the two
    first object-oriented languages.
  • Simula 67 introduced most of the key concepts of
    object-oriented programming both objects and
    classed, subclasses (usually referred to as
    inheritance) and virtual procedures, combined
    with safe referencing and mechanisms for bringing
    into a program collections of program structures
    described under a common class heading (prefixed
    blocks)

16
Other important languages
  • ALGOL-like
  • Jovial, Euler, Pascal, Algol-68, Forsythe, CLU,
    Ada
  • OO
  • Smalltalk, Objective-C, C, Eiffel, Modula-3,
    self, C
  • Functional
  • ISWIM, FP, SASL, Miranda, Haskell
  • LCF, ML, SML, Caml OCAML
  • Scheme, Common LISP, CLOS
  • Logic
  • PROLOG, Gödel, LDL, automated theorem provers
  • Research-Oriented
  • Dylan, ABCL/1, ACT and more and more ...

17
Ada
  • Primarily used by the US dept of Defense
  • Designed by a French language design team as part
    of an open competition
  • Named after Ada Byron (Lady Lovelace), 1815
    1851
  • At a young age, Ada learned of Charles Babbages
    ideas for a new calculating engine, the
    Analytical Engine, He conjectured what if a
    calculating engine could not only foresee but
    could act on that foresight. Ada was impressed by
    the universality of this idea. She suggested the
    idea of writing a plan for how this new
    calculating engine could be used to calculate
    Bernoulli numbers. This plan, is now regarded as
    the first computer program.
  • Ada, The Enchantress of Numbers, by Betty
    Alexandra Toole

18
Application specific languages
  • Commercial data processing
  • COBOL, SQL, 4GLs
  • Systems Programming
  • PL/I, PL/M, BLISS, Modula, Modula-2, Oberon
  • Specialized applications
  • BASIC, APL, Forth, Icon, Logo, SNOBOL4, GPSS,
    VisualBasic
  • Concurrent, Parallel Distributer
  • Concurrent Pascal, Concurrent C, C, SR, Occam,
    Erlang, Obliq
  • System administration
  • Command shells sh, csh/tcsh, ksh/zsh, bash, ..
  • Perl, PHP, python, Rexx, Ruby, Tcl,
  • Programming tool (Mini languages)
  • AWK, make, lex, yacc, autoconf,

19
COBOL
  • COmmon Business Oriented Language
  • Invented in 1950s
  • Primarily used for business data processing
    applications
  • Billions spent to fix Y2K issues in old COBOL
    programs
  • Admiral Grace Murray Hopper, 1906 1992
  • Ph. D in Mathematics, Yale, 1934
  • Joined the Navy in 1943 and worked at Harvard
    with Howard Aiken on the Mark I and Mark II
    computers
  • Called the mother of COBOL for her
    contributions to the standardization of the
    language
  • Grace Hopper Celebration of Women in Computing
  • Grace Murray Hopper Award

20
The First Computer Bug
  • U.S. Naval Historical Center Photograph.Courtesy
    of the Naval Surface Warfare Center, Dahlgren,
    Va., 1988.
  • In 1945, LTJG Grace Murray was working on the
    Harvard University Mark II Aiken Relay
    Calculator.  While testing Mark II due to a
    malfunction, a moth was found trapped between
    points at Relay 70, Panel F on 9 September.  The
    operators removed and affixed the moth to the
    computer log, with the entry  "First actual case
    of bug being found."  They put out the word that
    they had "debugged" the machine, thus introducing
    the term "debugging a computer program."
  • Although, Hopper was always careful to admit that
    she was  not present when the moth was
    discovered, it was one of her favorite stories. 
  • In 1988, the log, with the moth still taped by
    the entry, was found in the Naval Surface Warfare
    Center Computer Museum at Dahlgren, Va. 

21
KR C, ISO/ANSI C
  • Brian Kernighan
  • Also the K in AWK
  • Dennis Ritchie
  • 1983 Turing award (with Ken Thompson)

22
From C to C with classes to C
  • Bjarne Stroustrup
  • Ph.D unvi of Cambridge
  • Used Simula in Ph. D. research and he knew about
    BCPL
  • Then he went to Bell Labs created C with
    Classes in 1979
  • in C due to A. Koenig
  • First Cfront translator from C to C around
    1983
  • An overview of the C programming Language

23
And then came Java
  • James Gosling (and Duke)
  • Gosling Emacs
  • The Green Project
  • Oak ? Java
  • Java is more influenced by C (syntax) and
    Modula-3 (object model) than by C
  • Unlike C
  • No operator overloading
  • No templates
  • No multiple inheritance
  • Like Modula-3
  • Explicit interfaces
  • Single class inheritance
  • Exception handling
  • Built-in threading model
  • Automatic garbage collection

24
From BASIC to c to
  • The un-Java for windows
  • It is window-ized so that it is legally not java
  • The politics of language adoption
  • C had an interesting run-time environment
  • .NET CLR common language run time for Visual
    Basic, C, C and future Microsoft languages.

25
Why so many languages?
  • EPIGRAMS IN PROGRAMMING by Alan Perlis
  • 1. One man's constant is another man's variable.
  • 2. Functions delay binding data structures
    induce binding. Moral Structure data late in the
    programming process.
  • 3. Syntactic sugar causes cancer of the
    semicolon.
  • 4. Every program is a part of some other program
    and rarely fits.
  • 5. If a program manipulates a large amount of
    data, it does so in a small number of ways.
  • 6. Symmetry is a complexity-reducing concept
    (co-routines include subroutines) seek it
    everywhere.
  • 7. It is easier to write an incorrect program
    than understand a correct one.
  • 118. If you can imagine a society in which the
    computer- robot is the only menial, you can
    imagine anything.
  • 119. Programming is an unnatural act.
  • 120. Adapting old programs to fit new machines
    usually means adapting new machines to behave
    like old ones.
  • http//www.cs.yale.edu/homes/perlis-alan/quotes.ht
    ml

26
Language evolution versus revolution
  • Are new languages really new?
  • First we must ask in what way is a language
    new?
  • Significantly improves upon 1st generation
    languages
  • E.g. better than ALGOL, LISP and Simula in some
    key ways
  • Programmer productivity, program correctness,
    efficiency, reusability, extensibility,
    usderstandability, etc
  • Evolutionary progress since 1960?
  • Revolutionary progress since 1960?
  • Any candidate? What about java?
  • http//java.sun.com/people/jag/green/index.html
  • http//ei.cs.vt.edu/wwwbtb/book/chap1/java_hist.h
    tml

27
Language Design
  • What are good design criteria for a language?
  • What do the experts say?
  • Fundamental Concepts in Programming Language,
    Christopher Strachey
  • On the Design of Programming Languages, Nikalus
    Wirth
  • Hints on Programming Language Design, C.A.R.
    Hoare
  • Why Pascal is Not My Favorite Language, Brian
    Kernighan
  • Lisp notes on its past and Future, John
    McCarthy
  • Growing a Language, Guy Steele

28
Language Designers
  • Christopher Strachey
  • Founded Oxford universitys Programming Research
    Group (PRG) in early 1960s
  • Co-invented Scott-Strachey denotational
    semantics, with Dana Scott
  • Sir C.A.R. (Tony) Hoare, FRS
  • ALGOL 68, quicksort, find, monitors, CSP,
    axiomatic semantics (Hoare Logic)
  • Niklaus Wirth
  • Invented Euler, Algol-W, Pascal, Pascal-P,
    Modula, Modula-2, Oberon
  • 1984 Turing Award
Write a Comment
User Comments (0)
About PowerShow.com