Re: Newbie question: What is the importance for a compiler to be able to compile itself?

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Tue, 19 May 2009 17:07:48 +0200

          From comp.compilers

Related articles
Newbie question: What is the importance for a compiler to be able to c armencho@gmail.com (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able andrew@tomazos.com (Andrew Tomazos) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able marcov@snail.stack.nl (Marco van de Voort) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able rose@acm.org (Ken Rose) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able gneuner2@comcast.net (George Neuner) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able kenney@cix.compulink.co.uk (2009-05-19)
Re: Newbie question: What is the importance for a compiler to be able pertti.kellomaki@tut.fi (Pertti Kellomaki) (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)
[7 later articles]
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Tue, 19 May 2009 17:07:48 +0200
Organization: Compilers Central
References: 09-05-080
Keywords: practice
Posted-Date: 19 May 2009 14:00:32 EDT

armencho@gmail.com schrieb:


> What is the importance with a compiler that is able to compile itself?


You'll find out when you want to port your compiler to a new platform.
If it doesn't support the language you wrote your compiler in, or that
other compiler there doesn't behave as expected, you're almost lost.


> As far as I can see from my limited wisdom, it is not a requirement
> and perhaps does not even prove anything substantial about the
> compiler? I mean, a C/C++ compiler may be written in Java and so will
> at most be compiled by a Java compiler, and vice versa, right?


A more practical argument: writing an compiler in its own language will
be the first essential test project for that compiler and language. Of
course then the compiler has to be implemented twice, for the original
(bootstrap) language, and in its own language. A comparison of the
created compilers can prove the language and compiler as (un)usable. The
amount of coding can be reduced in a multi-step bootstrap process, where
the first step only implements an subset of the language, just enough
for building the full blown compiler in the following steps.


> Also, assemblers do not assemble themselves for the most part, and
> XSLT transformers do not transform themselves either.


Not all languages are designed for implementing compilers, they even
must not be Turing-complete. But when a language is general-purpose
enough, possible customers may wonder when the compiler cannot compile
itself - does the creator not trust it's own compiler, or does the
language lack essential elements, which may stop an application project
in the implementation phase?


DoDi



Post a followup to this message

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