Compiler Vs Interpreter

Compiler Vs Interpreter

Let’s see the main differences between Compiler Vs Interpreter. Both compiler and interpreter act differently in many aspects.

Compiler Vs Interpreter

COMPILER:

  1. Compiler takes an entire program as input. It works on the complete program at once
  2. It generates Intermediate Object code (machine code)
  3. It executes Conditional control statements faster than Interpreter
  4. More memory required (since Object Code is generated)
  5. Compiled program doesn’t need to be compiled every time
  6. Errors are displayed after entire program is checked
  7. Programming languages that use compilers are C, C++

INTERPRETER:

  1. Interpreter takes a single statement at a time as input. It works line by line
  2. It doesn’t generate Intermediate code (machine code)
  3. It executes Conditional control statements much slower than Compiler
  4. Memory requirement is less. It doesn’t generate intermediate Object Code
  5. Every time higher level program is converted into lower level program
  6. Errors are displayed for every instruction interpreted (if any)
  7. Programming languages that use interpreter are Visual Basic Script , Ruby, Perl

 

COMPILER INTERPRETER
Compiler takes an entire program as input. It works on the complete program at once Interpreter takes a single statement at a time as input. It works line by line
It generates Intermediate Object code (machine code) It doesn’t generate Intermediate code (machine code)
It executes Conditional control statements faster than Interpreter It executes Conditional control statements much slower than Compiler
More memory required (since Object Code is generated) Memory requirement is less. It doesn’t generate intermediate Object Code
Compiled program doesn’t need to be compiled every time Every time higher level program is converted into lower level program
Errors are displayed after entire program is checked Errors are displayed for every instruction interpreted (if any)
Programming languages that use compilers are C, C++ Programming languages that use interpreter are Visual Basic Script, Ruby, Perl
Back To Top