4.5 Translators Lab
Compiler, interpreter, assembler — the three translators, when to use each, and the trap that caught out most Nov 2025 candidates: they described HOW an interpreter works instead of WHY it suits the context.
4.5 Path
Mistakes
Stats
Bookmarks
Book Notes
Knowledge Vault
Add entry
Entries
What do I need to know before I start?
Section 4.5 is one of the most testable topics in the whole syllabus — Cambridge asks about translators every session, and the pattern is predictable: define one, describe the process, compare interpreter vs compiler, then a scenario asking WHICH translator and WHY. The Nov 2025 examiner report flagged the costly mistake directly: most students explained how an interpreter works instead of why it suits the context. On justification questions, always link your answer to the specific scenario.
By the end of 4.5 you can…
| Objective | Why it matters |
|---|---|
| Define translator, assembler, interpreter, compiler | 2025 Q6d(i–iv) — one mark each, exact roles. |
| Explain what an interpreter does, line by line | Textbook Table 4.3 — translates and runs one line at a time; stops at the first error. |
| Explain how a compiler produces an executable | Table 4.3 — translates the whole program at once into a file that runs on its own. |
| Compare interpreter and compiler (paired points) | s22 Q8 · s25 Q6c — answer in matched pairs, not a list. |
| Justify WHICH translator for a scenario — with WHY | n25 Q4d(iv) — the flagged weak area. Give the reason, not the mechanism. |
| Explain the benefits of an executable file | m22 Q7a(ii) — no source code exposed, no translator needed to run. |
Cambridge-approved terms
Software that converts code from one language into another — usually high-level into machine code.
Converts assembly language mnemonics into machine code.
Translates and runs the program line by line, and stops at the first error.
Translates the whole program at once, producing an executable file.
A compiled program that runs on its own — no translator needed and the source code is hidden.
The original high-level program the programmer writes, before translation.
The tables you must know cold
1. The three translators
| Translator | Converts | How |
|---|---|---|
| Assembler | Assembly → machine code | One mnemonic → one machine instruction. |
| Interpreter | High-level → machine code | Line by line; stops at the first error. |
| Compiler | High-level → machine code | Whole program at once → executable file. |
2. Interpreter vs compiler — paired points
| Interpreter | Compiler |
|---|---|
| Translates and runs line by line | Translates the whole program before running |
| Stops at the first error — good for developing/testing | Reports errors after compiling — good for finished programs |
| No executable produced; needs the interpreter each run | Produces an executable that runs without a translator |
Traps that cost marks every session
n25 trap: "reads line by line" is the mechanism. The mark wants the reason it suits the scenario (fix-and-continue, test in parts).
That's the interpreter. A compiler translates the whole program at once.
No — the compiler produces the executable file. The interpreter leaves no standalone file.
An assembler converts assembly → machine code. A compiler converts a high-level language → machine code.
An executable runs on its own — that's a key benefit of compiling.
Comparison marks come from matched pairs (interpreter does X / compiler does the opposite), not two separate lists.
Check yourself — tap to reveal
Answer in your head, then tap to see the model answer. Aim for 5 of 6 before moving to Learn.
✅ Ready for Learn?
Before moving on, make sure you can answer these without notes:
- Define translator, assembler, interpreter and compiler.
- Explain why an interpreter suits developing, and a compiler suits distributing.
- Give two benefits of an executable file.
- Compare interpreter and compiler in matched pairs.
- Remember: justify with WHY, not HOW.
📚 From the Textbook
A CPU does not speak Python, Java or VB.NET. It only understands one thing: machine code — pure binary. So every program written in a language a human can read must first be translated into a language the CPU can execute. That is the job of a translator. There are three of them, each specialised for a different starting point. An assembler converts assembly language line by line into machine code. An interpreter takes a high-level program and reads one line at a time — translating it and running it immediately, then moving to the next. A compiler takes the whole high-level program, checks and translates every line at once, and produces a stand-alone executable file that can be run without the compiler being present. Choosing the right translator depends on what stage you're at — writing, testing, or shipping.
📢 Getting Started
Think about the last time you ran a Python script. You typed python script.py and it just ran. But how did the CPU actually understand that? Was every line translated, or was the whole file translated first? What happens if line 5 has a typo — does line 4 still run? Write down what you think, then use the Translation Process Simulator to check whether you were right.
🌍 In Context — three translators in your life
You use all three of these translators every day without realising it:
- Interpreter — every time you run a Python or JavaScript program, an interpreter is doing the work line by line
- Compiler — the games and apps you download were compiled by their developers into
.exeor.appfiles; you never see the source code - Assembler — the firmware inside your microwave, washing machine and smart lightbulb was written in assembly and assembled into machine code before being burned onto ROM
🤔 Discussion — why hide the source?
A compiler produces an executable that does not include the original source code. Why might a software company prefer to ship a compiled program rather than the source? Think about (a) protecting intellectual property, (b) making sure end users do not need to install any translator software, and (c) preventing users from changing the code. Which reason do you think matters most?
Ready to move on? Read the Book Notes below, then jump into the Translation Process Simulator to see each translator in action.
📚 Book Notes — Exam Focus
📖 Topic Overview
Section 4.5 is one of the most testable in the whole syllabus. Cambridge asks about translators every session, and the pattern is predictable: define one; describe the process; compare interpreter vs compiler; then a scenario asking WHICH translator and WHY. Nov 2025 examiner report specifically flagged that most students explained how an interpreter works instead of why it suits the context — a costly mistake on 3-mark justification questions.
🎯 Learning Objectives — with Cambridge paper references
🔑 Key Terms — quick recall
Software that converts one language into another.
Assembly → machine code.
Line-by-line. Stops at first error.
Whole program. Executable file.
✍️ Worked Example — Nov 2025 Q4d(iv) style
Q: A student is writing and testing a program. Give ONE reason why an interpreter is more appropriate than a compiler. Answer with WHY, not just how. [1 mark] Nov 2025 Q4d(iv)
Model answer — full marks (any ONE of these):
✓ Because when an error is found, the student can fix it and continue running the program from the same position — without restarting or fixing every error first. 1 mark
✓ Because she can test parts of the program as she writes them, without completing the whole thing first. 1 mark
Common wrong answers that score 0:
✗ "Because an interpreter reads code line by line." — describes HOW it works, not WHY it suits her.
✗ "Because an interpreter translates high-level languages." — this is a general fact, not connected to her context.
📊 Quick Knowledge Check — before you start activities
Test yourself. Click each question to reveal the answer.
✅ Ready for Activities?
When you can (a) explain WHY an interpreter helps during writing, and (b) explain WHY a compiler suits distribution, jump to Activities → Scenario Justifier. That's where the Nov 2025 trap lives.
What is a translator?
A translator is software that converts a program from one language into another. In IGCSE Computer Science, this almost always means converting a language a human can read (high-level or assembly) into machine code that the CPU can execute directly. There are three translators on the syllabus. Each is designed for a different starting point.
Assembler
Takes assembly language (mnemonics like STO, ADD) and converts it into machine code for a specific processor. One mnemonic becomes one machine instruction.
Interpreter
Takes high-level code, translates and executes it one line at a time. Stops at the first error and reports it so the programmer can fix it. Never produces a standalone file.
Compiler
Takes high-level code, translates the whole program at once, reports every error together, and produces a stand-alone executable file that can be run without the compiler present.
🎬 Tool 1 — Translation Process Simulator
Pick a translator, then step through the process. See how each one handles input, processing, and output — with errors thrown in to show what really happens.
🎬 Tool 2 — Scenario Advisor
A programming scenario appears. Which translator would Cambridge recommend? Practise the reasoning pattern (context → benefit) that earns full marks.
Table 4.3 — Interpreter vs Compiler (full comparison)
These are the eight comparison points Cambridge draws from. Learn the pairs.
| Aspect | ▶️ Interpreter | ⚡ Compiler |
|---|---|---|
| Translation approach | Translates and executes one line at a time | Translates all lines before any execution |
| Error reporting | Stops at the first error and reports it | Reports every error together; program does not run |
| Best used when | Writing / developing — fix errors as you go | Finished / ready to distribute |
| Re-translation | Code must be re-translated every time the program runs | Code is translated once; executable is reused |
| Executable file | Does NOT produce an executable | Produces an executable file |
| Source code needed? | Yes — source code is required to run | No — only the executable file is needed |
| Extra software? | Interpreter software must be installed to run | No translator needed to run the executable |
| Partial testing | Can test part of a program without finishing it | A whole section must be complete before testing |
👩💻 Saria's Decision — the textbook worked example
The scenario
Saria is writing a computer game where a character walks through different worlds collecting coins. She is still writing the code — some parts work, some parts have bugs, and she wants to see the game run as she builds it. Which translator should she use?
The Cambridge answer
Interpreter is more appropriate. Here is why — this is what earns the marks:
- An interpreter stops as soon as it hits an error, so Saria can fix the error and continue from the same position without restarting the whole program.
- She can test parts of the game (e.g. just the character movement) before writing every level.
- A compiler would report every error at once and would not run any part of the game until she had fixed all of them — much slower when she wants to see progress as she goes.
WHY an executable file matters
When the program is finished and ready to be shipped to real users, a compiler is preferred. Three benefits:
Stand-alone
The executable runs on its own. Users do not need to install any translator software to run it.
Source hidden
The executable does not contain the original source code, so users cannot view or modify the program's logic.
Faster to run
Translation happens once. Every future run skips translation — the program starts faster and runs more efficiently.
⭐ Activity 1 — Translator Identifier (Signature)
Read the description or output and identify which translator is being described.
Press New.
🎮 Activity 2 — Fill-in-the-Gap
Click a word from the bank, then click the gap you want to place it in. Build the complete Cambridge-style answer about translators.
🎮 Activity 3 — Scenario Justifier (Nov 2025 fix)
A scenario appears. Pick the correct translator and the reason that earns the "why" mark. This trains the exact skill Nov 2025 flagged as weak.
Press New.
⏱️ Activity 4 — 60-Second Translator Sprint
Quick-fire recall. Match each statement to Interpreter, Compiler, or Assembler.
Adaptive practice
Press New.
Cambridge-style questions
Press New.
Review quiz
Press New.
Exam traps
Memory triggers
🧠 "Interpreter INTERROGATES each line"
Line by line, stops on first error, asks you to fix it. Like a strict examiner.
🧠 "Compiler COLLECTS every error first"
Reads everything, tells you every mistake at once, then either runs (if clean) or refuses (if buggy).
🧠 "Assembler ASSEMBLES mnemonics"
Only for assembly. Turns short codes (STO, ADD) into binary.
🧠 "Executable = Escape from the translator"
Once compiled, the .exe runs without needing the compiler. Free of its translator.
🧠 "WHY not HOW"
Justification questions want the reason IN CONTEXT. If you find yourself explaining the mechanism, stop and ask "why does this SUIT the scenario?"
Mastery Map
Checkpoints
Next up
Translators sorted. Next is 4.6 IDE Features Trainer — the editor, auto-completion, auto-correction, prettyprint, run-time environment, and debug features that live inside every code editor you use.