What is difference between compiler and interpreter?

Compiler:
It is a software program is used to convert source code or human language code into machine code or low-level language.
By using compiler, overall program is compiled and if there is any error in program it is difficult to correct.
Intrepreter: 
It is a software program is used to convert source code or human language code into machine code or low-level language.

Main difference between compiler and interpreter:
An interpreter translates high-level instructions into an intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly into machine language. Compiled programs generally run faster than interpreted programs. The advantage of an interpreter, however, is that it does not need to go through the compilation stage during which machine instructions are generated. This process can be time-consuming if the program is long. The interpreter, on the other hand, can immediately execute high-level programs.

For this reason, interpreters are sometimes used during the development of a program, when a programmer wants to add small sections at a time and test them quickly. In addition, interpreters are often used in education because they allow students to program interactively.

Comments

Popular posts from this blog

To print python keywords in a list