High-level and low-level languages
- High-level languages, such as Python, Java and C#, use English-like keywords. They are easier to write, read and debug, and they are portable: the same code can run on different types of processor. They must be translated into machine code.
- Low-level languages are close to the hardware. Machine code is the binary instructions the CPU runs directly. Assembly language uses short mnemonics, such as ADD or LDA, one for each machine code instruction.
- Low-level code gives direct control of the hardware and can be very fast and small, which suits embedded systems. But it is hard to write, and it only works on one type of processor.
Translators
- A compiler translates the whole program into machine code in one go, making an executable file. It reports all the errors at the end. The executable runs quickly without the compiler, and the source code doesn't need to be shared.
- An interpreter translates and runs the program one line at a time. It stops at the first error, which helps debugging, but the program runs more slowly and the interpreter is needed every time it runs.
- An assembler translates assembly language into machine code.
The IDE
- An integrated development environment (IDE) is software for writing programs. It usually has an editor (with syntax highlighting and automatic indentation), error diagnostics, a translator and a run-time environment.
- Debugging tools include breakpoints (pausing the program at a chosen line), stepping through the code line by line, and watching the values of variables.
Key terms
- High-level language
- A programming language with English-like keywords, such as Python.
- Low-level language
- A language close to the hardware: machine code or assembly language.
- Machine code
- Binary instructions that the CPU can run directly.
- Assembly language
- A low-level language that uses short mnemonics, such as ADD.
- Compiler
- A translator that converts a whole program into machine code in one go.
- Interpreter
- A translator that translates and runs a program one line at a time.
- Assembler
- A translator that converts assembly language into machine code.
- IDE
- Integrated development environment: software with tools for writing and testing programs.
- Breakpoint
- A point where a program pauses so the programmer can inspect it.
Practise Programming languages and translators: 12 questions