Evolution of The Major Programming Languages
Evolution of The Major Programming Languages
Evolution of the
Major
Programming
Languages
History
• Early History : The first programmers
• The 1940s: Von Neumann and Zuse
• The 1950s: The First Programming Language
• The 1960s: An Explosion in Programming
languages
• The 1970s: Simplicity, Abstraction, Study
• The 1980s: Consolidation and New Directions
• The 1990s: Internet and the Web
• The 2000s: tbd
2
Early History: The First
Programmer
• Jacquard loom of early 1800s
• Charles Babbage’s analytical
engine (1830s & 40s)
Programs were cards with data and operations
• Ada Lovelace – first programmer
“The engine can arrange and combine
its numerical quantities exactly as if
they were letters or any other general
symbols; And in fact might bring out
its results in algebraic notation, were
provision made.”
Source : UMBC CMSC 331
3
Jacquard loom of early 1800s
4
Charles Babbage’s analytical engine (1830s &
40s)
5
Charles Babbage’s analytical engine (1830s &
40s)
6
Ada Lovelace – first programmer
7
The 1940s: Von Neumann and
John Von
Zuse
Neumann led
a team that built
computers with
stored programs
and a central
processor
ENIAC,
however, was
also
programmed
wit patch cords.
Von Neuman with ENIAC
8
ENIA
C
9
Old
Computers
UNIVAC 1108, circa 1970
12
Plankalkul
notation
A(7) := 5 * B(6)
| 5 * B => A
V | 6 7 (subscripts)
S | 1.n 1.n (data types)
13
Machine Code
(1940’s)
• Initial computers were programmed in raw
machine code.
• These were entirely numeric.
• What was wrong with using machine code?
Everything!
• Poor readability
• Poor modifiability
• Expression coding was tedious
• Inherit deficiencies of hardware, e.g., no
indexing or floating point numbers
14
Pseudocodes
(1949)
• Short Code or SHORTCODE - John Mauchly, 1949.
• Pseudocode interpreter for math problems, on
Eckert and Mauchly’s BINAC and later on
UNIVAC I and II.
• Possibly the first attempt at a higher level language.
• Expressions were coded, left to right, e.g.:
X0 = sqrt(abs(Y0))
00 X0 03 20 06 Y0
• Some operations:
01 – 06 abs 1n (n+2)nd power
02 ) 07 + 2n (n+2)nd root
03 = 08 pause 4n if <= n
04 / 09 ( 58 print & tab
15
More Pseudocodes
Speedcoding; 1953-4
• A pseudocode interpreter for math on IBM 701, IBM 650.
• Developed by John Backus
• Pseudo ops for arithmetic and math functions
• Conditional and unconditional branching
• Autoincrement registers for array access
• Slow but still dominated by slowness of s/w math
• Interpreter left only 700 words left for user program
Laning and Zierler System - 1953
• Implemented on the MIT Whirlwind computer
• First "algebraic" compiler system
• Subscripted variables, function calls, expression translation
• Never ported to any other machine
16
The 1950s: The First
Programming Language
• Pseudocodes: interpreters for assembly language
like
• Fortran: the first higher level programming
language
• COBOL: he first business oriented language
• Algol: one of the most influential programming
languages ever designed
• LISP: the first language to depart from the
procedural paradigm
• APL:
17
Fortran (1954-57)
• FORmula TRANslator
• Developed at IBM under the
guidance of John Backus
primarily for scientific programming
• Dramatically changed forever the
way computers used
• Has continued to evolve, adding new features & concepts.
– FORTRAN II, FORTRAN IV, FORTRAN 66, FORTRAN 77, FORTRAN 90
• Always among the most efficient compilers, producing fast
code
• Still popular, e.g. for supercomputers
18
Punch
Card
19
Fortran (1954-
57)
20
Fortran 0 and
1
FORTRAN 0 – 1954 (not implemented)
FORTRAN I - 1957
Designed for the new IBM 704, which had index registers and
floating point hardware
Environment of development:
Computers were small and unreliable
Applications were scientific
No programming methodology or tools
Machine efficiency was most important
Impact of environment on design
• No need for dynamic storage
• Need good array handling and counting loops
• No string handling, decimal arithmetic, or powerful
input/output (commercial stuff)
21
Fortran I
Features
• Names could have up to six characters
• Post-test counting loop (DO)
• Formatted I/O
• User-defined subprograms
• Three-way selection statement (arithmetic IF)
IF (ICOUNT-1) 100, 200, 300
• No data typing statements
variables beginning with i, j, k, l, m or n were
integers, all else floating point
• No separate compilation
• Programs larger than 400 lines rarely compiled
correctly, mainly due to IBM 704’s poor reliability
• Code was very fast
• Quickly became widely used
22
CAREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION
CINPUT - CARD READER UNIT 5, INTEGER INPUT
COUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT
CINPUT ERROR DISPAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING
READ INPUT TAPE 5, 501, IA, IB, IC
501 FORMAT (3I5)
IF (IA) 777, 777, 701
701 IF (IB) 777, 777, 702
702 IF (IC) 777, 777, 703
703 IF (IA+IB-IC) 777,777,704
704 IF (IA+IC-IB) 777,777,705
705 IF (IB+IC-IA) 777,777,799
777 STOP 1
799 S = FLOATF (IA + IB + IC) / 2.0
AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) *
+ (S - FLOATF(IC)))
WRITE OUTPUT TAPE 6, 601, IA, IB, IC, AREA
601 FORMAT (4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2,
+ 13H SQUARE UNITS)
STOP
END
23
Fortran II, IV and
FORTRAN II -77
1958
• Independent compilation
• Fix the bugs
FORTRAN IV - 1960-62
• Explicit type declarations
• Logical selection (IF) statement
• Subprogram names could be parameters
• ANSI standard in 1966
FORTRAN 77 - 1978
• Character string handling
• Logical loop control (WHILE) statement
• IF-THEN-ELSE statement
24
Fortran 77 Bubble
Sort
SUBROUTINE SSORT (X, IY, N, KFLAG)
IMPLICIT NONE
c
c Example of a Bubble Sort
JMAX=N-1
DO 200 I=1,N-1
TEMP=1.E38
DO 100 J=1,JMAX
IF(X(J).GT.X(J+1)) GO TO 100
TEMP=X(J)
X(J)=X(J+1)
X(J+1)=TEMP
ITEMP=IY(J)
IY(J)=IY(J+1)
IY(J+1)=ITEMP
100 CONTINUE
IF(TEMP.EQ.1.E38) GO TO 300
JMAX=JMAX-1
200 CONTINUE
300 RETURN
END
25
Fortran 90
(1990)
Added many features of more modern
programming languages, including
• Pointers
• Recursion
• CASE statement
• Parameter type checking
• A collection of array operations, DOTPRODUCT,
MATMUL, TRANSPOSE, etc
• dynamic allocations and deallocation of arrays
• a form of records (called derived types)
• Module facility (similar Ada’s package)
26
FORTRAN 90
! EXAMPLE 1
!
Examples
real,dimension(1000)::a=(/(i,i=1,1000)/)
real,dimension(1000)::b,c
b=a
c=a+b
print *, c
end
! EXAMPLE 2
!
real,dimension(10,10)::a=(/((i+j,i=1,10),j=1,10)/)
real,dimension(10,10)::b,c
b=a
c=a+b
print *, c
end
27
COBOL
• COmmon Business Oriented Language
• Principal mentor: (Rear Admiral Dr.)
Grace Murray Hopper (1906-1992)
• Based on FLOW-MATIC which had such
features as:
• Names up to 12 characters, with
embedded hyphens
• English names for arithmetic operators
• Data and code were completely separate
• Verbs were first word in every statement
• CODASYL committee (Conference on Data
Systems Languages) developed a
programming language by the name of
COBOL
28
COBOL
29
COBOL
First CODASYL Design Meeting - May 1959
Design goals:
• Must look like simple English
• Must be easy to use, even if that means it will be
less powerful
• Must broaden the base of computer users
• Must not be biased by current compiler problems
Design committee were all from computer manufacturers
and DoD branches
Design Problems: arithmetic expressions? subscripts?
Fights among manufacturers
30
COBOL
Contributions:
- First macro facility in a high-level language
- Hierarchical data structures (records)
- Nested selection statements
- Long names (up to 30 characters), with hyphens
- Data Division
Comments:
• First language required by DoD; would have
failed without DoD
• Still the most widely used business applications
language
31
COBOL Example
• Description : This program takes all input records of salesperson data
and writes it to an output file reformatted.
000100 ID DIVISION.
000200 PROGRAM-ID. SLS02.
000300 FILE-CONTROL.
000400 SELECT SALESPERSON-FILE
000500 ASSIGN TO DISK.
000600 SELECT REPORT-FILE
000700 ASSIGN TO PRINTER.
000800 DATA DIVISION.
000900 FILE SECTION.
001000 FD SALESPERSON-FILE.
001100 01 SALESPERSON-RECORD.
001200 05 FILLER PIC XX.
001300 05 SP-NUMBER PIC X(4).
001400 05 SP-NAME PIC X(18).
001500 05 FILLER PIC X(21).
001600 05 SP-CURRENT-SALES PIC 9(5)V99.
001700 05 SP-CURRENT-RETURNS PIC 9(4)V99.
001800 FD REPORT-FILE.
001900 01 REPORT-RECORD.
002000 05 FILLER PIC X(10).
002100 05 RT-NUMBER PIC X(4).
002200 05 FILLER PIC X(6).
002300 05 RT-NAME PIC X(18).
002400 05 FILLER PIC X(6).
002500 05 RT-CURRENT-SALES PIC ZZ,ZZZ.99.
002600 05 FILLER PIC X(6).
002700 05 RT-CURRENT-RETURNS PIC Z,ZZZ.99.
002800 05 FILLER PIC X(65).
32
COBOL Example
002900 WORKING-STORAGE SECTION.
003000 01 WS-EOF-FLAG PIC X.
003100*
003200 PROCEDURE DIVISION.
003300*
003400 MAIN-ROUTINE.
003500 OPEN INPUT SALESPERSON-FILE
003600 OUTPUT REPORT-FILE
003700 MOVE "N" TO WS-EOF-FLAG
003800 READ SALESPERSON-FILE
003900 AT END MOVE "Y" TO WS-EOF-FLAG
004000 END-READ
004100*
004200 PERFORM UNTIL WS-EOF-FLAG IS EQUAL TO "Y"
004300 MOVE SPACES TO REPORT-RECORD
004400 MOVE SP-NUMBER TO RT-NUMBER
004500 MOVE SP-NAME TO RT-NAME
004600 MOVE SP-CURRENT-SALES TO RT-CURRENT-SALES
004700 MOVE SP-CURRENT-RETURNS TO RT-CURRENT-RETURNS
004800 WRITE REPORT-RECORD
004900 READ SALESPERSON-FILE
005000 AT END MOVE "Y" TO WS-EOF-FLAG
005100 END-READ
005200 END-PERFORM
005300*
005400 CLOSE SALESPERSON-FILE, REPORT-FILE
005500 STOP RUN.
--------------------------------------------------------------------------------
Sample Run
33
BASIC
(1964)
• Beginner's All purpose Symbolic Instruction Code
• Designed by Kemeny & Kurtz at Dartmouth for the GE
225 with the goals:
• Easy to learn and use for non-science students and as a path to
Fortran and Algol
• Must be ”pleasant and friendly"
• Fast turnaround for homework
• Free and private access
• User time is more important than computer time
Source Code
10 INPUT "ENTER TWO NUMBERS SEPARATED BY A COMMA:
20 LET S = N1 + N2
30 LET D = N1 - N2
40 LET P = N1 * N2
50 LET Q = N1 / N2
60 PRINT "THE SUM IS ", S
70 PRINT "THE DIFFERENCE IS ", D
80 PRINT "THE PRODUCT IS ", P
90 PRINT "THE QUOTIENT IS ", Q
100 END
--------------------------------------------------------------------------------
Sample Run
ENTER TWO NUMBERS SEPARATED BY A COMMA:
42
THE SUM IS 6
THE DIFFERENCE IS 2
THE PRODUCT IS 8
THE QUOTIENT IS 2
35
LISP
(1959)
• LISt Processing language (Designed at MIT by McCarthy)
• AI research needed a language that:
• Process data in lists (rather than arrays)
• Handles symbolic computation (rather than numeric)
• One universal, recursive data type: the s-expression
• An s-expression is either an atom or a list of zero or more
s-expressions
• Syntax is based on the lambda calculus
• Pioneered functional programming
• No need for variables or assignment
• Control via recursion and conditional expressions
• Status
• Still the dominant language for AI
• COMMON LISP and Scheme are contemporary dialects
• ML, Miranda, and Haskell are related languages
36
Representation of Two LISP
Lists
37
LISP
Source Code
Example
;;; This function, given a specific degree in Farhrenheit,
;;; presents the user with equivalent Celsius degree.
(defun convert ()
(format t "Enter Fahrenheit ")
(LET (fahr)
(SETQ fahr (read fahr))
(APPEND '(celsisus is) (*(- fahr 32)(/ 5 9)) )
)
)
Ref: http://www.engin.umd.umich.edu/CIS/course.des/cis400/
38
Algo
Environment of development:
l
1. FORTRAN had (barely) arrived for IBM 70x
2. Many other languages were being developed, all for
specific machines
3. No portable language; all were machine-dependent
4. No universal language for communicating
algorithms
ACM and GAMM met for four days for design
- Goals of the language:
1. Close to mathematical notation
2. Good for describing algorithms
3. Must be translatable to machine code
39
Algol 58
• Concept of type was formalized
• Names could have anyFeatures
length
• Arrays could have any number of subscripts
• Parameters were separated by mode (in & out)
• Subscripts were placed in brackets
• Compound statements (begin ... end)
• Semicolon as a statement separator
• Assignment operator was :=
• if had an else-if clause
Comments:
•Not meant to be implemented, but variations of it were
(MAD, JOVIAL)
•Although IBM was initially enthusiastic, all support was
dropped by mid-1959
40
Algol
60
Modified ALGOL 58 at 6-day meeting in Paris adding such
new features as:
• Block structure (local scope)
• Two parameter passing methods
• Subprogram recursion
• Stack-dynamic arrays
• Still no I/O and no string handling
Successes:
• The standard way to publish algorithms for over 20
years
• All subsequent imperative languages are based on it
• First machine-independent language
• First language whose syntax was formally defined
(BNF)
41
Algol 60
(1960)
Failure: Never widely used, especially in U.S.,
mostly because
1. No I/O and the character set made
programs nonportable
2. Too flexible--hard to implement
3. Entrenchment of FORTRAN
4. Formal syntax description
5. Lack of support by IBM
42
Sample
of an array. Block structures,ALGOL
• Description : This program computes the mean (average) of the absolute value
a dynamic array, and iterative statements are
featured in this program. The bold type print represent keywords.
// the main program (this is a comment)
begin
integer N;
Read Int(N);
begin
real array Data[1:N];
real sum, avg;
integer i;
sum:=0;
44
The 1960s: An Explosion in
Programming Languages
• The development of hundreds of programming
languages
• PL/I designed in 1963-4
– supposed to be all purpose
– combined features of FORTRAN, COBOL and Algol 60 and more!
– translators were slow, huge and unreliable
– some say it was ahead of its time......
• Algol 68
• SNOBOL
• Simula
• BASIC
45
PL/
I
• Computing situation in 1964 (IBM's point of view)
Scientific computing
• IBM 1620 and 7090 computers
• FORTRAN
• SHARE user group
Business computing
• IBM 1401, 7080 computers
• COBOL
• GUIDE user group
• IBM’s goal: develop a single computer (IBM 360) and a
single programming language (PL/I) that would be good
for scientific and business applications.
• Eventually grew to include virtually every idea in current
practical programming languages.
46
PL/
PL/I contributions: I
1. First unit-level concurrency
2. First exception handling
3. Switch-selectable recursion
4. First pointer data type
5. First array cross sections
Comments:
• Many new features were poorly designed
• Too large and too complex
• Was (and still is) actually used for both scientific
and business applications
• Subsets (e.g. PL/C) developed which were more
manageable
47
Simula (1962-
67)
• Designed and built by Ole-Johan Dahl and Kristen
Nygaard at the Norwegian Computing Centre (NCC) in
Oslo between 1962 and 1967
• Originally designed and implemented as a language for
discrete event simulation
• Based on ALGOL 60
Primary Contributions:
• Coroutines - a kind of subprogram
• Classes (data plus methods) and objects
• Inheritance
• Dynamic binding
=> Introduced the basic ideas that developed into object-
oriented programming.
48
Algol
From the continued development
a superset of that language
68of ALGOL 60, but it is not
• Comments:
• Had even less usage than ALGOL 60
• Had strong influence on subsequent languages,
especially Pascal, C, and Ada
49
The 1970s: Simplicity,
Abstraction, Study
• Algol-W - Nicklaus Wirth and C.A.R.Hoare
– reaction against 1960s
– simplicity
• Pascal
– small, simple, efficient structures
– for teaching program
• C - 1972 - Dennis Ritchie
– aims for simplicity by reducing restrictions of the type system
– allows access to underlying system
– interface with O/S - UNIX
50
Pascal
(1971)
• Designed by Wirth, who quit the ALGOL 68
committee (didn't like the direction of that
work)
• Designed for teaching structured programming
• Small, simple
• Introduces some modest improvements, such as
the case statement
• Was widely used for teaching programming ~
1980-1995.
51
Pascal
Sample
(********************************************************************
* A simple bubble sort program. Reads integers, one per line, and prints *
* them out in sorted order. Blows up if there are more than 49. *
********************************************************************)
PROGRAM Sort(input, output);
CONST
(* Max array size. *)
MaxElts = 50;
TYPE
(* Type of the element array. *) BEGIN
IntArrType = ARRAY [1..MaxElts] OF Integer; (* Read *)
ReadArr(size, arr);
VAR
(* Indexes, exchange temp, array size. *) (* Sort using bubble sort. *)
i, j, tmp, size: integer; FOR i := size - 1 DOWNTO 1 DO
FOR j := 1 TO i DO
(* Array of ints *) IF arr[j] > arr[j + 1] THEN BEGIN
arr: IntArrType; tmp := arr[j];
arr[j] := arr[j + 1];
(* Read in the integers. *) arr[j + 1] := tmp;
PROCEDURE ReadArr(VAR size: Integer; VAR a: IntArrType); END;
BEGIN
size := 1; (* Print. *)
WHILE NOT eof DO BEGIN FOR i := 1 TO size DO
readln(a[size]); writeln(arr[i])
IF NOT eof THEN END.
size := size + 1
END
END;
52
C
(1972-)
• Designed for systems programming at Bell
Labs by Dennis Ritchie and colleagues.
• Evolved primarily from B, but also
ALGOL 68
• Powerful set of operators, but poor type
checking
• Initially spread through UNIX and the
availability of high quality, free compilers,
especially gcc.
53
Other descendants of ALGOL
• Modula-2 (mid-1970s by Niklaus Wirth at ETH)
• Pascal plus modules and some low-level
features designed for systems programming
• Modula-3 (late 1980s at Digital & Olivetti)
• Modula-2 plus classes, exception handling,
garbage collection, and concurrency
• Oberon (late 1980s by Wirth at ETH)
• Adds support for OOP to Modula-2
• Many Modula-2 features were deleted (e.g., for
statement, enumeration types, with statement,
non-integer array indices)
54
The 1980s: Consolidation
and New Paradigms
• Ada
– US Department of Defence
– European team lead by Jean Ichbiah. (Sam Lomonaco was
also on the ADA team :-)
• Functional programming
– Scheme, ML, Haskell
• Logic programming
– Prolog
• Object-oriented programming
– Smalltalk, C++, Eiffel
55
Ad
• In study done in 73-74 itawas determined that the
DoD was spending $3B annually on software, over
half on embedded computer systems.
• The Higher Order Language Working Group was
formed and initial language requirements compiled
and refined in 75-76 and existing languages
evaluated.
• In 1997, it was concluded that none were suitable,
though Pascal, ALGOL 68 or PL/I would be a good
starting point.
• Language DoD-1 was developed through a series of
competitive contracts.
56
Ad
a
• Renamed Ada in May 1979.
• Reference manual, Mil. Std. 1815 approved 10
December 1980. (Ada Bryon was born
10/12/1815)
• “mandated” for use in DoD work during late 80’s
and early 90’s.
• Ada95, a joint ISO and ANSI standard, accepted in
February 1995 and included many new features.
• The Ada Joint Program Office (AJPO) closed 1
October 1998 (Same day as ISO/IEC 14882:1998
(C++) published!)
57
Ad
a
Contributions:
1. Packages - support for data abstraction
2. Exception handling - elaborate
3. Generic program units
4. Concurrency - through the tasking model
Comments:
• Competitive design
• Included all that was then known about software
engineering and language design
• First compilers were very difficult; the first really
usable compiler came nearly five years after the
language design was completed
• Very difficult to mandate programming technology
58
Logic Programming:
Prolog
• Developed at the University of Aix Marseille, by Comerauer and
Roussel, with some help from Kowalski at the University of
Edinburgh
• Based on formal logic
• Non-procedural
• Can be summarized as being an intelligent database system that
uses an inferencing process to infer the truth of given queries
sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).
parent_child(X, Y) :- father_child(X, Y).
parent_child(X, Y) :- mother_child(X, Y).
mother_child(trude, sally).
father_child(tom, sally).
father_child(tom, erica).
father_child(mike, tom).
59
Functional
Programming
• Common Lisp: consolidation of LISP dialects
spurred practical use, as did the development of
Lisp Machines.
• Scheme: a simple and pure LISP like language
used for teaching programming.
• Logo: Used for teaching young children how to
program.
• ML: (Meta Language) a strongly-typed functional
language first developed by Robin Milner in the
70’s
• Haskell: polymorphicly typed, lazy, purely
functional language.
60
Smalltalk (1972-
80) by Alan Kay and
• Developed at Xerox PARC
colleagues (esp. Adele Goldberg) inspired by
Simula 67
• First compilation in 1972 was written on a bet to
come up with "the most powerful language in the
world" in "a single page of code".
• In 1980, Smalltalk 80, a uniformly object-oriented
programming environment became available as the
first commercial release of the Smalltalk language
• Pioneered the graphical user interface everyone
now uses
• Industrial use continues to the present day
61
Combining Imperative and Object-Oriented
Programming: C++ (1985)
• Developed at Bell Labs by Stroustrup
• Evolved from C and SIMULA 67
• Facilities for object-oriented programming, taken
partially from SIMULA 67, added to C
• Also has exception handling
• A large and complex language, in part because it
supports both procedural and OO programming
• Rapidly grew in popularity, along with OOP
• ANSI standard approved in November, 1997
62
Related OOP Languages
• Objective-C (designed by Brad Cox – early
1980s)
– C plus support for OOP based on Smalltalk
– Uses Smalltalk’s method calling syntax
– Used by Apple for systems programs
• Delphi (Borland)
– Pascal plus features to support OOP
– More elegant and safer than C++
• Go (designed at Google - 2009)
– Loosely based on C, but also quite different
– Does not support traditional OOP
Copyright © 2012 Addison-Wesley. All rights reserved. 1-63
63
An Imperative-Based Object-Oriented
Language: Java
• Developed at Sun in the early 1990s with original goal
of a language for
embedded computers
– C and C++ were not satisfactory for embedded electronic devices
• Principals: Bill Joy, James Gosling, Mike
Sheradin, Patrick Naughton
• Original name, Oak, changed for copyright reasons
• Based on C++
– Significantly simplified (does not include struct, union, enum,
pointer arithmetic, and half of the assignment coercions of C++)
– Supports only OOP
– Has references, but not pointers
– Includes support for applets and a form of concurrency
64
Java
• 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
65
1990’s: the Internet and
Web
During the 90’s, Object-oriented languages
(mostly C++) became widely used in
practical applications
The Internet and Web drove several
phenomena:
– Adding concurrency and threads to existing
languages
– Increased use of scripting languages such as Perl
and Tcl/Tk
– Java as a new programming language
66
Scripting Languages for the
• Perl
Web
– 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
• 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
Copyright © 2012 Addison-Wesley. All rights reserved. 1-67
67
Scripting Languages for the
• Python
Web
– 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
68
Scripting Languages for the
• Lua
Web
– 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
69
The Flagship .NET Language: C#
• Part of the .NET development platform
• Based on C++ and Java
• Provides a language for component-based
software development
• All .NET languages (C#, Visual
BASIC.NET, Managed C++, J#.NET, and
Jscript.NET) use Common Type System
(CTS), which provides a common class
library
• Likely to become widely used
70
Markup/Programming
Hybrid Languages
• XML, XSLT
– eXtensible Markup Language (XML): a metamarkup language
– eXtensible Stylesheet Language Transformation (XSLT) transforms
XML documents for display
– Programming constructs (e.g., looping)
• JSP
– Java Server Pages: a collection of technologies to support dynamic
Web documents
– servlet: a Java program that resides on a Web server; servlet’s
output is displayed by the browser
71
Programming Paradigms
• Imperative
• Object Oriented
• Functional
• Logic
• Parallel/Concurrent
• Distributed
• Constraint (declarative based on specifying constraints)
• Data flow (model as a directed graph of the data flowing
between operations)
• Aspect Oriented (separation of cross-cutting concerns, built
on top of OO, is it a new paradigm?)
• Generic (sometimes considered as a new paradigm)
72
Multiparadigm languages
• 1 paradigm:
– Imperative: C, Pascal, Basic
• 2 paradigms
– Imperative + OO: C++
– Functional + imperative: scheme
• 3 paradigms
– Functional + imperative + OO: Perl, Python, Tcl
– Imperative + concurrent + OO: Java, C#
• 4 paradigms
– Functional + imperative + concurrent + OO: Ruby
– Functional + imperative + logic + OO: Leda
• 8 paradigms
– Concurrent + constraint + dataflow + distributed + functional +
imperative + logic + OO: Mozart
73
Genealogy of Common
Languages
74
The future
• In the 60’s, the dream was a single all-purpose
language (e.g., PL/I, Algol)
• The 70s and 80s dream expressed by
Winograd (1979)
“Just as high-level languages allow the programmer to
escape the intricacies of the machine, higher level
programming systems can provide for manipulating
complex systems. We need to shift away from algorithms
and towards the description of the properties of the
packages that we build. Programming systems will be
declarative not imperative”
• Will that dream be realised?
• Programming is not yet obsolete
75