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

Explain different types of storage devices

Topic: Explain different types of storage devices in Computer systems Storage Devices Storage devices are used to store data and instructions permanently. Storage devices are also called secondary storage devices / backing storage devices / external storage devices or auxiliary storage devices. Examples of storage devices include Hard Disk, CD and DVD etc. Why Secondary Storage Devices are Used? Secondary storage devices are used because: Primary memory(RAM) is volatile and temporary. When computer is switched off, all data in ram is erased. Storage devices can store large amounts of data and instructions permanently whereas Primary memory has less capacity of storing data. Types Of Storage Devices There are three main types of storage devices:  Magnetic Tape   Magnetic Disk   Optical Disk   Flash Memory storage devices 1. Magnetic Tape Magnetic tape is the oldest storage device. It is made of plastic coated with m...

Explain Different Types Of Output Devices

Output devices Out put devices are used to display results of processing to the user. They perform the following functions:  Receive results from memory  Convert data into human readable form  Display results to the user Examples include: Monitor, printer, plotter, speaker, and multimedia projector. Different Types of Output Devices 1.    Monitor LCD Monitor CTR Monitor     Monitor is the most commonly used output device used to display results of processing. It has a TV like shape. Pictures on monitor are formed with picture elements called PIXEL. Monitors may be Monochrome that will display results in Black & White. Color Monitors are also available. They display results in multi colors. Monitor produces soft copy output. 2.    Printers Printers are used to produce hard copy out put. They print processing results on paper. Printers are divided into two main categories: · ...

Types Of Scanners Input Device

Scanner / Optical Scanner A scanner is an input device for computer. It can scan any printed document with text as well as images. It will : Read any printed paper or picture, Convert text or images into digital form Saves this converted digital file into computer storage for later use Uses Of Optical Scanners You can scan your documents or pictures to: Store into computer memory. To save lot of effort and time because if you type the whole text on printed page, it will take effort as well as time). Show image or text on computer screen or on a multimedia projector's screen. In addition, you can send this scanned document or image to your friends all over the world with the help of Internet & Email. You can publish the scanned documents or images on your website or blog. You can apply online and send the scanned images of your academic documents in any part of the world within minutes. If your scanner supports OCR - Optical Character Recognition, you can scan a page...