Types Of Program Translators

4.6.3 (7 questions). Public Notes: AQA's A Level Computer Science

Compare the method of error checking during translation between compliers and interpreters.

Compilers check source code line-line for errors before translatingWhile translators will translate program code line by line until they reach an line with an error where an interrupt will be thrown.

Compare the method of translation between compilers and interpreters.

Compilers translate the entire source code at onceWhile translators will translate and execute code sequentially after checking line by line for errors

Compare the final product of compilers and interpreters.

Final binary output of compilers can be executed independently of source code, and so offers code extraction protectionBoth the interpreter and the source code must be present for the program to execute, so offers no protection against code extraction.

Compare the speed of execution of the final product of compilers and interpreters.

Compilers produce binaries, which are essentially pure machine code which can be directly executed by the processor. Compiled code has a faster execution timeWhile translation must occur before each line is executed using an interpreter.

Compare source code and object code.

Source code is the input program code of a translatorObject code is the machine code/ byte code output of a translator.

Explain the purpose of a translator producing bytecode output instead of machine code.

Bytecode is an intermediate language, which enables code to platform independent, while still offering code extraction prevention and faster-than-interpreter execution speeds.

Explain how bytecode allows for platform independent execution, without all the disadvantages of a interpreter.

Software will run on many target machines called virtual machines. Virtual machines possess the ability to understand and execute bytecode, as all virtual machine will share an instruction set.