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
Return to the
comp.compilers page.
Search the
comp.compilers archives again.