I was thinking that my understanding about interpreters and compilers is correct:
- I think the compiler translates only from source code into binary code, whereas a translator works not only in translation but also executing whatever is generated after compilation.
- Is an interpreter always a part of the compilation?
- Does the compiler not always execute the binary code?
Sorry to ask the wrong questions. Thanks and regards!
-
You are right about the compiler, but wrong about interpreter . The interpreter does not need to translate anything, just reads the piece of code and "interprets it" - executes what he has read. For example, it reads
1 + 2 and then the function
sum (1, 2) .
The interpreter can use the compilation for optimization purposes (like this hot spot uses JIT compilation in JVM).
Good, compile is to "compile" - translate source code into binary code. So the answer to your question - yes This is not his job.
-
Comments
Post a Comment