GCSE Computer Science · public explanation

Program Translators

Understand why programs need translation. Compare compilers, interpreters and assemblers, and explain how translation and error reporting differ.

Read the explanation and worked examples, then choose your exam board to continue with activities and practice in your account.

OCR J277On the specificationOCR J277 2.5.1

Purpose and differences of compilers and interpreters; assembler is not an additional required category.

AQA 8525 (2027+)On the specificationAQA 8525 3.4.4

Compiler, interpreter and assembler; interpreter execution using its own subroutines.

Connect source instructions to execution

A processor executes its machine instructions, not high-level source text directly. A translator or language execution tool provides the bridge. Source code is what the programmer writes; generated object or executable code is a different representation.

One program, two possible workflows

  1. In a compiled workflow, translate the source before running the generated program.
  2. In an interpreted workflow, the interpreter processes and carries out source instructions during execution.

The source can express the same algorithm while the translation and execution workflows differ.

Compile before running the generated program

A compiler translates a whole program into another form, typically object or machine code in the GCSE model. Compilation reports detected errors. Once a suitable executable has been built successfully, the user can run it without compiling the source again on each run.

Changing the source requires building a new version. A compiler can detect syntax errors but cannot guarantee that the program solves the intended problem correctly.

Use the interpreter while the program runs

An interpreter processes and carries out instructions as execution proceeds. It makes interactive testing and locating an encountered error convenient, but the interpreter remains needed to run the source. Repeated execution involves the interpreter again.

In the GCSE comparison, compiled programs often run faster after the build because translation has already taken place. Do not confuse build time with the time taken by a later execution.

AQA focus

AQA: be precise about an interpreter's action

AQA describes an interpreter as carrying out source statements by calling appropriate machine-code subroutines within its own code. These reusable routines already belong to the interpreter; calling them performs work and changes program values. The interpreter does not directly produce a translated machine-code program from the learner's source.

For example, an interpreter can use an existing multiplication routine with a count of eight and a price of three to calculate twenty-four. A later display operation makes that result visible. The values change; a new executable has not been generated from each statement. This is an explanatory model, not a prescribed implementation or a one-statement-to-one-machine-instruction rule.

An assembler translates assembly-language mnemonics into the corresponding machine code. It is a separate translator category from a high-level compiler or interpreter.

Give paired differences

A comparison needs both sides of the same property. Compare when translation happens, whether a separate executable is produced, how repeated runs work and how the developer encounters errors. Neither translation method removes the need for logical testing.

QuestionCompilerInterpreter
When is source processed?Before running the generated programAs execution proceeds
What is reused on a later run?The generated executableThe interpreter with the source
Why useful?Distribution and repeated executionInteractive development and feedback

Continue with your exam board

The course combines lesson videos, interactive activities, topic questions and original exam mocks. Sign in to use the learning tools and save your progress; your account’s course access applies.

Independent learning resources. Not endorsed by AQA or OCR. These public introductions complement the full course and the official specification.