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.
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.
Each Next moves one box along the route. Every state here is the lesson's own; the page runs no code.
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?
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
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
What are high-level languages written in?
Why can't the CPU execute high-level code as it's written?
Name the two translators for high-level code.
What do translators let programmers do?
Without translators, what would the only option be?
What did high-level languages do for programming?
How does a compiler translate a program?
Which translator leaves you with something you can share and run later?
An interpreter is running your program. What's happening to each line?
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 OCR GCSE Computer Science topics
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.