|How does a language compile itself? email@example.com (J KILLEA) (1997-05-17)|
|Re: How does a language compile itself? firstname.lastname@example.org (Dwight VandenBerghe) (1997-05-22)|
|Re: How does a language compile itself? email@example.com (1997-05-22)|
|Re: How does a language compile itself? firstname.lastname@example.org (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? email@example.com (Cliff Click) (1997-06-02)|
|Re: How does a language compile itself? firstname.lastname@example.org (1997-06-04)|
|From:||email@example.com (Mark Hopkins)|
|Date:||4 Jun 1997 22:53:28 -0400|
>From firstname.lastname@example.org (J KILLEA):
> At the "java.sun.com" Web site I noted the statement that the compiler
> for Oak (now evolved into Java) was written in Oak. Not being a CS
> person, I do not understand how this can be...
>From email@example.com (Dwight VandenBerghe):
> It's one of the great joys of programming; you really have to try it
> to understand. Here's the idea. You come up with the simplest, most
> bone-head version of the language that is actually useful, and then
> you write the first version of the compiler in that language...
> and you hand-translate your program into, say, C.
I'm not sure this is the best way to go through the process. There's too
many things that can go wrong, and not enough opportunity to actually test
the design of the language you're compiling to.
A better way is to first test the language design by writing an interpreter
for it (in C or some other existing language). Once you have everything
worked out and you're satisfied with the results, then you can write a
compiler for the language in the language, itself, and then interpret the
compiler compiling itself. The resulting output will be the executable for
the compiler you wrote.
You can test it by compiling the compiler with that executable and comparing
the result to what you got when you used the interpreter.
Return to the
Search the comp.compilers archives again.