What is Language Translator and its Types? Differences between Compiler and Interpreter

A language translator is a program that converts source code instructions into object code instructions. i.e. from high-level language or assembly language into machine language.

language translator | What is language translator?

There are 3 types of language translators. They are:

Assembler:

Assembler is a language translator that converts assembly language (source codes) into machine language (machine code) (object codes). Source codes are the original assembly language program codes, and object codes are the final machine language program codes after translation.

Compiler:

A compiler is a program that converts high-level language programs into machine language programs. It validates the syntax (grammar of the source code) and translates it into object code in a single try when translating. If any error is found, the compiler produces syntax errors and causes the errors. For the entire compilation process, the source code file must be syntax error-free.

Interpreter:

The interpreter is a language translator that works one instruction at a time to convert high-level language programs into machine language programs. Unlike the compiler, it only works on one statement at a time, translating and executing it before going on to the next. The translation is interrupted and an error message is provided if an error occurs.

Differences between Compiler and Interpreter:
Compiler Interpreter
It converts an entire high-level language program into machine language at the same time. Line by line, it converts high-level language applications to machine language.
After compiling the entire program, it detects syntax mistakes. After translating each line of the program, it looks for syntax mistakes.
The compiler is more efficient than the interpreter. When compared to a compiler, the interpreting process is slower.
After compiling the entire program, it generates object code. After translating each line of the program, it generates object code.
In a compiler, debugging is a difficult task. Debugging process is easy in the interpreter.
The compiler consumes more resources (memory, CPU time, and so on) than the interpreter. Interpreter requires low resources.
Example: C, C++, Visual Basic, java, etc. Example: BASIC, QBASIC, GWBASIC, etc.

Post a Comment

Please do not enter any spam link in the comment.

Previous Post Next Post