Topic 4 Software

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.

🧪 Cambridge Exam Mode ON — hints hidden, feedback delayed, model answers locked until marking.
Path

4.5 Path

Mistakes

Mistakes

Progress

Stats

0%Accuracy
0Answered
0Streak
Bookmarks

Bookmarks

Book Notes

Book Notes

Title
Note
Knowledge Vault 2.0

Knowledge Vault

Add entry

Category
Confidence
Title
Info

Entries

📚 Book Notes
📖 Learn
🎮 Activities
✎ Practice
📋 Exam
🔄 Review
🏆 Mastery
§1 · Topic overview

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.

§2 · Learning objectives

By the end of 4.5 you can…

ObjectiveWhy it matters
Define translator, assembler, interpreter, compiler2025 Q6d(i–iv) — one mark each, exact roles.
Explain what an interpreter does, line by lineTextbook Table 4.3 — translates and runs one line at a time; stops at the first error.
Explain how a compiler produces an executableTable 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 WHYn25 Q4d(iv) — the flagged weak area. Give the reason, not the mechanism.
Explain the benefits of an executable filem22 Q7a(ii) — no source code exposed, no translator needed to run.
§3 · Key terminology

Cambridge-approved terms

Translator

Software that converts code from one language into another — usually high-level into machine code.

Assembler

Converts assembly language mnemonics into machine code.

Interpreter

Translates and runs the program line by line, and stops at the first error.

Compiler

Translates the whole program at once, producing an executable file.

Executable file

A compiled program that runs on its own — no translator needed and the source code is hidden.

Source code

The original high-level program the programmer writes, before translation.

§4 · Core theory

The tables you must know cold

1. The three translators

TranslatorConvertsHow
AssemblerAssembly → machine codeOne mnemonic → one machine instruction.
InterpreterHigh-level → machine codeLine by line; stops at the first error.
CompilerHigh-level → machine codeWhole program at once → executable file.

2. Interpreter vs compiler — paired points

InterpreterCompiler
Translates and runs line by lineTranslates the whole program before running
Stops at the first error — good for developing/testingReports errors after compiling — good for finished programs
No executable produced; needs the interpreter each runProduces an executable that runs without a translator
§5 · Common misconceptions

Traps that cost marks every session

❌ Giving HOW instead of WHY

n25 trap: "reads line by line" is the mechanism. The mark wants the reason it suits the scenario (fix-and-continue, test in parts).

❌ "A compiler translates line by line"

That's the interpreter. A compiler translates the whole program at once.

❌ "An interpreter produces an executable"

No — the compiler produces the executable file. The interpreter leaves no standalone file.

❌ Assembler = compiler

An assembler converts assembly → machine code. A compiler converts a high-level language → machine code.

❌ "You need the translator to run a .exe"

An executable runs on its own — that's a key benefit of compiling.

❌ Listing instead of pairing

Comparison marks come from matched pairs (interpreter does X / compiler does the opposite), not two separate lists.

§6 · Quick knowledge check

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.

1 · What is a translator? Name the three types.
Tap to reveal
Software that converts code from one language to another (usually high-level → machine code). Types: compiler, interpreter, assembler.
2 · When is an interpreter more appropriate — and WHY?
Tap to reveal
When writing/developing. WHY: it stops at each error so you fix it and continue from the same position; you can test parts before finishing. (Give the WHY, not the HOW.)
3 · When is a compiler more appropriate — and WHY?
Tap to reveal
When the program is finished and distributed. WHY: it produces an executable that runs without a translator, hides the source code, and runs faster.
4 · What does an assembler do, and how does it differ from the others?
Tap to reveal
It converts assembly mnemonics into machine code. The interpreter and compiler translate a high-level language; the assembler translates assembly.
5 · Give two benefits of an executable file.
Tap to reveal
It runs without a translator installed, and the source code is hidden from users. (It also runs faster — translation happens once.)
6 · State one key difference between an interpreter and a compiler.
Tap to reveal
An interpreter translates and runs line by line (stopping at the first error); a compiler translates the whole program at once into an executable.

✅ 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 .exe or .app files; 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

Define translator, assembler, interpreter, compiler
2025 Q6d(i–iv)
Explain what an interpreter does line by line
textbook Table 4.3
Explain how a compiler produces an executable file
Table 4.3
Compare interpreter and compiler (paired points)
s22 Q8 · s25 Q6c
Justify WHICH translator for a scenario (with WHY)
Nov 2025 Q4d(iv) — weak area
Explain benefits of an executable file (no source, no translator)
m22 Q7a(ii)

🔑 Key Terms — quick recall

Translator

Software that converts one language into another.

Assembler

Assembly → machine code.

Interpreter

Line-by-line. Stops at first error.

Compiler

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.

⚠ Nov 2025 examiner report: "Few candidates could explain why an interpreter would be more appropriate. Most described how it works instead of why it suits the context." Always link your answer to the specific scenario in the question.

