Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between compiler and interpreter?

user-image
Question added by Gurmeet Mathur , Freelance Developer/Designer , Scriptlance.com
Date Posted: 2013/11/24
JEYA SHOBANA SUBBIAH
by JEYA SHOBANA SUBBIAH , Assistant Professor , Rajas International Institute of Technology for Women

A compiler just checks all syntax errors of a source program. If the source program has no errors then it transforms the source code into machine code (binaries) and then the program can be executed by invoking several library commands and a linker. An interpreter simply checks the errors of a program statement by statement. It cannot consider the whole program as a single unit.

karpaga selvi Subramanian
by karpaga selvi Subramanian , Assistant Professor , Mekelle University

Interpreter performs step by step translation, and stops when a error occurs.

Compiler translate the entire program and highlight all errors if any

Shafi Ahmad
by Shafi Ahmad , Principal Software Engineer , Microsoft India Pvt Ltd

 

Input

Compiler Takes Entire program as input

Interpreter Takes Single instruction as input .

Intermediate Code

Intermediate Object Code is Generated

No Intermediate Object Code is Generated

Compilation

Program need not be compiled every time

Every time higher level program is converted into lower level program

Error Report

Compiler gives you list of all errors after compilation of whole program.

Interpreter stops the translation at the error generation and will continue when error get solved.

Machine code

Compiler converts the entire program to the machine code when all the errors are removed, execution takes place.

Each time the program is executed; every line is check for error and then converted into equivalent machine code.

Debugging

Compiler is slow for debugging.

Interpreter is good for fast debugging.

Execution Time

Compiler takes less execution time.

Interpreter takes more execution time.

Speed

Compiler is faster.

Interpreter is slower in compare to compiler.

Example

C Compiler

BASIC

 

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.