| ▲ | java-man 3 hours ago | |||||||
I hope at some point we'll get AOT-only mode (or compile to native) and maybe even cross-compilation. | ||||||||
| ▲ | layer8 an hour ago | parent | next [-] | |||||||
That would place significant limitations on the applications that can be compiled. As the JEP explains: “Features such as dynamic class loading, dynamic linkage, dynamic dispatch, and dynamic reflection bring vast expressive power, and have been fundamental to the platform's success. HotSpot handles these features naturally, while static compilers struggle with them. Even heroic amounts of static analysis cannot make up for the fact that these features require many decisions to be made at run time. Implementors of static compilers for Java code have therefore resorted to incompatible constraints, such as closed-world assumptions, and to putting significant burdens on developers, such as having to identify in advance the classes eligible for reflection.” Therefore I don’t see AOT-only becoming an integral part of standard Java in the foreseeable future. | ||||||||
| ||||||||
| ▲ | nirvdrum 2 hours ago | parent | prev | next [-] | |||||||
If you haven't checked it out yet, GraalVM's Native Image [1] already let's do AOT compilation suitable for distribution. You have to do some configuration to deal with reflection and dynamic class loading since there's no JVM in the produced build, but it comes with tooling to simplify that. And that restriction is being addressed by Project Crema [2]. [1] -- https://www.graalvm.org/latest/reference-manual/native-image... [2] -- https://github.com/oracle/graal/issues/11327 | ||||||||
| ||||||||
| ▲ | exabrial 2 hours ago | parent | prev | next [-] | |||||||
progress, not perfection! Java is on fire right now with new stuff landing. We'll get there! | ||||||||
| ▲ | invalidname 2 hours ago | parent | prev [-] | |||||||
We have that in Codename One, yes it's not really "Java" but it compiles bytecode AOT and cross compiles to some of the platforms. | ||||||||