4 ms·
Reminds me of one day in the 90s I was out jogging with a colleague. He said that what the world needed was a Java compiler that compiled to native code. He nee
by WalterBright 9y ago
Reminds me of one day in the 90s I was out jogging with a colleague. He said that what the world needed was a Java compiler that compiled to native code. He needed one right now, and I should work on it.
I said it was a great idea, and I had already implemented one. He could start using it today.
He promptly lost all interest in it.
(It turns out, on the complex plane the demand for native Java compilers is on the imaginary axis.)
- thesmallestcat 9y agoDid he say what he needed it for, or was it a vague aspiration?
- gumby 9y agoIndeed, gcc recently nuked its support for this due to lack of interest (by users or maintainers).
- pjmlp 9y agoThat only happened, because the majority of GCJ developers left when OpenJDK was announced back in 2009, and almost no one cared about it since then. Companies selling commercial native compilers for Java are still in business since the early days.
- donw 9y agoThe follow-on question to an ask like that is nominally a variation on "So, what would that enable you to do?" From there, I can then start digging into what the real problem is. Maybe it was a desire for greater performance, or easier deployability. Maybe his concern was about protecting intellectual property, and he thought that binaries would be harder to reverse-engineer than bytecode. All of those could be legitimate problems, and none of them would really be solved by a Java-to-native compiler.
- hinkley 9y agohttps://www.aicas.com/cms/en/JamaicaVM https://www.aicas.com/cms/en/JamaicaVM There are/were a couple others, but the customer base is very... exclusive
- pjmlp 9y ago> It turns out, on the complex plane the demand for native Java compilers is on the imaginary axis. Quite the contrary. Excelsion JET, IBM, PTG, Aicas have supported native Java compilers since the early days. Oracle added AOT compilation for Linux x64 to OpenJDK on Java 9, with the remaining platforms being supported later. The Java 10 fork, already has Windows and macOS support as well. The Graal team recently announced the Polyglot VM, which is actually another AOT compiler for Java. The demand for native Java compilers is going quite thanks to Fintech and embedded development.
- le-mark 9y agoIndeed, Excelsior JET is really a fantastic product. It's a really straight forward, low friction way to deploy Java desktop applications. Their commercial license prices have risen precipitously in recent years, indicating they must be doing quite well for themselves. It's been a few years since I was a user, but I was very please with the product.
- le-mark 9y ago@Walter: did you generate code form the AST or from bytecode? Seems like a lot of the solutions around now generate code from the bytecode, my understanding at least.
- WalterBright 9y agoFrom the AST. The trouble with a native compiler is dealing with dynamic class loading.
- le-mark 9y agoYeah, I'd leave that out if I were doing it :) otherwise you pretty much have to include an interpreter as well.
- WalterBright 9y agoIncluding the interpreter, and then the JIT, made a native compiler pointless. But that's all beside the point, which is people will often tell me what they want in a product, but don't actually want it.