I have studied specifications for a number of computer programming
languages, including machine languages.
There is quite a variety of styles of specification.
The attempt to be precise has often lead to a considerable degree of
obscure constructions.
My impression, on the whole, is that precision has often been obtained,
but at a considerably greater cost to the reader than necessary.
The precision was achieved only thru great and successful work.
A considerable extra further cost would be necessary to make the
specification simple.
There is, of course, a limit on how simple the description of a language
may be.
As Pascal said famously:
Please excuse the length of this letter,
I have not had the time to make it short.
I will comment on specifications for several languages that I have studied.
Scheme
My favorite is Scheme.
The Report is
about 40 pages which includes a fairly extensive library of built in
functions.
The main reason that the specification is short is that the language is simple.
Relatively few concepts pervade the describe the specification.
Procedures, environments, continuations and the smallish variety of values
are about all of the global concepts.
Algol 68
Algol 68, which is very much extended over Algol 60, is another favorite
language but the report is very difficult to comprehend.
I think that the effort to learn to extract language information from the
report is comparable to a one year calculus course.
The elegance of the presentation scheme (a two level grammar) will be enough reward for some.
Many terms and concepts are introduced.
I think that there are a few that would improve computer science if they
were better known, but only a few.
The others are often elegant, but not strictly necessary.
Standard PL/I
Some years ago there was a standards effort to define a small enhancement of IBM’s PL/I.
American National Standards Institute, Proposed American National Standard Programming Language BASIC, ANSI BSR X3.113-198X, 1983.
IBM was part of that effort but IBM did not follow the standard.
The document was a very interesting exercise in specification, nonetheless.
The specs called out three stages of performing a PL/I program:
- Parsing the input and producing an abstract tree
-