Skip to main content

Types and Differences of Language Processors or Translators in Programming

Q. Define Language processor or Translator. Explain different types of Language processors.

Language Processors / Translator

        Computer directly understands machine language only. That is why Machine language is called the native language of computer. Machine language is in binary form that is its instructions consists of strings of zeros and ones. 

       A program written in high-level or assembly language cannot be run on a computer directly. Firstly, it is converted into machine language. So there is a need to translate the source program into object code for a computer to execute it. 

Definition of Language Processor 

Language processor may be defined as a software that converts source programs into object program. Language processor is also called Language Translator.  Therefore, a language translator software will take a source program(that cannot be understood by computer) as input and then will convert it into object code(that can be understood by computer).

Different types of language processors are:

  1.     Compilers
  2.     Interpreters
  3.    Assemblers

how Compiler works, How Language translator works, Language processor explanation, difference between language translators, different types of language translators

Compiler

           A compiler is a program that converts the source program into object program(machine code) as a whole. The compiler converts source program in machine code called object program. Compiler also checks and reports syntax errors in the program. A source program containing an error cannot be compiled.
        A program written in high-level language is called source program. A program in machine language is called Object program.
For example, C language and COBOL uses compiler. The function of a compiler is shown in the figure above.


Interpreter


How Interpreter works, How Language Translator Interpreter works, interpreter translates one instruction at a time

An interpreter is a program that converts one statement of a program into machine code at one time. Then translated instruction is executed. If there is an error in the statements, the interpreter displays an errors message. In other words we can say that interpreter is a software that translates an instruction into a machine language and gets executed it before proceeding to the next instruction.
The advantage of interpreters over compilers is that an error is found immediately. The disadvantage of interpreter is that it is not very efficient. It does not create object file. So every time we execute the source program, it is translated again one instruction at a time. Whereas compiler creates an object code file. So next time when the program is executed, this object program is run( and no translation or compilation is needed unless we change the source code). Visual Basic uses interpreter normally and it can use compiler also when we wish to make .EXE file of a visual basic project.


Assembler

An assembler is a translating program that translates the instructions of a program written in assembly language into machine language.
Therefore, Assemblers are used for translating assembly language programs into machine code.


You would also like to read:

Difference between Compiler and  Interpreter

Comments

Popular posts from this blog

Basic Structure of HTML Document

Basic Structure of HTML Document  The basic structure of an HTML document is given below: <HTML>         <HEAD>                  </HEAD>                 <BODY>                </BODY> </HTML> The above format shows that an HTML document starts with <HTML> tag and ends with </HTML> tag. It is also clear that an HTML document consists of two main sections:  Head Section Head section is used to specify a title of the web page, normally. There are some other uses of Head section too, like linking external style sheets and Java script code, etc. Head section starts with the <HEAD> tag and ends with the </HEAD> tag. <TITLE> tag is used to display a title of...

What are Different Types of Input Devices With Examples

Topic: Different types of input devices of a computer system with examples, pictures and explanation:  Topics Covered are: Definition of Input Devices Functions of Input Devices ( How input devices work? ) Examples of Input Devices Pictures / Images of different input devices Different Examples of Input Devices With Description Keybboard Mouse Trach Ball Trackpad Joy Stick Light Pen Microphone Scanner Graphic Tablet ( Digitizer ) Digital Camera Touch Screen ( I/O Device / Dual Device - Perform Both Functions input + Output ) INPUT DEVICES ( Definition ) Input devices are used to enter data and instructions into computer memory from external world. Input Device is a hardware part of the computer that is used to enter data and instructions into computer memory. The examples of input devices include: Keyboard, Mouse , Track ball, Track Pad, Joy stick, Touch Screen, Light pen,   Scanner , Digital Camera, Microphone, Graphics tablet e...

What are Different Types of Computer Hardware

What is Hardware? The physical parts of a computer are called hardware. Hardware can be touched or seen by us. For example, hard disk, mouse, keyboard, CD, CD-ROM Drive, Floppy Disk, Speakers, Modem and Printers - all are computer hardware. Explain different types of computer hardware Different types of hardware components on the basis of the functionality  they provide are as follows: 1.    Input devices Input devices are used to enter data and instructions into computer. Examples of input devices are: Keyboard, mouse, scanner, digital camera etc. Microphone Mouse Keyboard 2.    The Central Processing unit Central processing unit is the brain of the computer . It is also called CPU or Processor. Intel is the leading manufacturer of microprocessors. For example, Intel Pentium IV 3.2 MHz is an example of a CPU. You can see the images of processors / Micro processors or CPUs. Images of CPU or Microprocessor or s...