Re: How does a language compile itself?

dgay@barnowl.CS.Berkeley.EDU (David Gay)
30 May 1997 23:18:34 -0400

          From comp.compilers

Related articles
How does a language compile itself? crp333@worldnet.att.net (J KILLEA) (1997-05-17)
Re: How does a language compile itself? dwight@pentasoft.com (Dwight VandenBerghe) (1997-05-22)
Re: How does a language compile itself? pardo@cs.washington.edu (1997-05-22)
Re: How does a language compile itself? walter@bytecraft.com (Walter Banks) (1997-05-25)
Re: How does a language compile itself? dgay@barnowl.CS.Berkeley.EDU (1997-05-30)
Re: How does a language compile itself? cliffc@risc.sps.mot.com (Cliff Click) (1997-06-02)
Re: How does a language compile itself? mark@omnifest.uwm.edu (1997-06-04)
| List of all articles for this month |
From: dgay@barnowl.CS.Berkeley.EDU (David Gay)
Newsgroups: comp.compilers
Date: 30 May 1997 23:18:34 -0400
Organization: mume
References: 97-05-209
Keywords: practice

J KILLEA <crp333@worldnet.att.net> writes:
      [Summary: how can you write a compiler for X in X ?]


      - Jay Killea
      [It's called bootstrapping. You generally hand-compile a tiny first
      version or do a tiny cross-compiler in some other language, then keep
      feeding improved and expanded version N through version N-1. -John]


This has always sounded like way too much work to me (the N versions
of the compiler and language, that is). Instead when I wrote a
compiler, I started with an interpreter for the language (written in
C), and then wrote the compiler directly in the final language. Not
only does this reduce the bootstrapping effort (an interpreter is
probably easier to write than even the first "tiny" compiler), it also
provides a convenient fallback for when you break the compiler (for
the M'th time...).


I guess this sounds like a good approach for Java, what with all these
interpreters lying around out there...
--
David Gay - Yet Another Starving Grad Student
dgay@cs.berkeley.edu
--


Post a followup to this message

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