[Mono-list] Java compiler for .NET
Thu, 17 Apr 2003 20:54:49 +0530
> thought I could write my thesis on the java to IL compiler, and
> contribute something back to the open source community as well. Before I
> begin researching into it and proposing the project to my thesis
> advisor, I am wondering if anyone has started working on this project
> yet? Please advise. Let me know. Thanks.
I'm one of the developers of the DotGNU (dotgnu.org) project and have
been working on an IL compiler for Java for the past 3 months as part
of (surprise !) graduate project & thesis . I have 90% of the compiler
complete and have written the Object,Exception and String classes for
java as well as compiling the Integer class from the GNU classpath.
I am the guy who wrote all the JVM bytecode loading routines for JILC ,
but the rest of the project didn't quite make it. (ie, the loading works
, but conversion does not). Anyway having failed there , I picked up
the Java source to IL compiler.
My compiler supports a lot of things like nested classes , virtual
functions & overriding etc.. So you might want a look at that . It
compiles some things gcj does not [WierdDecl.java in gcj testsuite].
But it needs more testing . I have no idea if the unicode handling
is right etc..
It is a patch for pnet-0.5.4 and somewhere in dotgnu.org Developers mailing
list , there are instructions for it as well. Due to the limited time
the class library is practically non-existent , but the compiler is
90% done with anonymous inner classes being the largest missing component,
followed by synchronized methods (and lots of little peices here and there).
It will hit CVS within 2 weeks as soon as I cleanup code , write some
regression tests etc. I want to make the frontend to be truly backend
independent by allowing to produce JVM code from Java as well.
On a personal benchmark set against a jdk1.2.2 blackdown port , the cscc
was 4 times faster than Sun's javac . But all credit for that goes to the
Portable.net Guru :-) , it's his Red Black Trees , aspect oriented tools
and string handling funcs that speeds up the compiler.
If you still want to move on with the java compiler for Mono , I think
my code (especially the parser) will prove very helpful. But IMHO, MCS
was not designed to be reused , built as a monolithic single executable.
That might be your biggest problem , that is forking code off MCS into
a seperate directory . MBAS is an example where the entire backend had
to be copied out to be used.
PS: sorry for being late on this thread , I'm off mono-list and
was forwarded this by someone on it.
The difference between insanity and genius is measured by success