Translators, Knowledge Organiser

Knowledge Organiser: Translators (Compiler, Interpreter, Assembler)

Key Terms

  • Compiler: Translates the entire high-level program into machine code all at once, producing an executable file
  • Interpreter: Translates and executes a high-level program one line at a time — no output file created
  • Assembler: Translates Assembly language mnemonics into machine code (near one-to-one translation)
  • Source code: The original high-level or assembly program written by the programmer
  • Executable file: The compiled machine code file that can run directly without translation

Must-Know Facts

  • Compiler: translates ALL at once → creates executable → fast execution → reports all errors after compilation
  • Interpreter: translates ONE LINE at a time → no file created → slower execution → stops at first error
  • Assembler: translates Assembly mnemonics → machine code (1-to-1 mapping)
  • Compiled programs can be shared without source code; interpreted programs need source code every time
  • Interpreter is easier for development/testing (instant feedback); compiler is faster for final distribution
  • All three translators convert code the CPU cannot understand into machine code it can

Key Concepts

  • Compiler = translate whole book first, then read quickly; Interpreter = translate each sentence as you go
  • Interpreter advantage: easier debugging (stops at first error with line number shown)
  • Compiler advantage: faster execution; distributable without source code
  • Assembler is processor-specific — Assembly code for one CPU type won't assemble for another

Common Mistakes

  • Confusing compiler and interpreter behaviour on errors: A compiler reports ALL errors after translating the whole program; an interpreter stops at the FIRST error it encounters — different error reporting behaviour
  • Saying compiled programs run slower: Compiled programs run FASTER because translation has already been done — the executable runs directly on the CPU without re-translating each time
  • Forgetting the assembler as a third type: Many students only mention compiler and interpreter — the assembler (which translates Assembly mnemonics to machine code) is a distinct third translator type
  • Confusing Assembly language with machine code: Assembly uses human-readable mnemonics (LDA, ADD, STA); machine code is pure binary (0s and 1s) — they are different levels of language
  • Saying interpreted programs cannot be distributed: Interpreted programs can be distributed — but the recipient needs both the source code and an interpreter installed, unlike compiled executables which run standalone

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.