Language translators
What is language translator?
Any program written in high level language is known as source code. However, computers cannot understand the source code. Before running it, the source code must first be translated into a form that the computer understands. Translator is a program that converts source code into machine code. There are generally three types of translators:
- compilers
- Interpretor
- Assembler
What is compilers?
The compiler takes the source code as a whole and translates it into machine code at once. Once converted, the object code can be run at any time without assistance. This process is called compilation. Compilers have several advantages: Compiled programs run faster, because they have been translated. A compiled program can be provided as an executable file. An executable file is a file that is ready to be executed. Because an executable file cannot be easily edited, programmers prefer to provide an executable rather than a source code.Developers improve the code. Optimized code can run faster and take up less memory. Compilers also have disadvantages: the source code must be rearranged whenever the programmer changes the program. Source code compiled on one platform will not run on another platform - machine code is specific to the processor architecture.
What is Interpretor?
A translator translates the code into machine code, instruction by instruction - the CPU follows each instruction before the translator can proceed to translate the next instruction. The interpreted code will show an error as soon as it encounters an issue, so it is easy to debug the compiled code.An interpreter follows instructions written in a programming or scripting language without first converting them into an object code or machine code. Examples of interpreted languages are Pearl, Python and Matlab. Here are some interesting facts about translators and editors.
What is assembler?
Assemblers are a third type of translator. The purpose of the assembly is to translate the assembly language into machine code. While compilers and spokespersons prepare many machine code instructions for each advanced instruction, assemblers prepare one machine code instruction for each assembly instruction.
Comments