Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

by than definition ALL apps are "native". Because if there wasn't some "native" code involved then nothing would run at all.


If we're going to be that pedantic, then it becomes difficult to communicate at all...


The interpreter is native, but the code that runs on top of it isn't.

In interpreted code, something like 'var i = 0;' could result in 100+ instructions, from the compilation/parsing of the script, to the actual running of that statement, and then the final execution on the hardware.

In C, `int i = 0;` WILL result in 2 instructions - movl $0, -4(%rbp) movl $0, %eax


By this standard, no interpretted languages are native. That would mean for example that Android has no native apps at all, because they're all written in Java.

There are already terms for what you're talking about: compiled applications, or binary applications.

"Native", to me, simply means an app that does not run in a browser. It is irrespective of language. Reasons this distinction might matter include the degree to which the code is sandboxed, OS and hardware features that the code can access, the distribution method, or the extent to which the app can run without network connectivity.


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 :|


I'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: