Interpreter

Interpreter

An interpreter is a computer program that executes other programs. This is in contrast to a compiler which does not execute its input program (the source code) but translates it into executable machine code (also called object code) which is output to a file for later execution.

It may be possible to execute the same source code either directly by an interpreter or by compiling it and then executing the machine code produced. It takes longer to run a program under an interpreter than to run the compiled code but it can take less time to interpret it than the total required to compile and run it. This is especially important when prototyping and testing code when an edit-interpret-debug cycle can often be much shorter than an edit-compile-run-debug cycle. Interpreting code is slower than running the compiled code because the interpreter must analyses each statement in the program each time it is executed and then perform the desired action whereas the compiled code just performs the action.

This run-time analysis is known as “interpretive overhead”. Access to variables is also slower in an interpreter because the mapping of identifiers to storage locations must be done repeatedly at run-time rather than at compile time.

error: Content is protected !!