A compiler and an interpreter both translate source code.
Describe one difference between what a compiler produces and what an interpreter produces.
Mark scheme
Award up to two marks for a linked description such as:
- A compiler produces object code/machine code/an executable (file) (1) whereas an interpreter produces no object code/translated file (1)
- A compiler produces a machine code file (1) that can be run on its own/without the compiler/translator being present (1)
- An interpreter produces no object code/file (1) because it translates and executes each line instead of saving translated code (1)
- The compiler's output can be saved/stored (1) and run again later, while interpreted code has to be translated again each time it is run (1)
Allow binary for machine code.
Allow executable/an executable for object code.
Do not accept responses about translating the whole program, reporting errors or the speed of execution.
Do not accept 'the interpreter translates/executes one line at a time' on its own: this is how it translates, not what it produces. It earns the development only when linked to no object code/translated file being produced.
Do not accept the interpreter producing object code/an executable.
Example answers and how they were marked
A compiler produces object code, which is saved as a file, whereas an interpreter does not produce a file because it translates and executes each line.
Why: Compiler produces object code (1) contrasted with the interpreter producing no object code/translated file (1).
The compiler produces machine code.
Why: Machine code/object code produced (1); there is no contrast with the interpreter, so the development is not earned.
The interpreter produces object code for each line it translates.
Why: Reverses the translators' outputs: the interpreter produces no object code, so nothing is creditworthy.