ProAnswers.org

What is the difference between a compiler and an interpreter?

A compiler translates code from a source language (e.g. C, C++, Java) to a target language, which can then be executed by a (virtual or physical) machine.

An interpreter reads code in an interpreted language (e.g. PHP, Perl, JavaScript) and directly executes the contained instructions.

Compiler:

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:

 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