GCSE · Computer Science · OCR · Spec J277

Translators (purpose)

Type print("Hello") and it makes perfect sense to you. The CPU can't use it: it needs machine code, 1s and 0s. So how does your program ever run?

Follow one program, twice

Take the translator away

A one-line program heads for the CPU. First there's a translator on the route. Then there isn't.

Before each Next, predict where the program goes. Watch closely when the translator disappears.

YesNoStartHigh-levelcodeTranslator?Make machine codeCPU executes itCPU can't run itWrite 1s and 0s
program=print("You win!")

Output

 

Step 1: Here's a whole program: print("You win!"). One line, and you can read it instantly. Let's send it to the CPU.

1 / 8

Each Next moves one box along the route. Every state here is the lesson's own; the page runs no code.

Step 1 of 8: Here's a whole program: print("You win!"). One line, and you can read it instantly. Let's send it to the CPU..

Watch out: Code that looks like English is written for you, not for the CPU. Looking readable doesn't make it runnable.

Predict, then check

Commit to an answer before you reveal. Think about what the CPU can actually execute.

Overnight, every translator in the world vanishes: no compilers, no interpreters. What happens to high-level languages?

Compiler or interpreter?

Build the comparison grid

Both of these translate high-level code into machine code. Tick each property that translator has, then check your grid.

Compiler
Interpreter

Your turn to explain

Write it, then mark it

Explain why a program written in a high-level language needs a translator before the computer can run it. [3 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.

You write code in something close to English. The CPU needs 1s and 0s. Something has to bridge that gap.

What you need to know

  • Computers need instructions in machine code: binary instructions, 1s and 0s, that the CPU understands.
  • Programmers can write in high-level languages instead, which use structured English.
  • So high-level code has to be translated into machine code before the CPU can execute it.
  • Have a goYour mate types print("Hi") and announces: "The CPU can run that straight away. It's basically English!" Fair point?

    No. It has to be translated into machine code first.

    Looking like English is exactly the problem. The CPU needs machine code, binary 1s and 0s, not structured English.

  • Compilers and interpreters are the translators that do this job.
  • They let programmers write in normal structured English and still get instructions the computer can execute.
  • Without translators, the only option would be machine code. High-level languages only exist because of translators.
  • Have a goIf translators disappeared tomorrow, which would vanish with them: high-level languages or machine code?

    High-level languages.

    Machine code is what the CPU runs, so it doesn't need a translator. High-level languages only exist because translators turn them into machine code.

  • High-level languages made programming more accessible to a wider audience.
  • A compiler translates the whole program into machine code at once, creating a single executable file.
  • That executable file can be run without the original code.
  • An interpreter translates and runs the code line by line, and doesn't create an executable file.
  • Have a goPriya's translator works through her program one line at a time, running each line as it goes. When it's finished, can she share an executable file?

    No.

    Translating and running line by line is what an interpreter does, and an interpreter doesn't create an executable file. A compiler is the one that creates it.

The big picture

Computers need instructions in machine code: binary 1s and 0s that the CPU understands. High-level languages use structured English, so their code has to be translated first. Compilers and interpreters are the translators that do it. Without them, the only option would be machine code, so high-level languages only exist because of translators, and those languages made programming accessible to a wider audience. A compiler translates the whole program at once into a single executable file that runs without the original code; an interpreter translates and runs the code line by line and creates no executable file.

Key points

1The CPU needs machine code (binary 1s and 0s), so high-level code written in structured English has to be translated first.
2Compilers and interpreters are the translators: they let programmers write in structured English and get instructions the computer can execute.
3Without translators the only option would be machine code; high-level languages only exist because of translators, and they made programming accessible to a wider audience.
4A compiler translates the whole program at once into a single executable file that runs without the original code; an interpreter translates and runs line by line and creates no executable file.

Worked example

Problem

Exam-style question: Compare how a compiler and an interpreter translate a program.

⚠ Watch out

Thinking the CPU can run high-level code because it looks like English. It can't: the CPU needs machine code, so a compiler or an interpreter has to translate the code first.

🧠

Memory hook

No translator, no high-level code. Then tell the two apart: a Compiler takes the Complete program in one go and leaves a file behind; an Interpreter goes line by line and leaves no executable file.

✓

Check yourself

Close the page and say it out loud: why does high-level code need translating, what would programmers be stuck with if translators didn't exist, and what's one thing a compiler does that an interpreter doesn't?

Flashcards

(10)
Machine code
Binary instructions, 1s and 0s, that the CPU understands.
What are high-level languages written in?
Structured English.
Why can't the CPU execute high-level code as it's written?
The CPU needs instructions in machine code, so high-level code has to be translated first.
Name the two translators for high-level code.
Compilers and interpreters.
What do translators let programmers do?
Write programs in normal structured English, then have them translated into instructions the computer can execute.
Without translators, what would the only option be?
Writing programs in machine code. High-level languages only exist because of translators.
What did high-level languages do for programming?
They made it more accessible to a wider audience.
How does a compiler translate a program?
The whole program into machine code at once.
Which translator leaves you with something you can share and run later?
A compiler. Its single executable file can be run without the original code.
An interpreter is running your program. What's happening to each line?
Each line is translated, then run, one at a time. No executable file is made.

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 OCR GCSE Computer Science topics

See the full OCR Computer Science curriculum →

How this lesson was checked. This OCR GCSE Computer Science (specification J277)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 4 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.