5 ms·
> Using Java 9 Modularization to Ship Zero-Dependency Native Apps > [...] > and superior to web-hybrid options like Electron How is Java or Electron (JavaScr
by alfanick 9y ago
> Using Java 9 Modularization to Ship Zero-Dependency Native Apps
> [...]
> and superior to web-hybrid options like Electron
How is Java or Electron (JavaScript+WebKit) considered native nowadays?
Please use native APIs, so my laptop can actually hold 10h load on battery.
edit: can we remove native from the title?
- dang 9y agoWe'll take 'native' out of the title to reduce arguments about 'native'.
- kuschku 9y agoJava can be compiled to a native binary now, thanks to Java 9. No bytecode, interpreter, or JIT left in the resulting file. (Only available for Linux x86_64 right now).
- readittwice 9y agoIf you are talking about Java's AOT feature (JEP 295: http://openjdk.java.net/jeps/295 http://openjdk.java.net/jeps/295) then I don't think it is true AFAICS. The JVM is still needed, Java-Code can be compiled into a shared library but this is "just" a code-cache that can be passed to the JVM when starting the application. This feature is mainly aimed for improving startup.
- kuschku 9y agoI’ll link you the beautiful thing I’m referring to: https://github.com/graalvm/graal/tree/master/substratevm https://github.com/graalvm/graal/tree/master/substratevm
- readittwice 9y agoAh thanks, I got confused because you mentioned Java 9. I really hope Substrate VM or something similar gets into the JDK. Having the option of AOT-compilation or using jlink for bundling would be amazing.
- alfanick 9y agoPlease note that Native binary is not always Native API. Does the app use the most efficient methods provided by operating system? Is the graphical user interface consistent with the other applications on the same system? Is number of syscalls predictable?
- nradov 9y agoThat's really a separate issue. You can make native calls if you want to, but then you lose the benefits of writing high-level cross-platform code. Trade offs.
- alfanick 9y agoThat's exactly what I'm trying to point out here: Please invest some engineering time into native apps instead of cross-platform code.
- nradov 9y agoMost organizations have no spare engineering time to invest in features that customers won't pay for.
- MaxBarraclough 9y agoI'm not sure I follow. You're suggesting Oracle invest resources in Java bindings for Cocoa, Qt, and whatever the flavour of the week is on Windows? That wouldn't make sense. Not only would it go against the Java philosophy of write-once-run-anywhere (Java is very hostile to cosying up to platform-specific frameworks), it would also be a mistake in practical terms - they're right to just keep maintaining JavaFX, which is a perfectly competent GUI framework.
- MaxBarraclough 9y agoToo late to edit: I forgot that Apple maintained official Cocoa-for-Java bindings for a short time, but it wasn't popular, and was deprecated.