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.

Python
  1. print("Starting up")
  2. points = 12
  3. print("Points:", points)
  4. print("Bonus:", points + bonus)
  5. print("Finished")

These are the messages Python 3 gives for this exact code. The page runs nothing; each result was written in advance.

Put the jobs in order

Translate, carry out, move on

the order an interpreter does these six jobs in when it runs a program of three statements

1 · Happens first6 · Happens last
  1. Translate statement 1

  2. Translate statement 2

  3. Translate statement 3

  4. Carry out statement 1

  5. Carry out statement 2

  6. Carry out statement 3

Which idea sounds like yours?

What do you think an interpreter does?

Maya has written a short Python program and is about to press Run. Four classmates each explain what the interpreter will do.

Which classmate is closest to what you think right now?
How sure are you?

Write it, then mark it

Describe an interpreter

Describe what an interpreter is and how it deals with a program written in a high-level language. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

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

1An interpreter is a type of translator for high-level source code.
2Its purpose is to translate and execute (carry out) a high-level program.
3It translates a statement, carries it out, then moves on to the next statement.
4It translates while the program is running, so it translates again each time the program is run.

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?
A translator: it translates high-level source code so the computer can carry it out.
What is the purpose of an interpreter?
To translate and execute (carry out) a high-level program.
How much of a program does an interpreter translate before it carries something out?
One statement. It translates it, carries it out, then moves on to the next.
When does an interpreter translate a program?
While the program is running, not beforehand.
What happens to the translation when you run the same program again?
It happens again: the program is translated each time it is run.
What does "execute" mean?
To carry out a statement once it has been translated.
Why is a translator needed for high-level code?
The code is written for people to read, so it must be translated before the computer can carry it out.

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 posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

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.