Live data from Hacker News

Scala Native with Denys Shabalin – Software Engineering Daily Podcast

softwareengineeringdaily.com

41–42 of 42 posts

Re: Scala Native with Denys Shabalin – Software Engineering Daily Podcast

#41
post #6

Why would you compile Scala natively itself instead of compiling JVM bytecode?

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-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.

Doesn't the JVM have some kind of native FFI?

Re: Scala Native with Denys Shabalin – Software Engineering Daily Podcast

#42

Earlier quoted context omitted.

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-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.

Doesn't the JVM have some kind of native FFI?

I 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 .
Post reply on HN