[go: up one dir, main page]

0% found this document useful (0 votes)
8 views18 pages

SOFTWARE Types of Programming Languages

The document discusses programming languages, focusing on interrupts, high-level and low-level languages, and the tools used for translating code. It explains the differences between compilers and interpreters, as well as the advantages and disadvantages of each type of programming language. Additionally, it describes the role of Integrated Development Environments (IDEs) in enhancing the coding process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views18 pages

SOFTWARE Types of Programming Languages

The document discusses programming languages, focusing on interrupts, high-level and low-level languages, and the tools used for translating code. It explains the differences between compilers and interpreters, as well as the advantages and disadvantages of each type of programming language. Additionally, it describes the role of Integrated Development Environments (IDEs) in enhancing the coding process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

SOFTWARE

TYPES OF
PROGRAMMING
LANGUAGE
INTERRUPTS
◦Interrupt is a signal to the processor, that
its attention it required. It could be a data
input or system failure signals
◦An interrupts can be a software or a
hardware
EXAMPLES OF INTERRUPTS
Software Hardware
Division by 0 Data input, e.g key pressed on
keyboard, mouse click

Two processes attempting to access the Error from hardware, e.g printer out of
same memory location paper

Program request for input Hardware failure


READ MORE NOTE
ON INTERRUPTS
PROGRAMMING LANGUAGE
∙ A programming language acts as a bridge between
what humans understand and what a computer understands
∙ Early computers were complex and instructions would have
to be written in binary code, 0s and 1s
∙ This process was slow, taking days to program simple tasks
∙ Over time, new generations of programming languages have
enabled people to become faster and more efficient at
writing programs as they resemble human language
TYPES OF PROGRAMMING
LANGUAGE

01 02
High Level Low-Level
Language. Language
HIGH LEVEL LANGUAGE

01 02 03
High-level languages
allow for
A high-level clear debugging and High level languages
programming once programs are were needed due to
language created they the development of
uses English-like are easier to processor
statements to allow maintain. speeds and
users to program with the increase in
easy to use code. memory capacity.
HIGH LEVEL LANGUAGE (cont.)
∙ One instruction translates into many machine code instructions
∙ Needs to be translated into machine code for the computer to be able to
execute it
∙ Examples of high-level languages include:
∙ Python
∙ Java
∙ Basic
∙ C+
LOW-LEVEL LANGUAGE
∙ A low-level language is a ◦These languages are
programming language written for specific
that directly translates to processors to ensure they
machine code understood by embed the correct
the processor
machine architecture
∙ Low-level languages
allow direct control over
hardware components such
as memory and registers
LOW-LEVEL LANGUAGE
(types)
∙ First generation ∙ Second generation
∙ Machine code is a ∙ Assembly code is a
first-generation language second-generation language
∙ Instructions are directly ∙ The code is written
executable by the using mnemonics, abbreviated text
processor commands such as LDA (Load),
STA(Store)
∙ Written in binary code ∙ Needs to be translated into
machine code for the computer to
be able to execute it
Advantages and Disadvantages of High
and Low-level Language
High-level language Low-level language
Easier for users to understand, read, write, More difficult for users to understand,
amend read, write, amend
Easier for users to debug code Harder for users to debug code

It must be converted into a low-level Machine code does not need converting
language before it can be run
One statement can represent many Several instructions are needed for each
low-level instructions high-level language statement.
Cannot directly manipulate the hardware Can directly manipulate the hardware.
Translator
◦What is a translator?
∙ A translator is a program that translates program source
code into machine code so that it can executed directly by a
processor.
∙ Low-level languages such as assembly code are translated
using an assembler
∙ High-level languages such as Python are translated using
a compiler or interpreter
Compiler
◦What is a compiler?
∙ A compiler translates high-level languages into machine code all
in one go. E.g Java, C++
∙ Compilers are generally used when a program is finished and has
been checked for syntax errors
∙ Compiled code can be distributed (creates an executable) and
run without the need for translation software
∙ If compiled code contains any errors, after fixing, it will need
re-compiling
Interpreter
◦What is an interpreter?
∙ An interpreter translates high-level languages into machine
code one line at a time. E.g (python, Ruby, PHP)
∙ Each line is executed after translation and if any errors are
found, the process stops
∙ Interpreters are generally used when a program is being
written in the development stage
∙ Interpreted code is more difficult to distribute as translation
software is needed for it to run
Difference between Compiler and Interpreter
Compiler Interpreter

Compiler translates all the an interpreter translates one


code in one go line at a time

Compiler creates an an interpreter does not


executable execute one line at a time

Compiler reports an error at an interpreter stops when it


the end finds an error
IDE
◦What is an IDE?
∙ An Integrated Development Environment (IDE) is software designed to
make writing high-level languages more efficient
∙ IDEs include tools and facilities to make the process of
creating/maintaining code easier, such as:
o Auto-completion
o Auto-correction
o Run-time environment
o Prettyprint
◦Run-time environment

◦Gives users the ability to run and see


the corresponding output of a high-level language
o Prettyprint - using colour to make it easier
to identify keywords, for example 'print',
'input' and 'if' in Python

You might also like