Related articles |
---|
[6 earlier articles] |
Re: Why Can't We Build a C Compiler? daveb@lethe.uucp (1988-12-26) |
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) |
Date: | Wed, 18 Jan 89 13:44:39 CST |
From: | uokmax!glcowin@Central.Sun.COM (Greg Cowin) |
Dale Worley writes the following:
> I think that part of the problem is the C is not all that well
> defined.
And later writes the following:
> Another rule for decent language design:
> If the grammar that you want to present to the user in the reference
> manual isn't LALR(1), the language design should be considered
> deficient.
> Following rules like this in language design should get rid of much of
> the work of compiler writing, since they eliminate features of the
> language that make compiler writing hard, but don't add anything
> useful for the user.
PROBLEM
-------
Overlooking the real problem of defining a programming language
seems to be very common. The problem is providing a formal
semantic definition. This problem is not easily solved, although
it can be done.
GRAMMARS
--------
I do not think that limiting ourselves to LALR(1) grammars
is going to solve the problem. Also, why limit ourselves to
only to LALR(1) grammars. In fact, to some degree the grammar
is insignificant. Formalization of syntax is a simpler problem
than the formalization of semantics.
C
-
Is C a (somewhat) portable language, because of the formalization
of semantics? If it were, we would not be having these querky
problems.
Could it be portable, because of porting the UN*X operating
to many different architectures? Yes, isn't the UN*X operating
system a big test suite. Even though it is big, it is still
inadequate. Note: I believe the preprocessor has also helped
portability; therefore, the portability is somewhat inherent.
SOLUTION
--------
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.
SOMETHING TO THINK ABOUT
------------------------
Are C compilers lacking? Or is it the formal specifications of the
C programming language? Are not our compilers dependent on the
language specification?
-----------------------------------------------------------------------
Greg Cowin occrsh!uokmax!glcowin or
University of Oklahoma occrsh!uokmax!gpsun!glc
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.