[go: up one dir, main page]

0% found this document useful (0 votes)
9 views66 pages

A History of Programming Languages

Uploaded by

samsun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views66 pages

A History of Programming Languages

Uploaded by

samsun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 66

Principles of Programming

Languages
A History of Programming
Languages
What is a Programming Language?

• A programming language describes


computation to be performed by computers.
• Programming languages have a history that
parallels the development of computers and
a history that is independent of computer
development.
– Konrad’s Zuse’s Plankalkül (1942-1945)
– Alonzo Church’s lambda calculus
Programming Languages Describe
Algorithms
• The need to describe calculations is ancient:
A cistern.
The length equals the height.
A certain volume of dirt has been excavated.
The cross-sectional area plus this volume comes to 120.
The length is 5. What is the width?
Add 1 to 5, giving 6.
Divide 6 into 120, obtaining 20.
Divide 5 into 20, obtaining the width, 4.
This is the procedure.
• Why does this work?
The Math Behind the Description
Volume + Cross-section
=LWH+LW
= L2 W + L W
= L W ( L + 1)
= 5 W ( 5 + 1)
= 5 W ( 6) = 120
Early History – The First
Programmer
• The First Stored-Program Computer to be
designed was Charles Babbage’s Analytical
Engine (the store-program computer to be
completed was the UNIVAC in 1951).
• The first computer program to be written
was by Babbage’s collaborator Ada
Lovelace in the 1940s.
Zuse’s Plankalkül
• Designed in 1945(First High level
language), but not published until 1972
Never implemented
• Advanced data structures
• Floating point numbers, arrays, records
Plankalkül Syntax
• An assignment statement to assign the
expression A[4] + 1 to A[5]
| A + 1 => A
V | 4 5 (operand subscripts)
S | 1.n 1.n (data types – n-bit integers)
The 1950s - The First
Programming Languages
Originally, all programming was done using the
machine’s own language, i.e., the binary code
native to the CPU.
• This led to many mistakes which took a great deal
of time to locate and correct.
• Eventually, programmers started using symbolic
names for opcodes and operands to make it easier
to program and then they would hand-translate.
The First Programming Languages
(continued)
• Eventually, assemblers were written to automate
the translations of these symbolic programs into
machine language.
• The success of assembly languages encouraged
computer scientists to develop higher-level
languages which could further simplify the
programming process.
Numerically-Based Languages

• Many of the earliest computers were used almost


exclusively for scientific calculations and
consequently many of the earliest attempts at
languages were for scientific purposes.
• Mauchly’s Short Code, Grace Murray Hopper’s
A-0 and John Backus’s Speedcoding were
designed to compile simple arithmetic
expressions.
FORTRAN
• John Backus’s team at IBM developed FORTRAN (for
FORmula TRANslator) in 1955-1957.
• While FORTRAN was designed for numerical
computation, it included control structures, conditions and
input/output.
• the first Fortran program ran on the IBM 704 vacuum tube
computer
• FORTRAN’s popularity led to FORTRAN II in 1958,
FORTRAN IV in 1962, leading to its standardization in
1966, with revised standards coming out in 1977 and 1990.
A Program In FORTRAN
A Program in FORTRAN IV
A Program in FORTRAN 77
ALGOL

• FORTRAN’s success led to fear that IBM would


dominate the computer industry.
• GAMM and ACM organized committees to
design a universal language which merged and
developed ALGOL 58 (which led to ALGOL 60
and ALGOL 62).
• Many later languages are derivatives of
ALGOL, including PL/I, C, Pascal and Ada.
Design of ALGOL
FORTRAN had been designed to run efficiently on
an IBM 701; ALGOL had been designed to meet
four different goals:
– ALGOL notation should be close to standard
mathematics
– ALGOL should be useful in describing
algorithms
– Programs in ALGOL should be compilable
into machine language.
– ALGOL should not be tied to a single
computer architecture.
Influence of ALGOL

• While ALGOL saw limited use in the US


(and only some in Europe), it made many
contributions to other languages:
– Backus and Naur developed the notation still
used to express language syntax (BNF), based
on Chomsky’s context-free language concept.
– Burrough’s use of Lukasiwicz’s notation for
writing expressions (prefix notation) led to the
use of stack-based architectures.
ALGOL-60: Example
procedure Absmax(a) Size:(n, m) Result:(y)
Subscripts:(i, k);
value n, m; array a; integer n, m, i, k;
real y;
comment The absolute greatest element of the
matrix a, of size n by m is transferred
to y, and the subscripts of this element
to i and k;

