|Compilers and using gcc as part of the compiler firstname.lastname@example.org (Nicholas King) (2001-08-15)|
|Re: Compilers and using gcc as part of the compiler email@example.com.OZ.AU (2001-08-16)|
|Re: Compilers and using gcc as part of the compiler firstname.lastname@example.org (Axel Kittenberger) (2001-08-17)|
|Re: Compilers and using gcc as part of the compiler email@example.com (Joachim Durchholz) (2001-08-18)|
|From:||"Joachim Durchholz" <firstname.lastname@example.org>|
|Date:||18 Aug 2001 00:41:21 -0400|
|Posted-Date:||18 Aug 2001 00:41:20 EDT|
Fergus Henderson <email@example.com.OZ.AU> wrote:
> >[I'd compile to C and then use GCC to compile the C code. -John]
> The moderator's advice is good. Even if you do decide to implement
> your own compiler and interface to the back-end, your compiler will be
> much easier to debug if you first generate C code, and only try
> interfacing directly with the GCC back-end once the C code works. But
> you should also consider compiling to C++ or Java if they are a better
> match for your source language.
This is all true, however C has its drawbacks as well. Some examples:
It's difficult to go beyond C's idea of what an integer is, and the
size variations in integer types don't help much with that
either. Doesn't sound like an earth-shattering problem, and indeed
isn't one until the language comes into actual use, but it can become
a real show-stopper (it certainly has become that for Eiffel).
Then there's the usual problem that the debugger will display the
generated C code, not that of the HLL. One *can* work around this
problem, but it ain't easy.
Etc. etc. - there are many problems, most can be solved one or the
other way, but it will take effort and time. It's a great way to get a
compiler up and running quickly, you should just take into account
that the path isn't effortless or painless. It's still one of the best
paths available (but other paths are being worked on, see e.g. C-- at
Return to the
Search the comp.compilers archives again.