News for hackers. Stuff that matters.
Re:Compiling Java into Native Binaries with Graal and Mill by pjmlp on Tuesday February 04, 2025 @02:48AM (#42929382)
This has been a solved problem since Exclesior JET in the 2000's, via agents and PGO, nowadays sadly gone because they no longer can compete with free beer GrallVM and OpenJ9.

https://en.wikipedia.org/wiki/Excelsior_JET

Also ART takes the best of both worlds, as they quickly learned the best is to have JIT/AOT compiler collaborating, thus AOT gets all the reflection related info from the JIT, or Play Store Baseline Profiles and has all it needs to produce a proper AOT binary with the relevant execution flows.

To note that Java and .NET to some extent are catching up to Eiffel, Oberon, Smalltalk and Common Lisp toolchains, of a mix JIT/AOT, while inovating on their own ways as well.

Re:Compiling Java into Native Binaries with Graal and Mill by hn8726 on Tuesday February 04, 2025 @03:51AM (#42929880)
I think https://openjdk.org/jeps/8335368 and https://openjdk.org/jeps/8325147 are two recent JEPs that try to introduce something similar to Google's baseline profiles
Re:Compiling Java into Native Binaries with Graal and Mill by pjmlp on Tuesday February 04, 2025 @05:42AM (#42930734)
Yes, and catch up to OpenJ9 features as well.

https://eclipse.dev/openj9/docs/shrc/#aot-code-and-jit-data

Re:Compiling Java into Native Binaries with Graal and Mill by sgammon on Tuesday February 04, 2025 @05:59AM (#42930846)
GraalVM also has an agent for Gradle and Maven which can do this.
Re:Compiling Java into Native Binaries with Graal and Mill by doikor on Tuesday February 04, 2025 @07:02AM (#42931283)
It is just a normal java agent and works with any jvm app. As in "java -agentlib:... -jar app.jar"

But you do need to start/run your app once to get the agent to do its stuff.

https://www.graalvm.org/latest/reference-manual/native-image...

(it is part of the graalvm so use that as your jvm to do this)

Re:Compiling Java into Native Binaries with Graal and Mill by pjmlp on Tuesday February 04, 2025 @06:10AM (#42930925)
Indeed.
Re:Compiling Java into Native Binaries with Graal and Mill by SamInTheShell on Tuesday February 04, 2025 @07:33AM (#42931521)
I think you misunderstand the free beer quote because those tools are free as in freedom not as free beer.

Competing looks like starting with what other people are already doing and making it better.

Re:Compiling Java into Native Binaries with Graal and Mill by lmz on Tuesday February 04, 2025 @07:49AM (#42931682)
The free beer angle is more relevant because obviously their previous users were OK with paying for non-libre software.