CS301 W'99 Lecture Notes
Lecture 3
Evaluating Programming Languages

How can we judge or compare languages?

Expressiveness

$\bullet$ Technically not interesting; nearly all languages are ``Turing-complete.''

Appropriateness to domain

$\bullet$ Scientific (numerical) computing
$\bullet$ Business applications
$\bullet$ Artificial intelligence
$\bullet$ Systems programming
$\bullet$ etc.

High-level goals for code

$\bullet$ Easily readable
$\bullet$ Easily writable
$\bullet$ Maintainable
$\bullet$ Efficient

Goals for languages

$\bullet$ Simplicity
$\bullet$ Uniformity (orthogonality)
$\bullet$ Modularity
$\bullet$ Clean syntax
$\bullet$ Maximizes explicit structure
$\bullet$ Clear execution model
$\bullet$ Efficient implementation model
Costs affected by programming language choice

Execution speed (& space)

Development time

$\bullet$ Program writing

$\bullet$ Compilation, testing, debugging

$\bullet$ (Training)

Maintenance time

$\bullet$ Program reading

Factors affecting programming language choice

Costs (as above)

Availability of implementations

Availability of trained programmers (should this matter?)

Politics

Inertia FORTRAN 1954-58 John Backus (IBM)

Domain: Numerical computation

Features:

$\bullet$ Arithmetic expressions (evaluated using stack)

$\bullet$ Statements

$\bullet$ Bounded arrays

$\bullet$ Iterative control structures

$\bullet$ Subroutines (no recursion; call-by-reference; separate compilation (in FORTRAN II))

$\bullet$ Common blocks (and EQUIVALENCE declarations)

$\bullet$ I/O using FORMAT directives

Implementation model:

$\bullet$ Fixed run-time storage requirements

$\bullet$ Optimization of numerical computations

Still used very widely: FORTRAN IV, FORTRAN 77, FORTRAN 90, HPF ALGOL 60 1957-60 Committee
(incl. Backus, McCarthy, Naur)

Domain: Numerical computation

Features:

$\bullet$ Carefully defined by ``report''
Syntax defined with BNF

$\bullet$ Block structure (stack-based implementation)

$\bullet$ Recursive subroutines

$\bullet$ Explicit type declarations

$\bullet$ Scope rules and dynamic lifetimes

$\bullet$ Relational & boolean expressions

$\bullet$ Call-by-value & call-by-name

$\bullet$ Dynamic Array Bounds

Never widely used in US; somewhat used in Europe.

Very influential on later languages.

``An improvement on nearly all its successors.'' - Hoare

Cobol 1959-61 DOD-led committee

Domain: Business data processing

Features:

$\bullet$ Separate data description

$\bullet$ Record data structures

$\bullet$ File description/ manipulation

$\bullet$ English-language-like syntax (``Syntactic sugar'')

$\bullet$ Early standardization

Still used very widely.

Ada 1977-83 DOD-sponsored committee
(Ichbiah)

Domain: Everything, but especially embedded systems.

Features:

$\bullet$ Focus on reliability, safety.

$\bullet$ Real-time control and multiprocessing.

$\bullet$ Programming support environments.

$\bullet$ Very large and verbose language.

Was mandated for much DOD work, but no more. Ada95 now available.

Pascal Family 1971- Niklaus Wirth

Pascal 1971

Domain: General-purpose programming, education.

$\bullet$ Simplicity of language and implementation

$\bullet$ Rich type definition facility

$\bullet$ Structured programming methodology

$\bullet$ Suitable for proving programs correct

Modula-2 1979-81

$\bullet$ Modules for abstraction

$\bullet$ Systems programming facilities

$\bullet$ Procedure types

Oberon, Oberon-2 1988-90, 1992

$\bullet$ Further simplification!

$\bullet$ Addition of object-oriented features.

Modula-3 1988-89

$\bullet$ Separate development by DEC SRC.

C 1972-74 Dennis Ritchie (Bell Labs)

Domain: Systems Programming; hacking of all kinds.

Implementation language for UNIX kernel and utilities

$\bullet$ Rich set of operators

$\bullet$ Terse syntax

$\bullet$ Easy machine access

Very successful; widely used in engineering and education

Standardized as ANSI C

C++ 1980- Bjarne Stroustrup

Domain: As C.

$\bullet$ Extended version of C.

$\bullet$ Direct support for abstract data types

$\bullet$ Object-oriented programming

$\bullet$ Large and very complex language

Used very widely. Java 1995- Arnold & Gosling (Sun)

Domain: Internet applet programming; as C++.

$\bullet$ Cut-down, cleaned-up version of C++.

$\bullet$ Automatic heap storage management (garbage collection).

$\bullet$ Type-safety and runtime memory security.

$\bullet$ Portable runtime environment (Java Virtual Machine).

Wildly hyped for network applications; may or may not take over C++ territory.

LISP and Functional Languages

LISP 1959-60 John McCarthy (MIT)

Domain: Artificial intelligence; symbolic computing

Features:

$\bullet$ List processing

$\bullet$ ``First-class'' functions

$\bullet$ Extremely simple program syntax; programs can easily manipulate programs

$\bullet$ Dynamic typing

Many variants, including Common Lisp, Scheme; also related to

Standard ML1981- Robin Milner, et al.

$\bullet$ Static but flexible typing

$\bullet$ Rich, orthogonal type system

$\bullet$ Module support

Visual Basic1990's Microsoft

Domain: Customizing and extending MS Windows-based office and COM applications.

$\bullet$ Very loosely based on BASIC language developed in early '60's.

$\bullet$ Programs (especially user-interfaces) usually built using interactive visual program development environment.

$\bullet$ Often used to ``glue'' together existing code components.

$\bullet$ Supports rapid, ``one-off'' prototyping and large-scale system development.

$\bullet$ Conventional procedural language.

$\bullet$ Dynamic typing.

$\bullet$ Supports COM objects.

Used very widely in Microsoft environments.


Andrew P. Tolmach
1999-01-11