Interpreters

Cards (10)

  • Interpreters:
    1. Translate and execute each line of source code one by one
    2. Syntax-check each program line
    3. Convert each line of source code into machine code equivalent
    4. Execute each line
  • If a syntax error is found, e.g. a missing bracket, the program halts and it is reported
  • If a runtime error occurs, the program crashes
  • Interpreters
    • Allow the developer to test the program and to quickly identify and remedy each error as it occurs, without having to go through the whole process of translating the entire program every time
    • Very useful at the development stage of a program
  • Source code that is interpreted
    Runs more slowly than compiled code
  • Each time the program is run
    It must be translated all over again
  • The user must have the interpreter installed to be able to run the program
  • Interpreted code
    Can be advantageous if the programmer does not know which platform will be used to run the code
  • Most interpreted languages now use bytecode
    1. Source code is compiled to produce bytecode (low-level code)
    2. Bytecode is interpreted (i.e. translated and executed) by a virtual machine
  • Bytecode is used as an intermediate stage to speed up the translation process