AQA · GCSE · Computer Science · Higher
Compiler and interpreter operation
Describe how compilers and interpreters operate.
Write your answer first. You can study the marking guidance whenever you need it.
Study the marking See what earns credit and compare it with a full-mark answer.
Marking points
- 1 For more than 3 marks, describes both a compiler and an interpreter.
- 2 Whole-program translation is a credited compiler point.
- 3 A standalone compiled program is a credited compiler point.
- 4 A list of syntax errors after compilation is credited.
- 5 Creating executable/object/machine code without executing source is credited.
- 6 Line-at-a-time translation/execution is a credited interpreter point.
- 7 Requiring the interpreter is credited.
- 8 Requiring source each run/no separate executable is credited.
- 9 Stopping at the first syntax error is credited.
- 10 Executing code as it is translated is credited.
Full-mark answer
A compiler translates the whole source program in one go and creates executable machine/object code; it reports syntax errors after compilation, and the executable can then run without the compiler or source code. An interpreter translates and executes one line at a time, stops when it reaches a syntax error, and requires the source code and interpreter each time because it does not create a separate executable.
Why this answer loses marks
Both translators turn the whole program into an executable before it runs.
That misses line-by-line interpretation, its run-time source and interpreter needs, and its immediate stopping on an error.