Which Java compiler for a student/research project?

I'm looking for a java compiler (source code) that is easy to understand and extend. Performance or full coverage of the language are not really relevant, as long as it's robust and realistic. Source code should be in ML or Java. Are there any canonical compiler for that kind of things?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


You might want to take a look at this:
Fjavac. I've never used it my self though.

eclipse compiler

i cannot speak from experience, but i recently stumbled over this link that states that the compiler shipped with eclipse is a good platform for compiler-extensions. it is implemented in java and tried with robust extensions like aspectj.

Eclipse Java Compiler

GCC 4.3 will use a modified version of the Eclipse compiler.

I remember thinking Polyglot

I remember thinking Polyglot was interesting, but I never got the chance to try it out myself.

Where to start...

From my superfical use of Polyglot, I do find it interesting as a frontend or source-to-source compiler. Also, there's Soot, a bytecode optimization framework. If you want a parser, there's CUP+JFlex or SableCC.

These are all various research projects to make a framework out of some component of the compiler. There are other options, I'm sure. It really depends on what you want to do.


Polyglot is really nice. The best thing about it is that it tends to use many small passes, so the code is very clear and extensible. The abc AspectJ compiler is a success story, though there are (unpublished) others. Some of the KSU verification guys where using it to prototype a Java-to-transition-system compiler, with good results.


My friend wrote JoeQ, which they use at Stanford for teaching:


As an example of stuff he's done with it, he made a scalable, programmable, context-sensitive program analysis framework: