[comp.compilers] Why Can't We Build a C Compiler

holt@turing.toronto.edu (Ric Holt) (12/30/88)

Regarding this question and the comment that "Standard ML is, to my knowledge
the only language with a complete formal semantics" by Nick Rothwell.

The Turing language, used at the University of Toronto since 1983, has a 
complete formal semantics (as well as a complete formal definition of its 
lexical structure, its context free structure and its context conditions).
The various Turing compilers are (ideally at least) based on these definitions.
Turing is, briefly, an easy to use language with all the features of Pascal and
more.  Its superset, called Turing Plus, contains features of C and more, for
example, concurrent processes.

A recent article in the SUN technical journal describes the difficulties of
porting their C compiler from the 68000 to the SPARC.  It seems that their
main problems arose from the fact that many C features have unclear definitions,
such as, variable number of parameters, use of pointers on machines requiring
alignments, etc.  A formally defined language, such as Turing, does not have
these problems.
[Does a formal definition deal with problems of mapping the language's
abstract machine onto a real one?  I'm not persuaded, particularly if you
require that an implementation of a language on a given piece of hardware be
reasonable efficient, i.e. no misaligned pointers on machines without
hardware support for them.  -John]
[From Ric Holt <holt@turing.toronto.edu>]
--
Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU
Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request