r/programming • • 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

109 comments sorted by

View all comments

Show parent comments

68

u/BadMoonRosin Oct 21 '17 edited Oct 21 '17

Yup... it's a good discussion topic, and I definitely wrestled with the phrasing. Having studied Pascal back in university, and starting out my career as a C++ dev, I too have always thought of "native" as being "a standalone executable".

However, I would run into issues when playing with cross-platform GUI libraries such as wxWidgets, GTK, or Qt. I always wanted to compile my apps down to a statically linked, standalone executable. I didn't want to have to ship a bunch of shared libs, or depend on them being present on the target machines! Yet more knowledgeable developers would calmly try to explain to me that dynamic linking is often technically superior (or with Qt, necessary due to licensing).

Also, last year I went to a Java conference and sat through a few sessions on profiling and JVM tuning. It was a lightbulb moment, that left me considering the possibility that a runtime VM with a JIT compiler really IS a technically superior approach over full AOT compilation.

So anyway, if you're having to ship to tens of megs of dynamically linked libraries with your "native" app... then is it really THAT far removed from an app that's linked to an embedded runtime? I'm not so sure. And I would strongly argue that you have no less claim to the "native" label than Electron has.

2

u/SizzlingVortex Oct 21 '17 edited Oct 21 '17

Yup... it's a good discussion topic, and I definitely wrestled with the phrasing.

I agree with calling it native. In today's world it's pretty much embedded web browser (web-hybrid) apps vs everything else. I realize I'm speaking "generally" here, but I'm specifically comparing embedded web browser apps vs non-embedded web browser apps. For example, IntelliJ IDEA (which requires the JDK -- be it the bundled one or one that already exists on your computer), I think most users would call this IDE "native" when compared to Electron. However, if I was comparing IntelliJ against an app that compiled down to native code, that didn't need a runtime environment, then I would make the distinction that the app that doesn't require a runtime is the "native" app.

Edit: To the downvoter(s), I'm interested in knowing what you disagree with.

11

u/meschbach Oct 21 '17

I didn't down vote but I was tempted too. As an experienced Java developer when I read the term "native" it initially lead me to believe the program was in object code of the target processor, not in byte code. Not a a pure Java application. The article makes it sound as though a native executable has byte code embedded within the image.

1

u/zanotam Oct 22 '17

Eh, I read a good argument elsewhere in this thread that basically came down to reviewing the standard definition using the concept of S-expressions. If code is data then you can't distinguish between the 'obvious' example of code interpreting data structures and code interpreting other code.