Why do we need translators?
For a program to be executed by a computer’s processor it must be in the form of machine code
What is an assembler? What is the translation like?
Translates assembly language into machine code. As they have a 1:1 relationship, the translation is quick and straightforward
Are assemblers platform specific?
Yes this means a different assembler must exist for each different type of processor instruction set
What is a compiler? Are they platform specific?
Used to translate programs written in high-level languages into machine code by taking the program as a source code, checking for any errors and then translating the entire program (object code). Once translated the program can run without requirement of any other software
Yes as they produce machine code
What is an interpreter, how does it work?
Translates high-level language into machine code line by line and have procedures that can be used to translate each kind of instruction
They check for errors as they go. This means the source code and interpreter need to be present when executing which results in poor protection of the source code
What is byte code?
An intermediate language sometimes formed when a compiler translates source code which allows for platform independence
Why are intermediate languages used?
Allows the translators to translate the source code once but still be able to execute the translated code with a variety of different processors
How is bytecode translated to machine code?
A virtual machine executes the bytecode once different processors
What is the input and output of translators called?
Input: source code (assembly language/ high-level language)
Output: object code