r/programming • u/BadMoonRosin • Oct 21 '17
Using Java 9 Modularization to Ship Zero-Dependency Native Apps
https://steveperkins.com/using-java-9-modularization-to-ship-zero-dependency-native-apps#.Wes5IMWbUWE.reddit
310
Upvotes
r/programming • u/BadMoonRosin • Oct 21 '17
3
u/pron98 Oct 22 '17 edited Oct 22 '17
OK. The software I use most on a daily basis is an OS, a browser, editors with plugins (some entirely written in JS), and an IDE, all heavily rely on runtime interpretation/compilation, and that's before we even get to my phone, where all apps are written mostly in Java (and compiled on installation to save energy).
First, I did not claim that Java is as fast as C, I just said the processor ends up running a stream of native instructions, just as it does when running a program written in C. Second, the reason Java is slower in some cases has absolutely nothing to do with the JIT (which only contributes to warmup time). It mostly has to do with memory layout, and to a lesser extent with GC. What you mention regarding Javascript is similar. None of this has anything to do with being native or not. I'm sure you'd agree that Java is faster than other languages that don't compile at runtime, but may also rely on a GC etc. It is possible to compile even Javascript AOT, yet the resulting "native" code would be much slower than the JITted one, because JITs produce better code in general, and much better code when the language is as dynamic as JS.