Languages and translators
High- and low-level languages
A high-level language uses instructions closer to human language, so programmers can write and maintain programs more easily. It is usually portable between different processor types, but needs translating before a computer can execute it. Python is high level. A low-level language is closer to the processor's instructions. Assembly language uses short codes for operations; machine code is binary instructions a processor executes. Low-level code can give detailed hardware control, but is harder to write and is often specific to a processor family.
Key terms
Assemblers, compilers and interpreters
A translator converts a program into a form the processor can run. An assembler translates assembly language into machine code. A compiler translates a whole high-level program before it runs; an interpreter translates and runs the program one instruction at a time.
| Translator | Input | How it translates | Example use |
|---|---|---|---|
| Assembler | Assembly language | Converts assembly instructions to machine code | Preparing a device's low-level program |
| Compiler | High-level source code | Translates the program before execution | Building a program to run as an executable |
| Interpreter | High-level source code | Translates and executes instructions as it goes | Running a Python program in an interpreter |
The specification focuses on these general differences; individual tools may combine approaches.