5.2 Language Translators

2026 Syllabus Objectives

By the end of this subtopic, you should be able to:

  • understand why an assembler is needed to translate an assembly language program

  • understand why a compiler is needed to translate a high-level language program

  • understand why an interpreter is needed to translate and execute a high-level language program

  • explain the benefits and drawbacks of using a compiler

  • explain the benefits and drawbacks of using an interpreter

  • justify when it is better to use a compiler and when it is better to use an interpreter

  • understand that some high-level language programs are partly compiled and partly interpreted, such as Java

  • describe the features of a typical Integrated Development Environment (IDE), including:

    • features for coding, such as context-sensitive prompts
    • features for initial error detection, such as dynamic syntax checking
    • features for presentation, such as prettyprint and expand/collapse code blocks
    • features for debugging, such as single stepping, breakpoints, and tools to view variables, expressions, and the report window

What is a language translator?

A computer processor can only run instructions in machine code. Machine code is made of binary patterns that the processor can understand directly. Humans do not normally write large programs in machine code because it is very hard to read, write, and fix.

Instead, programmers usually write code in either:

  • assembly language, which uses short instruction names called mnemonics
  • high-level languages, such as Python or Java, which are closer to normal English and much easier for humans to use

Because the processor cannot directly understand assembly language or most high-level languages, a translator is needed. A translator is a program that changes source code into a form that can be run.

There are three translators you need to know in this topic:

  • assembler
  • compiler
  • interpreter

Each one has a different job.


Why an assembler is needed

An assembler is used for an assembly language program.

Assembly language is a low-level language. This means it is close to machine code, but it still uses words or abbreviations that humans can remember more easily, such as instruction mnemonics. The processor cannot run these mnemonics directly, so the assembly code must be translated into machine code first.

The assembler does this translation.

A simple way to think about it is this:

  • the programmer writes an instruction in assembly language
  • the assembler changes that instruction into the matching machine code instruction
  • the processor can then execute it

So, the need for an assembler is clear: without it, the assembly language program could not be turned into machine code for the processor to run.

Assembly language is useful when very close control of hardware is needed, but it is harder to write than a high-level language. That is one reason why assemblers are important. They let programmers write in a slightly more human-friendly low-level form instead of writing raw machine code.

Sign in to view full notes