Re: Newbie question: What is the importance for a compiler to be able to compi

alextangent <blog@rivadpm.com>
Thu, 21 May 2009 15:44:15 -0700 (PDT)

          From comp.compilers

Related articles
[9 earlier articles]
Re: Newbie question: What is the importance for a compiler to be able jeremy.wright@microfocus.com (Jeremy Wright) (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able torbenm@pc-003.diku.dk (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able armencho@gmail.com (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able marcov@snail.stack.nl (Marco van de Voort) (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able jeremy.wright@microfocus.com (Jeremy Wright) (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-05-20)
Re: Newbie question: What is the importance for a compiler to be able blog@rivadpm.com (alextangent) (2009-05-21)
Re: Newbie question: What is the importance for a compiler to be able barry.j.kelly@gmail.com (Barry Kelly) (2009-05-22)
| List of all articles for this month |

From: alextangent <blog@rivadpm.com>
Newsgroups: comp.compilers
Date: Thu, 21 May 2009 15:44:15 -0700 (PDT)
Organization: Compilers Central
References: 09-05-086 09-05-089
Keywords: practice, forth
Posted-Date: 21 May 2009 20:15:54 EDT

On May 19, 11:28 pm, ken...@cix.compulink.co.uk wrote:
> gneun...@comcast.net (George Neuner) wrote:
> > so, naturally, along with the language validation suite
> > (if there is one), one of the first big tests of your new compiler is
> > whether it can compile itself.
>
> The other point it is possible to bootstrap the thing. Once you have a
> minimal compiler it can be used to compile the full version. It is also
> easier to add additional features. Delphi distributions for example
> includes the complete source code of the compiler and the components.
>
> A different example is Forth. While you can write Forth systems in
> another language such as C a large proportion of them have a minimum
> word set in machine code and the rest is written in Forth.
>
> Ken Young


The Forth example is a good one, in that many (if not most) Forth
compilers compile themselves, including the assembler parts, by using
Forth to generate version+1 of the compiler, a process Forthers call
metacompilation.


An exampe for the definition of a putative word X. The metacompiler
Forth code that implements X in the new target version uses X to
define X. The history of how X was originally defined is lost at the
current source level; there is a version many, many generations ago
where X was defined in terms of simpler, more primitive units. By this
method, bootstrapping source code in the compiler can be removed until
the resulting system is described entirely in terms of itself. It can
be a little confusing. Fascinating nonetheless.


--
Regards
Alex McDonald



Post a followup to this message

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