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

George Neuner <gneuner2@comcast.net>
Tue, 19 May 2009 13:39:03 -0400

          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)
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)
[5 later articles]
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Tue, 19 May 2009 13:39:03 -0400
Organization: A noiseless patient Spider
References: 09-05-080
Keywords: practice
Posted-Date: 19 May 2009 14:01:09 EDT

On Tue, 19 May 2009 04:01:26 -0700 (PDT), armencho@gmail.com wrote:




>What is the importance with a compiler that is able to compile itself?
>... a C/C++ compiler may be written in Java and so will at most be
>compiled by a Java compiler, and vice versa ...
>... Also, assemblers do not assemble themselves for the most part ...


The easiest way to get a compiler onto a new architecture is to
cross-compile it from an existing machine. Ditto assemblers.


Obviously, you can write a compiler in any suitable language, but
there can be a high cost in complexity - an impedance mismatch - when
the implementation language is very different from the language being
compiled. Some modern high level languages, in particular the group
of functional languages, have features and semantics which can be
difficult and inefficient to translate into the more traditional,
imperative, implementation languages like C (and C++, C#, Java, etc.
They are no more advanced than C despite hype to the contrary).


For this reason there is a tradition of writing compilers in their own
target source language (once the first compiler has been written, of
course). Beside which, a compiler is typically a large, non-trivial
application - 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.


George



Post a followup to this message

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