tags:

views:

135

answers:

2

Possible Duplicate:
How does an interpreter/compiler work

Hi what is the exact difference between the Compiler and interpreter ?

+2  A: 

From Wikipedia:

  • Compiler: A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).
  • Interpreter: An interpreted language is a programming language in which programs are 'indirectly' executed ("interpreted") by an interpreter program. This can be contrasted with a compiled language which is converted into machine code and then 'directly' executed by the host CPU.
Noel M
+1  A: 

Compiler

A compiler generates machine-dependent assembly code which can then be assembled and linked to into the appropriate machine op-codes to allow the program to execute. This process can only be run at build time.

Interpreter

An interpreter generates machine-independent code which can then be on-the-fly compiled to assembly code (e.g. Just-in-Time compilation). This process can be executed at build time and / or run time.

Hope this helps!

husterk