Professional Documents
Culture Documents
1115870
1115870
ALTERNATI~ TO EXTENSIBLE ~ N G U A G E $
Ms Do Mcl!rey~ Bell Telephone Labsratories~ Murray Hill, New Jersey° 1969 ~ y 13o
One of the most important things~ it seems to me~ in extending a languages is some-
how to have the extension smooth with respect to the base° Smoothness is an aesthetic
requiroment~ and I can't be too precise about it~ but it is also a very strong require°°
ment~ and one that is very hard to live up to when you actually come down to try to
write an extonsiono For example~ in extending a language by introducing a new data
type~ one should allow that now data type to appear in all contexts of the language or
as many as possibleo Not only in expressions~ which we seem to know how to do, but
also in places like input/outputo If the language has parametric data types (for ex~
ample~ declarable precisions) and has corresponding poly~orphic operators defined over
all of them~ then extension should likewise have comparable capabilities for para~et~
erization and polymorphismo This is not possible in Algol 68~ for instance° (I will
make frequent reference to Algol 68 in this talk for the reason that Algol 68 is de~
fined and available~ has been thought about very carefully~ and therefore, is much
easier to shoot at since it is a reasonably stable target°)
Smooth extensibility can depend on amazingly innocuous features of the base lan~
guageo Again consider Algol 68 as an example~ where one has ~ ~ ~ ,
l ~ ~ ~ , ~ ~ ~ and so one Suppose I decided that what I
wanted long integer to be was arbitrary precision integers which I would implement in
the customary way of having some dynamic storage allocation package that allocates
pieces adequate to each integer computedo And then I would try to put into the lane
guage an onviro~ent inquiry (because Algol 68 believes in environment inquiries)
~at~s the biggest ~ ~ ? ~ In answering that inquiry it would use up all the
storagoo And I can't do much more computing°
Until quite recently~ most forays into the exciting language8 have had fuzzy and
over-ambitious goalso It is easy to set down a collection of representative things
one would like to do in language extension and a very short list can set up an un~
reachable goalo We all know more challenges than we can implo~ento
I have personal familiarity with only a few actually implemented idea~ beyond
straight ~aero processors~ and most of these have succeeded by virtue of limited goals°
For instanco~ Dick Bennett's Sot processors He observed that ~aero~ work~ and that
the syntax of function calls was handy~ by restricting himself to functional syntax
and nothing ~ore~ he was able to ~trip away ~o~e of the p r o b l e ~ a n d actually got ~o~e~
where with the problem of extengion of se~antic~ if not syntax~ There was the simple
idea of type otho_r in various Fortran compilers by CDC~ where a handful of data types
could be provided by user~definod routines with know~ na~es~ Handy and woll~usedo
Michigan's Mad translator had a neat way (for the initiate) of introducing new oper~
ators~ and very powerful things have been done with this~ but they depended in detail
on the exact internal representation of tables within one particular compil~ro Mere
recently~ there has been ML/1 by Peter Browne I ~ not sure it is correctly referred
to in an extensible languages symposium because it has no base language whatsoever°
But precisely because it has no base language and is a string~to~string translator~
it doos~ in fact~ give remarkable power to the virtuoso user willing to start at ground
zeroo And finally~ there are the compile ti~e facilities of PL/I~ and these are very
significant because indeed this is the first time any sort of macro facility has
really made it into the public domain as part of a higher level language°
Based on observation of those few solid successes, a~id a torrent of hopeful prom
posals~ l~m ready to say that we can't expect to extend any languages in a clean way
all the way across the board except perhaps for some languages as trivial as Set w a ~
which had no syntax worth mentioning and no characteristic programming style°
SIGPLAN Notices 51 1969 August