2.5.1

Languages

Programming languages exist at different levels. You need to compare high-level and low-level languages, understand why translators are needed, and explain the differences between compilers and interpreters. The key is understanding the trade-offs rather than memorising unnecessary technical detail.

20 exam questions 8 flashcards

What you need to know

  • Explain the differences between high-level and low-level languages.
  • Explain why translators are needed.
  • Compare compilers and interpreters, including benefits and drawbacks.

Big Picture

High-level and low-level languages

Different languages are useful for different reasons.

TypeStrengthDrawback
High-levelEasier for humans to read, write, and maintainLess direct control over hardware
Low-levelCloser to machine code and hardwareHarder for humans to read and write

Machine Code

Why translators are needed

The processor cannot run high-level code directly.

Source code must be translated into machine code so the processor can execute it. That is why translators are needed.

Comparison

Compiler vs interpreter

You may be asked to compare these directly.

TranslatorHow it worksBenefitDrawback
CompilerTranslates the whole program before runningExecutable can run again without retranslationErrors may be reported after the whole translation stage
InterpreterTranslates and runs one line at a timeGood for testing and debugging line by lineProgram usually runs more slowly

Not required

Detailed knowledge of assemblers is not required.

Key takeaways

  • High-level languages are easier for humans to read and write.
  • Low-level languages are closer to machine code and can give more direct hardware control.
  • A translator is needed because the CPU only runs machine code.
  • A compiler translates the whole program, while an interpreter translates and runs code line by line.

Glossary

High-level language
A language designed to be easier for humans to read and write.
Low-level language
A language much closer to machine code and hardware.
Translator
Software that converts source code into machine code.
Compiler
A translator that converts the whole program before it runs.
Interpreter
A translator that converts and runs code line by line.

Test yourself

Common questions