begin
integer p, q;
y := 0; i := 1; k := 1;
for p:=1 step 1 until n do
for q:=1 step 1 until m do
if abs(a[p, q]) > y then
begin y := abs(a[p, q]);
i := p; k := q
end
end Absmax
COBOL
• Commercial data processing was one of the
earliest commercial applications of computers.
• The U.S. Defense Dept. sponsored the effort to
develop COBOL (Common Business-Oriented
Language), which was standardized in 1960,
revised in 1961 & 1962, re-standarized in 1968,
1974, and 1984.
• As of 2000, more lines of source code have been
written in COBOL than any other programming
language.
Influence of COBOL

• Its popularity is due to:


– self-documenting style (very English-like)
– its record structure makes it easy to organize
data
– its PICTURE clauses made it easy to format
input and output in different ways.
• COBOL has been a major influence on most
database manipulation languages.
A Program in COBOL

* Example 3 - PRG3 Write a program to accept the


2 nos. from user and display the same.
IDENTIFICATION DIVISION.
PROGRAM-ID. PRG3.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 NUM1 PIC 9(2).
77 NUM2 PIC 9(2).
PROCEDURE DIVISION.
ACCEPT NUM1.
ACCEPT NUM2.
DISPLAY NUM1.
DISPLAY NUM2.
STOP RUN.
*
PRG4 Write a program to accept the student record (ROLL NO, NAME and 3 subject marks)
individually and display the same. Also accept as a group and display individually.

IDENTIFICATION DIVISION.
PROGRAM-ID. PRG4.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 G1.
02 ROLLNO PIC 9(3).
02 FILLER PIC X.
02 STUNAME PIC A(8).
02 FILLER PIC X.
02 MARK1 PIC 9(3).
02 FILLER PIC X.
02 MARK2 PIC 9(3).
02 FILLER PIC X.
02 MARK3 PIC 9(3).
PROCEDURE DIVISION.
ACCEPT G1.
DISPLAY G1
STOP RUN.
LISP

• John McCarthy of MIT developed LISP (LISt Processor)


in the late 1950s to handle list structures in a functional
format.
• Only two data types: atoms and lists
• The language pioneered garbage collection and recursive
procedures; its dialects include Scheme.
• Because it is not an imperative language, it does not run as
efficiently on standard computer architectures. However,
there are computer architectures designed for it on which
they run more efficiently.
• Many major AI programs have been written in LISP.
LISP Lists
(A B C D)

(A (B C) D (E(F G)))
APL
• APL (A Programming Language) was
designed by Ken Iverson to handle
scientific computations, especially those
involves vectors and matrices.
• It has a large set of operators and requires a
special character set and is extremely
difficult to read.
APL Keyboard Layout
Sample APL Program
(~R∊R∘.×R)/R←1↓⍳R
Executed from right to left, this means:
•ιR creates a vector containing integers from 1 to R
– (if R = 6 at the beginning of the program, ιR is 1 2 3 4 5 6)
•Drop first element of this vector (↓ function), i.e. 1. So 1↓ιR
is 2 3 4 5 6
•Set R to the new vector (←, assignment primitive), i.e. 2 3 4
56
The 1960s – An Explosion of
Programming Languages
• The 1960s saw the development of
hundreds of programming languages, many
of them special-purpose languages (for
tasks such as graphics and report
generation)
• Other efforts went into developing a
“universal programming language” that
would be suitable for all programming
tasks.
PL/I
• IBM developed NPL for its 360 computers
(renaming MPPL and later PL/I).
• PL/I used an ALGOL-style syntax and
combined featured of both FORTRAN and
COBOL.
• PL/I was a complex language that saw some
commercial success and its subset PL/C saw
some success as a teaching language in the
1970s.
A Program in PL/I
MAINFACT:PROC OPTIONS(MAIN) REORDER;
FACT:PROC(NUM) RETURNS(FIXED BIN(15,0));
DCL FCT FIXED BIN(15,0) INIT(1);
DCL NUM FIXED BIN(15,0);
DO WHILE(NUM>0);
FCT=FCT*NUM;
NUM=NUM-1;
END;
RETURN (FCT);
END FACT;

