Topic 4
4.2 Types of
programming
language,
translators
& IDEs
IGCSE 0478 Computer
Science
review
review
Objectives
Objectives
Objectives
Objectives
Resources
Resources
• Topic 4 Software Video Playlist
Introduction
Introduction
Have you ever wondered how a
computer understands and executes our
instructions?
Can you name some programming
languages?
Introduction
Introduction
Listen to the audio file about types of
programming languages and take notes
on your copybook. Compare your notes
with your classmate/desk mate
Introduction-
What is a computer
program?
● A computer program is a list
of instructions that enable a
computer to perform a specific
task. Computer programs can
be written in high-level
languages and low-level
languages depending on the
task to be performed and the
computer to be used. Most
programmers write programs
in high-level languages.
Thank you Daniel and
Introduction
Introduction
Thank you
1
high level
language vs
low level
language
Types
Types of
of Programming
Programming
languages
languages analogy
analogy
Imagine building a house.
High-Level Language:
• Blueprint: A detailed plan with specifications, but no
specific instructions on how to lay bricks or install
plumbing.
• Example: A programming language like Python or
Java, where you write code using human-readable
instructions and variables.
Low-Level Language:
• Raw Materials: Bricks, wood, pipes, and tools.
• Example: Assembly language, which directly interacts with
the computer's hardware, providing instructions for specific
operations like moving data or performing arithmetic.
Programming
Programming languages
languages
Programming
Languages
High-level Low-level
Assembly
Language
Machine Code
High
High level
level language
language example
example
High
High level
level language
language
//uses English-like statements
by a translator, interpreter or a compiler
- One line of code can perform multiple commands
- One line of code represents many low-level instructions
Advantages: Disadvantages:
- Easy for the programmer to - Must be converted to a low-level language
read/write/understand/edit before it can run
- Easy to debug // easy to find/correct errors - Cannot directly manipulate the hardware
- Machine independent which makes the
code portable
What is meant by a high-level
language?
High-level languages
typically include features
Explanation such as: Abstraction:
They do not
• A high-level programming Readability: require detailed
language is one that is The code is often knowledge of the
closer to natural
designed to be easy for language,
computer's
hardware to use.
humans to read and write. It making it easier The programmer
to understand.
abstracts away the complex Portability:
Programs written
can focus on
solving problems
details of the computer's in high-level rather than
hardware, allowing languages can
often run on
managing
Examples:
hardware-
programmers to use different types of
Some common
specific details.
high-level
commands and syntax that computer
systems with
programming
are more aligned with human little or no
languages
include Python,
language and logical modification.
Java, C++, and
structures. JavaScript.
Thank you Daniel and
High-level language advantages &
disadvantages.
Advantages Disadvantages
• Easier for users (humans) • It must be converted into
to understand, read, a low-level language
write, amend. before it can run.
• Easier for users to debug • Cannot directly
code. manipulate the hardware
• Portable, machine
independent.
• One statement can
represent many low-level
instructions
Thank you Daniel and
Low
Low level
level language
language example
example
Mnemonics
Low
Low level
level language
language
• Multiple lines of code can be represented by 1 line of high-level
language code
Advantages: Disadvantages:
What is meant by a low-level
language? Key points about low-
level programming
Explanation languages:
• A low-level programming Close to machine code: Low-level languages are very similar to the
binary code (1s and 0s) that a computer's CPU understands. Each
instruction in a low-level language often corresponds to a specific
language refers to a type machine code instruction.
of programming language Less abstract: These languages offer little to no abstraction from the
hardware, meaning the programmer must manage system resources such
as memory and CPU directly.
that is closer to machine
code, making it more Faster and more efficient: Since low-level languages are closely
aligned with machine instructions, programs written in these languages
can run faster and use fewer resources. This makes them suitable for
closely tied to the specific tasks that require high performance or direct hardware control.
hardware of a computer. Hardware-specific: Programs written in low-level languages are
typically specific to the hardware they are written for, making them less
Low-level languages require portable than high-level languages.
a deep understanding of the Examples: The two main types of low-level languages are machine
code (the binary code that the CPU executes directly) and assembly
computer’s architecture and language (a symbolic representation of machine code that is slightly
easier for humans to read but still requires knowledge of the hardware).
are less abstract than high-
levelThank you Daniel and
programming
Low-level language advantages &
disadvantages
Advantages Disadvantages
• Machine code does not • More difficult for programmers
need converting. to understand, read and write
• Harder for users to debug
• Can directly manipulate code.
the hardware • Several intrusions are needed
for each high-level language
statement.
• Not portable and
machine/hardware dependent
Thank you Daniel and
Assembly
Assembly language
language
• It is a low-level programming language.
• It is dependable on the architecture of the processor.
For example, ARMv8 and Intel x86 have different assembly
languages.
• Assembler converts it to machine code, 0s & 1s
Assembly Code Simulator
Low
Low level
level language
language VS VS HIGH
HIGH
level
level language
Python
EXAMPLE
languageAssembly
EXAMPLECode
https://www.codeconvert.ai/python-to-assembly-converter
Thank you
Check
Check in
in questions
questions
Check
Check in
in questions
questions
Check
Check in
in Past
Past Paper
Paper
Question
Question
2
Compilers &
interpreters
Why do we use compilers and
interpreters
We use compilers and interpreters in high level
programming languages to convert source code into
machine code that computers can understand and
execute.
Source code: The human readable set of
instructions written in a programming languages. It is
easy for humans to read, write and understand
Machine code: A low-level language that consists of
binary instructions directly understood by a
computer's hardware.
Thank you Ibrahim and
Translators
Translators
Translate programs to
Translators machine code to be executed
by the hardware of the
computer
High-level Low-level
Compiler Interpreter Assembler
Translates one
generates line to machine Assembly
executable code then language
executes it
Interpreter
Interpreter
Thank you
Ananya
Advantages of an interpreter
Thank you Ibrahim and
Amin
Immediate The program is executed line by line,
execution allowing for immediate results and
faster debugging
Platform
independen Since the source code is interpreted, it
ce can run on different platforms without
recompilation
Errors are reported as soon as they
Easy for are encountered, allowing for quick
Debugging fixes without needing to recompile the
entire code
Disadvantages of an interpreter
Thank you Ibrahim and
Amin
Slower Since the code is interpreted line by
Execution: line, it tends to run slower compared
to compiled programs
No Full Errors are only detected during
Error execution, which means you might
Detection encounter errors only after part of the
program has already run.
Each time the program runs, it needs
Repeated to be interpreted again, which can
Translation make it inefficient for large or
repetitive tasks
COMPILER
COMPILER
How does a compiler report an error?
Compilers and
interpreters
Compiler: A compiler is a specialized
software tool that translates high-level
programming code into low-level machine
code, making it understandable by a
computer's hardware. A compiler translates
the entire source code into machine code
before execution
Interpreter: An interpreter is a type of
software that executes high-level
programming code directly, translating it
into machine code line by line at runtime
Thank you Ibrahim and
Thank you
Ananya
Advantages of a compiler
No need for translation at run time
• Compiled code is translated into machine language before execution,
allowing programs to run significantly faster since there’s no translation
happening during runtime.
Speed of execution is faster
• Once a program is compiled, the executable file can be run quickly without
needing to translate the code each time
Code is usually optimized
• This is because the compiler analyzes the source code and applies various
techniques to improve its efficiency. This leads to faster execution times
and reduced recourse usage
Original source code is kept a secret
• It means that the process converts the human readable source code into
machine code which is hard to understand. This provides an extra layer of
security
Error detection
• Errors in the entire code are detected before execution, allowing the
programmer to correct them before running the program
Thank you Ibrahim and
Disadvantages of a compiler
Thank you Ibrahim and
Slow Amin
The process of compiling large
compilation programs can take a significant
amount of time
Errors must be fixed in the whole
No partial program before it can run, so you
testing cannot test sections of the code
individually
Platform Compiled programs are specific to the
dependenc platform they were compiled to
y meaning that they don’t work on
different systems
Thank you Salma
Thank you Jana
Thank you Jana
Thank you
Jana
Thank you
Salma
Thank you
Jana
Thank you
Summary(❁´◡`❁) Jana
Translators convert code from one language to another.
Compilers translate high-level code (like Python) into low-level
machine code that computers understand. They do this all at once,
creating an executable file.
Interpreters translate and execute high-level code line by line, without
creating a separate executable file. This allows for easier debugging but
can be slower.
Assemblers are specific translators that convert assembly language (a
low-level language) into machine code.
These tools bridge the gap between human-readable code and the binary
instructions computers execute.
Thank you
Jana
Justify
Justify use
use of
of an
an interpreter
interpreter
Justify
Justify use
use of
of a
a compiler
compiler
Justify
Justify your
your choice
choice of
of a
a
compiler
compiler or
or an
an interpreter
interpreter
3
Functions of
Integrated
Development
Environments
(IDEs)
THE ROLE OF AN IDE
Most Common
It is a piece of application Features:
Code Editor
software used by programmers Auto Completion 52
to aid the writing and
Auto Correction
development of programs by
helping with writing, testing, and Pretty Print
debugging their code more Translator
efficiently by providing essential Run-Time Environment
tools in one place.
Error Diagnostics
Thank you Maaz
Thank you Salma
INTEGRATED
INTEGRATED DEVELOPMENT DEVELOPMENT
ENVIRONMENT
ENVIRONMENT
IDE
(ide)
(ide)
is a software that includes an editor for you to enter and edit your
code.
Common
Common functions
functions of
of an
an ide
ide
Common
Common functions
functions of
of an
an ide
ide
–– Error
Error diagnostics
diagnostics
Thank you Salma
Thank you Salma
Thank you Salma
Thank you
Rafif
Thank you
Salma
Thank you
Salma
Any Questions?
You
You are
are doing
doing great!
great!