Showing posts with label COMPILER & INTERPRETER. Show all posts
Showing posts with label COMPILER & INTERPRETER. Show all posts

Monday, April 10, 2017

COMPILER & INTERPRETER

A compiler is a program that translates the entire source program written in some high-level programming language (such as Java) into machine code for some computer architecture (such as the Intel Pentium architecture).
Image result for compiler
  1. A computer program which reads entire source code and outputs assembly code or executable code is called compiler.
  2. A program that translates software written in source code into instructions that a computer can understand Software used to translate the text that a programmer writes into a format the CPU can use.
  3. A piece of software that takes third-generation language code and translates it into a specific assembly code. Compilers can be quite complicated pieces of software.
An Interpreter is a program that translates a source program written in some high-level programming language (such as BASIC) into machine code for some computer architecture (such as the Intel Pentium architecture) line by line.
  1. A computer program which reads line by line source code and outputs assembly code or executable code is called interpreter.

Difference between Compiler and Interpreter

NoCompilerInterpreter
1Compiler Takes Entire program as inputInterpreter Takes Single instruction as input .
2Intermediate Object Code is GeneratedNo Intermediate Object Code is Generated
3Conditional Control Statements are Executes fasterConditional Control Statements are Executes slower
4Memory Requirement : More (Since Object Code is Generated)Memory Requirement is Less
5Program need not be compiled every timeEvery time higher level program is converted into lower level program
6Errors are displayed after entire program is checkedErrors are displayed for every instruction interpreted (if any)
7Example : C CompilerExample : BASIC