Re: [QUERY] A "ignorant newbie" question about compiler-writing.

Arch Robison <robison@kai.com>
3 Jan 1997 23:16:53 -0500

          From comp.compilers

Related articles
[QUERY] A "ignorant newbie" question about compiler-writing. synaptik@why.net (1997-01-02)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. dennis@netcom.com (1997-01-03)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. jlilley@empathy.com (1997-01-03)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. robison@kai.com (Arch Robison) (1997-01-03)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. mw@ipx2.rz.uni-mannheim.de (1997-01-04)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. kanze@gabi-soft.fr (1997-01-29)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. kanze@gabi-soft.fr (1997-01-29)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. mw@ipx2.rz.uni-mannheim.de (1997-01-30)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. darius@phidani.be (Darius Blasband) (1997-01-30)
Re: [QUERY] A "ignorant newbie" question about compiler-writing. kanze@gabi-soft.fr (J. Kanze) (1997-01-30)
[9 later articles]
| List of all articles for this month |

From: Arch Robison <robison@kai.com>
Newsgroups: comp.compilers
Date: 3 Jan 1997 23:16:53 -0500
Organization: Kuck & Associates, Inc.
References: 97-01-013
Keywords: practice

synaptik@why.net (synaptik) writes:
>Let me preface my question by stating that I have read what relevant
>FAQs I could find,... yadda yadda yadda.
>
>I am interesting it "trying my hand" at writing a 'C' compiler. I


Students regularly write simple compilers in one semester courses.
It's not difficult to write a basic non-optimizing compiler.


>My question is... what is it that makes compiler development so difficult?


Support for dialects, multiple backends, debug information,
optimization, and shifting specifications.


Commercial C compilers are expected to support at least K&R, ANSI, and
usually a combination dialect. (And often minor variants such as
making char signed or unsigned.) The compilers often have to support
multiple instruction sets and variants of those instruction sets.
(E.g., 32-bit and 64-bit.) Debug information has to be maintained.
Optimization can be a whole industry itself (that's how our company
got started!)


Of course, doing all that got too easy for C and Fortran 77, so the
gods handed down F90 and C++. These languages are so complicated to
parse that whole companies are devoted to just parsing them! And the
C++ is still being standardized, so it shifts.


Then there's the GUI and Integrated Development environment. And
incremental compilation etc.


But even if all the above is easy, there's the root problem:


Customers demand features.


Unfortunately, N customers each demand "one little feature". Which
leads to O(N*N) pairwise feature interactions. Each of N customers
understands "their" feature, but no human can understand all of them
together.


>Forgive my ignorance, but I have always thought it would
>be a fun project, but then become disillusioned when I pick up a book
>on compiler theory and it doesn't appear "straight forward."


Don't be disillusioned. Writing compilers can be fun and educational.
If you're writing it as a hobby, *you* and not the market get to
decide what's important to implement and what is not. Have fun!


My only critique would be the choice of C. If you're not market
driven, search for a novel/interesting/saner language. The world
already has too many C compilers.


Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 Champaign IL 61820
Lead Developer for KAI C++ http://www.kai.com/C_plus_plus/index.html
--


Post a followup to this message

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