- The difference between high-level and low-level programming languages.
- Why programs often need a translator before they can run.
- How compilers and interpreters work.
- The main benefits and drawbacks of using a compiler or an interpreter.
A programming language is a language used to write instructions for a computer.
When you write a program in a language such as Python, the text you write is called source code. Source code is designed to be understandable by programmers.
A CPU, however, can only directly execute machine code: binary instructions made from 0s and 1s. So, if you write code in a human-friendly language, something must convert it into a form the CPU can run.
Machine code
Machine code is a low-level programming language made of binary instructions that the CPU can execute directly.

The core idea
Programmers usually write code in a language that is easier for humans to understand, but the CPU ultimately needs machine code.
Programming languages can be described by their level.
The level tells you how close the language is to human language or to the computer hardware.
A high-level language is a programming language that is closer to natural human language and further away from the hardware.
Examples include Python, Java, JavaScript and C#.
High-level languages often use words and structures that are easier for humans to read, such as IF, WHILE, PRINT, variables and meaningful procedure names.
High-level languages are usually:
- Easier to read and write than machine code.
- Easier to debug, which means find and fix errors.
- Easier to maintain, meaning easier to update later.
- More portable, meaning the same source code can often be translated for different types of computer.
- Less directly connected to the hardware.
Portability
A program is portable if it can be used on different types of computer system with little or no change to the source code.
The drawback is that high-level language code cannot usually be executed directly by the CPU. It needs a translator.
A low-level language is a programming language that is close to the hardware.
For GCSE J277, the key low-level idea is machine code: binary instructions that the CPU can run directly.
Low-level languages are usually:
- Harder for humans to read and write.
- More closely linked to a specific CPU or type of hardware.
- Less portable.
- Useful when very direct control of hardware is needed.
- Potentially efficient, because the instructions are close to what the CPU actually runs.
You do not need to explain assemblers for this sub-topic.
| Feature | High-level language | Low-level language |
|---|
| Closeness to humans | Easier for humans to understand | Difficult for humans to understand |
| Closeness to hardware | Further from the CPU | Close to the CPU |
| Portability | Usually more portable | Usually hardware-specific |
| Translation needed? | Yes, before or during execution | Machine code can be executed directly |
| Ease of debugging | Usually easier | Usually harder |
| Typical use | General software development | Direct hardware control or very specific low-level tasks |
High-level does not mean more powerful
Do not assume “high-level” means “better” and “low-level” means “worse”. The words describe distance from the hardware, not quality.
Choosing a language level
A company is making a simple booking app that must run on different operating systems.
- The app needs to be developed quickly and maintained by programmers, so readability and maintainability matter.
- It must run on different systems, so portability is important.
- It does not need direct control of hardware, so a low-level language is not necessary.
- A high-level language is the better choice because it is easier to write, easier to maintain and more portable.
A translator is a program that converts code from one programming language into another.
In this topic, translators are needed because high-level source code must be converted into machine code so that the CPU can execute it.
Translator
A translator is software that converts program code into another language, usually from high-level source code into machine code.
Translators are needed because:
- The CPU only directly understands machine code.
- High-level languages are designed for humans, not CPUs.
- Translation allows programmers to write readable code while still producing instructions the computer can run.
- Translators can also report some errors in the source code.
A syntax error is an error where the code breaks the grammar rules of the programming language, such as a missing bracket or misspelled keyword.
A compiler is a translator that translates the whole program into machine code before the program is run.
The translated result is often saved as an executable file. An executable file is a program file that can be run by the computer.
Compiler
A compiler translates the whole source program into machine code before execution, usually creating an executable file.
A compiler has several advantages:
- The program usually runs quickly after it has been compiled.
- The executable can often be run many times without translating the source code again.
- The user does not usually need the compiler or the source code to run the program.
- The source code can be kept private, because users receive the executable rather than the original code.
- The compiler can report errors found during compilation.
A compiler also has disadvantages:
- The whole program must be compiled before it can run.
- If the compiler finds errors, it may not create an executable.
- Testing small changes can be slower because you may need to recompile.
- The executable may be specific to a particular operating system or type of processor.
An interpreter is a translator that translates and runs code one instruction at a time.
It does not usually create a separate executable file. Instead, the source code is translated as the program runs.
Interpreter
An interpreter translates and executes a program one instruction at a time, without producing a separate executable file.
An interpreter is useful because:
- It is good for testing and debugging.
- It can stop at the exact instruction where an error is found.
- You can run small sections or changes quickly.
- It is often convenient while developing a program.
An interpreter also has disadvantages:
- The program usually runs more slowly because translation happens during execution.
- The interpreter is needed each time the program runs.
- The source code is usually needed, so it is harder to keep the code private.
- The program is not distributed as a standalone executable in the same way as compiled code.
Fast clue for exam questions
If the question says the whole program is translated before running, think compiler. If it says code is translated and executed one instruction at a time, think interpreter.
| Feature | Compiler | Interpreter |
|---|
| Translation method | Translates the whole program at once | Translates and runs one instruction at a time |
| When execution happens | After compilation | During translation |
| Output | Usually creates an executable file | Usually no separate executable file |
| Speed when running | Usually faster | Usually slower |
| Debugging | Errors reported after compilation | Can stop when an error is reached |
| Source code needed by user | Usually not needed | Usually needed |
| Best suited for | Finished programs to distribute | Developing, testing and debugging |
Choosing a translator
A student is still developing a program and wants to test each change quickly.
- The program is not finished yet, so the student needs quick testing and easy debugging.
- If an error occurs, it would be useful for translation to stop at the instruction causing the problem.
- An interpreter is suitable because it translates and runs one instruction at a time, making it helpful during development.
- A compiler may be better later when the program is finished, because the final program can run faster as an executable.
Translation does not prove the program is correct
A compiler or interpreter can find some syntax errors, but a translated program can still have logic errors, where it runs but gives the wrong result.
- Source code: the program code written by a programmer.
- Machine code: binary instructions the CPU can execute directly.
- High-level language: closer to human language and easier to read.
- Low-level language: closer to hardware and harder for humans to read.
- Translator: software that converts code from one language to another.
- Compiler: translates the whole program before it runs.
- Interpreter: translates and runs one instruction at a time.
- Executable file: a translated program file that can be run.
In the exam
- When comparing language levels, mention both sides: high-level is easier for humans and more portable; low-level is closer to hardware and less portable.
- When asked why translators are needed, link your answer to the CPU only executing machine code.
- For compiler vs interpreter questions, structure your answer around translation method, output, speed, debugging and whether source code is needed.
Check yourself
- Why can a CPU not directly run most high-level source code?
- Give two benefits and one drawback of using a compiler.
- Why might an interpreter be useful while a programmer is developing a program?