Difference Between Compiler and interpreter and assembler
Language Processor
Computer
understands only machine language. A program writer in high level or assembly
language cannot be run on a computer directly. It must be converted into
machine language before execution. Language processor or translator is a software that converts these programs into
machine language. Every computer language has its own translators.
Different
Types of language processors are as follows.\
Difference
Between Compiler and interpreter and assembler
|
Compiler
A
compiler is a program that converts the instruction of a high level language
into machine language as a whole. A program written in high level language is
called source program. Compiler converts source program into machine code know
as object Program.
The compiler
checks each statement in the source program and generates machine instructions.
Compiler also checks syntax errors in the program. A source program containing
an error can not be compiled.
Source
program -------Ã
Compiler------------------Ã Object
Program
A
compiler can translate the program of only that language for which it is
written. For example C Compiler can translate only those program that are
written in C Language.
Interpreter
An
interpreter is a program that converts one statement of a program at one time. It
executes this statement before translating the next statement of the source
program. If there is an error in the statement, the interpreter stops working
and displays an error message.
The advantage
of interpreters over compilers is that an error is found immediately. So the
programmer can correct errors during program development.
This disadvantage
of interpreter is that it is not very efficient. The interpreter does not
produce an object program. It must convert the program each time it is
executed. Visual basic uses interpreter.
Assembler
An
Assembler is translating program that translates the instructions of an
assembly language into machine language
AssemblylanguageProgram -----Ã Assember------------Ã object
program
Difference Between Compiler and interpreter
Compiler | Interpreter |
---|---|
Compiler converts a program machine code as whole | Interpreter converts a program into machine code statement by statement |
Compiler creates object code file | interpreter does not create object code file |
program execution is fast | program execution is slow |
Compiler displays syntax errors after compiling the whole program | interpreter displays the syntax error on each statement of program |
Post a Comment