|Contemplating writing first compiler... comments please. firstname.lastname@example.org (1997-06-30)|
|Re: Contemplating writing first compiler... comments please. email@example.com (1997-07-04)|
|Re: Contemplating writing first compiler... comments please. firstname.lastname@example.org (1997-07-08)|
|Re: Contemplating writing first compiler... comments please. email@example.com (1997-07-21)|
|Re: Contemplating writing first compiler... comments please. HSauro@fssc.demon.co.uk (Herbert M Sauro) (1997-07-22)|
|Re: Contemplating writing first compiler... comments please. firstname.lastname@example.org (1997-07-29)|
|Re: Contemplating writing first compiler... comments please. email@example.com (1997-08-09)|
|From:||firstname.lastname@example.org (\"C Wright\")|
|Date:||8 Jul 1997 00:31:03 -0400|
|Organization:||Datawave Technology Ltd.|
it was written by email@example.com (Martin Harvey) :
> This led me on to think about writing a compiler.
> ... have decided that Modula-3 would be a good choice.
> I'll be ... happy if several (months / years / decades)
> from now I end up with something that self builds and
> produces correct code.... even if it runs slowly.
> I intend to write the compiler in Delphi
Something to consider, and which will by no means be universally
accepted, is that in he first instance you may want to compile to
something other than assembler. You will want to separate several
issues such as building and transforming intermediate representations
from register allocation and instruction choice. By compiling to
something like C, say, you have to solve all the front end problems
without having to worry about some of the equally difficult back-end
problems. More, assuming you choose a target language for which you
have a compiler you will be able to get something running soon,
without having to solve problems like DOS segmentation, lack or
instruction orthogonality, etc.
This is an approach used in the large by several major systems, the
Glasgow Haskell compiler springs to mind. Although they have now
adopted a mixed strategy, it's something like writing in a HLL and
then finding the hot-spots and re-coding them in assembler. You could
target C, say, or BCPL, and then worry about other issues later.
Dr C.D. Wright,
personal opinions only.
[Another possibility is to generate byte codes and then write a little
interpreter to runs them. Worked for UCSD Pascal, works for Java. -John]
Return to the
Search the comp.compilers archives again.