F
F
foxyboy2019-01-27 00:49:05
Books
foxyboy, 2019-01-27 00:49:05

Are the notions of translation, compilation, and interpretation in Tanenbaum's books correct?

I am studying the 6th edition of "Computer Architecture" by Tanenbaum. The book provides the following definitions.
Translation is the translation of a program from one language to another, when each command of the source program is replaced by a command or set of commands of the target. In this case, all source text is translated into a new language and then used.
The interpretation is the same, but each source command is replaced with a set of commands in the target language and immediately executed by the interpreter.
Compiling it means the same thing as broadcasting.
Other sources give a slightly different definition:
Translation is the process of translating a program from one language into another. It is divided into compilation and interpretation. When the target language is machine language or assembly, then it is compilation. When another program, then this is an interpretation.
Please tell me the correct definition of these terms.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vapaamies, 2019-01-27
@foxyboy

In the sense in which these terms are meant by Tannenbaum, the difference between translation and compilation is that in the first case there is a one-to-one (and potentially reversible) transformation of the statements of the input language (source code) into commands of the executor, and compilation is a more "creative" process , when an arbitrary (usually quite significant) number of executor commands corresponds to one operator of the input language, unambiguity is possible only at the level of code blocks, and reversibility is practically lost (unique decompilation is impossible).
In practice, translators are various assemblers, and compilers are machine code generators of high-level languages ​​(HLL). This is reflected in the literature: assembling programs with assembler is called translation, and translation (pun intended!) into mashcode of high-level languages ​​is called compilation. Sometimes they say "translation from HLL", implying the ambiguity of the process explicitly.
Another use of the term "translation" is as a unifying term for compilation and interpretation. In this case, we are talking only about high-level languages, assemblers are left out of brackets.

I used these terms incorrectly on my forum.
После углубленного изучения темы выяснилось, что процесс генерации обратимого кода для дальнейшего добавления в базу правильней называть трансляцией и установкой, а не компиляцией. В окончательном документе это будет учтено.

M
Moskus, 2019-01-27
@Moskus

These definitions are irrelevant, except when you are working on a project that is developing a compiler, decompiler, or some other tool that performs similar functions. It is important there, because the team must communicate in the same language and call the same thing the same way.
The main thing is that you understand the essence of these actions. In the book, these definitions are given for "internal" use, that is, so that you understand what this book is about .

S
Saboteur, 2019-01-27
@saboteur_kiev

If you dig too deep, you won't get a perfect match.
If you start digging - already compiled code - is executed by the processor, which is the machine code interpreter. If you dig even deeper - the processor has its own logical blocks, caching, parallel branches - the machine code is translated into a language understandable to these blocks, inside the blocks you can already reach transistors and electrical signals, and then get to the bottom of quantums.
In other words, don't dig too far - the formal language in IT is closer to physics than math after all.
For example - do not confuse machine language and assembler - when it comes to compilation and interpretation, these are different things.
You can go to a simple definition - the interpreter executes the commands of the program.
Therefore, interpretation is when your program text is executed directly by the interpreter.
Compilation - when your program text is converted into something else, and the result of compilation is used during execution, and not your program text.
Translation is an ambiguous thing, it is not always possible to translate code from one language to another, but when compiling, translation is used to initially prepare the source text for compilation. Pure broadcasting is a specific thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question