Hi, I'm interested in using LLVM to run source languages supported by GCC (mostly just C and Fortran, actually) on a JVM. There seem to be two general ways this could be accomplished. 1. LLVM bytecodes could be compiled to JVM bytecodes 2. LLVM bytecodes could be interpreted by a program running on a JVM Has anybody started work in either direction? Has anyone started work on anything similar, like compiling to CLR or writing a LLVM interpreter in C#? Thanks, Curt
On Feb 28, 2005, at 19:16, Curt Cox wrote:> I'm interested in using LLVM to run source languages supported by GCC > (mostly just C and Fortran, actually) on a JVM. There seem to be two > general ways this could be accomplished.Here is a better way to do this. At least, I think it is better, mostly because someone else has already done all the work: http://www.xwt.org/mips2java/ This program runs statically linked MIPS R2000 binaries on the JVM via binary -> source translation. Does this solve the problem that you are interested in, or are you interested in running LLVM code directly on the JVM for some reason other than executing C/Fortran programs on the JVM? Evan Jones
Mips2Java solves the same problem. The latest version of Mips2Java is called NestedVM and is part of the larger Vexi project. Much work has been done on NestedVM and it is quite impressive. http://wiki.vexi.org/ Still, it could use a lot of improvement. It's biggest immediate problems are: 1) It doesn't integrate well into a standard (Ant-based) Java build 2) There is no documented support for JNI It would obviously be quicker to fix these problems with NestedVM than to get LLVM to the same point (in terms of JVM support) that NestedVM is now. Once that point is reached, the remainder of the effort would be almost exclusively optimization. LLVM would seem to provide a better base for optimizing the runtime. If LLVM binaries can soon be made to run more quickly than NestedVM binaries, it would be a positive affirmation of the principles of LLVM. Perhaps the MIPS instruction set is really better suited for running C/Fortran binaries on a JVM. Given the design goals of LLVM, it doesn't seem likely. - Curt