Languages & Translators

Understanding the difference between high and low level code, and how we translate it for the processor.

Lesson Objectives

1. Levels of Programming Language

High-Level

Python, Java, C#

Tap to Flip

High-Level Language

Designed for humans. Uses English keywords like print and if.

Exam Tip: Portable (runs anywhere) and easy to debug.

Machine Code

10110010 11001000

Tap to Flip

Machine Code

Pure Binary (1s and 0s). The only language the CPU understands.

Exam Tip: Specific to one type of processor. No translation needed.
Note on Assembly Language: Assembly is also a type of low-level language. However, for the J277 exam, you only need to evaluate Machine Code and do not need to know about Assemblers or mnemonics.

Examiner's Eye: The "Hex" Trap

Examiners will award zero marks if you state that machine code is written in Hexadecimal. Machine code is strictly binary (1s and 0s). Hexadecimal is only used by humans as a shorthand to make binary easier to read on screen.

Exam Tip Remember: Low-level languages are efficient and allow direct hardware manipulation, but difficult to write. High-level languages are slower to execute but much faster to develop software in.

2. Translators

Processors only understand Machine Code (Binary). Therefore, high-level code and assembly language must be translated before they can be run.

Examiner's Eye: The Purpose Trap

When asked why a translator is needed, writing "so the computer can understand it" is too weak and scores zero marks. To guarantee the mark, you must be highly specific: "To convert high-level source code into machine code/binary so the CPU can execute it."

Feature Compiler Interpreter
Translation Method ? ?
Executable File ? ?
Error Reporting ? ?
Distribution ? ?

Click the '?' boxes to reveal the answers

Examiner's Eye: The Speed Misconception

Do not just write "A compiler is faster". This is ambiguous! You must specify that a compiler creates an executable that executes faster, but the initial translation process actually takes longer than an interpreter.

Interactive Lab: See it in action

Run code through a virtual Compiler and Interpreter to see the difference.

Open Translator Lab
Grade 9 AO2

Stretch & Challenge

"Sarah is a freelance software developer who has written a new video game in Python. She wishes to distribute it for sale on a digital storefront online. Evaluate whether she should use a compiler or an interpreter to prepare her software for distribution." [8 marks]

View Examiner Model Answer

Sarah should definitively use a compiler for distribution.

Compilers translate the entire source code into a standalone executable file (.exe) which can be given directly to customers. This means her customers will not need to forcefully install the Python interpreter software just to play her game.

Crucially, compiling the code converts it strictly to machine code, which hides the original source code. This protects Sarah's intellectual property, preventing rival developers from seeing, stealing, or modifying her original code.

Finally, compiled software generally executes much faster as it is already fully translated into processor-ready binary, providing a smoother gaming experience, even though her initial compilation process back in her studio may take longer than interpreting.

Formative Assessment

1. Why does high-level code need to be translated?

2. Which translator should be used during active software development to catch errors efficiently line-by-line?