5 ms·
Dunno if I'd call Java native. This is more like zero-dependecy Java apps — aka, you don't need to pre-install the JVM (and its "optional" adware on Windows).
by adamzegelin 9y ago
Dunno if I'd call Java native. This is more like zero-dependecy Java apps — aka, you don't need to pre-install the JVM (and its "optional" adware on Windows).
- SwellJoe 9y agoDoes that mean Go apps aren't native since they also have a runtime embedded? What defines "native"?
- chrisseaton 9y ago> What defines "native"? I think it's reasonable to say that if the the user code is transmitted as a managed intermediate representation then it's not native. Arguing beyond that probably isn't productive. But that's this particular blog post. Java can be native, if you compiled all the user code to machine code ahead of time.
- saghm 9y agoIf the VM is shipped as native code and the app is bundled with it as "code" that runs on the VM, is that fundamentally different from shipping an app written in compiled-to-machine code that bundles some data (JSON, XML, a SQLite database, etc.)? It definitely "feels" different, but I'm not convinced that the former is not "native" just because more of the logic is in the data rather than the machine code.
- SwellJoe 9y agoSo, anything that uses a JIT, such as the LLVM JIT, is not "native"? Are programs written in C# not native, even on Windows? Are programs in Java for Android not native, even though it is the language much of the OS is written in and what the standard UI toolkit is built for? Seems like lots of projects are likely to become non-native over time, by this definition, even if they start out "native" with a basic C/C++ codebase, since lots of projects accrete some sort of scripting or extension interface that might use a runtime of some sort. Is Emacs not native? Does it really matter if the runtime (which is machine code) was made by the compiler developer or by the application developer in some cases? I feel like there's an arbitrary line, and it's not entirely useful distinction to make. A native app can be big and slow and ugly and fail to follow the OS UI guideliness. An app with a runtime can be small(ish) and fast and beautiful and strictly adhere to the UI guidelines for the OS in question. I want the small, fast, beautiful, app with standard UI behavior, no matter whether it's delivered with a runtime embedded or built from C/C++ (and a few others) and without a JIT. I mean, we're just arguing semantics here, which is kinda silly. I think it's pretty neat; I don't really like working in Java, but I'd rather work in Java than C/C++, so if I needed to deliver a cross-platform GUI app, I'd certainly consider it.
- dullgiulio 9y agoLLVM IR is transformed into native code only once. You don't ship the assembler to your users for a C program. Of course the JVM has advantages that it can dynamically optimize code according to actual execution profiles. If I am not mistaken with the right instrumentation LLVM can also makw your program generate a special optimization profile which you can then apply to your final build compilation.
- chrisseaton 9y ago> Are programs written in C# not native, even on Windows? Well I think that's a different meaning of the word 'native'. They're native in terms of being written using the recommended techniques for that platform, but not native in terms of being natively compiled. But as you say it's just a discussion of semantics.
- igravious 9y ago> So, anything that uses a JIT, such as the LLVM JIT, is not "native"? Correct. > Are programs written in C# not native, even on Windows? No they are not, because .Net uses an intermediate representation, being Windows and Microsoft confers no magic "native"-ness. > Are programs in Java for Android not native, even though it is the language much of the OS is written in and what the standard UI toolkit is built for? Programs in Java for Android are not native. Much of the kernel (Linux) is written in C. According to "Francesco Iovine, AndroidStudio lover" over at Quora[0] the UI toolkit is written in Java and the virtual machines (Dalvik and Art) are written in C++. > Is Emacs not native? Emacs is a strange and evil beast whose name we shall not invoke. No, but seriously – I imagine Emacs is a hybrid native / Emacs lisp program. Many programs with embedded scripting languages are hybrid beasts but they ought to be thought of as native apps if they are compiled for a certain bare metal hardware platform. I presume the core of Emacs is C. Ergo, native. > Does it really matter if the runtime (which is machine code) was made by the compiler developer or by the application developer in some cases? Yes, I believe it does matter. > I feel like there's an arbitrary line, and it's not entirely useful distinction to make. No, I don't believe it's arbitrary. > A native app can be big and slow and ugly and fail to follow the OS UI guideliness. An app with a runtime can be small(ish) and fast and beautiful and strictly adhere to the UI guidelines for the OS in question. I want the small, fast, beautiful, app with standard UI behavior, no matter whether it's delivered with a runtime embedded or built from C/C++ (and a few others) and without a JIT. True. But that is neither here nor there, that's a whole other issue. > I mean, we're just arguing semantics here, which is kinda silly. No, we are not. A native app is one which is either hand-crafted assembly for a specific hardware platform or compiled ahead of time targeting a specific platform. Native code is non-portable, the source code might be portable, but generally is not unless care is taken. Assembly code is never portable. Non-native (whether by VM: Java, C#, … or interpreted: Ruby, Python, …) tends to be more portable. [0] https://www.quora.com/What-programming-language(s)-is-Android-written-in https://www.quora.com/What-programming-language(s)-is-Androi...
- kuschku 9y ago> But that's this particular blog post. Java can be native, if you compiled all the user code to machine code ahead of time. Which the method described in this particular blog post is going to support very soon – today you still need to invoke subtratevm or jaotc separately.
- averagewall 9y agoNative used to mean machine code for the hardware but there's so little of that nowadays that I think people often use it to mean anything that's more tied to one platform than a web app so it's a bit ambiguous.
- userbinator 9y agoTo be more precise, smaller zero-dependency Java apps --- the practice of bundling the app.jar with a JVM, into one file you can download, unzip, and run immediately, has been around for probably as long as Java itself.