Lesson overview
Explain why source code must be translated and compare compilers, interpreters and assemblers.
Focus: Translators, compilers and interpreters.
What you will learn
- Explain why high-level source code must be translated before a computer can execute it.
- Describe a compiler as translating a whole program into executable code.
- Describe an interpreter as translating and running code line by line or statement by statement.
- Describe an assembler as translating assembly language into machine code.
Before you start
- Programming basics.
- CPU instruction processing.
- Binary representation.
Translation examples
Use the source-code, syntax-error and executable-file examples below to compare compiler and interpreter behaviour.
Translators, compilers and interpreters infographic

Explanation
Programmers often write high-level source code because it is easier for humans to read and maintain than machine code.
A translator converts code into a form the computer can execute. Compilers, interpreters and assemblers are different kinds of translators.
A compiler translates the whole program and can produce an executable file. An interpreter translates and runs code during execution, which can make testing interactive but may run more slowly.
Worked examples
Choosing a translator
A developer wants to distribute a program as an executable file.
The user should not need the source code to run it.
The whole program can be translated before distribution.
Answer: A compiler is suitable because it can translate the whole program and produce executable code.
Quick checks
1. Why is source code translated?
- a. So the monitor becomes brighter
- b. So storage is volatile
- c. So the computer can execute instructions
Reveal answer
Answer: c. Correct. Computers execute machine-level instructions.
Not quite. Translation bridges human-readable code and executable instructions.
2. Which translator processes a whole program before running?
- a. Compiler
- b. Interpreter
- c. Router
Reveal answer
Answer: a. Correct. A compiler translates the whole program.
Not quite. An interpreter typically runs code as it translates it.
Practice
1. What does an assembler translate?
Reveal answer
Answer: Assembly language into machine code.
Marking: Credit assembly to machine code.
2. Give one advantage of using an interpreter during development.
Reveal answer
Answer: It can help test code interactively or find errors as code runs.
Marking: Credit testing/debugging convenience.
3. Give one advantage of compiled code.
Reveal answer
Answer: It can run without the source code and may run faster.
Marking: Credit executable distribution or performance.
4. What is source code?
Reveal answer
Answer: Program code written by a programmer before translation.
Marking: Credit human-readable program instructions.
Exam practice ladder
- Fluency: recall the key term and use it accurately.
- Application: apply the idea to the scenario rather than giving a generic definition.
- Algorithmic reasoning: show the steps, condition or variable change clearly.
- Evaluation: explain why one method, structure or control is suitable.
Answers and marking guidance
Exact answers and marking guidance are hidden under each question. For this lesson, earn marks by naming the correct Computer Science idea, applying it to the scenario and showing the logic or value change clearly.
Common mistakes
- Saying high-level code is directly executed by the CPU without translation.
- Confusing compiler and interpreter behaviour.
- Forgetting assembler is linked to assembly language.
- Describing translation as changing natural language rather than program code.
Extension
Compare compiler and interpreter use for a beginner learning Python and a company shipping a desktop application.
Next lesson
Next, continue with System Performance Factors.
Exam-board guidance
Aplailasain is an independent learning resource and is not endorsed by any exam board.
AQA GCSE Computer Science
AQA GCSE Computer Science: this skill supports problem solving, clear algorithms and accurate programming explanations.
OCR GCSE Computer Science
OCR GCSE Computer Science: expect precise algorithm reasoning, trace work and careful use of programming vocabulary.
Pearson Edexcel GCSE Computer Science
Pearson Edexcel GCSE Computer Science: practise explaining the method as well as giving the final answer or code.
Eduqas GCSE Computer Science
Eduqas GCSE Computer Science: secure the transferable idea first, then check how your class applies it in tasks.
WJEC Wales
WJEC Wales: use accurate terminology and show enough working for the examiner to follow your logic.
CCEA
CCEA: connect the idea to your class route and use the same algorithm, programming or systems vocabulary your teacher uses.