3 ms·
To me the difference is that an interpreter read the code and execute every operation immediately as it encounter them, while I expect a compiler to process a l
by Joky 8y ago
To me the difference is that an interpreter read the code and execute every operation immediately as it encounter them, while I expect a compiler to process a large portion of the code and potentially perform more transformation on it before executing it. In some way I see an interpreter as potentially invoking a compiler on a single operation one-at-a-time and executing the result of the compilation before moving to the next operation.
- RHSeeger 8y agoThe lines are grey, to some extent. Many interpreted languages (such as Tcl) compile to bycode, then interpret that. The compilation happens not at the operation level, but at the block (or maybe file) level.
- blacksqr 8y agoIn Tcl, procedures are bytecode-compiled when they are created, which is generally when the files containing their code are sourced. Code outside procedures is not compiled, but interpreted line-by line as it is executed. So if you care about the performance of your Tcl code, put as much of it as you can into procedures.