005603_02_CAIE_AS_Level_IT_BP_049-075.
indd Page 59 23/11/23 7:17 AM F-0120 /147/HO02989/work/indd
2.2 System software
2.2 System software
System software refers to the programs that run and control a computer’s
hardware and application software.
2.2.1 Types and functions of system software
Examples of system software are compilers, interpreters, linkers, device
drivers, operating systems and utilities.
Compilers
Most software that runs on computers is in machine code, which is stored in
binary form within the computer. Machine code consists of the instructions
that computers understand and each instruction is actually a number written in
binary. Unfortunately, programmers who write the software for computer users
find it difficult to use machine code for programming purposes. In the early
days of computing it was felt necessary to develop languages which programmers
could understand and was close to their use of everyday language.
Some of the early high-level languages developed included:
» FORTRAN (Formula Translation) was the first high-level language to be
developed. It was very technical and mathematical in nature. FORTR AN is
rarely used these days, but still remains popular for simulating large physical
systems, such as the modelling of stars and galaxies. The fact that it is still
widely used by physicists today often mystifies computer scientists, who
regard it as being out of date.
59
005603_02_CAIE_AS_Level_IT_BP_049-[Link] Page 60 23/11/23 7:17 AM F-0120 /147/HO02989/work/indd
» COBOL (Common Business-Oriented Language) was developed not
2
long after FORTR AN to help businesses. Unlike FORTR AN, which relied
on mathematical equations, COBOL tended to use simple expressions, such
as SUBTR ACT money FROM account GIVING balance, rather than an
equation like bal=acc-mon.
» LISP (List Processor) was also an early high-level language. In LISP, simple
statements often start with the mathematical operator, such as (+ 2 4) which
would calculate 2+4. LISP was used extensively in the early years of AI but,
apart from its use in association with CAD, it is rarely used today.
2 Hardware and software
Most high-level language programming for modern-day systems is done using
languages such as Visual C++®, Visual C#®, Visual Basic® or Pascal®, among
others. These have largely replaced the other languages mentioned above.
However, the development of all these high-level languages led to the need for
software which could translate a program written in high-level language into the
machine code that computers could understand.
A compiler is software (a program) that processes statements written in a high-
level programming language and converts them into machine language or code
that a computer’s processor understands and can execute. In other words, it
translates a high-level language program called source code into an executable
file called object code. The compiled program is then run directly without the
need for the compiler to be present.
Although compilers translate the whole program as one unit, they often need to
make more than one pass through the program to do this. This is because after
translating, it may become apparent that line 10 of the program refers to a statement
at line 5. The first pass picks up this type of information and then the second pass
completes the translation. The whole program is still effectively translated in one go
before it is executed. However, some programming languages, such as Pascal, have
been designed so that they would only require one pass. The object code is machine
code that the processor can execute one instruction at a time. A compiler produces a
list of error messages after it has translated the program. These cannot be corrected
without going back to the source code.
Interpreters
An interpreter translates the high-level language program one statement, or
line, at a time into an intermediate form, which it then executes. It continues
translating the program until the first error is met, at which point it stops. This
means that errors are located by the programmer, exactly where they occur. An
interpreter has to do this conversion every time a statement is executed.
Unlike with a compiler, translation occurs at the same time as the program is being
executed. The interpreter has to be resident in memory in order for the program to
be executed. Interpreters just run through a program line by line and execute each
command. As a result, another benefit of using an interpreter is that only a few lines
of the program need to be in memory at any one time, saving memory space.
There are other benefits of using interpreters, such as they help programmers
when they are developing programs. Interpreters are able to execute each
statement as it is entered and are able to generate helpful error reports. This
means that interpreters can be used during program development allowing a
programmer to add a few lines at a time and test them quickly.
Some high-level language programs such as Python® can be translated using a
combination of a compiler and an interpreter. It is possible for the program to
be translated or compiled into what is called ‘bytecode’. This is then processed
60
005603_02_CAIE_AS_Level_IT_BP_049-[Link] Page 61 23/11/23 7:17 AM F-0120 /147/HO02989/work/indd
by a program called a ‘virtual machine’, which is often an interpreter, instead of
2
by the processor within the computer.
Activity 2d
Describe the purpose of compilers and interpreters.
Advantages and disadvantages of interpreters compared with compilers
2.2 System software
▼ Table 2.1 Advantages and disadvantages of interpreters compared with compilers
Advantages of interpreters Disadvantages of interpreters
While a program is being compiled, if it is a major The execution process is slower for an interpreted program
application and takes a long time, the programmer has to as each statement must be translated before execution,
wait, doing nothing, before they can correct any errors. whereas once a program has been compiled it executes
With an interpreted program the programmer can correct all in one go. The time it takes to compile a program can
errors as they are found. be long but once it is compiled it does not have to be
translated, which compares favourably with an interpreted
program which has to be translated every time it runs.
Debugging is easier with an interpreter as error messages With an interpreted program, the source code must
are output as soon as an error in a statement is always be available, which can lead to software copyright
encountered, which gives the programmer the opportunity infringement or intellectual property rights being at
to correct the error there and then. With a compiler all the risk. With a compiled program, the source code has been
error messages are output at the end of the process and translated and machine code is difficult to understand
errors can be difficult to locate and correct. and alter.
A compiled program will only run on a computer with the
same operating system as the computer it was originally
compiled on, whereas an interpreted program will still
be in its original source code and so it will work on any
system with the appropriate interpreter.
Compiling a program uses more memory than interpreting
it as the whole program must be loaded before translation,
whereas with an interpreter only a few statements of the
program have to be in memory at any given time. This
means that small pieces of code can be tested to make sure
they work before continuing with the rest of the program.
61