Revise Computingrevisecomputing.co.uk
Free student revisionSee questionsFor schoolsSchool enquiry
Free revisionSee questionsFor schoolsSchool enquiry
Knowledge/A Level/H446/01 Computer systems/Applications Generation/Translators: interpreters, compilers…

Translators: interpreters, compilers and assemblers

Translators: Interpreters, compilers and assemblers

1.2.2 Applications Generation

Practise exam questions

Applications Generation — Note 4 of 6

Candidates need to understand the need for translators when writing programs. They need to have knowledge of the differences in operation of interpreters and compilers, from these they need to be able to assess the benefits and drawbacks of using each type, and recommend with justification which should be used in a specific scenario. Candidates need to understand the role of an assembler and how it differs from interpreters and compilers.

What you need to know

Processors can only execute machine code, so programs written in high-level or assembly language must be translated. Compilers, interpreters and assemblers do this in different ways, with different benefits and drawbacks.

What to know

Key terms

Exam tipCommon mistake

Compiler

Translates the whole high-level source code into machine code (object code) in one go, producing an executable file.

  • Compiler benefits: the executable runs faster; it does not need translating again; the user does not need the compiler; the source code is not distributed, protecting it.
  • Compiler drawbacks: all errors are reported at the end, which can make debugging slower; the executable only runs on the type of processor/OS it was compiled for; must recompile after every change.
Interpreter

Translates and executes high-level source code one line (statement) at a time, without producing an executable file.

  • Interpreter benefits: stops at the first error, making debugging easier during development; code can be run on any platform with an interpreter; no need to compile before testing.
  • Interpreter drawbacks: runs more slowly because each line is translated every time; the source code and interpreter must be present to run the program.
  • Common mistake: Saying an interpreter produces machine code that is saved. It executes each translated line immediately and does not save an executable.
Assembler

Translates assembly language into machine code. Each assembly instruction usually corresponds to one machine code instruction.

Exam technique

  • Tip:Recommend with justification: an interpreter during development (easier debugging), a compiler for the finished product (faster, source code protected).

Ready to test yourself?

Practise 1.2.2 questions
← Previous noteOpen source vs closed source1.2.2 Applications GenerationNext note →Stages of compilation: lexical analysis, syntax analysis, code generation and optimisation1.2.2 Applications Generation

Back to Applications Generation

Applications Generation

Note 4 of 6

  1. 1The nature of applications, justifying suitable applications for a specific purpose
  2. 2Utilities
  3. 3Open source vs closed source
  4. 4Translators: interpreters, compilers and assemblers
  5. 5Stages of compilation: lexical analysis, syntax analysis, code generation and optimisation
  6. 6Linkers and loaders and use of libraries
Topic overview