←back to thread

Java Hello World, LLVM Edition

(www.javaadvent.com)
200 points ingve | 7 comments | | HN request time: 0s | source | bottom
Show context
zkmon ◴[] No.46181500[source]
What's wrong with using the standard JDK for Java code?
replies(1): >>46181596 #
1. throwaway150 ◴[] No.46181596[source]
Nothing wrong with it. Why would you assume the author is in anyway hinting that there's something wrong with using the standard JDK for Java code?
replies(1): >>46181679 #
2. zkmon ◴[] No.46181679[source]
Ok. Let me ask differently. Why would I download and use LLVM for working with java code? Which usecases favor this?
replies(5): >>46181704 #>>46181810 #>>46182040 #>>46182173 #>>46182184 #
3. drzaiusx11 ◴[] No.46181704[source]
This is interop glue to cross language boundaries in the JVM without the problems that come with JNI. The natural goal/use-case being that you can call pre-existing code in other languages that target LLVM IR.
4. TazeTSchnitzel ◴[] No.46181810[source]
That's not what the article is about.
5. connicpu ◴[] No.46182040[source]
The article is presenting something different entirely. This is the precursor to what it would take to create a compiler written in java that produces native code.
6. mands ◴[] No.46182173[source]
It's more an fun educational overview of the new FFM API.

I can't think of many actual use-cases where you'd want to use the LLVM JIT over those built-in to HotSpot.

Interfacing with existing LLVM-based systems, writing a very tight inner loop using LLVM where you absolutely need LLVM-like performance, or creating a compiler that targets LLVM using Java would be the main "real-world" use-cases.

7. almostgotcaught ◴[] No.46182184[source]
"why would I use a frying pan when I can use a flashlight"

The two things have nothing to do with each other.