Translating Programs, also known as language processors. They are the system programs that translate a source program in high level language. Such as BASIC to an object program in Machine Languages or Binary language or in 0 and 1. Which is meaningful to the hardware of the Computer. These programs include the assembler and the various Compilers and Interpreters available with the System Software. A translating program is usually called from a direct access storage device only after the Job control program of the Operating System Interprets a job control statement and informs the operating System supervisor of what is needed. (translator)
Compilers
Since a Computer hardware is capable of understanding only machine level codes or in binary form. So it is necessary to convert the instructions of a program written in a high-level language to Machine Instructions before the programs can executed by the Computer. In case of High-Level Language, this job is carry out by a Compiler. Thus, a compiler is a translating program (translator) that translates the instructions of a high-level language into machine language.
Note: A Compiler compiles a set of Machine Language Instructions for every program instruction of a high level language. Compilers are large programs which reside permanently on Secondary Storage. When the translation of a program is to be done, they are copied into the main memory of the Computer.
A Program written by a programmer in a High-level language is called a Source Program. After this Source program convert into Machine language by compiler. It refer to as an object Program.
As shown in the figure above the input to a Compiler (program). It is a source program write in a high-level language and its output is an object program which consists of Machine Language instructions.
The source program and the object program are the same program, but at different stages of Development. A compiler can translate only those source programs, which have been written in language for which the Computer is meant.
The Compiler is a program. It executes in the CPU. While translating a given program, the compiler analyses each statement in the source program and generates a sequence of machine instructions. which when executed, will precisely carry out the computation specified in the statements.
As the Compiler analyses each statement, it uncovers certain types of errors. These refer to as diagnose the following kinds of source program:
a) Illegal Character
b) Illegal combination of characters
c) Improper sequencing of instructions in a program
Interpreters
An interpreter is another type of Translator used for translating a high-level language into Machine Codes. It takes one statement of a high-level language and translates into a machine instruction which is immediately executed. Translation and execution alternate for each statement encountered in the high-level language program. In other words, an interpreter translates one instruction at a time and control unit executes the resulting machine code, then the next instruction is translated and the Control Unit executes the resulting Machine code instructions and so on.
Difference Between Interpreters and Compilers
An interpreter differs from a compiler which merely translates the entire source program into an Object program. And it is not involve in its execution. In case of a Compiler, the whole source program translate into an equivalent machine language program before the program execute. The object code, thus obtained, is permanently save for the future use. So repeated compilation is not necessary for repeated execution of the same program. However, in case of an Interpreter, no Object code save for future use. Because translation and execution processes alternate.
Interpreters are often employ with microcomputers. The advantage of an interpreter over a compiler is fast response to changes in the source program. The Interpreter over a compiler is fast response to changes in the source program. The Interpreter eliminates the need for a separate compiling run after each program change to add features or to correct errors. Moreover, a Compiler is a complex program as compared to an interpreter. Interpreters are easy to write and do not require large memory space in the Computer. The Interpreter however, is a Time Consuming Translation Method. Because each statement must be translated every time it is executed from source it is executed from the Open source program.
Assemblers
A Program which translates an assembly language program into a Machine language program is called an Assembler (translator) . An Assembler which runs on a Computer for which it produces object codes (machine Codes) is called a self assembler (or resident Assembler). A less powerful and cheaper Computer may not have enough Software and hardware facilities for program development in assembly languages. In such a situation, a faster and the more Powerful computer can be used for program development. The program so develop are to run on smaller Computer.