Write the difference between compiler and interpreter in table form.

Compiler Interpreter
It scans the entire program first and translates it into machine code. It translates program line by line.
It converts the entire program to machine code, when all the syntax errors are removed, execution takes place. Each time the program is executed, every line is checked for syntax error and the converted to equivalent machine code.
Debugging (removal of mistakes froma a program) is slow in compiler. Debugging is fast in interpreter.
Execution time is less in compiler. Execution time is more in interpreter.
Intermediate object code is generated in case of compiler. In case of interpreter, No intermediate object code is generated.
Compiler requires more memory than interpreter. Interpreter needs less memory when compared to compiler.
The assembly code generated by the compiler is a mnemonic version of machine code. At the output of assembler is re-locatable machine code generated by an assembler represented by binary code.
Compiler takes entire program as input. Interpreter takes single instruction as input.
Compiler gives you the list of all errors after compilation of whole program. Interpreter stops the translation at the error generation and will continue to next line when error get solved.
Example:C,COBOL,C#,C++,etc. Example:Python,Perl,VB,PostScript,LISP,etc.

Post a Comment