Change Language:
USA English French Deutsch (Germen) Spanish Portugese Italian Nederlands (Dutch) Polish Russian Swidesh Arabic Korian Chinese Japanese UK English Bookmark and Share

Language Processors

Computer Programming > Language Processors

We know that computer understands instructions in machine code, i.e. in the form of 0s and 1s. It is difficult to write computer program directly in machine code. Nowadays, the programs are written mostly in high-level languages, i.e. BASIC, C-H-, PASCAL, etc. A program written in any high-level programming language (or written in assembly language) is called the Source Program.

The source code cannot be executed directly by the computer. The source program must be converted into machine code to run it on the computer. The program translated into machine code is known as Object Program.

Every language has its own language processor (or translator). Therefore, language processor is defined as:

The special translator system software that is used to translate the program written in high-level language (or Assembly language) into machine code is called language processor or translator program.

The language processors are divided into three types.

  1. Compilers
  2. Interpreters
  3. Assemblers

1. Compiler

The language processor that translates the complete source program as a whole in machine code before execution is called compiler. The C and C++ compilers are best examples of compilers.

The program translated into machine code is called the object program. The source code is translated to object code successfully if it is free of errors. If there are any errors in the source code, the compiler specifies the errors at the end of compilation. The errors must be removed before the compiler can successfully compile the source code. The object program can be executed a number of times without translating it again.

2. Interpreter

The language processor that translates (converts) each statement of source program into machine code and executes it immediately before to translate the next statement is called Interpreter. If there is an error in the statement the interpreter terminates its translating process at that statement and displays an error message. The OWBASIC is an example of interpreter.

The Interpreter differs from compiler that translates the entire source program into object program before execution.

The main advantage of Interpreter is that it makes easy to trace out and correct errors in the source program.

The main disadvantages of Interpreter are:

  • It is a time consuming process of translating and executing statements one by one.
  • Each time the program is run, the source code is translated and executed have a translator program (Interpreter) permanently in your computer.

3. Assembler

An assembler is third type of translator program. It is used to translate the program written in Assembly language into machine code. An assembler performs the translation process in similar way as compiler. But assembler is the translator program for low-level programming language, while a compiler is the translator program for high-level programming languages.

Difference between Compiler & Interpreter

The main difference between compiler and interpreter is:

CompilerInterpreter
1) It translates source code into object codes as a whole. 1) It translates the statements of the source code one by one and execute immediately.
2) It creates an object file. 2) It does not create an object file.
3) Program execution is very fast. 3) Program execution is slow.
4) Translator program is not required to translate the program each time you want to run the program. 4) Translator program is required to translate the program each time you want to run the program.
5) It does not make easier to correct the mistakes in the source code. 5) It makes easier to correct the mistakes in the source code.
6) Most of the high-level programming languages have compiler program. 6) A few high-level programming languages have Iterpreter program.


See Also or Related Articles:

Contact Us - RSS Feed
Get Page Rank 10 - SEO Experiment

Feedback Form