Progress in Programming Languages: Kim@cs - Williams.edu&
Progress in Programming Languages: Kim@cs - Williams.edu&
KIM B. BRUCE
Williams College ^[email protected]&
A great deal of progress has been made pieces, each of which can be separately
over the last forty years in the design compiled. However, since these different
and implementation of programming compilation units depend on each other,
languages. Unfortunately, most pro- there must be a way of reliably passing
grammers have little experience with type information from one unit to the
imperative programming languages de- next. C provides primitive facilities to
veloped after the early 1970s, and still support this with header files, while the
use older languages like FORTRAN, (non-standard) Pascal units provide
COBOL, Pascal, and C. Yet in the last somewhat better support (though with-
twenty or so years there have been im- out information hiding). Modula-2 and
portant improvements to these lan- Ada-83, on the other hand, support sep-
guages. arate compilation by providing separate
Perhaps the most important develop- specification and implementation units.
ment has been the introduction of fea- This allows programs to be compiled
tures that support abstract data types once the imported units specifications
(ADTs). These features allow program- have been defined, while leaving the
mers to add new types to languages that implementations to be compiled later.
can be treated as though they were In fact, programmers may interchange a
primitive types of the language. The variety of implementations of specifica-
programmer can define a type and a tions without having any impact on the
collection of constants, functions, and code of programs using these units.
procedures on the type, while prohibit- Clu and Ada-83 also provided support
ing any program using this type from for parameterized types and polymor-
gaining access to the implementation of phic operations by allowing parameter-
the type. In particular, access to values ized ADTs. For instance, in Ada-83 one
of the type is available only through the can specify a parameterized binary
provided constants, functions, and pro- search tree as:
cedures. Simula-67 was one of the first generic
type BSTElt is private
languages to provide support for ADTs,
with function LessThan(x, y:
though it did not provide support for BSTElt) return BOOLEAN;
hiding the representation of types. For package BinSrchTree is
example, in the mid-’70s Clu’s clusters . . .
provided full support for ADTs. Two of end BinSrchTree;
the more popular languages providing This package can then be instantiated
full support for ADTs (though using with any type T that has an appropriate
slightly different mechanisms) are LessThan function defined for it. More-
Modula-2 and Ada-83. over, in both Clu and Ada-83 these pa-
These languages have also provided rameterized ADTs can be type checked
better support for separate, but not in- before being instantiated, which guar-
dependent, compilation. That is, pro- antees that instantiated versions will be
grams can be broken into smaller free of type errors as long as the opera-
tions required in the declaration exist. based rather than object-oriented, be-
The ability to define such parameter- cause of the different point of view and
ized ADTs is clearly very useful to pro- because they lack features like subtyp-
grammers. ing and inheritance commonly found in
At least partially in response to the object-oriented languages.) Many of
concerns raised in Djikstra’s famous let- these languages also include support for
ter “Go to considered harmful” [1968], parameterized types, polymorphic rou-
language designers have searched for tines (or classes), and exceptions. It is
more structured language features to not clear yet whether or not the current
handle cases where programmers for- focus on object-oriented languages will
merly used goto statements. One such eventually replace interest in more tra-
construct is the exception mechanism, ditional imperative languages.
which appeared in PL/I, Clu, and Ada, Meanwhile, there have been many in-
among others. Exceptions can be teresting developments in modern func-
“raised” either automatically by the sys- tional languages that provide support
tem (e.g., upon division by zero) or by for ADT’s, exceptions, and polymor-
the programmer (e.g., on an attempt to phism. Languages like ML [Milner et al.
pop an element off of an empty stack). 1990] and Haskell [Hudak and Fasel
As suggested by these examples, excep- 1992], for instance, are statically typed
tions are typically used to handle error and support implicit polymorphism.
conditions that arise in programming. Features in these languages like struc-
In many of these cases the currently tures, functors, and type classes provide
executing unit (e.g., the pop routine for a great deal of support for modular pro-
a stack) has no useful action that can be gramming. The Common Lisp Object
taken on detecting the error, but a call- System (CLOS) provides support for a
ing routing may. variant of object-oriented features
When an exception is raised, a search known as multi-methods, while a forth-
is made for an appropriate “handler.” If coming version of ML, ML 2000, will
a handler for the exception is found in almost certainly include support for ob-
the current activation unit, it is exe- jects.
cuted, otherwise the search for a handler The future of logic programming lan-
for the exception is made down the run- guages is not clear at the moment. After
time stack. That is, the search proceeds to a burst of interest in the early 1980s,
the unit that called the currently execut- they have settled into a fairly narrow
ing unit, and so on, until a handler is range of applications. More recent work
found. If no handler is found in the run- has focussed on replacing the “logic” in
time stack, the program halts. (A good these languages by the solution of con-
source of information on this and the straints [Benhamou and Colmerauer
other programming-language constructs 1993]. It is premature to say how impor-
discussed above is Louden [1993]). tant these languages will be in the long
More recently, more attention has run, but very interesting work is con-
been paid to object-oriented languages tinuing in this area.
like Smalltalk [Goldberg and Robson Languages are also playing an impor-
1983] and Eiffel [Meyer 1992] as well as tant role in the support of concurrency
to adding object-oriented features to and distributed computing. The key
older languages such as Pascal, C, Ada, ideas that must be supported are the
and even COBOL. As noted in this issue sharing of information and resources by
by Hirshfeld and Ege, object-oriented different processes and the need to en-
languages provide support for abstrac- sure the consistency of shared informa-
tions similar to that described above, tion across these processes. Languages
though from a somewhat different point can simply support primitive features to
of view. (Languages like Clu, Modula-2, fork off processes and synchronize them
and Ada-83 are sometimes called object- (e.g., using semaphores), or they can