[Mono-list] GCC front-end?

Fergus Henderson fjh@cs.mu.oz.au
Thu, 12 Jul 2001 01:50:38 +1000


On 10-Jul-2001, John Zedlewski <zedlwski@Princeton.EDU> wrote:
>   On the roadmap, it seems to imply that y'all are working on a
> completely new "JIT" compiler for the CLI.  I'm curious about why this
> is a better plan than writing a Gcc front-end for CLI bytecode.

I've been seriously thinking about doing that for quite a while now; since
long before Mono was announced.  Technically I think it is a very good idea.

The main drawback, from my perspective, is that doing so would increase
the acceptance of .NET, which would be good for Microsoft, which would
increase world-wide income inequity, and concentrate too much power in
the hands of too few, and that would be bad.

I remember when I first heard of C++; it was from Bell Labs, same place
as C, and it had some nice technical improvements to C.  But it was a
new language, and it didn't have the same degree of vendor support that
C had.  Was it really worth writing code in this new language?
I first became convinced that C++ would become popular when I heard
that there was a GNU C++ implementation.  The existence of a free
software implementation can be quite important to people's decisions
as to whether or not to adopt a particular piece of technology.

> Some old posts from the Mercury folks implied that they were able to do the
> Mercury->gcc interface in under 8,000 LOC.

The GCC-specific parts were under 8,000 LOC.
There's also about 15,000 LOC that accepts 
parse tree from the front-end (already type-checked, etc.)
and converts it into a form which is closer to C.
That 15,000 LOC is also used by other back-ends (C, Java, ...).

A big part of the work in writing a GCC front-end for CLI bytecode is
very similar to the work in writing a CLI decompiler.  Once you've got
something that is roughly C-like, the rest is pretty easy.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.