VidyaGyaan

Language Processors or Translators: Assembler, Compiler and Interpreter

Language Processors or Translators Assembler, Compiler and Interpreter

Language Processors or Translators in Programming and its types- Assembler, Compiler and Interpreter

Language translator or Processor

To express our idea we use a suitable language. Same in the computer system, to make a dialogue, a language is required. The language is known as programming language. The programming language is generally used to give command or instruction to computer. It is required to translate into machine format. For a translation of programs, language processor is used. Computers understand instructions only when they are written in the machine language. Machine language is in binary form that is its instructions consist of zeros and ones.

Definition of Language Processor

A language translator is a program which is used to translate an input program written in one programming language into another programming language (output program). Language processor is also called a language translator.

A program written in any high-level programming language is called the Source code or program. To convert the source code into machine code is called the object code or program. A Translator translates the source program into the object program that the computer can understand and execute.

Types of Language Processor or Translators

In programming Language processors are  three types:

  1. Assembler
  2. Interpreter
  3. Compiler

1.Assembler

Assembler is a translator which is used to translate the assembly language code into machine language code.
Assembly language is a low level programming language where we use the symbols called mnemonics in place of machine codes. The assembler performs a one to one mapping from mnemonic statement into machine codes and data. The translated program is called as object program.

Advantages of Assembler

Disadvantages of Assembler

2.Interpreter

Interpreter converts the source program written in high level language into machine languages.
An interpreter converts each statement of the program line by line into machine code. It means an interpreter translates the one line at a time into machine language and executes it. Then moves towards the next line this goes on till the end of the program. If no error encounters.
Interpreter stops and highlights the problem and will not move to next line when any errors are encountered.
A interpreter requires a less storage space in primary memory than a compiler.

Advantages of Interpreter

Disadvantages of Interpreter

3.Compiler

The purpose of compiler is same as interpreter but unlike interpreters which translate the source program line by line, compiler are the translators, which translate the entire program into machine codes.
If source program contain errors, the compiler highlights a list of errors at the end of the execution of the program. i.e. a compiler translates the whole program before execution. A compiler is a larger program and occupies more memory space. It is costlier than interpreter.

Advantages of compiler

Disadvantages of compiler

Difference between Compiler and Interpreter

S. No. Compiler Interpreter
1 A compiler takes the whole program as a single unit and compiles it at once Interpreter each line in translated or converted one by one and executed
2 It stores an object file. It does not store an object file.
3 Occupies more memory space Occupies less memory space
4 Program execution is very fast. Program execution is slow.
5 Debugging is harder Debugging is easier
6 Translator program is required to translate the program each time you want to run the program. Translator program is not required to translate the program each time you want to run the program.
7 More useful for commercial purpose More useful for learning purpose
8 Costlier then interpreter Cheaper than compiler
9 Compiler are good for a very long program Interpreter is good for small programs.
10 Example :C compiler, PASCAL compiler, FORTRAN compiler etc Example : Basic interpreter, Prolog interpreter, LISP, APL etc.

Related Posts Fundamental of Computer