chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Which came first, the chicken or the egg?


From: John Cowan
Subject: Re: [Chicken-users] Which came first, the chicken or the egg?
Date: Tue, 28 Mar 2006 07:55:41 -0500
User-agent: Mutt/1.3.28i

Brandon J. Van Every scripsit:

> So, I'm contemplating bootstrapping.  If you didn't have a chicken 
> compiler already, how would you bootstrap?  

You wouldn't, but that almost certainly is not what happened.  Felix
probably wrote an early version of chicken and ran it on some other
Scheme -- it's not like he was devising the language from scratch.

Back in the early 70s, though, I was helping to write a compiler that did
have to be bootstrapped from zero: no other implementation available,
and not even a reasonable high-level language to use, only assembler.
We decided on a JVM-style design, designed a bytecode (really "wordcode")
architecture, and wrote a VM in assembler.

Then we wrote the compiler in its own language and hand-translated it
into wordcode with some assistance from a general-purpose macro package
in the spirit of m4 that generated labels for us so we could write
if-then-else-fi codes instead of gotos (and ditto for loops).

We next made a version of the assembler with redefined tables so it
would assemble the wordcode instead of machine instructions, and then
assembled the wordcode and linked the wordcode and VM together.

That first compiler was said to work when it could compile its original
source code and produce a compiler which could likewise compile its
original source code with identical results.

We then made changes to the language in a series of bootstrap steps:
the "old compiler" at each stage would be modified to accept the new
language feature, creating the "intermediate compiler".  When that was
debugged, we modified it to take advantage of the new feature, creating
the "new compiler".  Eventually we stopped using the modified assembler
and had the compiler generate simple core-dumps, which the VM was
modified to understand and load.

As often happens with these efforts, we never got much past writing demos,
and the compiler was the only serious program written in the language....

-- 
With techies, I've generally found              John Cowan
If your arguments lose the first round          http://www.ap.org
    Make it rhyme, make it scan                 http://www.ccil.org/~cowan
    Then you generally can                      address@hidden
Make the same stupid point seem profound!           --Jonathan Robie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]