Ask a Teacher



Distinguish between compiler and interpreter

The difference between an interpreter and a compiler is given below:

Interpreter
Translates program one statement at a time.
It takes less amount of time to analyze the source code but the overall execution time is slower.
No intermediate object code is generated, hence are memory efficient.

Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.

Programming language like Python, Ruby use interpreters.



Compiler

Scans the entire program and translates it as a whole into machine code.

It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.

Generates intermediate object code which further requires linking, hence requires more memory.

It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.

Programming language like C, C++ use compilers.


comments powered by Disqus