Re: "The C compiler is Written in C" What!

Martin Ward <Martin.Ward@durham.ac.uk>
4 Aug 2003 00:06:24 -0400

          From comp.compilers

Related articles
Re: "The C compiler is Written in C" What! gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-07-26)
Re: "The C compiler is Written in C" What! marcov@toad.stack.nl (Marco van de Voort) (2003-07-31)
Re: "The C compiler is Written in C" What! postmaster@paul.washington.dc.us (Paul Robinson) (2003-07-31)
Re: "The C compiler is Written in C" What! rinie@xs4all.nl (Rinie Kervel) (2003-07-31)
Re: "The C compiler is Written in C" What! gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-08-04)
Re: "The C compiler is Written in C" What! Martin.Ward@durham.ac.uk (Martin Ward) (2003-08-04)
Re: "The C compiler is Written in C" What! marcov@toad.stack.nl (Marco van de Voort) (2003-08-04)
| List of all articles for this month |
From: Martin Ward <Martin.Ward@durham.ac.uk>
Newsgroups: comp.compilers
Date: 4 Aug 2003 00:06:24 -0400
Organization: Compilers Central
References: <43797288.0307260936.7ea8822c@posting.google.com> 03-07-198 03-07-209
Keywords: practice
Posted-Date: 04 Aug 2003 00:06:24 EDT

One further point to add to this thread is that you don't actually
*need* a compiler in order to bootstrap a compiler written in its own
language: it is sufficient to implement an interpreter for the target
language in an existing language. In fact, you can even write the
interpreter in a small subset of the target language: then all you
need is an interpreter for the subset of the target language written
in an existing language. In other words:


Comp1 is the compiler for C written in C


Int1 is an interpreter for the subset of C used to write Comp1
written in an even smaller subset of C, which I will call TeenyC.


Int2 is an interpreter for TeenyC written in a language for
which you already have a compiler or interpreter.


Then you run Int2 interpreting Int1 interpreting Comp1 compiling Comp1!


After a (long!) coffee break, you have a compiled copy of Comp1 which
can be used to develop Comp2 and so on. So you can throw away Int1
and Int2.


--
Martin


Martin.Ward@durham.ac.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4


Post a followup to this message

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