📊 Quick Knowledge Check — before you start activities

Test yourself. Click each question to reveal the answer.

1. What is a translator? Name the three types. tap to reveal ▾
A translator is software that converts code from one language into another — usually high-level to machine code. The three types are: compiler (all lines at once → executable file), interpreter (line-by-line, stops at first error), and assembler (assembly mnemonics → machine code).
2. When is an interpreter more appropriate — and WHY? tap to reveal ▾
When writing / developing a program. WHY: (1) it stops at each error so the programmer can fix it and continue from the same position; (2) they can test parts of the program before finishing the whole thing. Nov 2025 trap — give the WHY (context reason), not the HOW (mechanism).
3. When is a compiler more appropriate — and WHY? tap to reveal ▾
When the program is finished and being distributed to end users. WHY: (1) it produces an executable file that runs without any translator installed; (2) the source code is hidden from users; (3) the program runs faster since translation is done once, not every run.
4. What does an assembler do — and how is it different from the other two? tap to reveal ▾
An assembler converts assembly language mnemonics (LDD, ADD, STO) into machine code. Unlike compilers and interpreters, it only works with assembly — never with high-level languages like Python. It converts one mnemonic into one machine instruction.
5. What is an executable file and give TWO benefits. tap to reveal ▾
A file produced by a compiler that can run on its own. Benefits: (1) runs without any translator software installed; (2) does NOT contain the source code, so users can't view or modify the logic; (3) faster execution since no translation is needed at run time.

✅ 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.

⚡ Translation Simulator — pick a translator above
INPUT
PROCESS
OUTPUT
Pick a translator to begin.

🎬 Tool 2 — Scenario Advisor

A programming scenario appears. Which translator would Cambridge recommend? Practise the reasoning pattern (context → benefit) that earns full marks.

🎯 Scenario
Press New Scenario.

Table 4.3 — Interpreter vs Compiler (full comparison)

These are the eight comparison points Cambridge draws from. Learn the pairs.

Aspect▶️ Interpreter⚡ Compiler
Translation approachTranslates and executes one line at a timeTranslates all lines before any execution
Error reportingStops at the first error and reports itReports every error together; program does not run
Best used whenWriting / developing — fix errors as you goFinished / ready to distribute
Re-translationCode must be re-translated every time the program runsCode is translated once; executable is reused
Executable fileDoes NOT produce an executableProduces an executable file
Source code needed?Yes — source code is required to runNo — only the executable file is needed
Extra software?Interpreter software must be installed to runNo translator needed to run the executable
Partial testingCan test part of a program without finishing itA whole section must be complete before testing
⚠ Cambridge trap: "Compare" means pair each point. Saying "interpreter goes line by line" scores 1 mark; saying "interpreter goes line by line whereas compiler translates all lines first" scores 2. Always pair.

👩‍💻 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.
⚠ Nov 2025 trap: Students wrote "an interpreter reads code line by line and translates it" — that describes HOW it works, not WHY it's more appropriate. Full marks need the context connection: "because she can fix errors as she goes" / "because she can test part of the game without finishing it".

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.

⚠ Cambridge trap: Cambridge wants "the executable file can be distributed" AND "users do not need translator software" AND "source code is not visible". At least two of these earn the marks on a 2-mark question.

⭐ 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.

Loading...
Word bank — click a word, then click a gap:
Score: 0/6

🎮 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.

60
Score: 0
Press Start Sprint.

Adaptive practice

Press New.

Cambridge-style questions

Press New.

Review quiz

Press New.

Exam traps

⚠ 1 (Nov 2025): When asked WHY an interpreter is more appropriate, give the CONTEXT reason — "she can fix errors as she goes" or "she can test part of the program". Describing HOW the interpreter works (line by line) does NOT answer the question.
⚠ 2: Interpreter goes LINE BY LINE and STOPS at first error. Compiler translates ALL lines and REPORTS ALL errors together. Do not swap.
⚠ 3: Only a compiler produces an executable file. An interpreter never produces a stand-alone file.
⚠ 4: An executable file (compiler output) needs NO translator to run. An interpreter's program needs the interpreter installed every time.
⚠ 5: An assembler translates ONLY assembly language. It cannot translate Python or any high-level language.
⚠ 6: "Compare" wants paired points. "Interpreter goes line by line WHEREAS compiler translates all lines" scores 2. Just one side scores 1.

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

[ ] Define translator
[ ] Define assembler, interpreter, compiler
[ ] Describe interpreter process (line by line + stop)
[ ] Describe compiler process (all lines + executable)
[ ] Explain what an executable file is + its benefits
[ ] Compare interpreter and compiler (paired points)
[ ] Justify WHY (not just how) for a scenario
[ ] Recite Table 4.3 comparisons
[ ] Assembler ≠ interpreter / compiler
[ ] Cambridge exam confidence

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.

Developer Panel