Introduction
Instructor: E.
Head
Why Study Programming Languages?
- Learn new ways to think and express solutions to problems.
- To improve your use of existing languages.
- Increase you ability to learn new languages.
- Learn methods to evaluate languages.
- Gives criteria for designing your own language.
What is Computer Science?
What is a programming language?
What are programs used for:
- Original view: Programs are used to control
computers
- Modern view:
- Programs are used to specify
computations.
- Computers are used to perform the specified
computations.
- A programs most important audience are people NOT
machines.
Why are there so many languages?
- Different hardware (old view)
- Different domains (applications)
- Need for better tools that yield software that is more
trustworthy, faster and less expensive.
What will be cover ?
- Judging the design of
a languages
- History of programming
languages
- Different Language Paradigms
- Implemention and Run Time Environment
How do we judge a programming language?
- What is the extent of support for program correctness?
- What is the cost of program development and modification?
- What is the cost of using the program (execution time and
space)?
Total cost is a combination of 2 and 3.
There are trade-offs
Brief History of
Programming Languages
- 1944, Von
Neumann described a stored program
computer
- Each program for the first computers had to be hard
wired by
hand.
- Later switches were put on a console
- The original view of a program was to control a
computer
- 1951, Wilkes,
Wheeler and Gill published The
Preparation of Programs for an Electronic Digital Computer
which
described an assembler.
- It presents an elegant symbolic notation and coding for
the
large subroutine library that provided the building blocks for an array
of programs.
- Subroutines were written in machine code
- 1949, assembly language introduced mnemonics to represent
machine instructions with a program to translate it
into
machine
code.
LDA STOR1
ADD STOR2
STA STOR3
JNZ LOC17
- Assemblers are programs that convert assembly programs
to
machine code.
- Is an abstraction of machine instructions and memory
addresses.
- 1949, Grace
Hopper developes the first computer compiler and publishes
the
first paper on compilers in 1952
- 1954-57, John
Backus developed FORmula TRANslation the first widely
accepted
compiled language.
SUM = 0.0
SUM = SUM + ARR(I)
IF (SUM .GT. 20.5) STOP
- Fortran is first high-level language
- A high-level language is simply a
programming
language
whose instruction format is
- More closely related to the problem domain of the
problem
than to the instructions of the computer that will run the program.
- Fortran influenced Algol 60 and its decendents, PL/I,
BASIC
- Mid 50s, interest developed
in solving
non-numerical problems.
- 1956, Allen Newell, J.C. Shaw and Herbert Simon published
a
paper that described the first AI program and a language that could
implement
it.
- It was too low level to be widely accepted.
- 1956-62, J.
McCarthy developed LISt P
rocessing the first
highly
successful symbol processing language for AI
(DEFUN SUM_LIST(L)
(+(CAR L)(SUM_LIST(CDR L)))
- First accepted language not based on controlling a
machine but
based on the (mathematic) computational model, Lambda
Calculus.
- Second oldest language in use.
- Computes by substitution and reduction.
- Recursive functions is the key programming
technique
- In addition to introducing recursion, Lisp introduced:
- garbage collection
- conditional expressions
- Algol's conditional expression was suggested by
McCarthy
who was a member of the Algol committee.
- interactive program execution
- ML (Milner 1978), Miranda(1986) and Haskell
(1988) are pure functional languages that are influenced by Lisp.
- 1958-60, Committee
developed ALGOL 60 to
provide a general, expressive language for describing algorithms.
- The most important milestone in developing modern
languages.
- Algol 60 led to Algol 68 which led directly to C and then C++ .
- Algol 60 led to Algol W which led to Pascal and Ada
- Algol 60 led to Simula and then Simula 67 and then
Smalltalk
- Many reason Algol 60 was not widely accepted language
- Too flexible which made it hard to difficult to
understand
and to implement efficiently.
- Introduced:
- block structures
- recursive function calls to procedural languages
- first language whose syntax was formally described
(using
BNF)
- Backus was a principle member of the design team
- Interesting in the 60s BNF seemed too complicated
and was
one of the reason Algol 60 was not accepted.
- Affected the design of some Burroughs machines to
include
stack which enable an efficient implementation of block structures and
recursive procedures.
- 1963-68, Committee developed Algol 68 was designed to be a
general purpose language as opposed to having the scientific
orientation
of Algol 60.
- Design goal was to make the various features of the
language
as
orthogonal as possible.
- Orthogonality means
that:
language features can be used in any combination,
the combinations all make sense
meaning of a given feature is consistent.
- Did not distinguish between expressions and
statements
- Introduced:
- User-defined data types
- dynamic arrays
- The use of an unknown metalanguage to describe the
language
was
one of the reason the language was not accepted and the difficulty of
implementing the language.
- 1965-67 Nygaard &
Dahl created Simula 67
the first object oriented language
- It was invented for writing simulation programs
- Programs in Simula is a model of some process in the
real
world
as opposed to a set of actions that we want a computer to carry out.
- Smalltalk80 follows from Simula67.
- Developed as part of the ALTO project at Xerox Parc
- Adele Goldberg and Alan Kay presented the goals for the
Smalltalk research efforts in a paper entitled "Personal Dynamic Media"
(IEEE
Computer, March 1977).
- Adele Goldberg and Dan Ingalls were original members of
the
Smalltalk development team.
- First object oriented language
- squeak is a direct decendent of Smalltalk
- First version of Smalltalk developed in 1972.
- Xerox
Parc
- Eiffel
(Bertand Meyer) follows also from Simula67.
- Java’s
semantics follows from
Smalltalk but the syntax follows from C.
- 1974-1983, international committee created Ada which was
to be
"one" for use by the Dept. Of Defense (DoD).
- In 1974, the US Government studied the languages in use
by the
Department of Defense (DoD):
there were more than 450 in use in the DoD alone!
- several thousand programming languages have been
developed
- The lead designer of Ada (Jean Ichbiah) claims that only
Ada
can be used safely for programs over 1,000,000 lines of code
- Any large piece of software (at least 100,000 lines of
code)
WILL have errors
- Ichbiah’s claim is that programs of that size in C or
C++ are
simply unfixable
- A sophisticated word processor could be around 300,000
lines
- The new air-traffic control system is supposed to be
getting
close 10 million lines of code
- Early 70s, Alain and
Colmerauer, Phillippe
Roussel (France) and Robert
Kowalski (Edinburgh) developed the fundamental design of
Prolog.
- Prolog
is
logic-programming
languages (called fifth-generation languages in the 80’s)
- Programs consist of a data base and rules that are
queried.
- ISO standard became available late in 1995.
- Principle mechanism
- Unification, relations, Horn clauses
- There are many
applications-generator
languages
- they started with COBOL-generators in the 70’s and 80’s.
- now we have Visual Basic, Javascript, etc.
- There are scripting
languages (immediately executable)
- JCL - first used to control the flow of batch jobs
- Unix (Linux) sh, csh, tcsh, bash
- Used to "glue" together utilities (programs) to create
new
applications
- made Unix popular
- DOS, REXX, ORexx
- Common Features of scripting languages:
- Usually dynamically typed
- Excellent string faculties (regular expressions)
- AWK
- 1977/1985 Alfred
V. Aho, Peter J. Weinberger, and Brian
W.
Kernighan designers
- Tcl/Tk
- 1980s by John Ousterhout
- Tcl - Tool Command Language
- Tk- began as a component GUI extension to Tcl.
- Perl
- Python
- Ruby was designed and developed by Yukihiro Matsumoto
in 1993-95
- various blogs, data processing applications,
- Ruby On Rails is a web-application framework for the MVC pattern that includes
both a template engine, controller framework, and object-relational
mapping package. Everything needed to develop web-apps that can run on
CGI, FastCGI, and mod_ruby (Apache module).
- PHP
- PHP/FI was
created by Rasmus Lerdorf in 1995 (Personal Home Page / Forms Interpreter)
- Yahoo web site
- JavaScript (early names Mocha then LiveScript)
- Written by Brendan
Eich in 1996 to enable non-programmers to process numbers and modify
contents of forms. Easier than Java applets -- syntax resembled
Java.
- Google Maps
- There are macro-languages, especially for spreadsheets,
e.g. for
Lotus, Excel, Quattro
- There are languages to display documents, HTML, XML, SGML
- There are languages compiled into an intermediate language