Page Contents
What is a translator?
A translator is the system software that is used to translate source code into object code (machine code). Maybe a translator is a language translator. Generally, there are three types of translators in the computer system. They are:
- Assembler
- Compiler
- Interpreter
Assembler:
A assembler is a translator that translates a low-level language into object code.
Compiler:
A compiler is a translator that goes through the entire program and translates it into machine code or object code.
Interpreter:
An interpreter is also a translator that translates one statement at a time and next till the entire program into object code.
These are all translators are interdependence and not interdependence to each other. For it, it as given below:
Difference between Assembler, Compiler, and Interpreter
Compiler | Interpreter | Assembler |
It translates the entire program first and translates it into machine code. | Also, it translates the program line by line. | Similarly, it converts the entire program into machine code. |
It converts the entire program to machine code when all the syntax errors are removed, and execution takes place. | Each time the program is executed when every line is checked for syntax errors and converted to equivalent machine code. | Same as the compiler i.e. (It converts the entire program to machine code when all the syntax errors are removed, and execution takes place.) |
Slow for debugging. | Faster for debugging. | Faster for debugging. |
Overall execution time is less. | It is overall execution time is more. | Overall execution time is more than the interpreter. |
It creates only one object program after executing of the program. | It does not create an object program. | Same as compiler (it creates only one object program after executing of the program) |
It translates high-level language into machine code. | Same as the compiler. | It translates assembly level language into machine language. |