Classification of translators

Lecture




Translator (English translator - translator) is a translator program. It converts a program written in one of the programming languages ​​into a binary program file consisting of machine instructions, or directly executes the program actions.

Translators are implemented as compilers, interpreters, preprocessors and emulators. In terms of performance, the compiler and interpreter differ significantly.

The compiler (English compiler - compiler, collector) - reads the entire program, makes its translation and creates a complete version of the program in machine language, that is, a binary file containing a list of machine instructions. The binary file can be executable, library, object), it is executed by the operating system without the compiler.
The interpreter (English interpreter - interpreter, translator) - translates the program line by line (one operator each) into machine code (processor commands, OS, other medium), executes the translated operator (program line), and then moves to the next line of program text. The interpreter does not generate executable files, it itself performs all the actions recorded in the text of the source program.

After the program is compiled, neither the source program itself nor the compiler are needed anymore. At the same time, the program being processed by the interpreter must be re-translated into machine language every time the program is started.

Compiled programs run faster, but interpreted are easier to correct and change.

Each specific language is focused either on compilation or on interpretation, depending on the purpose for which it was created. For example, Pascal is usually used to solve fairly complex problems in which the speed of the programs is important. Therefore, this language is usually implemented using a compiler.

On the other hand, BASIC was created as a language for novice programmers, for whom line-by-line program execution has indisputable advantages.

Sometimes for one language there is both a compiler and an interpreter. In this case, to develop and test the program, you can use the interpreter, and then compile the debugged program to increase its speed.

A preprocessor is a translator from one programming language to another without creating an executable file or executing a program.

Preprocessors are convenient for extending the capabilities of a language and programming convenience by using the programming language’s dialect of a programming language that is more human-friendly and that the preprocessor translates it into a standard programming language that can be compiled with a standard compiler.

The emulator is a software and / or hardware tool operating in some target operating system and hardware that is designed to run programs made in another operating system or running on different hardware than the target hardware, but allowing the same operations to be performed in the target environment as in the simulated system.

Emulation languages ​​include such systems as Java, .Net, Mono, in which at the stage of creating a program it is compiled into a special bytecode and get a binary file suitable for execution in any operating and hardware environment, and the execution of the bytecode produced on the target machine using a simple and fast interpreter (virtual machine).

Reassembler, disassembler is a software tool designed to decrypt a binary code with its representation in the form of assembly text or text of another programming language, which allows you to analyze the algorithm of the original program and use the resulting text for the necessary program modification, for example, change the addresses of external devices, access system and network resources, to identify the hidden functions of a binary code (for example, a computer virus or other malicious program: a trojan, worm, keylogger, etc.).
created: 2014-09-30
updated: 2021-03-13
132535



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Programming Languages and Methods / Translation Theory

Terms: Programming Languages and Methods / Translation Theory