3 ms·
Interesting question - I hadn't thought about compiling the JVM bytecode to machine code. It looks like there is a Java frontend for LLVM that achieves that: h
by binarynate 9y ago
Interesting question - I hadn't thought about compiling the JVM bytecode to machine code. It looks like there is a Java frontend for LLVM that achieves that:
https://llvm.org/svn/llvm-project/java/trunk/docs/java-frontend.txt https://llvm.org/svn/llvm-project/java/trunk/docs/java-front...
One of the things that appeals to me about Scala Native is its interoperability with C, which I suspect is something that the LLVM Java frontend doesn't provide.
- nerdponx 9y agoDoesn't the JVM have some kind of native FFI?
- binarynate 9y agoI suspect the built-in Java Native Interface (JNI) won't work when compiling bytecode to native code, since the JNI methods require a pointer to the JVM (passing a pointer to the JVM to C functions or calling methods on the JVM class in C++). Perhaps an FFI library like this could work, though: https://github.com/jnr/jnr-ffi https://github.com/jnr/jnr-ffi .