5 ms·
Java was originally designed to run on set top boxes that had a wide variety of chips in them, and which loaded code on the fly from disks or over the air trans
by mike_hearn 10y ago
Java was originally designed to run on set top boxes that had a wide variety of chips in them, and which loaded code on the fly from disks or over the air transmissions I think. Such boxes may not have even had much in the way of persistent storage, so I can see how they ended up with that design. Then they started down the speculative opts-with-deopt route and I guess the rest is history.
Java 9 does have an AOT compiler, at least for Linux (they're using the platform native DLL formats unfortunately so the AOT compiler tool has to be manually ported to each platform). Unfortunately it isn't just saving the compiled hotspots. They compile everything without speculative opts and then you can make it re-JIT on the fly from native->native.
- pjmlp 10y agoEiffel, Oberon and LISP are three examples of programming languages whose toolchains offered JIT and AOT compilation models depending on the use case being targeted, all of them before Java was even a thought. I am fully aware of Java 9 AOT compiler, including the facts that not only it is just for x64 Linux, it just supports compiling the java.base module and the result isn't distributable. However all commercial third party JDKs that didn't suffer from Sun's dogmatic war against AOT compilation, do support fully compiling Java into native code ahead of time. Sure Java 10 is supposed to make everything better, including supporting value types, which the above mentioned languages also supported by the time Java was designed, yet that is something that is still like 5 years away or even more.