FACT1:PROC(NUM1) RECURSIVE;
DCL NUM1 FIXED BIN(15,0);
IF NUM1 <=1 THEN
RETURN(1);
ELSE
RETURN(NUM1*FACT1(NUM1-1));
END FACT1;

DCL ANS FIXED BIN(15,0);


ANS=FACT(6);
PUT SKIP LIST(ANS);
ANS=FACT1(5);
PUT SKIP LIST(ANS);
END MAINFACT;
Successes and Failures of PL/I
• The PL/I language was so complex that its
compiler was huge and slow and the
executable code that it created was also
huge and slow.
• Because of its complexity, PL/I was a
difficult language to master.
• PL/I included some concepts that were
ahead of its time, such as exception
handling.
SNOBOL
• SNOBOL (String Oriented Symbolic
Language) was develop by R. Griswold at
AT&T Bell Labs.
• SNOBOL was the first string-processing
language and SNOBOL4 included powerful
pattern-matching capabilities.
Simula

• Simula67 was created by Kristen Nygaard


and Ole-Johan Dahl at the Norwegian
Computing Center in 1965-1967.
• It was designed for computer simulation
and introduced to concept of the class, the
basis behind object-orientation.
BASIC
• John Kemeny and Thomas Kurtz originally
developed BASIC as a language to teach
beginning students how to program in a
more user-friendly environment.
• BASIC’s original design was most heavily
influenced by FORTRAN but was later
expanded to include many other features.
BASIC Sample Progam
10 INPUT "What is your name: ", U$
20 PRINT "Hello "; U$
30 INPUT "How many stars do you want: ", N
40 S$ = ""
50 FOR I = 1 TO N
60 S$ = S$ + "*"
70 NEXT I
80 PRINT S$
90 INPUT "Do you want more stars? ", A$
100 IF LEN(A$) = 0 THEN GOTO 90
110 A$ = LEFT$(A$, 1)
120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30
130 PRINT "Goodbye "; U$
140 END
The 1970s – Simplicity, Abstraction,
Study
• Most of the new programming languages are
characterized by a move toward simplicity and
consistency.
• Developments included Pascal and C. Both
languages became extremely popular although
adding few new concepts.
• The desire to add mechanisms for data abstraction,
concurrency and verification led to the
development of languages such as CLU, Euclid
and Mesa.
Pascal
• Niklaus Wirth and C. A. R. Hoare developed
ALGOL-W and later Pascal, which had a
simplified structure.
• Pascal’s structure made it a great teaching
langauge and a popular language for describing
algorithms.
• There were several important features that it
lacked including string processing, separate
compilation, practical I/O facilities.
C

• Dennis Ritchie of AT&T Bell Labs created C


based on earlier languages BCPL and B to use it in
writing a revised version of UNIX.
• C is based heavily around the idea of an
expression and allows easy conversion between its
data types.
• It is regarded as a “middle-level” programming
language.
The 1980s – New Directions and the
Rise of Object-Orientation

• The 1980s began with attempts to introduce ADT


mechanisms (Ada and Modula-2).
• The most significant advance in programming
languages during the 1980s was the rise of object
orientation (Smalltalk and C++).
• Lastly, there was renewed interest in functional
and procedural languages (Scheme, ML, FP and
Prolog).
Ada
• Ada was designed in 1980 and standardized
in 1983 by J. Ichbiah.
• It includes mechanisms of ADT (the
package) and concurrency (the task).
• Because of the language’s complexity, Ada
has been frequently described as “the PL/I
of the ’80s.”
A Program in Ada
with Ada.Text_IO;
use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, World!");
end Hello;
A Program in Ada
(helloworld.adb)
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
declare
name : String := Ada.Text_IO.Get_Line;
begin
Ada.Text_IO.Put ("Hello ");
Ada.Text_IO.Put_Line (name);
end;
end Hello;
Modula-2
• Modula-2 was more modest in design,
expanding the features of Pascal to include
modules (similar to Ada’s packages) and a
limited form of concurrency called
coroutines.
• Because of its restrictive typing and the
popularity of Turbo Pascal and C, it never
became as popular as expected.
Smalltalk

• Smalltalk was developed at Xerox PARC by Alan


