Re: Why can't we build a C compiler?

limonce@pilot.njin.net (Tom Limoncelli)
24 Jan 89 00:27:19 GMT

          From comp.compilers

Related articles
[7 earlier articles]
Re: Why Can't We Build a C Compiler? olender@rachmaninov.CS.ColoState.EDU (1988-12-28)
Re: Why Can't We Build a C Compiler? frode@m2cs.naggum.se (Frode Odegard) (1988-12-29)
Re: Why Can't We Build a C Compiler? unido!gmdzi!jc@uunet.uu.net (1989-01-05)
Why can't we build a C compiler? think!compass!worley@EDDIE.MIT.EDU (1988-12-19)
Re: Why Can't We Build a C Compiler? jbs@fenchurch.mit.edu (1989-01-03)
Re: Why can't we build a C compiler? uokmax!glcowin@Central.Sun.COM (1989-01-18)
Re: Why can't we build a C compiler? limonce@pilot.njin.net (1989-01-24)
Re: Why can't we build a C compiler? waterloo.edu!cognos!rayt@RELAY.CS.NET (R.) (1989-01-25)
Re: Why can't we build a C compiler? kurt@tc.fluke.com (1989-01-25)
| List of all articles for this month |
From: limonce@pilot.njin.net (Tom Limoncelli)
Newsgroups: comp.compilers
Date: 24 Jan 89 00:27:19 GMT
References: <3210@ima.ima.isc.com>
Organization: NJ InterCampus Network, New Brunswick, N.J.

In article <3210@ima.ima.isc.com> uokmax!glcowin@Central.Sun.COM (Greg Cowin) writes:


> The solution is not an easy one. Presently, we usually describe
> semantics informally and formal specification of semantics can be
> complex and arcane. Although I do not have a solution, it is
> an area that we should give more attention. I certainly plan
> to give it more attention. After all, it is interesting and
> a major part of the process that we enjoy.


One of the major break-throughs of Algol/Pascal/C-like languages is
that their syntax was completely specified in BNF (Backus-Naur Form?)
or a BNF-like syntax notation. This allowed definitive specifications
and since it was machine readable it was possible to make
code-generators for languages that could be specified in BNF (or
BNF-like) notation.


Specifying *semantics* can be done without English (or a natural
language). I can't remember the author but there's a book called
"The Denotational Description of Programming Languages" which is a
good beginners guide to the notation. Yes, it is a bit difficult to
learn and takes quite a talent to actually use you can describe all of
the C language (and the libraries!) in this notation. Don't ask ME to
do it but I'm sure someone could do it. Semantics are quite
difficult.


Anyway... the point that I wanted to bring up is that in the next
10 years *someone* is going to come up with a new style of semantic notation.
This will be an easier notation to use, to read, and it will truly be
a break-through if it is machine-readable and can be used to make
automatic code-generators.


Now all we have to do is sit back and wait for someone to invent it! :-)
--
  Tom Limoncelli -- tlimonce@drunivac.Bitnet -- limonce@pilot.njin.net
                        Drew University -- Madison, NJ -- 201-408-5389
[One problem that I still haven't seen adequately addressed is the mapping
of abstract semantics onto real hardware. With grammars, the grammar-
interpreting machine that you build via LR(1) or whatever perfectly implements
the grammar that it interprets. With semantics, you have ugly problems with
the behavior that the hardware wants to give you, e.g. overflow, alignment,
rounding, and although it is possible to generate code that implements
arbitrary semantics, the cost of doing so if the semantics is very far from
that preferred by the hardware makes most of us compiler writers throw up
our hands and give you what the hardware gives you. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.