Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Languages

The characteristics of a compiler and an interpreter

All topicsPractise exam questions
Knowledge organiser

Languages

2.5.1c

The differences, benefits and drawbacks of using a compiler or an interpreter

What you need to know

A compiler translates the entire source code into machine code in one go before the program is run, creating a standalone executable file. An interpreter translates and executes the code line by line at runtime. Each has advantages and disadvantages related to speed, error handling, portability, and source code protection.

Key points

  • Definition:Compiler: translates the whole program into machine code before execution, producing a standalone executable file.
  • Definition:Interpreter: translates and executes code line by line at runtime, without producing an executable file.
  • COMPILER: translates the ENTIRE program at once, producing a standalone executable file.
  • COMPILER: compiled program runs/executes FASTER because it is already in machine code.
  • COMPILER: reports all errors at the END of translation / creates an error report. Code will not run until there are NO errors.
  • COMPILER: the executable file can be run WITHOUT the compiler. End users don't need the translator.
  • COMPILER: end users have no access to source code — code cannot be stolen/copied/modified.
  • COMPILER: only needs to translate ONCE — can be run again multiple times without re-translating.
  • INTERPRETER: translates and executes code LINE BY LINE at runtime.
  • INTERPRETER: STOPS when it finds an error and when corrected continues running from the same position. Helpful for debugging.
  • INTERPRETER: program needs to be translated EVERY TIME it is run — slower.
  • INTERPRETER: source code and interpreter must both be present to run the program.
  • Exam Tip:You need TWO differences. Common pairs: (1) all-at-once vs line-by-line, (2) creates executable vs does not, (3) errors at end vs stops at first error.
  • Exam Tip:When asked for BENEFITS of a compiler (not just differences): executable file, faster execution, no need to re-translate, source code protection, end users don't need translator. Don't just describe HOW it translates.
  • Exam Example:Fill in the blanks — 'high-level' language; interpreter 'stops' when error found; 'no' errors; 'executable' file; 'without' the compiler.
  • Exam Tip:'Faster/quicker' by itself is too vague — say 'compiled program runs faster' or 'executable runs faster than interpreted version'.