Software · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 4% of your exam marks.
Compiler vs interpreter differences are a recurring 3-mark question.
A high-level language uses English-like statements that are far closer to how humans think than to how the CPU works. Each high-level instruction usually corresponds to many machine-code instructions.
Examples named in the syllabus: Python, Java, C++, BASIC. Many others exist (JavaScript, C#, Ruby, Swift, Go, etc.).
A typical high-level program looks like:
FOR i = 1 TO 10
PRINT i * 2
NEXT i
This program would translate into dozens of machine-code instructions under the hood, but the programmer never has to see or write those instructions.
High-level languages were developed once processors became fast enough and memory cheap enough that the slight loss of efficiency was worth the huge gain in programmer productivity. They let the programmer focus on what the program should do, rather than on the details of how the CPU does it.
| Advantages | Disadvantages |
|---|---|
| Easier to read, write and maintain | Cannot directly manipulate hardware without special features or libraries |
| Easier to debug thanks to clearer syntax | Must be translated to machine code before running |
| Portable: the same source code can run on many different computers after re-translation | May be less efficient than equivalent low-level code |
| One line can do a lot: a single statement may correspond to many machine-code instructions | Hides hardware details, which can hurt when fine control matters |
| Feature | Low-level (assembly) | High-level (Python, Java) |
|---|---|---|
| Closeness to hardware | Very close | Far away |
| Closeness to human language | Far away | Close |
| Instructions per machine-code instruction | One | Many |
| Portability | Machine-specific | Portable across CPUs |
| Speed of execution | Very fast | Slower (but the gap is small for most tasks) |
| Speed of development | Slow | Much faster |
| Translator needed | Assembler | Compiler or interpreter |