Program Translators (AQA GCSE Computer Science): Revision Notes
Programme translators
What are programme translators?
A programme translator is a special piece of software that acts like a language converter for computers. Just like how you might use Google Translate to convert English into French, a translator converts code written in high-level programming languages (like Python or Java) into low-level machine code that the computer's processor can actually understand and execute.
Without translators, high-level programming languages like Python simply wouldn't work - the computer has no idea what commands like print("Hello World") mean until they're translated into the binary machine code that processors can follow.
The concept of programme translation was pioneered by computer scientist Grace Hopper in the 1950s, who created the very first compiler in 1952 and programmed early computers like the UNIVAC.
The three types of programme translators
There are three main types of programme translators, each working in different ways and used for different purposes: compilers, interpreters, and assemblers.
Compilers
A compiler works like a professional book translator who translates an entire novel from one language to another before anyone reads it. It takes your complete high-level programme (the source code) and translates every single line into machine code all at once, creating what's called an executable file.
Worked Example: The Compilation Process
Step 1: You write your programme in a high-level language
Step 2: The compiler reads through your entire programme
Step 3: It converts every instruction into machine code
Step 4: It creates a standalone executable file that can run independently
Step 5: Once compiled, the executable can be run anytime without needing the original source code
The key advantage is that after compilation is complete, your programme runs very quickly because all the translation work has already been done. Most commercial software you buy or download has been compiled - this is why you can install and run programmes without seeing the original source code.
Interpreters
An interpreter works more like a live translator at a conference who translates speech line by line as someone is speaking. It reads one line of your high-level code, translates it immediately into machine code, executes that instruction, then moves on to the next line.

Worked Example: The Interpretation Process
Step 1: Read one line of high-level code
Step 2: Translate that line into machine code
Step 3: Execute the machine code instruction immediately
Step 4: Move to the next line and repeat
Python is a popular example of an interpreted language - you can download the Python interpreter for different operating systems and run Python programmes directly without creating executable files first.
The big advantage of interpreters is that they're excellent for programme development and debugging because if there's an error in your code, the programme stops immediately and tells you exactly where the problem occurred.
Assemblers
An assembler is a specialised translator that works with assembly language - a very low-level programming language that's just one step above pure machine code. Assembly language has what's called a 1:1 correspondence with machine code, meaning each assembly instruction translates into exactly one machine code instruction.
Think of assembly language as being like a more readable version of machine code - instead of writing pure binary numbers, you can write short commands like ADD or STORE that are easier for humans to understand but still very close to what the processor actually does.
Comparing the three translator types
| Translator | What it does | When to use it |
|---|---|---|
| Compiler | Translates your entire high-level programme into machine code and creates an executable file that can run independently | Perfect for creating commercial software that you want to distribute to users, since they get a fast-running programme without needing to see your source code |
| Interpreter | Translates and executes your high-level code one line at a time as the programme runs | Ideal when developing and testing programmes because it makes finding and fixing errors much easier - the programme stops exactly where problems occur |
| Assembler | Converts low-level assembly language instructions into machine code to create executable files | Used when you need maximum control over exactly how the computer hardware operates, often for system software or embedded devices |
Each translator type serves different purposes in software development, from creating fast commercial applications to enabling easy programme development and providing low-level hardware control.
Key concepts for exams
Speed differences: Compiled programmes run much faster than interpreted programmes because all the translation work happens before the programme runs. With interpreters, translation happens while the programme is running, which slows things down.
Hardware dependency: This is crucial to remember - all three types of translators are hardware-dependent. This means you need different translators for different types of processors or computers, even if you're translating the same high-level language.
File distribution: Compiled programmes can be distributed as executable files without sharing the source code, making them ideal for commercial software. Interpreted programmes require both the source code and the interpreter to be present on the target computer.
Error detection: Interpreters excel at helping you find bugs because they stop executing immediately when they encounter an error and show you exactly which line caused the problem. Compilers check for errors during the compilation process but won't catch runtime errors until you actually run the executable.
Remember!
Key Points to Remember:
- Program translators are essential software that convert high-level code into machine code that processors can execute
- Three main types exist: compilers (translate entire programmes into executables), interpreters (translate and run line-by-line), and assemblers (work with low-level assembly language)
- Compilers are best for distribution - they create fast, standalone programmes perfect for commercial software
- Interpreters are best for development - they make debugging easier by stopping exactly where errors occur
- All translators are hardware-dependent - different processors need different translators even for the same programming language