Are there scenarios where JIT compiler is faster than other compilers like C++?
Do you think in the future JIT compiler will just see minor optimizations, features b
Lots of people answered maybe I am skimming (maybe I have have the wrong end of the stick) but for me they are two different things:
AFAIK there is nothing stopping you JIT'ing compiled c++ for example project Dynamo JIT'ed machine code:
http://arstechnica.com/reviews/1q00/dynamo/dynamo-1.html
And it did actually provide speed improvements under certain circumstances.
Compiling code, in the sense of a c++ compiler means taking code written in a language and turning it into a set of instructions (or in some cases another language to then be compiled again) that can be executed by some kind of logical device.
e.g. c++ compiling to assembly (I think ;-) or c# compiling to IL or Java compiling to byte code
JIT is a process that happens during execution. The machine executing the code analyses it to see if it can improve it. Java and C# are able to make use of both as the compiler prepares commands for the VM and then the VM has the opportunity at least to have another go at optimising it.
Some programs are not compiled they are interpreted, meaning the machine that runs them reads the exact code you wrote. These machines have the oppourtunity to do some JIT, but remember they can also be statically compiled, potentially be a third party vendor in ways that the original designer of the language never intended.
So to answer your question I don't think JIT will replace static compilers. I think there will always (as long as there is programming at least) be a place for taking a representation of a program and converting that into an set of instructions for a machine of some type. (potentially optimising while it does it)
HOWEVER, I do think that JIT may become a bigger part of the story, as the Java run time and .net run time evolve I am sure JIT will get better and given things like project Dynamo I guess there is scope for hardware taking up JIT too, so that everything your processor does is re-optimised based on run time environment.