Saturday, 26 November 2016

Difference between compiler and interpreter

Difference between compiler and interpreter
Compiler and interpreter are computer programs that covert a program/source code  written in a programming  language to other programming language/machine code. Typically a programmer writes statements in a high level language and computers process instructions in low level languages or machine language, so to translate a  that instructions we need a program called compiler or interpreter. Both have same target task but they do it with different methods.

Compiler:
Compiler takes entire program as an input.
Compiler checks all errors and list them.
As it works on whole program so takes more memory than interpreter.
Known as Offline compilers.
Examples: C compiler




Interpreter:
Interpreter takes single statement as an input and execute them.
Interpreter check errors line by line.
As it works line by line so takes less memory.
Known as Online compilers.
Example: BASIC


No comments:

Post a Comment