Uploaded by supta.philip

6.4 Programming Languages

advertisement
History of Computing
John H Reif
History of Programming
Languages
Topics of this Lecture on History of Programming
Languages:
History of Computing
Programming Languages
• History of Early Programming Notations:
• Alonzo Church’s Lambda Calculus
• Zuse’s Plankalkül (Plan Calculus): 1st programming notation resembling a
programming language
• Flowcharts
• Assembly Languages
• Early High Level Programming Languages:
• McMauchly’s Shortcode: 1st high level programming language.
• Alick Glennie’s Autocode: The 1st programming language with a compiler
• John Backus’s FORTRAN: The 1st programming language with an optimized
compiler
• Dijkstra‘s ALGOL (Algorithmic Language): for structured programming
• McCarthy‘s LISP: based on the Lambda Calculus
• IBM’s Report Program Generator
• Hopper’s FLOW-MATIC and COBOL
Cover of the COBOL 60 report to
CODASYL [1960]
History of Computing
Programming Languages
Topics of this Lecture on History of Programming
Languages: , Cont:
• Later High Level Programming Languages:
• Kemeny and Kurtz’s BASIC
• Wirth’s PASCAL
• Kay’s Smalltalk:1st object-oriented programming language
• Ritchie’s C
• SEQUEL (SQL): language for relational databases
• Ada
• Modern High Level Programming Languages:
• Stroustrup’s C++ : structured C
• Wall‘s Perl: scripting language
• Haskell: Allows lazy evaluation
• Rossum‘s Python
• Microsoft’s Visual Basic
• James Gosling’s Java
• PHP and Javascript: Programming Languages for Web Development
Alan Kay's Smalltalk used as a user interface for
ALTO computer [1976]
History of Computing
Programming Languages
Articles on History of Programming Languages:
• Justin Lestal, History of programming languages, DevSkiller
•
Web download:
•
https://devskiller.com/history-of-programming-languages/
• Knuth, Donald E.; Pardo, Luis Trabb. "Early development of programming
languages". Encyclopedia of Computer Science and Technology (Marcel Dekker) 7:
419–493.
•
Web download:
•
http://bitsavers.informatik.uni-stuttgart.de/pdf/stanford/cs_techReports/STAN-CS-76-562_EarlyDevelPgmgLang_Aug76.pdf
Topics of this Lecture on History of Programming
Languages:
• History of Early Programming Notations:
• Alonzo Church’s Lambda Calculus
• Zuse’s Plankalkül (Plan Calculus): 1st programming notation resembling a
programming language
• Flowcharts
• Assembly Languages
History of Computing
Programming Languages
History of Computing
Programming Languages
Alonzo Church’s Lambda Calculus (λ-calculus) [1930s]: might be considered the 1st
programming language, defined before modern electronic computers.
• a formal system in mathematical logic for expressing computation based on function
abstraction and function application using variable binding and substitution.
• Function Abstraction: λ x . t is a definition for a function that takes input x and substitute
x into the expression t.
• For example, λ x . x2+2 is an abstraction for function f(x)= x2+2.
• Application: λ f (s) represents the application of a function λ f to an input s.
• λ f (s) represents the act of calling function f on input s to produce f(s).
• For example, λ f (2) = 6 is the application of function f(x)= x2+2 (defined by
abstraction λ x . x2+2) on input x = 2.
• John McCarthy‘s LISP programming language of 1958 is very similar to the λ-calculus.
Alonzo Church
History of Computing
Programming Languages
Konrad Zuse’s Plankalkül (Plan Calculus) [1944-1945]: 1st
programming language.
• Konrad Zuse had developed a series of relay-based
electromechanical computers.
• In 1939 he described his plans for a programming
language Plankalkül (Plan Calculus):
“Almost half a year of gradual introduction into formal logic. I
rediscovered there lots of my previous thoughts. (combinatorics of
conditionals = propositional calculus; study of intervals = lattice theory).
Now I plan creation of ‘Calculus of plans’. There are series of concepts
needed to clarify for this.”
• Plankalkül allowed for the creation of procedures:
• Segments of code that could be invoked over
and over to perform routine operations.
• But did not provide for looping.
• In a 1957 lecture, Zuse expressed his hope that
Plankalkül:
•
"after some time as a Sleeping Beauty, will yet come to life."
Konrad Zuse
History of Computing
Programming Languages
Flowchart [1921]: a type of diagram that provides a
step-by-step approach to solving a task.
• Shows the steps as boxes of various kinds,
• Gives their order by connecting the boxes with arrows.
A simple
flowchart:
Representing a process
for dealing with a nonfunctioning lamp.
Redefined in 1949 by Herman Goldstine and John von
Neumann to be:
Programming Flowchart [1947]: a type of diagram that
represents a program.
Herman Goldstine and John von Neumann, "Planning and coding of
problems for an electronic computing instrument, Part II, Volume 1" (1947).
An early
flowchart to
represent
program flow:
(Goldstine and
Neumann 1947, fig.
7.10)
History of Computing
Programming Languages
Assembly Language [1949]: 1st used in the Electronic
Delay Storage Automatic Calculator (EDSAC).
• a type of very low-level programming language.
• Just above the explicit machine code used to operate
a computer.
Electronic Delay Storage Automatic Calculator (EDSAC)()
Topics of this Lecture on History of Programming
Languages, Cont:
• Early High Level Programming Languages:
• McMauchly’s Shortcode: 1st high level programming language.
• Alick Glennie’s Autocode: The 1st programming language with a compiler
• John Backus’s FORTRAN: The 1st programming language with an optimized
compiler
• Dijkstra‘s ALGOL (Algorithmic Language): for structured programming
• McCarthy‘s LISP: based on the Lambda Calculus
• IBM’s Report Program Generator
• Hopper’s FLOW-MATIC and COBOL
History of Computing
Programming Languages
History of Computing
Programming Languages
John McMauchly ‘s Shortcode (short-order) [1949]: 1st high level programming
language.
• Was executed by an interpreter, not as compiled code.
• Implemented by William Schmitt:
• for the BINAC computer in 1949.
• for the UNIVAC computer in 1950.
History of Computing
Programming Languages
Alick Glennie’s Autocode [1952]: The 1st programming
language with a compiler: which translated it into
machine code.
• First developed for the Mark 1 computer at the
University of Manchester
• Also used on other early computing machines,
including the Ferranti Pegasus and Sirius.
Manchester Mark 1 computer
History of Computing
Programming Languages
John Backus’s FORTRAN [1957]: The 1st programming
language with an optimized compiler: which translated it
into optimized machine code.
• Initially proposed by John Backus at IBM in 1953.
John Backus
• Named FORTRAN = “FORmula TRANslation”.
• Its optimized code ran faster than most hand-written
assembly code programs.
• Still used extensively for scientific, mathematical, and
statistical computations.
• Is the oldest programming language still in use today.
First Fortran Language Manual [1957]
History of Computing
Programming Languages
Dijkstra‘s ALGOL (Algorithmic Language)[1958]:
• Created by a committee including both US and
European computer scientists.
• Provided support for Structured programming: a
programming paradigm that makes use of the
structured control flow constructs:
• selection (if/then/else) and
• repetition (while and for),
• block structures, and
• subroutines.
• These structured programming constructs improved:
• clarity,
• quality,
• Reduced development time
of computer program written in ALGOL.
• Led to development of many important programming
languages including Pascal, C, C++, and Java.
Edsger W. Dijkstra
Edgser Dijkstra [1968]: “Go To Statement Considered
Harmful”.
• Goto is a programming construct used in FORTRAN
that allows execution to jump to another part of the
code.
• Dijkstra argues that the excessive use of goto can
result in confusing code.
• Dijkstra suggests alternatives:
• structured programming, or
• procedural programming
History of Computing
Programming Languages
Functional Programming: a programming paradigm where:
•
•
•
•
programs are constructed by applying and composing functions.
Function definitions are trees of expressions that map values to other
values:
• do not update the running state of the program.
Functions are treated as first-class citizens:
• can be bound to names (including local identifiers),
• can be passed as arguments, and
• returned from other functions.
Allows programs to be written in a declarative and composable style,
where small functions are combined in a modular manner.
Purely Functional Programming:
•
•
•
A subset of functional programming treating all functions as pure
functions (deterministic mathematical functions).
When a pure function is called with some given arguments, it always
returns the same result - cannot be affected by side effects.
By outlawing side effects, programs can have
• fewer bugs,
• be easier to debug and test,
• be more suited to formal verification.
Example of
Purely
Functional
Programming:
History of Computing
Programming Languages
John McCarthy‘s LISP (List Processor) [1958]:
• The programming language used by early Artificial
Intelligence (AI) researchers at Massachusetts
Institute of Technology (MIT).
• LISP programming language is very similar to
the λ-calculus.
LISP logo
John McCarthy
• Allows recursion.
• Uses functional programming.
(- n 1)
LISP expression
for n-1.
(* n 5)
LISP expression
for n * 5.
(defun f (n) (* n 5 ) )
LISP notation for defining a
function f(n) that multiplies n by 5.
(defun factorial (n)
(if (= n 0) 1
(* n (factorial (- n 1)))))
Recursive LISP program for
factorial(n), which is 1 if n = 0, and
otherwise is n*factorial(n-1)
History of Computing
Programming Languages
IBM’s Report Program Generator (RPG) [1959]:
• Original purpose of the programming language: generation of business
reports from data files.
• Evolved into a fully procedural programming language.
• Facilitated transition of IBM customers from IBM’s tabulating machines
to IBM’s mainframe computers.
• In these prior tabulating machines,
• programs were executed in cycles by impulses emitted in the
tabulating machine’s cycle.
• There was a column-oriented syntax
• RPG’s programs were similar, maintaining:
• program cycles, and
• column-oriented syntax
History of Computing
Programming Languages
Admiral Grace Hopper’s FLOW-MATIC [1952-1959]:
• Developed at Remington Rand for the UNIVAC I.
• Designed for business processing: report generation
and accounting.
• Initially called B-0 (Business Language version 0).
• Used English-like statements for programming
operations.
• Data structures were defined separately.
• Had considerable impact of subsequent development
of COBOL.
Admiral Grace Hopper
Grace Hopper’s COBOL (Common Business Oriented
Language) [1959]:
History of Computing
Programming Languages
• Initial version very similar to Grace Hopper’s FLOWMATIC.
• Used English-like statements for programming
operations.
• Data structures were defined separately
• Developed for business and government report writing
and accounting.
•
Cover of the COBOL 60 report to
CODASYL [1960]
The statement A = B + C in FORTRAN written in COBOL
is: ADD B TO C GIVING A.
• Not well designed for scientific computing.
• Also, lacked recursion.
• Its widespread use in the 1950s and 1960s retarded the
development of modern software programming
techniques.
• In the US, 43% of banking systems still use COBOL.
Example COBOL program [1960]
Grace Hopper
History of Computing
Programming Languages
Topics of this Lecture on History of Programming
Languages: , Cont:
• Later High Level Programming Languages:
• Kemeny and Kurtz’s BASIC
• Wirth’s PASCAL
• Kay’s Smalltalk:1st object-oriented programming language
• Ritchie’s C
• SEQUEL (SQL): language for relational databases
• Ada
Kemeny and Kurtz’s BASIC (Beginner’s All-Purpose
Symbolic Instruction Code) [1964]:
History of Computing
Programming Languages
• Developed by John G. Kemeny and Thomas Kurtz for
students at Dartmouth College just beginning
programming.
• Similar to FORTRAN, but with a simplified syntax.
• Was installed on most early personal computers.
John Kemeny (left) and Thomas Kurtz (center)
(Dartmouth University)
• Microsoft’s first software products were BASIC
interpreters for personal computers such as Altair.
Paper-tape for Paul Allen, Bill Gates
and Monte Davidoff's Altair BASIC
(Wikipedia)
Paul Allen (left) and Bill Gates in 1981,
surrounded by some of the computers that
ran their version of BASIC (Wikipedia)
Basic Programming Animation (Dartmouth)
History of Computing
Programming Languages
Niklaus Wirth’s PASCAL [1970]:
• Named in honor of Blaise Pascal, a French
mathematician that developed one of the first
calculators.
Niklaus Wirth
PASCAL logo
• Developed for users just beginning programming.
•
Used extensively in European Universities.
Was in early Apple computers.
• Easy to use:
• Simple syntax: easy to parse and compile.
• A strongly typed language: so common errors
could be detected at compile time before the
program ran.
Example PASCAL program (Borland Pascal 7.0)
History of Computing
Programming Languages
Alan Kay’s Smalltalk [1972]:
1st object-oriented (class-based) programming language.
Alan Kay
• Allowed definition of abstract classes used to create
more specific, concrete objects.
• Developed at Xerox Palo Alto Research Center.
• Run interpretatively.
• Introduced programming language techniques used in
Python and Java.
Alan Kay's Smalltalk used
as a user interface for
ALTO computer [1976]:
History of Computing
Programming Languages
Dennis Ritchie’s C [1972]:
• Developed at Bell Telephone Laboratories for their
Unix operating system.
• it was based on an earlier language called B, so they
call it C.
C logo
The C Programming Language,
First Edition Cover
• Many leading modern programming languages are
derived from C: C#, Java, JavaScript, Perl, PHP, and
Python.
Structure of a C program
Dennis Ritchie
SEQUEL (SQL) [1972]: A domain-specific
language: for relational databases.
History of Computing
Programming Languages
• Relational Databases store data in tables
consisting of columns and rows similar to a
spreadsheet.
SQL logo
• SQL is a programming language for relational
databases: Used for
• Viewing and changing data that is stored
in a relational databases.
• Managing data or streams in a relational
database management system.
Relational Databases store data in tables consisting of
columns and rows similar to a spreadsheet.
• Handling structured data: data
incorporating relations among data base
entities and variables.
• Developed by Raymond Boyce and Donald
Chamberlain at IBM.
• Highly interoperable between distinct database
systems and computers.
A chart showing several of the SQL language
elements that compose a single statement
Ada [1980-1981]:
• Named for Ada Lovelace, who worked on Babbage’s Analytical Machine.
History of Computing
Programming Languages
• Ada is a high-level programming language that is
• Structured
•
has ALGOL‘s constructs for selection (if/then/else), repetition (while and for), block structures, and
subroutines
• Statically typed
•
as in Pascal, it performs type checking at compile time
• Imperative
•
uses statements that change a program's state
• wide-spectrum
•
•
a programming language designed to be simultaneously a low-level and a high-level language—
possibly a non-executable specification language.
support a programming methodology based on program refinement.
• object-oriented
•
as in C++, allows definition of abstract classes used to create more specific, concrete objects.
• Intended for use by the United States Department of Defense, and used (by mandate
specified by contracts) in various air-traffic management systems and space projects.
• Designed by a committee led by Jean Ichbiah of Honeywell Bull.
• Generally considered far too bulky for practical use:
• example of why it is best not to design a programming language using a large
committee.
History of Computing
Programming Languages
Topics of this Lecture on History of Programming
Languages: , Cont:
• Modern High Level Programming Languages:
• Stroustrup’s C++ : structured C
• Wall‘s Perl: scripting language
• Haskell: Allows lazy evaluation
• Rossum‘s Python
• Microsoft’s Visual Basic
• James Gosling’s Java
• PHP and Javascript: Programming Languages for Web Development
Bjarne Stroustrup’s C++ [1983]:
History of Computing
Programming Languages
• An extension of the C language developed at the Bell Labs.
• Its enhancements include
• Classes
• A user-defined data type which works as an object constructor
• a "blueprint" for creating objects.
• Allows definition of abstract classes
• used to create more specific, concrete objects.
C++ logo
Bjarne Stroustrup
• Virtual Functions
• Ensures that the correct function is called for an object, regardless of the
type of reference (or pointer) used for function
• Templates
• Allows for passing data type as a parameter to avoid explicitly writing the
type.
•
Extensively used for high-performance software.
History of Computing
Programming Languages
Larry Wall‘s Perl [1987]:
• Is interpreted.
• Originally designed as a scripting language to make report processing easier.
• While it is in its current version a general-purpose, high-level programming language,
it is generally still used as a scripting language.
Common Gateway Interface (CGI): an interface specification that enables web servers to
execute an external program, typically to process user requests
• Perl is extensively used for CGI scripting, and many other applications.
Example Perl Code
Larry Arnold Wall
Haskell [1990]:
History of Computing
Programming Languages
• Named in honor of Haskell Brooks Curry, a logician
and mathematician who invented Currying:
• a programming technique that transforms a
function of multiple arguments to one
where some of the arguments are fixed.
• Currying is usually done by evaluating some
of the arguments.
Haskell logo
Haskell Brooks Curry
Recall:
Purely Functional Programming:
• A subset of functional
• Uses: Lazy evaluation: only evaluate when
programming treating all
functions as pure functions
needed.
(deterministic mathematical
functions).
• It is a purely functional programming language.
• When a pure function is called
with some given arguments, it
• Statically typed
always returns the same result cannot be affected by side effects.
• Primarily used for complicated mathematical
• By outlawing side effects,
calculations.
programs can have
• fewer bugs,
• be easier to debug and test,
primes = filterPrime [2..] where filterPrime (p:xs) = p : filterPrime [x | x <- xs, x `mod` p /= 0]
• be more suited to formal
verification.
Haskell Program for Prime Numbers
History of Computing
Programming Languages
Guido Van Rossum‘s Python [1991]:
• A general-purpose, high-level programming
language that is simple and easy to program
with.
Python logo
Guido Van Rossum
• Dynamically interpreted, rather than compiled.
• Used by many search engine and web
companies, including Google, Yahoo, and
Spotify.
• Named after the British comedy ‘Monty
Python’.
\
Python Program for Fibonacci Series
History of Computing
Programming Languages
Microsoft’s Visual Basic [1991]:
• Uses a graphical user interface (GUI) to allow a programmer to
utilize a drag-and-drop style of choosing and changing pre-selected
segments of code.
• Used in Microsoft Office applications including Word, Excel, and
Access.
Using Visual Basic for Gif Animation
Microsoft’s Visual Basic logo
History of Computing
Programming Languages
James Gosling’s Java [1995]:
• Originally created for an interactive TV project.
• A general-purpose, high-level language.
• Object-oriented (Class-based):
• Allowes definition of abstract classes used to create more
specific, concrete objects.
• Java is compiled to bytecode, and then executed by the Java Virtual
Machine.
• The Java Virtual Machine allows Java to have cross-platform
functionality
• One of the world’s most popular programming languages.
Java logo
James Arthur Gosling [2008]
//slow fib
//pre: n >= 1
public static int fib(int n)
{ int result = 0;
if(n == 1 || n == 2) result = 1;
else result = fib(n-1) + fib(n-2);
return result; }
Java Program for Fibonacci Series
History of Computing
Programming Languages
Programming Languages for Web Development:
Rasmus Lerdorf’s PHP [1995]:
• Originally named for “Personal Home Page”, later named for
“Hypertext Processor”.
• Used for include building and maintaining dynamic web pages, and
also server-side development.
PHP logo
• Extensively used e.g., Facebook, Wikipedia, and WordPress.
Brendan Eich’s JavaScript [1995]:
• Used for dynamic web development, PDF documents, web
browsers, and desktop widgets.
• Dynamically interpreted, rather than compiled.
• Used by most websites e.g., Gmail, Adobe Photoshop, and Mozilla
Firefox.
JavaScript logo
History of Computing
Programming Languages
Microsoft’s C# [2000]:
• Combines the computing power of C++ with the simplicity and ease
of use of Visual Basic.
• Has many similarities to Java.
• Used in most Microsoft desktop applications.
C# logo
History of Computing
Programming Languages
Martin Odersky’s Scala [2003]:
• Combines object-oriented programming with functional
programming.
• Is compatible to Java.
• Often used in Android development.
• Used in Linkedin, Twitter, Foursquare, and Netflix.
Scala logo
History of Computing
Programming Languages
Groovy [2003]:
• Developed by James Strachan and Bob McWhirter.
• Derived from Java, but is easier to learn and more succinct.
• Used by Starbucks, Transferwise, and Craftbase.
Groovy logo
History of Computing
Programming Languages
Google’s Go [2009]:
• Has a simple and modern structure.
• Useful in development of very large software systems.
• Used by many large tech companies for large-scale software
development, including Google, Uber, Twitch, and Dropbox.
Go logo
History of Computing
Programming Languages
Apple‘s Swift [2014]:
• A simplification of various C languages, including C, C++, and
Objective-C.
• Is versatile, and can be used for desktop, mobile, and cloud
applications.
Swift logo
Download