Discuss the comparison of 'Compiler' and 'Interpreter'.

CS Professional · Information Technology and Systems Audit · PYQS · December 2019
Discuss the comparison of 'Compiler' and 'Interpreter'.

Answer & Explanation:

Compiler and Interpreter The basic purpose of interpreter is same as that of complier. In compiler, the program is translated completely and directly executable version is generated. Whereas interpreter translates each instruction, executes it and then the next instruction is translated and this goes on until end of the program. Interpreter translates program one statement at a time. In Interpreter, object code is not stored and reused. Every time the program is executed, the interpreter translates each instruction freshly. It also has program diagnostic capabilities. Instructions repeated in program must be translated each time they are executed by the interpreter. In Interpreters no intermediate object code is generated, hence are memory efficient. Whereas Compilers generate intermediate object code which further requires linking, hence requires more memory. Because the source program is translated fresh every time it is used, it is slow process or execution takes more time. Approx. 20 times slower than complier. Interpreter is more efficient than the compiler. In compiler, the compilation is done before execution, whereas in interpreter, compilation and execution takes place simultaneously. In Compiler, error message is generated only after scanning the whole program. Hence debugging is comparatively hard. Error detection is difficult in compiler than the interpreter.

Topics: Programming Languages

Open in Interactive Practice Hub · Full Practice Hub · Chapter Weightage · More in this subject

Related Questions in this Topic