Re: Compilers and using gcc as part of the compiler

"Joachim Durchholz" <joachim_d@gmx.de>
18 Aug 2001 00:41:21 -0400

          From comp.compilers

Related articles
Compilers and using gcc as part of the compiler nicholas.king@studentmail.newcastle.edu.au (Nicholas King) (2001-08-15)
Re: Compilers and using gcc as part of the compiler fjh@cs.mu.OZ.AU (2001-08-16)
Re: Compilers and using gcc as part of the compiler axel@dtone.org (Axel Kittenberger) (2001-08-17)
Re: Compilers and using gcc as part of the compiler joachim_d@gmx.de (Joachim Durchholz) (2001-08-18)
| List of all articles for this month |

From: "Joachim Durchholz" <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 18 Aug 2001 00:41:21 -0400
Organization: Compilers Central
References: 01-08-071 01-08-086
Keywords: C
Posted-Date: 18 Aug 2001 00:41:20 EDT

Fergus Henderson <fjh@cs.mu.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
http://www.cminusminus.org .)


Regards,
Joachim


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.