2.2.5

Translators

Test yourself

Compilers

Translators are special software that convert source code into executable binary. Compilers are just one type of translator:

Illustrative background for CompilersIllustrative background for Compilers ?? "content

Compilers

  • Compilers translate the whole of a program in one go.
  • Compilers will provide a list of errors once it has attempted the compilation process:
    • This can make debugging easier.
  • C, C++, Visual Basic, and Swift are all compiled languages.
Illustrative background for Pros of compilersIllustrative background for Pros of compilers ?? "content

Pros of compilers

  • Compilers produce an executable program:
    • There is no need to repeat this process more than once per version of the software.
  • Compilers hide the source code from the end user:
    • This helps to protect developers' intellectual property.
Illustrative background for Cons of compilersIllustrative background for Cons of compilers ?? "content

Cons of compilers

  • The compilation process can be very slow:
    • This can slow down development if many small changes need to be made.

Interpreters

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

Illustrative background for InterpretersIllustrative background for Interpreters ?? "content

Interpreters

  • Interpreters translate high-level source code into executable binary one line at a time.
  • Python and JavaScript are examples of interpreted languages.
Illustrative background for Pros of interpretersIllustrative background for Pros of interpreters ?? "content

Pros of interpreters

  • Interpreters will stop as soon as they encounter an error:
    • This is useful for debugging.
  • Interpreted languages are 'portable':
    • This means that they can be run on many different types of central processing unit as long as there is an interpreter available for the platform.
Illustrative background for Cons of interpretersIllustrative background for Cons of interpreters ?? "content

Cons of interpreters

  • Running an interpreted program is slower than a compiled program because we have to translate each line every time we run the software.
    • But it is quicker to get started which 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.

Assemblers

Assemblers translate assembly code into executable binary.

Illustrative background for AssemblersIllustrative background for Assemblers ?? "content

Assemblers

  • Assembly is a very low-level programming language.
  • Each instruction directly corresponds to a binary sequence, and the assembler replaces the commands with the relevant binary.
Illustrative background for Pros of assemblersIllustrative background for Pros of assemblers ?? "content

Pros of assemblers

  • Assembly provides exact control over the hardware:
    • This can lead to very efficient code that takes up little space in memory and is quick to execute.
  • Assembly can be used on low specification machines.
Illustrative background for Cons of assemblersIllustrative background for Cons of assemblers ?? "content

Cons of assemblers

  • Assembly is very difficult to use, and needs deep technical knowledge of the central processing unit and the memory.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson