Skip to topic
    ← Back to course topics

    Classification of programming languages and translators — AQA GCSE Computer Science

    Verified courseTeaching note checked against the official specification.

    Programming languages are classified into low-level languages (machine code and assembly) and high-level languages like Python, which require translators (compilers, interpreters, or assemblers) to convert source code into executable binary. Understanding how these tools execute instructions and manage hardware access is essential for writing efficient, secure code in AQA GCSE Computer Science.

    Classification of programming languages and translators explained

    A processor carries out instructions written in machine code, the binary patterns built into its design.

    Read the full explanation

    Each type of processor, such as a particular CPU family or a microcontroller, recognises only its own specific machine code instruction set: the fixed collection of instructions it can decode and execute, with defined binary patterns for operations like loading, adding or storing. This is why a program compiled for one processor type may not run on another, because the binary instructions mean something different or are not recognised. Assembly language is tied to the same instruction set, so an assembler targets a specific processor. Understanding this explains why software is built or compiled for a particular platform and why portability between different processors is not automatic.

    Read the Classification of programming languages and translators study guideFull revision notes for AQA GCSE Computer Science

    Your focus

    1. State that processors execute machine code.
    2. Explain that each type of processor has its own specific machine code instruction set.
    3. Describe a consequence of differing instruction sets, such as a program not running on a different processor type.

    Which command word is this?

    Set out the causes, reasons, or mechanisms behind a concept; require connecting phrases such as 'because', 'therefore', or 'which means that' to earn both assertion and reasoning marks.

    Classification of programming languages and translators exam tips

    Topic Overview

    This topic covers the hierarchy of programming languages, distinguishing between high-level languages and low-level languages (machine code and assembly code), alongside the specific translators used to bridge human-readable syntax and hardware architecture. You will explore how computers only natively execute binary instructions and learn how compilers, interpreters, and assemblers convert instructions into executable formats.

    Mastering language classification and translation mechanics is fundamental across computer systems, linking software design to the Von Neumann architecture, memory management, and operating system execution. In AQA GCSE examinations, these concepts frequently appear in comparison questions, scenario evaluations for embedded systems, and debugging analysis.

    Key Concepts
    • →Machine code consists purely of binary digits (1s and 0s) and is the only language directly understood and executed by the Central Processing Unit (CPU).
    • →Assembly language is a low-level language that uses human-readable mnemonics (e.g. INP, ADD, STA) to represent machine code instructions with a near one-to-one relationship to hardware instructions.
    • →High-level languages (e.g. Python, Java, C#) use problem-oriented, English-like syntax and data structures, allowing code portability across different processor architectures.
    • →Compilers translate entire high-level programs into machine code at once, generating an independent executable file, whereas interpreters translate and run code line by line in real time.
    • →Assemblers are dedicated translators designed specifically to convert low-level assembly language mnemonics into binary machine code.
    Marking Points
    • Processors execute machine code, which consists of binary instructions.
    • Each type of processor has its own specific machine code instruction set.
    • The instruction set is the fixed set of binary instructions a given processor can decode and execute.
    • Because instruction sets differ, machine code written for one processor type may not run on another.
    • Assembly language and its assembler are tied to a particular processor's instruction set.
    Examiner Tips
    • 💡Use the phrase 'instruction set' precisely to mean the processor's own set of binary instructions.
    • 💡When explaining portability, connect it explicitly to differences between instruction sets.
    • 💡Keep the focus on the processor executing machine code rather than on high-level language translation.
    • 💡When explaining the benefits of a compiler for distribution, always mention intellectual property protection: compiled code cannot be easily read or modified by the end user.
    • 💡Be precise with terminology: refer to 'machine code' or 'object code' rather than just 'computer language' or 'binary'.
    • 💡Remember the translator matching rule: High-level language -> Compiler or Interpreter; Assembly language -> Assembler.
    Common Mistakes
    • Thinking all processors understand the same machine code: correct this by stating each processor type has its own instruction set.
    • Believing machine code is translated again at run time: correct this by explaining the processor executes machine code directly.
    • Assuming a program runs unchanged on any device: correct this by linking portability problems to differing instruction sets.
    • Believing an interpreter converts the entire program before running it: an interpreter never produces an intermediate or final machine code file; it interprets and executes one statement at a time in memory.
    • Assuming assembly language is the same thing as binary machine code: assembly language is low-level text made of mnemonics and still requires translation via an assembler before the CPU can execute it.
    • Thinking high-level languages execute faster than low-level languages because they are newer: high-level languages have more overhead, abstraction, and memory safety checks, making them generally slower than hand-optimised low-level code.
    Revision Plan
    1. 1Day 1: Learn the definitions and characteristics of machine code, assembly language, and high-level languages.
    2. 2Day 2: Create a comparison table contrasting Compilers and Interpreters across speed, error handling, distribution, and code security.
    3. 3Day 3: Practice scenario-based questions identifying which language and translator fit embedded systems versus web development.
    4. 4Day 4: Attempt past AQA GCSE exam questions on translators under timed conditions and review against official mark schemes.
    Exam Question Types
    • 📋Table completion questions: checking boxes to indicate whether a feature applies to a compiler, interpreter, or both.
    • 📋Scenario-based justification: explaining which translator or language level is best suited for a specific system (e.g. washing machine vs cross-platform app).
    • 📋Short definition questions: defining terms like 'low-level language', 'mnemonic', or 'source code' for 1-2 marks.
    Command Word Expectations (AQA)
    Explain

    Set out the causes, reasons, or mechanisms behind a concept; require connecting phrases such as 'because', 'therefore', or 'which means that' to earn both assertion and reasoning marks.

    Compare

    Identify both similarities and differences between two or more items (e.g. compilers vs interpreters), making direct parallel points rather than listing isolated descriptions.

    State

    Give a specific name, fact, or brief answer without needing extended explanation or working.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Confusing how compilers and interpreters report errors and produce output.
    ❌ Weak Answer (Loses Marks):A compiler translates the whole code at once but an interpreter does it line by line and is slower.
    Example improved answer:A compiler translates the entire high-level source code into standalone machine code (object code) in one go, producing an error report at the end. An interpreter translates and executes the source code line by line, stopping immediately when it encounters the first error, without producing a permanent executable file.
    Examiner Tip: Always mention both the translation process (all at once vs line-by-line) and the output generated (executable object code file vs immediate execution without saving machine code).
    Pitfall: Failing to explain why assembly language is still used instead of high-level languages.
    ❌ Weak Answer (Loses Marks):Assembly is used because it is old and computers only understand binary.
    Example improved answer:Assembly language is used for low-level embedded systems and device drivers because it provides direct control over specific CPU registers and hardware architecture, and executes with minimal memory overhead compared to high-level languages.
    Examiner Tip: When asked why a developer would choose assembly code over a high-level language, refer directly to direct hardware/register manipulation or execution speed and memory constraints.
    Step-by-Step Worked Solutions

    Question: An embedded micro-controller inside a digital watch has strict memory limitations and controls specific hardware components directly. Explain whether the developer should write the software in a high-level language or assembly language, and state the type of translator required to run this code on the processor. [4 marks]

    1. 1.Step 1: Identify the hardware context provided in the scenario (embedded device, very limited memory, direct hardware control).
    2. 2.Step 2: Choose the language classification that matches these criteria: assembly language (a low-level language).
    3. 3.Step 3: Justify the choice: assembly language translates almost one-to-one into machine code, resulting in very small file sizes (conserving memory) and allows exact control of individual registers and memory addresses.
    4. 4.Step 4: Identify the specific translator needed: an assembler is required to translate assembly language mnemonics into binary machine code.
    Final Answer: The developer should use assembly language because it allows direct manipulation of CPU registers and hardware ports while producing compact executable code that uses minimal memory. The translator required to convert this code into executable machine code is an assembler.

    Question: Compare the use of a compiler and an interpreter for a software developer who is actively creating and debugging a commercial video game. [6 marks]

    1. 1.Step 1: Address the debugging and development phase: an interpreter allows faster testing because code can be edited and run immediately without waiting for recompilation, and execution stops on the exact line containing an error.
    2. 2.Step 2: Address the commercial distribution phase: a compiler generates a standalone executable file (.exe), which means end users do not need to install the translator to play the game.
    3. 3.Step 3: Address performance: compiled code runs significantly faster because it has already been translated into native machine code, which is essential for resource-heavy games.
    4. 4.Step 4: Address security/intellectual property: compiled object code hides the original source code from customers, preventing unauthorised modification or theft, whereas interpreted code requires shipping raw source code.
    Final Answer: During development, an interpreter is advantageous because it facilitates rapid debugging by halting execution immediately at syntax errors without requiring full recompilation. However, for commercial release, a compiler is preferable: it produces an independent executable file that runs faster (vital for real-time graphics), runs without an installed translator, and protects proprietary source code from being viewed or altered.
    Active Recall Memory Test
    What is the only type of code that a CPU can execute directly without translation?
    Key Fact: Machine code (binary instructions).
    Which translator converts low-level mnemonic instructions into machine code?
    Key Fact: An assembler.
    Name two advantages of distributing software as compiled code rather than interpreted source code.
    Key Fact: Faster execution speed and protection of source code/intellectual property from being read or modified.
    What action does an interpreter take when it encounters a syntax error during program execution?
    Key Fact: It halts program execution immediately and reports the error at the specific line reached.
    Frequently Asked Questions
    Why cannot a CPU directly execute Python or Java code?
    CPUs are digital electronic circuits built using logic gates that only process electric signals represented as binary 1s and 0s (machine code). High-level languages like Python use abstract, human-readable words and mathematical symbols that hardware cannot process directly. Therefore, the source code must first be translated into native machine code instructions via an interpreter or compiler.
    What is the difference between source code and object code?
    Source code refers to the original human-readable instructions written by a programmer in a high-level or assembly language. Object code is the machine-readable binary code produced after source code has been translated by a compiler or assembler. Object code can be executed directly by the processor or linked into an executable file.
    Is assembly language considered a high-level or low-level language?
    Assembly language is classified as a low-level language. Although it uses readable text mnemonics like 'MOV' or 'ADD' instead of pure binary 1s and 0s, each instruction corresponds almost directly to a single native machine code instruction for a specific CPU architecture, providing direct hardware control.
    Why do web browsers typically use interpreters rather than compilers for JavaScript?
    Web browsers use interpreters (and Just-In-Time compilation) so that web pages can load and run code immediately across different operating systems without requiring users to download pre-compiled executable files. This ensures platform independence and safety, as running unverified compiled binaries directly on a client device presents severe security risks.
    Can a programming language use both a compiler and an interpreter?
    Yes, many modern languages combine both approaches. For example, Java compiles source code into an intermediate platform-independent format called bytecode, which is then interpreted or Just-In-Time compiled into native machine code by the Java Virtual Machine (JVM) on the target device.