ProAnswers.org

compiler and interpreter?

what is the difference between compiler and interpreter, I see these terms are used at many places.

1 Like

Compiler:

A compiler is program that converts the instruction of a high level language into machine language as a whole. A program written in high level language is called source program. After the source program is converted into machine language by the compiler, it is called an object program.

Interpreter:

An interpreter is a program that converts one statement of a program at a time. It executes this statement before translating the next statement of the source program. If there is an error in the statement, the interpreter will stop working and displays an error message.

Compiler characteristics:

spends a lot of time analyzing and processing the program
the resulting executable is some form of machine- specific binary code
the computer hardware interprets (executes) the resulting code
program execution is fast

Interpreter characteristics:

relatively little time is spent analyzing and processing the program
the resulting code is some sort of intermediate code
the resulting code is interpreted by another program
program execution is relatively slow