Seneca

Translation - Interpreters

Computer Science: OCR GCSE, topic 2.5.4

Interpreters

Interpreters are a type of translator which convert high level languages to executable machine code.

Interpreters

Interpreters

  • Interpreters translate high-level source code into executable binary one line at a time.
  • Python and JavaScript are interpreted languages.
Pros of interpreters

Pros of interpreters

  • Interpreters will stop as soon as they meet an error:
  • Stopping at an error helps debugging.
  • Interpreted languages are 'portable':
  • Interpreted languages can run on many different types of central processing unit.
  • Running on a central processing unit needs an interpreter for that platform.
Cons of interpreters

Cons of interpreters

  • Running an interpreted program is slower than a compiled program.
  • Each line must be translated every time the software runs.
  • Interpreted programs are quicker to get started.
  • Getting started quickly can be good for small changes.
  • Interpreters do not produce a compiled program file:
  • The process must be repeated each time the program is run.

Test yourself on Translation - Interpreters

  • Compare how fast a program runs when it is translated by an interpreter rather than a compiler.

  • A computer has an interpreter for Python installed but no interpreter for JavaScript. What happens if someone tries to run a program written in JavaScript on this computer?

Practise this topic for free