[Mono-list] Hello all
Miguel de Icaza
02 Oct 2001 12:46:54 -0400
> - You guys are building your own compiler for C#. If you are not
> going to extend GCC, are you going to go on and build compilers for
> all the other languages?
Ximian is commited to developing a C# compiler.
Rafael has started work on Visual Basic and we are merging that too.
There is work on an ECMA Script compiler.
> - Did you really check out GCC a lot, or is this more a "fun"
> project, not a "this will last for decades" project like gcc?
I was discussing a few weeks ago with Sergey (yes, the super hacker
Sergey) about this.
With CIL-based languages, there is so much optimizations that a
compiler can do, because it is limited to perform optimizations that
are done before the intermediate representation is available.
Since we need to generate CIL, that puts a boundary on the
optimization work that you can do in the compiler.
The clear split between the language, the intermediate representation
and the target system is very interesting, because the intermediate
language is very well documented for both the generator and the
consumer of it.
Most of the traditional optimizations that gcc performs are done on
its "intermediate" language.
You could write a gcc front-end that takes CIL images as input and
generates native code.
Something that we are considering at Ximian to do after the JIT engine
is finished is to support ahead of time compilation of CIL images
using the same engine.
The first pass would just be targeted towards reducing startup time
and JIT time. A second pass at the problem would perform traditional
compiler optimizations (procedure inlining, array access optimization
(I forget the technical term for this), a better register allocator,
various peeophole optimizations and a few others.
Some optimizations can be performed on the intermediate
representation, some others need to be performed on lower level
representations. The optimizations on the intermediate representation
can probably be shared across architectures, the others are unlikely.
> - Is the compiler going to be always hand-crafted? Or based on a
> yacc/whatever parser-generator?
The Mono C# compiler uses yacc as its parser.