- Why high-level code must be translated before the CPU can run it.
- What a compiler does when it translates a program.
- What an interpreter does when it translates a program.
- How to compare compilers and interpreters in GCSE exam answers.
When you write a program in a language such as Python, Java, or C#, you are usually writing in a high-level language. This means the code is designed to be easier for humans to read and write.
A processor, however, does not understand Python-style instructions such as print("Hello"). The processor can only directly execute machine code: binary instructions specific to that type of CPU.
High-level language
A high-level language is a programming language that is designed to be understandable by humans and is mostly independent of the hardware it will run on.
Machine code
Machine code is the low-level binary instruction code that a CPU can directly execute.
Because of this, high-level code needs a translator.
Translator
A translator is software that converts high-level program code into machine code so that it can be executed by the computer.

The big idea
Both compilers and interpreters translate high-level code into machine code, but they do it in different ways and at different times.
A compiler translates the whole high-level program into machine code before the program is run.
The original high-level program is often called the source code. The translated machine-code version is often called an executable file or object code, depending on the context.
Compiler
A compiler is a translator that converts the whole program from high-level code into machine code before execution.
A simplified GCSE version of compilation is:
- The programmer writes the whole source code.
- The compiler checks and translates the whole program.
- If there are errors, the compiler reports them.
- If there are no errors, a machine-code executable can be produced.
- The executable can be run without translating the source code again.
So, with a compiler, translation happens before execution.
Compiled programs are often:
- faster to run once translated, because the translation has already happened
- distributable as executable files, so the user may not need the original source code
- useful when you want to protect the source code from being easily viewed
- less convenient during development if you need to recompile after changes
Compiler memory hook
Compiler = complete program first. It translates the whole program before the program runs.
An interpreter translates and runs a program one statement at a time.
Instead of producing a separate executable file first, the interpreter works through the source code during execution.
Interpreter
An interpreter is a translator that translates high-level code into machine code one statement at a time and executes it immediately.
A simplified GCSE version of interpretation is:
- The interpreter reads the next statement.
- It translates that statement into machine code.
- The CPU executes that translated instruction.
- The interpreter moves to the next statement.
- This repeats while the program is running.
So, with an interpreter, translation happens during execution.
Interpreted programs are often:
- easier to test and debug, because you can run the program and stop when an error is reached
- slower to run than compiled programs, because translation is happening while the program runs
- dependent on having the interpreter installed on the machine
- not usually turned into a separate machine-code executable by the interpreter
Saying interpreters do not translate
Do not write that an interpreter “does not translate” the program. It does translate high-level code into machine code — it just does it one statement at a time during execution.
The exam specification asks you to understand how an interpreter differs from a compiler in the way it translates high-level code into machine code.
That means the most important comparison is the method of translation, not just general advantages and disadvantages.
| Feature | Compiler | Interpreter |
|---|
| Amount translated | Translates the whole program | Translates one statement at a time |
| When translation happens | Before the program runs | During program execution |
| Output | Usually produces a machine-code executable | Usually does not produce a separate executable |
| Error handling in GCSE terms | Reports errors after checking/compiling the code | Stops when it reaches an error |
| Running again | Executable can be run again without recompiling, unless the source code changes | Source code is translated again each time it is run |
| Speed while running | Usually faster after compilation | Usually slower because translation happens as it runs |
Best one-sentence comparison
A compiler translates the whole program into machine code before execution, while an interpreter translates and executes the program one statement at a time during execution.
Identifying the translator from behaviour
A program is translated into machine code. The translator reads the first statement, translates it, executes it, then moves to the next statement. When it reaches an error, the program stops at that point. Decide whether this describes a compiler or an interpreter.
- The translator is not translating the whole program before running it; it is handling one statement at a time.
- Each statement is executed immediately after it has been translated, so translation is happening during execution.
- Stopping when it reaches an error matches the GCSE description of an interpreter.
- Therefore, the translator is an interpreter.
A programmer might choose a compiler when they want the final program to run efficiently.
For example, a game or large application may be compiled so that users can run the finished executable without translating the whole source code each time.
A compiler is also useful when distributing software because the user normally receives the executable file rather than the original source code.
However, during development, compilation can take time. If you change the source code, you usually need to compile it again before running the updated version.
A programmer might choose an interpreter when they are developing and testing code.
Because the interpreter works through the program step by step, it can be useful for finding where an error occurs. This is one reason interpreted languages are often beginner-friendly.
Python is commonly described at GCSE as an interpreted language. In real computer systems, translation can be more complicated, but for Edexcel GCSE you should focus on the clear distinction: line-by-line during execution versus whole program before execution.
Real systems can be more complex
Some modern languages use mixed approaches, such as bytecode or virtual machines. For GCSE 1CP2, keep your answer focused on the expected comparison: compiler translates the whole program before execution; interpreter translates and executes one statement at a time.
Choosing a translator for development or distribution
A programmer is creating a new program and keeps testing small changes. Later, they want to send the finished program to users as a file that runs quickly. Which translator is more suitable at each stage?
- During development, the programmer needs to test changes often and find errors easily, so translating and running one statement at a time is helpful.
- That behaviour matches an interpreter, because it translates during execution and can stop where an error occurs.
- For the finished program, the programmer wants users to run it quickly without translating the source code each time.
- That behaviour matches a compiler, because it produces machine code before execution, often as an executable file.
- So, an interpreter is more suitable during testing, while a compiler is more suitable for distributing the final program.
Questions may use different phrases for the same core ideas.
If you see:
- “translates the whole program” → think compiler
- “before the program is executed” → think compiler
- “produces an executable file” → think compiler
- “translates one line/statement at a time” → think interpreter
- “translates during execution” → think interpreter
- “stops when it reaches an error” → think interpreter
Only giving advantages
If the question asks how an interpreter differs from a compiler, do not only write “one is faster” or “one is easier to debug”. You must explain the translation difference: whole program before execution versus one statement at a time during execution.
At GCSE level, you can say:
- a compiler checks/translates the whole program and then reports errors
- an interpreter stops when it reaches an error during execution
This is useful in exam answers, but remember the main focus of this spec point is not detailed error types. The key focus is how high-level code is translated into machine code.
In the exam
- If asked to compare them, write paired points: “A compiler does X, whereas an interpreter does Y.”
- Always include the translation timing: compiler before execution; interpreter during execution.
- Mention the amount translated: compiler translates the whole program; interpreter translates one statement at a time.
Check yourself
- What does the CPU directly execute: high-level code or machine code?
- How does a compiler translate a program differently from an interpreter?
- Why might an interpreter be useful while a programmer is testing code?