Kay et. al. and is considered the purest example of
an object-oriented language.
• Its limited success is dues largely to its being tied
to a computer and operating system that saw
limited success as well as an unusual notation and
inefficient implementation.
C++
• C++ was developed by Bjarne Stroustrup of
AT&T Bell Labs beginning in 1980 as “C
with Classes.” It was finally standardized
in 1998.
• It is a complex language with no compiler
yet conforming entirely to the 1998
standard.
Functional Languages
• Scheme was actually developed in the late 1970s
but gained popularity in the 1980s due to Abelson
and Sussman’s book “Structure and
Implementation of Computer Programs.”
• ML (for Metalanguage) is a functional language
with a Pascal-like syntax.
• John Backus developed FP (Functional
Programming) that was heavily influenced by
APL.
Prolog
• Prolog is a declarative language developed
by Colmerauer, Roussel and Kowalski in
1972 based on predicate calculus and
mathematical logic.
• Prolog became popular in the 1980s
because it was useful in expert systems
development and the Japanese Fifth-
Generation Project.
Java

• Java was developed by James Gosling of Sun


Microsystems for embedded systems.
• Its popularity is due to its relative simplicity,
portability, large library of windowing,
networking and concurrency utilities and (of
course) the World Wide Web.
• Java is a proprietary language with Sun
maintaining tight control over it.
Features of Java
• Eliminated many unsafe features of C++
• Supports concurrency
• Libraries for applets, GUIs, database access
• Portable: Java Virtual Machine concept, JIT
compilers
• Widely used for Web programming
• Use increased faster than any previous language
• Most recent version, 7, released in 2011
Libraries
• In the past, libraries were frequently an
afterthought in the design of programming
languages.
• Increasingly, libraries are important to the
success of programming languages, e.g.,
– Java API
– C++ STL
Scripting Languages

• Scripting languages became increasingly popular


in the 1990s.
• A scripting language is a special-purpose language
which ties together utilities, library components
and operating systems commands into complete
programs.
• Examples include AWK, Perl, TCL, Javascript,
Rexx, and Python.
Scripting Languages for the Web
• Scripting languages that have become
popular (at least in part) because of the Web
include:
– Perl
– JavaScript
– PHP
– Python
– Ruby
– Lua
Perl
• Designed by Larry Wall—first released in 1987
• Variables are statically typed but implicitly
declared
• Three distinctive namespaces, denoted by the first
character of a variable’s name
• Powerful, but somewhat dangerous
• Gained widespread use for CGI programming on
the Web
• Also used for a replacement for UNIX system
administration language
1-56
JavaScript
• Began at Netscape, but later became a joint venture of
Netscape and Sun Microsystems
• A client-side HTML-embedded scripting language, often
used to create dynamic HTML documents
• Purely interpreted
• Related to Java only through similar syntax
PHP
• PHP: Hypertext Preprocessor, designed by
Rasmus Lerdorf
• A server-side HTML-embedded scripting
language, often used for form processing
and database access through the Web
• Purely interpreted

1-58
Python
• An OO interpreted scripting language
• Type checked but dynamically typed
• Used for CGI programming and form
processing
• Dynamically typed, but type checked
• Supports lists, tuples, and hashes
Ruby
• Designed in Japan by Yukihiro Matsumoto (a.k.a,
“Matz”)
• Began as a replacement for Perl and Python
• A pure object-oriented scripting language
- All data are objects
• Most operators are implemented as methods,
which can be redefined by user code
• Purely interpreted
Lua
• An OO interpreted scripting language
• Type checked but dynamically typed
• Used for CGI programming and form processing
• Dynamically typed, but type checked
• Supports lists, tuples, and hashes, all with its
single data structure, the table
• Easily extendable
The Flagship .NET Language:
C#
• Part of the .NET development platform
(2000)
• Based on C++ , Java, and Delphi
• Includes pointers, delegates, properties,
enumeration types, a limited kind of
dynamic typing, and anonymous types
• Is evolving rapidly
Markup/Programming Hybrid
Languages
• These include
– XSLT (eXtensible Stylesheet Language
Transformation)
– JSP (Java Servlet Pages)
XSLT
• eXtensible Markup Language (XML): a
metamarkup language
• eXtensible Stylesheet Language
Transformation (XSTL) transforms XML
documents for display
• Programming constructs (e.g., looping)
JSP
• Java Server Pages: a collection of
technologies to support dynamic Web
documents
• JSTL, a JSP library, includes programming
constructs in the form of HTML elements
The Future

• The past demonstrated that it is extremely


difficult to predict the direction of future
programming language development.

You might also like