Related articles |
---|
Contemplating writing first compiler... comments please. mch24@harvey27.demon.co.uk (1997-06-30) |
Re: Contemplating writing first compiler... comments please. gelleric@kafka.informatik.uni-stuttgart.de (1997-07-04) |
Re: Contemplating writing first compiler... comments please. cdw10@cix.compulink.co.uk (1997-07-08) |
Re: Contemplating writing first compiler... comments please. mrm1@msm.cam.ac.uk (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. pardo@cs.washington.edu (1997-07-29) |
Re: Contemplating writing first compiler... comments please. anton@mips.complang.tuwien.ac.at (1997-08-09) |
From: | cdw10@cix.compulink.co.uk (\"C Wright\") |
Newsgroups: | comp.compilers |
Date: | 8 Jul 1997 00:31:03 -0400 |
Organization: | Datawave Technology Ltd. |
References: | 97-06-113 |
Keywords: | design, practice |
it was written by mch24@harvey27.demon.co.uk (Martin Harvey) :
> This led me on to think about writing a compiler.
> ... have decided that Modula-3 would be a good choice.
(snip)
> 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.
(snip)
> 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
comp.compilers page.
Search the
comp.compilers archives again.