Tuesday, 23 April 2013

What is Difference Between Compiler and Interpreter

| |
ADS :
- All stilts - jumping stilts allstilts.com
- Anything painted on canvas anythingpaintedoncanvas.com

A Compiler and Interpreter both carry out the same purpose – convert a high level language (like C, Java) instructions into the binary form which is understandable by computer hardware.

Specific compilers/interpreters are designed for different high level languages. However both compiler and interpreter have the same objective but they differ in the way they accomplish their task i.e. convert high level language into machine language. 

The main difference between Compiler and Interpreter :

  • The compiler executes the entire program at a time, but the interpreter executes each and every line individually.
  • The interpreter takes one statement then translates it and executes it and then takes another statement. While the compiler translates the entire program in one go and then executes it.
  • Compiler generates the error report after the translation of the entire page while an interpreter will stop the translation after it gets the first error.
  • In a compiler the analyzing and processing time of the program is more, while an interpreter spends less time for the program analyzing and processing.
  • Compiler translates the high level instruction into machine language, but the interpreter translates the high level instruction into an intermediate code.


0 comments:

Post a Comment

Powered by Blogger.