GCSE · Computer Science · Eduqas · Spec C500QS
Interpreters
Press Run on a program with a mistake in line 4. Lines 1 to 3 still get done first. Why does the interpreter bother?
Press Run
Watch an interpreter at work
This program should print a points total with a bonus added. Press Run and watch which lines get done. Then choose a fix for line 4 and press Run again.
This shows the idea of an interpreter working one statement at a time. Real language systems differ in the finer detail of how they do it.
- print("Starting up")
- points = 12
- print("Points:", points)
- print("Bonus:", points + bonus)
- print("Finished")
These are the messages Python 3 gives for this exact code. The page runs nothing; each result was written in advance.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
The translator that works one statement at a time, every time you press Run
What you need to know
- High-level code is written for people to read, so the computer needs a translator before it can carry it out.
- An interpreter is a type of translator: a program that translates high-level source code so the computer can carry it out.
- Its purpose is to translate and execute (carry out) a high-level program.
Have a goPriya says: "An interpreter only translates. Once it has translated your program, its job is finished." What has Priya left out?
Carrying the program out (executing it).
An interpreter's purpose is to translate and execute a high-level program, so translating is only half of its job.
- It works one statement at a time: translate a statement, carry it out, then move on to the next.
- So lines before a faulty line can already be done by the time the interpreter stops.
Have a goA program has 10 lines. The interpreter cannot carry out line 7, so it stops there. At most how many lines did it carry out?
6 lines: lines 1 to 6.
Each statement is translated and carried out in turn, so everything before the faulty line is done and the faulty line itself is not.
- The interpreter translates while the program is running, not beforehand.
Have a goYou have just typed a program but not pressed Run yet. How many of its statements has the interpreter translated so far?
None.
The interpreter translates while the program is running, not beforehand, so no translating happens until you press Run.
- That translation happens each time the program is run, so running it again means translating it again.
The big picture
An interpreter is a type of translator. It translates a high-level program and carries it out, one statement at a time, while the program is running. Because the translating happens during the run, it happens again every time the program is run.
Key points
Worked example
Problem
A program has 5 statements and runs to the end without stopping. It is run 3 times without being changed. How many statements does the interpreter translate in total, and why?
⚠ Watch out
Thinking the interpreter translates the whole program first and keeps the translation. It translates one statement at a time while the program runs, and it translates again on every run.
Memory hook
Translate it, carry it out, next one. Then do the whole thing again on the next Run.
Check yourself
Explain to a friend, in your own words, what it means to say a program is translated again each time it is run. Use a program you run twice as your example.
Flashcards
(7)What type of program is an interpreter?
What is the purpose of an interpreter?
How much of a program does an interpreter translate before it carries something out?
When does an interpreter translate a program?
What happens to the translation when you run the same program again?
What does "execute" mean?
Why is a translator needed for high-level code?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.