Re: Bootstraping compilers ?

"Damian Thomas" <damian.thomas@unisys.com>
Fri, 18 Apr 2008 08:46:51 -0700

          From comp.compilers

Related articles
Bootstraping compilers ? pocm@soton.ac.uk (2008-04-16)
Re: Bootstraping compilers ? chris@phaedsys.org (Chris Hills) (2008-04-18)
Re: Bootstraping compilers ? roland.leissa@googlemail.com (=?ISO-8859-1?Q?Roland_Lei=DFa?=) (2008-04-18)
Re: Bootstraping compilers ? damian.thomas@unisys.com (Damian Thomas) (2008-04-18)
Re: Bootstraping compilers ? marcov@stack.nl (Marco van de Voort) (2008-04-18)
Re: Bootstraping compilers ? marcov@stack.nl (Marco van de Voort) (2008-04-18)
Re: Bootstraping compilers ? lindahl@pbm.com (Greg Lindahl) (2008-04-18)
Re: Bootstraping compilers ? cdb@nullstone.com (Christopher Glaeser) (2008-04-19)
Re: Bootstraping compilers ? torbenm@app-4.diku.dk (2008-04-21)
Re: Bootstraping compilers ? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-04-21)
[5 later articles]
| List of all articles for this month |
From: "Damian Thomas" <damian.thomas@unisys.com>
Newsgroups: comp.compilers
Date: Fri, 18 Apr 2008 08:46:51 -0700
Organization: Unisys - Roseville, MN
References: 08-04-059
Keywords: design, debug
Posted-Date: 18 Apr 2008 12:01:13 EDT

I think it is very beneficial to have a compiler be able to compile
itself. It is an excellent test of the quality of the compiler. (I
suggest starting with the C99 compiler written in C89, then migrate
the source to C99 when you have a functioning C99 compiler.)


Do not stop at simply compiling, but also using the resulting compiler to
compile itself again and again and again.
I suggest at least 3 generations of compiles. Some say you should need 5
generations.
1st - finds compile-time errors
2nd - finds run-time errors
3rd - finds errors where the compiler ran improperly
4th - finds errors where the program ran correctly, but produced incorrect
results
5th - ?


The 3rd generation bugs are the hardest to find and diagnose. I think
I've fixed one or two 4th generation bugs, but I've never seen a 5th
generation bug. The exercise is well worth the effort.


Damian Thomas
Not speaking for my employer.




"Paulo Jorge de O. C. de Matos" <pocm@soton.ac.uk> wrote in message
> itself. gcc for example seems to do it, but is this good practice or
> should this always happen?


Post a followup to this message

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