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.

1 min read 20 exam questions 8 flashcards
On this page6 sections
  1. High-level and low-level languages
  2. Why translators are needed
  3. Compiler vs interpreter
  4. Key takeaways
  5. Glossary
  6. Test yourself

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.

A translator converts high-level source code to machine code; a compiler translates the whole program, while an interpreter translates and runs step by step.
From source to machine
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

4 questions

  1. Why are high-level languages popular?

    Because they are easier for humans to read, write, and maintain.

  2. Why are translators needed?

    Because the processor can only run machine code.

  3. What does a compiler do?

    It translates the whole program before it is run.

  4. What does an interpreter do?

    It translates and runs the program line by line.

Common questions

Why are low-level languages still useful?

Because they give more direct control over hardware and can be very efficient for specific tasks.

What is the main difference between a compiler and an interpreter?

A compiler translates the whole program first, while an interpreter works through it one line at a time.

Do I need to know assemblers for OCR J277?

No. Detailed knowledge of assemblers is not required.