INTERPRETERS
An interpreter is another type of program translator used for higher level languages into machine level language. It takes one statement of higher level language and translate it into machine language which is immediately execute it. Translation and execution are carried out for each statement. It differs from compiler, which translate the entire source program into machine code and does involve in its execution.
On the other hand, in case of compiler , the whole source program is translated into an equivalent machine language program. The object code , thus obtained , is permanently saved for future use and is used every time the program is to be executed. But in case of interpreter, no object code is saved for future use because the translation and the execution processes alternate. The next time an instruction is used, it must once again be interpreted and translated into machine language.
The advantage of an interpreter over a compiler is fast response to changes in the source program. The interpreter eliminates the need for a separate compiling run after each program change to add features or correct errors. Moreover, a compiler is a complex program compared to an interpreter. Interpreters are easy to write and they do not require large memory space in the computer. The interpreter, however , is a time consuming translation method because each statement must be translated every time it is executed from the source program. Thus , a compiled machine language program runs much faster than an interpreted program.