3.3.1 - High- and low-level languages

3.3.1 - High- and low-level languages

A line of code can hide the processor's details or expose them almost instruction by instruction. In this lesson, you will compare high- and low-level languages and choose a suitable level by linking each task's needs to a language characteristic.

What language level means

A processor follows machine instructions. Programming languages differ in how much of that hardware detail they make the programmer handle. The amount of detail hidden from the programmer is called abstraction.

High-level language

A programming language with a high level of abstraction from the processor's machine instructions, allowing a programmer to express a solution without controlling each hardware operation.

High-level code lets the programmer concentrate on the problem and leaves the lower-level operations hidden.

Low-level language

A programming language with little abstraction from a processor's machine instructions, giving a programmer close control of hardware operations.

The words high and low describe distance from the processor, not quality. A high-level language is not automatically "better", and a low-level language is not an unfinished version of a high-level one. Each can suit a different purpose.

There are two important forms of low-level language:

FormRepresentationRelationship to the processor
Machine codeBinary instruction patternsThe instructions the processor can execute directly; the patterns depend on its instruction set.
Assembly languageShort mnemonic names such as LOAD, ADD and STOREEach mnemonic represents a processor instruction. It is more readable than binary, but still closely tied to a particular instruction set.

An assembly instruction maps closely to a machine instruction. A single high-level statement can instead describe a larger operation while hiding the smaller processor steps needed to achieve it.

High-level language characteristics

High-level languages such as Python, Java and C# let programmers work mainly with the problem they are solving rather than with processor instructions. Their syntax is still precise, but meaningful identifiers, familiar operators and words such as if make the code easier for humans to read than low-level code.

Their main characteristics are:

  • High abstraction: one statement can represent many lower-level operations.
  • Human readability: code is generally easier to learn, write, understand, debug and maintain.
  • Faster development: programmers can usually create and change solutions more quickly, helped by development tools and reusable libraries.
  • Greater portability: source code is generally not tied to one processor's instruction set, so it is easier to adapt for another architecture when the language and required libraries are supported on the target system.
  • Less direct hardware control: processor and memory details are mostly hidden, so the programmer has less precise control over individual hardware operations.

These characteristics make high-level languages suitable for most application software, large or frequently changing programs, and projects that must work across several types of computer.

Worked choice: a booking application

A theatre wants booking software that a team can update regularly and make available on different computer systems.

  1. Need: frequent changes and support for different systems.
  2. Characteristic: high-level source code is easier to read and maintain and is generally more portable.
  3. Consequence: the team can develop updates more quickly and adapt the source for each system that supports the language and required libraries.
  4. Choice: a high-level language is suitable.

Notice the qualification: portable does not mean "guaranteed to run unchanged everywhere". The target system must support the language and any libraries the program needs.

Low-level language characteristics

Low-level languages expose details that high-level languages usually hide. A programmer may work directly with processor instructions, memory locations and hardware operations.

Their main characteristics are:

  • Low abstraction: instructions are close to the operations carried out by the processor.
  • Architecture dependence: machine code and assembly are written for a particular instruction set, so code for one processor family will not normally work on a different one.
  • Fine hardware control: a programmer can control processor and memory operations precisely and interact closely with hardware.
  • More difficult development: binary patterns and assembly mnemonics are harder and more time-consuming for humans to read, write, debug and maintain than typical high-level code.
  • Potential resource efficiency: an expert can optimise low-level code for execution time, memory use or compact executable code because the hardware operations are controlled in detail.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account