Programming Languages and Translators · Cambridge syllabus 4.2 · Lesson 1 of 3
High-Level and Low-Level Languages
High-level languages use abstractions that are easier for humans to express and maintain. Low-level languages stay close to processor instructions. Assembly uses mnemonic instructions; machine code uses binary encodings understood by the processor.
By the end, you can
- Understand the characteristics of high-level programming languages.
- Explain why high-level languages are easier for humans to use.
- Identify benefits such as portability and abstraction.
- Understand machine code.
- Understand assembly language and why an assembler is needed to translate it into machine code.
- Compare low-level and high-level languages.
High-level languages
A high-level language is written in terms of the problem rather than the machine. Its statements use recognisable words and ordinary mathematical notation, and one statement generally becomes many machine instructions.
This makes it much quicker to write and far easier to read, so mistakes are rarer and easier to find, and a program can be maintained by someone who did not write it. Python, Java, VB.NET and C are all high level.
It is portable, or machine independent. The language says nothing about a particular processor, so the same source code can be translated for a different machine with a different instruction set and run there, which is impossible for code written in one machine’s own instructions.
It works by abstraction: the programmer is spared the details of registers, memory addresses and the instruction set, and can think about the task. The trade is a loss of direct control, and a program that may be slightly slower or larger than one hand-written for the machine, because the translator makes the detailed choices.
Worth remembering
- Written in problem terms, with one statement becoming many machine instructions.
- Faster to write, easier to read and maintain, and portable between machines.
- Less direct control over the hardware, and possibly less efficient code.
Low-level languages
A low-level language is written in terms of the machine. Machine code is the lowest: the binary instructions the processor executes directly, each an opcode and an operand, with no translation needed at all.
Nobody writes binary by hand, so assembly language gives each instruction a short mnemonic — LDA to load the accumulator, ADD, STO to store, JMP to jump — and lets addresses be named as labels. One assembly instruction corresponds to exactly one machine instruction, which is what makes it low level, and an assembler converts it.
Working this way gives complete control of the hardware and of memory, and allows code that is as small and fast as it can be. That matters where resources are tight or timing is exact: device drivers, embedded systems and parts of an operating system are still written this way.
The costs are severe. It is slow and difficult to write, hard to read, easy to get wrong, and tied to one instruction set, so it must be rewritten entirely for a different processor family. The programmer must manage registers and memory personally.
The trade is the same one in both directions: high level buys speed of development, readability and portability; low level buys control, size and execution speed.
Worth remembering
- Machine code is binary and runs directly; assembly gives it mnemonics and labels.
- One assembly instruction becomes exactly one machine instruction.
- Full hardware control and efficiency, but hard to write and not portable.
Worked example
A high-level loop may translate into multiple load, compare, branch and arithmetic instructions.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
Their abstractions and readable constructs make program intent easier to understand and modify.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.