So let me know if I am clear or not.
When we say that the differences between the compiler and the interpreter are that the interpreter translates the high-level instructions into an intermediate form , which it then executes. [I think the compiler also translates high-level instructions into an intermediate form, but at this point it generates object code instead of executing it, right?]
The interpreter reads the source code one command or line at a time, converts this line to machine code and executes it. [The interpreter itself does not convert the code to machine code, it evaluates the instruction (after that it was parsed) using its own precompiled functions. For instance. Add an expression in a high-level language will be evaluated using the add interpreter function that was previously compiled, right?]
I would agree with the first, although it is not necessarily true that the interpreter works one line at a time (it can do optimizations based on knowledge of the entire code).
, , : " " ( JVM). ( , ), , , ( ).
, , ( , )
: . , , . , .
. , Java " JIT", Java .
. , , , - . . (, , 'if' 53, 'else' 54, '' 55 .. - , .)
(1).
Ad (2), , , . , , , , .
, , ; , Java, Python, , Prolog, - . Python Prolog "" -/-.
, , - 4 5 SICP, , .
An S → T , S, , () T.
:
S interpreter , S, . , .
, (, Python) , . , .
. , .
, :
: JDK Java