3 ms·
Well, I guess I think there are kind of two levels of nativity. Operating System native, i.e. uses API's from the OS directly. But then I think there's also ha
by rnovak 12y ago
Well, I guess I think there are kind of two levels of nativity. Operating System native, i.e. uses API's from the OS directly.
But then I think there's also hardware native, which means the IR that the code gets compiled into executes directly on the hardware.
Both Java and C are compiled into a binary IR (Intermediate Representation), C is executed directly on the CPU (provided it's in the proper format: ELF, etc...), whereas Java is run in a compatibility layer, the JVM, which interprets the IR into native machine instructions.
I don't think Java is hardware native,but it can be OS native, making use of features or APIs that are OS dependent.
I feel like Android itself is native, it's compiled into direct machine code by each vendor, but I don't feel that the applications that run on it are hardware native, but they are native to Android, in that Dalvik and Hotspot bytecode are incompatible with each other's respective VM.
I guess I'm just a pedantic dickweed :|
- snowwrestler 12y agoI'm no expert but I believe most modern javascript engines now compile Javascript JIT. In fact I think Apple recently added LLVM to their Javascript engine. Node.js runs Javascript local to the machine in the V8 engine, which compiles it. As I understand it, that is architecturally analogous to running Java locally in the JVM. So I think that practically speaking, Javascript and Java are not so different from one another in how they access the hardware resources of the machine.