AQA GCSE Computer Science (8525), section 3.4.4 (Classification of programming languages and translators)
High-level languages
A high-level language is close to human language. Statements are easy to read and write, and one statement may do many things. Examples: Python, C#, Java, Visual Basic.
- Easier to learn, write and debug.
- Portable: the same program can run on different types of processor (with the right translator).
- Most programs are written in high-level languages.
- Does not let you control the hardware closely.
Low-level languages
A low-level language is close to the hardware, and works on the processor's own instructions. There are two kinds.
Machine code
- Binary instructions (1s and 0s) that the processor can run directly.
- Each type of processor has its own instruction set, so machine code is specific to a processor or family of processors.
- Very hard for people to read.
Assembly language
- Uses short words (mnemonics) such as
ADD,LDA,STArather than binary. - Has a 1:1 correspondence with machine code: one assembly instruction is turned into one machine code instruction.
- Easier to read than machine code, but still specific to a processor.
- Often used for embedded systems and for controlling specific hardware.
LDA 20 load the number in memory address 20
ADD 21 add the number in address 21
STA 22 store the answer in address 22
Translation is needed
The processor only runs machine code. So all code written in a high-level or assembly language must be translated into machine code.
Advantages and disadvantages
| High-level | Low-level | |
|---|---|---|
| Ease of writing | easier | harder |
| Readability | easy to read and understand | difficult |
| Portability | portable | specific to a processor |
| Speed and efficiency | usually slower, more memory | fast, small, efficient |
| Hardware control | limited | direct control |
| Development time | short | long |
Low-level languages are used where speed, small size or direct control of hardware matters, such as in embedded systems and device drivers.
Common mistake: saying assembly language is machine code. Assembly uses mnemonics and has to be translated (assembled) into machine code, with one assembly instruction giving one machine code instruction. Also, machine code is specific to a processor, not to a program.
Exam tip: for an advantages question, make your point about the language and link it to the result: "high-level code is portable, so it can run on different processors".
Check yourself
What is the relationship between assembly language and machine code?
Each assembly instruction corresponds to exactly one machine code instruction (1:1).
Give one advantage of a high-level language over a low-level language.
It is easier to read, write and debug, or it is portable between processors.
In which type of system might assembly language be used?
An embedded system, or to control specific hardware.