TopMyGrade

GCSE/Computer Science/AQA

CS2.12Classification of programming languages and translators: high-level vs low-level; assemblers, compilers and interpreters

Notes

Classification of programming languages and translators

High-level vs low-level languages

Programming languages exist on a spectrum from machine code (the lowest level) up to high-level languages like Python.

Machine code (lowest level)

  • Instructions are binary numbers (0s and 1s) that the CPU executes directly
  • Specific to one processor family — x86 code won't run on ARM
  • Extremely fast — no translation needed at runtime
  • Virtually unreadable by humans:
10110000 01100001   ; move the value 97 into register AL

Assembly language

  • Uses mnemonics (short words) instead of raw binary
  • One mnemonic corresponds to one machine-code instruction
  • Still processor-specific (low-level)
  • Used in device drivers, embedded systems and performance-critical code:
MOV AL, 97    ; move 97 into register AL
ADD AL, BL    ; add register BL to AL

High-level languages

  • Use English-like syntax, maths notation and named variables
  • Portable — the same code can run on different hardware (after translation)
  • One line often compiles to many machine-code instructions
  • Examples: Python, Java, C#, JavaScript
score = score + bonus   # Python — one readable assignment

Why use each level?

LevelAdvantagesDisadvantages
Machine codeFastest execution; direct hardware accessUnreadable; not portable; very slow to write
AssemblyClose to hardware; readable mnemonicsStill processor-specific; complex
High-levelReadable; portable; faster to write; libraries availableSlower than machine code; less direct hardware control

Translators

A translator converts source code written in one language into another form that the computer can execute.

Assembler

  • Translates assembly language → machine code
  • Simple 1-to-1 translation (one mnemonic → one instruction)

Compiler

  • Translates a high-level language → machine code all at once, before execution
  • Produces a standalone executable file
  • Advantages: Fast execution (no translation at runtime); executable can be distributed without the source code; errors caught at compile time
  • Disadvantages: Must recompile after any change; compiled file is platform-specific

Interpreter

  • Translates and executes a high-level language one line at a time, at runtime
  • Does NOT produce a standalone executable
  • Advantages: Easier to debug (errors reported line by line); code can be run on any machine that has the interpreter installed; good for development/scripting
  • Disadvantages: Slower at runtime (translating happens every time the program runs); source code must be present to run

Compiled vs interpreted — quick comparison

FeatureCompilerInterpreter
Translation timeBefore running (once)During running (every time)
Speed of executionFastSlower
Error reportingAll errors at onceStops at first error
Distributable?Yes (binary)Source code needed
DebuggingHarder (batch errors)Easier (line-by-line)

Python uses an interpreter; C uses a compiler. Some languages (Java, C#) use both — compiled to bytecode, then interpreted/JIT-compiled by a virtual machine.

Exam tip

The most common question asks you to compare compiler and interpreter or explain why a developer might prefer one. Remember: compilers are faster at runtime; interpreters are easier to debug during development.

AI-generated · claude-opus-4-7 · v3-deep-computer-science

Practice questions

Try each before peeking at the worked solution.

  1. Question 12 marks

    High-level vs low-level

    Give two differences between a high-level language and a low-level language.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  2. Question 22 marks

    Role of an assembler

    Explain what an assembler does.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  3. Question 32 marks

    Compiler advantages

    State two advantages of using a compiler rather than an interpreter.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  4. Question 42 marks

    Interpreter advantages

    A developer is writing and testing a new script. Give two reasons why an interpreter might be more useful than a compiler during development.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  5. Question 54 marks

    Compare compiler and interpreter

    Compare how a compiler and an interpreter translate a high-level language program. In your answer, include: when translation happens, speed of execution and what is produced.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  6. Question 63 marks

    Why machine code?

    Explain why machine code is the only language a CPU can execute directly, and give one disadvantage of writing programs in machine code.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

Flashcards

CS2.12 — Classification of programming languages and translators

11-card SR deck for AQA GCSE Computer Science topic CS2.12

11 cards · spaced repetition (SM-2)