Translators in Programming Languages
In this article, I am going to discuss What is a Translator and its need in Programming Languages. Please read our previous article where we gave an Introduction to Programming Languages.
What is a Translator?
Always the user’s given instructions are in English, which is called source code. But the computer is not able to understand this source code and the computer understandable code is binary / machine. To convert this source code into binary code we are using the interface software called translators.
Translators are system software that converts programming language code into binary format. The translators are classified into three types:
For better understanding please have a look at the following image.
Compiler and interpreter are both used to convert high-level programs to machine code. Assembler is used to convert low-level programs to machine code.
A compiler is the system software that translates High-level programming language code into binary format in a single step except for those lines which are having an error. It checks all kinds of limits, ranges, errors, etc. But its execution time is more and occupies the largest part of the memory.
It is the system software that converts programming language code into binary format step by step i.e. line by line compilation takes place. It reads one statement and then executes it until it proceeds further to all the statements. If an error occurs it will stop the compilation process. Development-wise, an interpreter is recommended to use.
Note: The compiler converts the total source code at once by leaving the error lines. Whereas the interpreter is line by line. C & C++ are compiler-based languages. Java / .Net / Python, etc. are compiler-based interpreted languages. The assembler working style is similar to the compiler.
It is the system software that converts assembly language instructions into binary formats.
An Operating System (OS) is an interface between a computer user and computer hardware. An Operating system is a software that performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and Printers.
A loader is a program that loads the machine codes of a program into system memory. And a locator is a program that assigns specific memory addresses for each machine code of a program that is to be loaded into system memory.
Usually, a longer program is divided into a number of smaller subprograms called modules. It is easier to develop, test, and debug smaller programs. A linker is a program that links smaller programs to form a single program. The linker links the machine codes of the program. Therefore, it accepts the user’s programs after the editor has edited the program, and the compiler has produced machine codes of the program. The Process is called Linking.
In the next article, I am going to give you an overview of Different Types of Applications. Here, in this article, I try to give you an overview of Translators and their needs in Programming Languages and I hope you like this Translator and their needs in the Programming Languages article. I would like to have your feedback. Please post your feedback, question, or comments about this article.