Interpreter vs. compiler (JIT)
843829Jan 23 2008 — edited Jan 26 2008Hello!
I have some questions regarding interpreter vs. compiler.
*1.* In an interpreter each bytecode instruction is read and translated to
machine code. Am I right?
*2.* In a compiler eg. JIT, blocks of byte code are compiled at runtime
to machine code. Am I right?
*3.* How does an interpreter translate the bytecode to machine code?
Isn't the interpreter compiling the bytecode to machine code in
the same way that the JIT does? Or does it retrieve the machine code
instructions from some kind of stack/shelf?
*4.* Is the difference between interpreter and JIT that the interpreter only
reads one bytecode instruction at a time while JIT compiles whole
blocks of code?
*5.* When the interpreter has translated a bytecode instruction, does
it save the translated machine code in some place to be retrieved the
next time the same bytecode instruction appears?
Regards
/Fredrik