Re: Writing a C/C++ compiler in C++

"Walter" <walter@digitalmars.com>
26 Feb 2004 01:05:21 -0500

          From comp.compilers

Related articles
[5 earlier articles]
Re: Writing a C/C++ compiler in C++ dezakin@usa.net (2004-02-01)
Re: Writing a C/C++ compiler in C++ vbdis@aol.com (2004-02-04)
Re: Writing a C/C++ compiler in C++ hkaiser@users.sourceforge.net (2004-02-12)
Re: Writing a C/C++ compiler in C++ jakacki@hotmail.com (2004-02-12)
Re: Writing a C/C++ compiler in C++ jo@spiffy.ox.compsoc.net (Joel Dillon) (2004-02-13)
Re: Writing a C/C++ compiler in C++ vbdis@aol.com (2004-02-26)
Re: Writing a C/C++ compiler in C++ walter@digitalmars.com (Walter) (2004-02-26)
| List of all articles for this month |
From: "Walter" <walter@digitalmars.com>
Newsgroups: comp.compilers
Date: 26 Feb 2004 01:05:21 -0500
Organization: Comcast Online
References: 04-01-146 04-01-151
Keywords: C++, design
Posted-Date: 26 Feb 2004 01:05:21 EST

"Dave Boyle" <david.boyle@ed.tadpole.com> wrote
> Just a word of warning. Walter Bright, who implemented an early C++
> compiler, had this to say in comp.lang.c++.moderated recently:
>
> "I'd venture that it would take 10 years to write a C++ compiler from
> scratch."
>
> He was talking specifically about a fully standard compliant compiler.
>
> This still seems a little excessive to me but I don't have the
> compiler construction experience that Walter has, so...


None of the existing compliant or near compliant C++ compilers are
under 10 years old. Digital Mars C++ is the oldest, containing bits of
compiler code first written in 1982 <g>. Naturally, that time can be
considerably shortened if you can incorporate existing components like
preprocessors, parsers, optimizers, code generators, etc., or if
you're not aiming for commercial quality.


Writing a C++ compiler as a first compiler project is like learning
mountain climbing by attempting Mt. Everest. Writing a compiler first
for a far simpler language, like say Pascal or Javascript, will
provide invaluable experience that should lower the overall time spent
implementing C++. Even implementing a C compiler isn't so easy (it
only looks easy compared with C++).


Anyhow, don't let me discourage you. When I started out, the reaction
from the experts was that I had no chance of ever succeeding at it
<g>.


-Walter
www.digitalmars.com free C/C++/D compilers


Post a followup to this message

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