isomorphic languages

David Hough dgh%dgh at Sun.COM
Sun Oct 30 14:31:27 AEST 1988


Thesis:  Language designers (including X3Jn committees) needn't
incorporate every bad syntax of the past if revised versions are
syntactically isomorphic.

One thing I've noticed in the current Fortran-8x discussion and in some
previous X3J11 C discussions is that new users of the new languages are
predestined to a lot of agony on the cross of literal compatibility.
These new users are destined to repeat all the mistakes necessary to
learn the tricks of the masters.  Of course, the masters don't regard
these mistakes as flaws in the languages, but as features, which
furthermore help maintain full employment for the masters.

I'd consider Fortran-8x to be upwardly compatible with Fortran-77, and
X3J11 C to be upwardly compatible from K&R, if every legal old program
could be converted to a legal new program by a "context-free"
translator that only has to look at one logical input line at a time.
One logical input line may contain multiple physical input lines -
Fortran-77 continuation lines are what I have in mind.  Languages with
this "context-free translatability" property could be called
"syntactically isomorphic".

In the last public review I urged X3J3 to be bold about devising modern
syntax for Fortran-8x.  I don't think it's necessary for Fortran-8x
compilers to accept Fortran-77 >syntax< if it is possible to provide a
translator as described above.  "Possible" means possible according to
the syntactical differences rather than according to the possible
skills of translator implementors; the requirement that a context-free
translation be possible is intended to minimize the skill requirement.
Furthermore, thanks to people like Richard Stallman, such translators
would be readily available in the public domain.

Note that unfortunately Fortran-8x will have to accept Fortran-77
>semantics<, which is most of the hard part, however expressed, so the
complexity of the total compiler wouldn't be much lessened; the thrust
of this proposal is to eliminate the known syntactic stumbling blocks.

Thus there's no reason to continue to inflict bugs like

	do i = 1. 10

or its C counterpart

	if(x=y) ...

It's too late for X3J11 this time around, but I can at least hope for a
better result from X3J3.

David Hough

dhough at sun.com   
na.hough at na-net.stanford.edu
{ucbvax,decvax,decwrl,seismo}!sun!dhough



More information about the Comp.lang.c mailing list