Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Bootstrapin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 19 Topic 2388 of 2529
Post > Topic >>

Re: Bootstraping compilers ?

by torbenm@[EMAIL PROTECTED] (Torben =?iso-8859-1?Q?=C6gidius?= Mogense Apr 21, 2008 at 10:35 AM

pocm@[EMAIL PROTECTED]
 (Paulo Jorge de O. C. de Matos) writes:


> I am wondering if a compiler should always be able to compile
> itself. gcc for example seems to do it, but is this good practice or
> should this always happen?

When writing a compiler, it is more im****tant to write it in a
language that is suitable for writing compilers than to write it in
the language that it compiles.  Many languages are unsuited for
writing compilers, so by insisting on bootstrapping, you can make
things much more complicated than necessary.

If the language is new, you have more things to consider.  FIrst of
all, the first implementation of the language (interpreter or
compiler) has to be made in a different language, though you can do
incremental bootstrapping, where you first implement a small subset of
the language in another language, then use this to bootstrap a
compiler for the same subset written in the subset, and then extend
the subset and compiler incrementally, bootstrapping after each step.

Eventually, either due to the above or due to language drift, where
you add new features to the language and the compiler, you are likely
to have your compiler be the only implementation of the full language,
so the only way to compile your compiler is to let it compile itself.
However, if you for some reason lose the compiled version of the
compiler (or it fails to run due to a system upgrade that breaks the
code), you are left with no way to compile your language other than
writing a new implementation to perform the bootstrap.  It has
happened, so it is not a hypothetical situation.

For this reason, it is a good idea to write your compiler in a
language that you have third-party implementations of (and preferably
more than one), so you never get in the above situation.

	Torben
[But it was so cool that they wrote Fortran H in itself. -John]
 




 19 Posts in Topic:
Bootstraping compilers ?
pocm@[EMAIL PROTECTED] (  2008-04-16 22:30:21 
Re: Bootstraping compilers ?
Chris Hills <chris@[EM  2008-04-18 11:45:12 
Re: Bootstraping compilers ?
pocm@[EMAIL PROTECTED] (  2008-04-22 00:07:22 
Re: Bootstraping compilers ?
David Spencer <spencer  2008-04-22 16:05:51 
Re: Bootstraping compilers ?
Hans-Peter Diettrich <  2008-04-22 20:07:33 
Re: Bootstraping compilers ?
=?ISO-8859-1?Q?Roland_Lei  2008-04-18 07:32:18 
Re: Bootstraping compilers ?
Marco van de Voort <ma  2008-04-18 19:32:59 
Re: Bootstraping compilers ?
"Damian Thomas"  2008-04-18 08:46:51 
Re: Bootstraping compilers ?
Marco van de Voort <ma  2008-04-18 19:38:29 
Re: Bootstraping compilers ?
"Christopher Glaeser  2008-04-19 23:42:06 
Re: Bootstraping compilers ?
Greg Lindahl <lindahl@  2008-04-18 14:13:55 
Re: Bootstraping compilers ?
torbenm@[EMAIL PROTECTED]  2008-04-21 10:35:52 
Re: Bootstraping compilers ?
Hans-Peter Diettrich <  2008-04-21 20:22:33 
Re: Bootstraping compilers ?
glen herrmannsfeldt <g  2008-04-21 21:18:53 
Re: Bootstraping compilers ?
glen herrmannsfeldt <g  2008-04-23 00:47:23 
Re: Fortran H, was Bootstraping compilers ?
"Comp.compilers"  2008-04-23 21:15:42 
Re: Fortran H, was Bootstraping compilers ?
=?ISO-8859-1?Q?J=FCrgen_K  2008-04-24 17:59:13 
Re: Fortran H, was Bootstraping compilers ?
glen herrmannsfeldt <g  2008-04-25 12:57:11 
Re: Fortran H, was Bootstraping compilers ?
glen herrmannsfeldt <g  2008-04-24 10:07:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 7:56:42 CDT 2008.