Professional Documents
Culture Documents
14 PRG Lang PDF
14 PRG Lang PDF
Low-level Languages
High-level Languages
Advantages & Disadvantages
Translators
Trends in Programming Languages
1
Introduction
u program
– a series of instructions make a computer
‘works’
– can be written in a variety of programming
languages
u programming lang. - later generations:
– fewer instructions
– provide a more sophisticated
programmer/computer interaction
2
Fourth
Fourth
4th generation
generation
gen. languages
languages
(4GLs)
(4GLs) High-level
languages
are
Procedural languages problem More
oriented sophistication
3rd Multipurpose
Multipurpose Business
Business Scientific
Scientific in programmer/
gen. BASIC
BASIC(1965)
(1965) COBOL
COBOL(1959)
(1959) FORTRAN
FORTRAN(1955)
(1955) computer
Pascal (1968)
Pascal (1968) interaction
2nd Low-level
Assembler
Assembler
gen. languages
are
1st Machine machine
Machine
gen. oriented
u Assembly language
– a symbolic language with an instruction set that
is basically one-to-one with the machine
language
4
Machine language (ML)
u each computer can only understand
programs that are written in its own ML
u is provided by the computer manufacturer
u translation is needed when executing
programs written in Pascal or BASIC
u written at the most basic level of computer
operation
– coded as a series of 0’s and 1’s, e.g., 10111010
5
Machine language (ML)
u Disadvantages:
– very difficult to write, because:
• binary system - not ‘user friendly’ to human
• it requires excellent memorising power
– programmer has to keep track of storage
locations of data & instruction
ASSEMBLY LANGUAGE
6
Assembly language
8
High-level Languages
u made programming much more convenient
u written using common names & words
more like human languages
u problem-oriented languages
– designed to solve specific problems
u e.g.,
FORTRAN, COBOL, BASIC, Pascal
& C language
9
[refer to Fig 13.4 - 13.8]
Advantages of
High-level Languages
u easier to write, to read & to modify
– written in English-like format
u programs - faster & shorter to code
– one statement for several computer operations
u more portable, i.e., can be executed by
different computers
– machine independent
10
Advantages of
Low-level Languages
u take up less storage space
u run faster
u useful for writing system programs
– e.g., operating systems (require fast & efficient
use of CPU)
u sometimes an operation can only be
performed in a low-level language
11
Translators
u programsmust be translated into machine
codes before execution
Source
Source Object
Object
Translator
Translator Execution
program
program program
program
12
Translators - 3 types
Source
Sourceprogram
program Translator
Translator Object
Objectprogram
program
assembly
assembly
language
language assembler
assembler
programs
programs machine
machine
codes
codes
compiler
compiler
high-level
high-level
language
language
programs
programs
interpreter
interpreter Execution
Execution