Lesson 2
Lesson 2
Grade 11
Term 1 – Lesson 2
System software
Compilers & Interpreters – Programming
Language
Compilers & Interpreters
DEFINITION OF AN
DEFINITION OF A COMPILER INTERPRETER
• A process that translates a • A process that translates and
program in one language executes both the source code
(source code) into another and input data at the same
language (object code) time
Error Source
messages program
Source Source
program program
Source
program
Source Source Source
program program program
The translator
• When two people try to communicate with each other but cannot
understand because they both speak different languages they need the
help of a third person who understands both languages. This third
person is known as a translator.
• For the computer to be able to carry out the instructions (source code),
the high-level languages must be translated into machine language (e.g.
00111101) before the computer can understand and execute the
instructions so the program can run.
• For the program to run the compiler or interpreter will translate the
sources code into machine language .
(e.g. 01110001)
• The computer will then load the machine code and run the program.
INTERPRETER
• The interpreter is used to interpret the program and then execute the
source code without compiling it first.
• The interpreter will read each line of code and convert it into machine
code (0 & 1s) and then execute it line by line
until the end of the program.
• Example of interpretered-based
language is: BASIC.
• The source code is converted into machine code e.g. (0s & 1s)
System software
Compilers & Interpreters – Programming
Language