To execute a computer program written in a high level language it must be either compiled or interpreted . When this happens the programmer must correct the program and then attempt to compile it again. This process normally proceeds for a number of iterations. If no errors are found the compiler goes on to translate the text into machine code. Translation to executable machine code.
Interpretation occurs every time a line in a program is executed.
This means that a line which occurs many times must be interpreted on each occasion. This wastes computer time, and causes programs to run relatively slowly. However, the repeated examination of the source program by an interpreter allows interpretation to be more flexible than when using a compiler. Interpreters also provide a faster and easier way of testing small programs or fragments of programs. Another, more questionable advantage, is that parts of a program which are not executed need not be interpreted.