[Mono-list] Re: From one Cyber Wiz to others

Zaphod j0k3rin@yahoo.co.in
Sun, 21 Jul 2002 17:54:44 +0530

On Sun, Jul 21, 2002 at 02:43:27AM -0400, BioChem333 wrote:
> The design of gcc is such that you have to split away from the normal 
> compilation path before it reaches the frontend->rtl process. 

Typically it requires you to take up the work from the parse tree stage
and do the whole semantic analysis/codegen ...

> The gcj execution path splits from the normal gcc path early on for 
> just this reason, and, afaik, still doesn't produce very good
> bytecode.

The point is gcj works only for Java ? (ie does not allow C to be 
compiled to bytecode or so I understand).

> The first is, you can invent an intermediate language like rtl which 
> is designed for stack machines, and redesign gcc (which means rewriting 
> frontends)

Well the egcs-jvm author has said that it was easier developing a Register
based abstract machine than rewriting gcc for outputing JVM code ... (maybe
we'll soon see Parrot output for gcc ... which is a register based engine)

> The translation: you would have to replace most of gcc.

Well there is a definite possibility of somebody doing this :-)

> should consider taking a look at Rhys Weatherly's treecc program; 

This is a tool for operating on tree based languages ... and codegens ...

> It helps to deal with a lot of the complexity of writing compilers 
> (and, considering that pnet is almost as far along as mcs but
> only has one hacker really working on it, it works). 

Well of course , treecc is just a program to autogenerate a lot of code
especially for inheritance and visitor mode operation ... Of course you
still need the dragon book by your side and a good large cup of coffee ..
But it is ideal if you want to rip out the guts of GCC and redo semantic
analysis ... (Rhys Weatherly has mentioned the problems implementing a
CIL output for GCC in his FAQ ... that it was easier doing a C# compiler
in whole ;-)