← IGCSE Computer Science Paper 1

Disadvantages of an interpreter

An interpreter translates the source code again on every run, so programs run slower and need the interpreter and source code each time. Only one error is shown at a time.

Understanding Disadvantages of an interpreter in IGCSE Computer Science Paper 1

What it does: Translating and executing every line during each run adds extra work, so execution is slower than a compiled program that is already in machine code. The interpreter halts at the first error, so the programmer has to fix it and run again to find the next error, rather than getting a list of all errors. An interpreter repeats the translation on every run, which takes extra time. A compiler translates once and then the executable file runs directly.

Common mistakes: An interpreter translates the source code line by line. It does not loop over machine code, because it never produces a saved machine code file. The line should be: for line in source_code:. An interpreted program is translated again on every run. The loop must repeat once per run (range(runs)), not just once, because the translation is repeated each time.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 440–449) and word search (Modules 440–463).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Why does an interpreted program usually run more slowly than a compiled one?
It is translated line by line again every time it is runIt is translated once and the machine code is saved
Matches
Once an interpreter has run a program, the user no longer needs the source code or the interpreter to run it again.
↓
This is wrong because the interpreter produces no saved executable file, so both the source code and the interpreter are needed every time.
Applying
Meanings
Term
line by line every run
Meaning
An interpreter translates the source code again on every run, so programs run slower and need the interpreter and source code each time. Only one error is shown at a time.
Practice
FOR run ← 1 TO 3
Testing
Gaps
Translation happens again on run
Check Answer
Spots
1for line in machine_code:
2 translate(line)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Octopus' badge — Multi-Tasker, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Why does an interpreted program usually run more slowly than a compiled one?
A. It is translated once and the machine code is saved
B. It is translated line by line again every time it is run ✓
An interpreter repeats the translation on every run, which takes extra time. A compiler translates once and then the executable file runs directly.
2. What must a user have to run an interpreted program?
A. The interpreter and the source code ✓
B. Only an executable file
An interpreter does not create an executable file, so the interpreter and the source code are needed each time the program is run.
3. Which statement about giving an interpreted program to users is true?
A. The source code must be supplied, so users can see and copy it ✓
B. The source code stays hidden because only machine code is shared
Because the source code is needed to run the program, it has to be given to users. This is a disadvantage for security and for protecting your work.
4. A student runs the same interpreted program 10 times. How many times is it translated?
A. 10 times, once for each run ✓
B. Once, then the result is reused
An interpreter translates the code again every time the program runs. Nothing is saved for next time.
5. An interpreter finds errors in a program. What does it report?
A. A full list of every error at the end
B. One error at a time, where it stops ✓
An interpreter stops at the first error it finds. A compiler reports all the errors it finds after reading the whole program.

Match the Pairs

Run 1: translate line 1, line 2, line 3... Run 2: translate line 1, line 2, line 3... → The interpreter translates the source code again from the start every time the program is run
Give the user: game.py + Python interpreter → The source code and the interpreter must both be supplied to anyone who wants to run the program
Interpreted programs run more slowly because each line is translated while the program is running → for i in range(1000): translate(line) then execute(line)
An interpreter stops at the first error it finds, so only one error is shown at a time → Line 4: SyntaxError (fix it, run again, then Line 9: SyntaxError)
Once an interpreter has run a program, the user no longer needs the source code or the interpreter to run it again. → This is wrong because the interpreter produces no saved executable file, so both the source code and the interpreter are needed every time.
An interpreter lists every error in the whole program after translating all of it at once. → This is wrong because an interpreter works line by line and stops at the first error, so only one error is shown at a time.

Key Term

line by line every run
An interpreter translates the source code again on every run, so programs run slower and need the interpreter and source code each time. Only one error is shown at a time.

Fill in the Blanks

1. Translation happens again on every run
Hint: Type the word meaning each and all of the times the program is run
2. Interpreted code runs slower than compiled
Hint: Type the comparative word describing execution speed
3. Users need the source code and the interpreter to run the program
Hint: Type the name of the translator that must be present on every run
4. The user must be given the source code
Hint: Type what has to be supplied to users, which can be a security risk
5. Only one error is shown at a time
Hint: Type the number of errors reported at once

Spot the Error

Question 1
A for line in machine_code:
B translate(line)
C execute(line)
Line A — An interpreter translates the source code line by line. It does not loop over machine code, because it never produces a saved machine code file. The line should be: for line in source_code:
Question 2
A runs = 3
B for run in range(1):
C translate_all()
D execute_all()
Line B — An interpreted program is translated again on every run. The loop must repeat once per run (range(runs)), not just once, because the translation is repeated each time.
Question 3
A compiled = 10
B interpreted = 4
C if interpreted < compiled:
D print('Faster')
Line D — The interpreted program has the lower speed value because it is translated while it runs. The message should say it is slower, not faster.
Question 4
A needs_source_code = False
B needs_interpreter = True
C if needs_source_code:
D print('Share source')
Line A — An interpreted program cannot run without its source code, so the source code must be supplied to users. The value should be True.
Question 5
A errors = 3
B shown = errors
C print(shown, 'of', errors)
Line B — An interpreter stops at the first error it finds, so only one error is shown at a time. The line should be: shown = 1

Student with a class code? Join your class →