I have created a compiler in C (using lex & bison) for a dynamic typed programming language that supports loops, functions declarations inside functions, recursive calls etc. I also created a virtual machine for that runs the intermediate code created by the compiler.
I was now thinking instead of compiling to my own intermediate code, compile it to java byte code.
I saw that the question about creating a JVM language has already been asked but I don't find the answer very informative.
So here are my questions:
- I guess to create a language for JVM a must is to read the JVM specification book, what other books can you suggest (except Dragon Book of course)? I'm mostly concerned in books or tutorials on how to create a JVM language, not a compiler in general.
- There are many Java libraries to read, write and change .class files like jclasslib, bcel, gnu bytecode, etc. Which one would you suggest? Also, are you aware of C libraries that do the same job?
- I was thinking to have a look at maybe another language that targets the JVM like Clojure, Jython or JRuby. But all these languages are very high level and complicated (to create a compiler for them). I was looking for a simpler (I don't mind it it's unknown or unused) programming language that targets the JVM and it's compiler is open source. Any ideas?