ProgrammingSequence, selection, iteration, procedures, functions, modules, parameters, compilers, interpreters

Syllabus Detail

  • Compiler / Interpreter Difference 12 ATAR

Background

  • Compilers and interpreters are different forms of programs
  • Both work to allow us to run programs and perform various functions
  • Their methods of working however are slightly different 

Interpreters

  • An interpreter is a program that analyzes and executes a program line-by-line
  • This means that instead of building the whole program before running, it runs each line sequentially
  • The overall execution time is slower using an interpreter
  • Interpreters are great for debugging, as they will execute the program line-by-line up until an error occurs
    • This makes bug finding easy and provides useful error feedback
  • Languages such as Java, Ruby, Python and Visual Basic use interpreters

Compilers

  • A compiler is a program that translates and executes another program in whole
  • The compiler works to first translate the entire program into machine code
  • Execution time is generally faster than using interpreters as the code is compiled as one block
  • Compilers use less system resources (memory) than interpreters
  • Error messages are only produced after the whole program has been analyzed, hence debugging is comparatively harder
  • Langauges such as BASIC, C++ and Objective-C use compilers

 

Interpreter vs. Compiler (copied from C4Learn - Compiler vs Interpreter)

Screenshot 2015 08 25 18.46.36

 

 

Further Research

  • Read ProgramWiz's article on Interpreter Vs Compiler here
  • Read TechWelkin's article on Compiler vs. Interpreter here

 

Worksheet and Practice (yet to be added)

Found an error or have an enhancement? Please let us know via this contact form