National 5 Computing Science
Compiler or interpreter? Spotting the clues
National 5 Computing Science: Computer systems
A processor can only run machine code, so a program written in a high-level language such as Python has to be translated first. National 5 asks about two kinds of translator, usually for 1 mark: name the right one for a situation.
The difference
| Interpreter | Compiler | |
|---|---|---|
| How it translates | One line at a time: translate a line, run it, then the next | The whole program, before it runs |
| Every time the program runs? | Yes: translated again every time | No: the machine code it makes runs without being translated again |
| A loop that repeats 10 times | The lines in the loop are translated 10 times | The lines in the loop are translated once |
| Good for | Writing and testing a program: errors show up as each line is reached | A finished program given to other people |
The clues in the question
- "Runs without further translation", "faster to run", "released to the public", "the users don't need the translator": compiler.
- "Translated each time it runs", "line by line", "while the program is being developed": interpreter.
In 2024 only some candidates named the right translator. One rule settles it: if the program is translated while it runs, every time it runs, it is an interpreter. If it runs without needing to be translated again, it was compiled.
Try two exam-style questions
Choose an answer, say how sure you are, then press Check. Every wrong answer tells you why it is wrong.

The full course covers every topic like this. Every topic in National 5 Computing Science has a short note, a simulation to try and a practice quiz with feedback on every answer, plus coding lessons, a full mock exam and a progress report for parents.
More guides
This site is independent: it is not connected to the SQA or Qualifications Scotland. Points from the examiners' course reports are given in our own words.