News for hackers. Stuff that matters.
Re:What on earth possessed me... (2008) by WalterBright on Wednesday August 30, 2017 @09:04PM (#15137373)
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.)

Re:What on earth possessed me... (2008) by donw on Wednesday August 30, 2017 @09:57PM (#15137586)
The 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.

Re:What on earth possessed me... (2008) by pjmlp on Thursday August 31, 2017 @07:49AM (#15139629)
> 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.

Re:What on earth possessed me... (2008) by le-mark on Thursday August 31, 2017 @10:13AM (#15140431)
Indeed, 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.
Re:What on earth possessed me... (2008) by gumby on Wednesday August 30, 2017 @09:30PM (#15137470)
Indeed, gcc recently nuked its support for this due to lack of interest (by users or maintainers).
Re:What on earth possessed me... (2008) by pjmlp on Thursday August 31, 2017 @07:51AM (#15139635)
That 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.

Re:What on earth possessed me... (2008) by le-mark on Thursday August 31, 2017 @10:18AM (#15140469)
@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.
Re:What on earth possessed me... (2008) by WalterBright on Thursday August 31, 2017 @02:36PM (#15142666)
From the AST.

The trouble with a native compiler is dealing with dynamic class loading.

Re:What on earth possessed me... (2008) by le-mark on Thursday August 31, 2017 @03:12PM (#15142938)
Yeah, I'd leave that out if I were doing it :) otherwise you pretty much have to include an interpreter as well.
Re:What on earth possessed me... (2008) by WalterBright on Thursday August 31, 2017 @03:51PM (#15143319)
Including 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.

Re:What on earth possessed me... (2008) by hinkley on Thursday August 31, 2017 @12:28AM (#15138165)
https://www.aicas.com/cms/en/JamaicaVM

There are/were a couple others, but the customer base is very... exclusive

Re:What on earth possessed me... (2008) by thesmallestcat on Wednesday August 30, 2017 @09:28PM (#15137466)
Did he say what he needed it for, or was it a vague aspiration?