- A translator is a piece of software that translates high-level language sources into machine language programs (object code).
- There are two kinds of translation programs:
- Is a compiler, it will be a high-level language source program all translated into goal at a time, every time the executor, simply execute the target program, so as long as the source program, you don’t need to translate again, please note that the same kind of high-level language under the different system structures, compiled into object program is different, the target program related to architecture, But it’s still not a program that computer hardware can execute directly.
- The other is the interpreter, which translates a statement of the source program into the corresponding machine object code and executes it immediately, then translates the next source program statement and executes it until all the source program statements have been translated and executed. The interpreter executes sentence by sentence without generating the target program.
- An assembler is also a language translator that translates assembly language source programs into machine language programs. Assembly language is a machine – oriented low-level language. It is the symbolic representation of machine language and corresponds to machine language.
- The difference between compiler and assembler:
- A translator is called a compiler if the source language is a “high-level language” such as C, C++, Java, and the target language is a “low-level language” such as assembly language or machine language.
- If the source language is assembly language and the target language is machine language, such a translator is called an assembler.