4 ms·
From what I've seen Java/JVM AOT won't produce binary executables but shared libraries that will be loaded on startup by the JVM. When I first read about Java A
by readittwice 9y ago
From what I've seen Java/JVM AOT won't produce binary executables but shared libraries that will be loaded on startup by the JVM.
When I first read about Java AOT-compilation I expected it to produce real executables that's why I think this is important to mention.
But please correct me if I am wrong.
So if this is true even with AOT compilation you still need the JVM as dependency (although I think you can get a minimal JVM in under 10MB).
It also seems that the AOT compiled code needs to be recompiled on Java updates.
Although I quite like Java and the JVM, I still wouldn't choose Java for writing simple command line tools.
Nevertheless it is quite useful for improving startup for tools like Gradle or server applications.
But sure, I also don't expect Java startup performance to be a problem in the mid- to long-run.
- pjmlp 9y agoCorrect, but that is no different than having to ship glibc.so or MSVCRT.dll alongside your application, specially if you want to be certain which version gets used. This is only relevant to Oracle's implementation though. Other JDKs do support static linking, as long as you restrain yourself from features that could require dynamic compilation. There was a talk at JVM Languages Summit about the current state of AOT compilation regarding Java 10. https://www.youtube.com/watch?v=n5DCg6M2MDM&index=11&list=PLX8CzqL3ArzXJ2EGftrmz4SzS6NRr6p2n https://www.youtube.com/watch?v=n5DCg6M2MDM&index=11&list=PL...
- weberc2 9y agoI would rather ship glibc (8MB) or musl (.5MB) than the JVM (100s of MBs?), but it's not necessary given that nearly every target already has a libc. Also, Go programs don't depend on libc, and C and Rust can probably statically link against some libc in a pinch.
- steveklabnik 9y agoRust can use musl, yes.