Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

# Compiler Interpreter

Compiler works on the complete program at Interpreter program works line-by-line. It


1
once. It takes the entire program as input. takes one statement at a time as input.
Compiler generates intermediate code, called Interpreter does not generate intermediate
2
the object code or machine code. object code or machine code.
Compiler executes conditional control
Interpreter execute conditional control
3 statements (like if-else and switch-case) and
statements at a much slower speed.
logical constructs faster than interpreter.
Compiled programs take more memory Interpreter does not generate intermediate
4 because the entire object code has to reside in object code. As a result, interpreted
memory. programs are more memory efficient.
Compile once and run anytime. Compiled
Interpreted programs are interpreted line-by-
5 program does not need to be compiled every
line every time they are run.
time.
Error is reported as soon as the first error is
Errors are reported after the entire program
6 encountered. Rest of the program will not be
is checked for syntactical and other errors.
checked until the existing error is removed.
A compiled language is more difficult to Debugging is easy because interpreter stops
7
debug. and reports errors as it encounters them.
Interpreter runs the program from first line
Compiler does not allow a program to run
8 and stops execution only if it encounters an
until it is completely error-free.
error.
Interpreted languages are less efficient but
Compiled languages are more efficient but
9 easier to debug. This makes such languages
difficult to debug.
an ideal choice for new students.
Examples of programming languages that use
Examples of programming languages that
10 interpreters: BASIC, Visual Basic, Python,
use compilers: C, C++, COBOL
Ruby, PHP, Perl, MATLAB, Lisp

You might also like