Is there any real advantage from Bytecode JIT execution over native code beside possible implementation of platform independency?
Apparently languages that use "virtual machines" over Bytecode JIT execution are attributed several advantages. But in what extend would this really affect a discussion concerning advantages/disadvantages of native code and JIT execution?
Here's a list of attributes that I identify, the question is in what extend does this also apply to native code - if the compiler supports it...
Security
VM runtime environments can observe the running application for e.g. buffer overflows.
So first question is if this is done by the "runtime environment", means e.g. by the class library or during JIT execution?
Memory bounds-checking exist also for native code compilers. Any other/general restrictions here?
Optimization
Classical optimization should be possible in native code compilers, too. See LLVM which in fact uses the generated bitcode to run optimization on, before compiling to native code.
Maybe there would be something like a dynamic optimization in JIT by e.g. identifying things to optimize related to the execution context. Could maybe be possible for a native compiler, too, to generate some code to optimize the execution during runtime. But dont't know if something like this is implemented.
Popular VM implementations do this - the question is if this really excuses a real advantages over native code.
Threading
I don't cound this while threading also in a VM is dependent on the native Thread implementation of the OS.
If we identify that there is no real advantage over native code and that there is always a runtime drawback in JIT... than this leads to the next question:
Does an operating system design based on JIT execution (e.g. Singularity, Cosmos, ...) make sense?
I could maybe identify one advantages: An OS with this design needs no MMU. Means there is no process seperation that makes use of the MMU, but a seperation between objects/components in software. But is it worth it?
Best regards ;-)