| ▲ | ck45 5 hours ago | ||||||||||||||||||||||||||||||||||
I never understood why AOT never took off for Java. The write once run anywhere quickly faded as an argument, the number of platforms that a software package needs to support is rather small. | |||||||||||||||||||||||||||||||||||
| ▲ | pjmlp 4 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||
Because developers don't like to pay for tools. https://en.wikipedia.org/wiki/Excelsior_JET https://www.ptc.com/en/products/developer-tools/perc https://www.aicas.com/products-services/jamaicavm/ It is now getting adopted because GraalVM and OpenJ9 are available for free. Also while not being proper Java, Android does AOT since version 5, mixed JIT/AOT since version 7. EDIT: Fixed the sentence regarding Android versions. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | gunnarmorling 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
> I never understood why AOT never took off for Java. GraalVM native images certainly are being adopted, the creation of native binaries via GraalVM is seamlessly integrated into stacks like Quarkus or Spring Boot. One small example would be kcctl, a CLI client for Kafka Connect (https://github.com/kcctl/kcctl/). I guess it boils down to the question of what constitutes "taking off" for you? But it's also not that native images are unambiguously superior to running on the JVM. Build times definitely leave to be desired, not all 3rd party libraries can easily be used, not all GCs are supported, the closed world assumption is not always practical, peak performance may also be better with JIT. So the way I see it, AOT compiled apps are seen as a tactical tool by the Java community currently, utilized when their advantages (e.g. fast start-up) matter. That said, interesting work is happening in OpenJDK's Project Leyden, which aims to move more work to AOT while being less disruptive to the development experience than GraalVM native binaries. Arguably, if you're using CDS, you are using AOT. | |||||||||||||||||||||||||||||||||||
| ▲ | gf000 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||
Well, one aspect is how dynamic the platform is. It simply defaults to an open world where you could just load a class from any source at any time to subclass something, or straight up apply some transformation to classes as they load via instrumentation. And defaults matter, so AOT compilation is not completely trivial (though it's not too bad either with GraalVM's native image, given that the framework you use (if any) supports it). Meanwhile most "AOT-first" languages assume a closed-world where everything "that could ever exist" is already known fully. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| ▲ | xxs 4 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||
dynamic class loading is a major issue, and it's an integral feature. Realistically, there are very few cases that AOT and Java make sense. | |||||||||||||||||||||||||||||||||||