You are on page 1of 0

1

Programming Languages
Low-level Languages
High-level Languages
Advantages & Disadvantages
Translators
Trends in Programming Languages
2
Introduction
uprogram
a series of instructions make a computer
works
can be written in a variety of programming
languages
uprogramming lang. - later generations:
fewer instructions
provide a more sophisticated
programmer/computer interaction
3
Fourth
generation
languages
(4GLs)
Fourth
generation
languages
(4GLs)
Assembler
Assembler
Business
COBOL (1959)
Business
COBOL (1959)
Machine
Machine
Multipurpose
BASIC (1965)
Pascal (1968)
Multipurpose
BASIC (1965)
Pascal (1968)
Scientific
FORTRAN (1955)
Scientific
FORTRAN (1955)
Procedural languages
High-level
languages
are
problem
oriented
Low-level
languages
are
machine
oriented
4th
gen.
3rd
gen.
2nd
gen.
1st
gen.
More
sophistication
in programmer/
computer
interaction
The hierarchy of programming languages
4
Low-level Languages
uMachine language
a programming language that is interpreted &
executed directly by the computer
uAssembly language
a symbolic language with an instruction set that
is basically one-to-one with the machine
language
5
Machine language (ML)
ueach computer can only understand
programs that are written in its own ML
uis provided by the computer manufacturer
utranslation is needed when executing
programs written in Pascal or BASIC
uwritten at the most basic level of computer
operation
coded as a series of 0s and 1s, e.g., 10111010
6
uDisadvantages:
very difficult to write, because:
binary system - not user friendly to human
it requires excellent memorisingpower
programmer has to keep track of storage
locations of data & instruction
ASSEMBLY LANGUAGE
Machine language (ML)
7
Assembly language
ualso provided by the manufacturer
uone instruction for each computer operation
uinstruction codes are represented by
mnemonics (a set of letters)
uthe code must be assembled into machine
language for execution
assembly language
[refer to Fig 13.2]
8
uDisadvantages: (similar to that of ML)
machine dependent
the program is usually long
hard to learn & slow to write
HIGH LEVEL LANGUAGES
Assembly language
9
High-level Languages
umade programming much more convenient
uwritten using common names & words
more like human languages
uproblem-oriented languages
designed to solve specific problems
ue.g., FORTRAN, COBOL, BASIC, Pascal
& C language
[refer to Fig 13.4 - 13.8]
10
Advantages of
High-level Languages
ueasier to write, to read & to modify
written in English-like format
uprograms - faster & shorter to code
one statement for several computer operations
umore portable, i.e., can be executed by
different computers
machine independent
11
utake up less storage space
urun faster
uuseful for writing system programs
e.g., operating systems (require fast & efficient
use of CPU)
usometimes an operation can only be
performed in a low-level language
Advantages of
Low-level Languages
12
Translators
uprograms must be translated into machine
codes before execution
Source
program
Source
program
Translator
Translator
Object
program
Object
program
Execution
A simplified translation process
13
Translators - 3 types
Source program
Source program
Translator
Translator
Object program
Object program
Execution
Execution
assembly
language
programs
assembly
language
programs
high-level
language
programs
high-level
language
programs
machine
codes
machine
codes
assembler
assembler
compiler
compiler
interpreter
interpreter
The functions of the three types of translators
14
Similarities between
compilers & interpreters
uboth translate high-level languages to
machine codes
uboth direct errors in the programs & print
error messages
uboth work out where to store the object
program & its data in the memory
15
Compilers Interpreters
Translation of
source program
the whole program
before execution
one line at a time
when it is run
Freqrency of
translation
each line is translated
once
has to be translated
every time it is
executed - slower
Object program can be saved for
future exeution
without the source
program
no object program is
generated, so, source
program must be
present for execution
Differences between
compilers & interpreters
16
Trends in
Programming Languages
ufewer instructions
umore user-friendly
utowards using 4GLs
non-procedural language
users only have to state what needs doing, but
not how to do it
designed for users with minimal programming
knowledge & training
17
uLogic programming (e.g., Prolog)
5th-generation computer language
declarative language
expert systems & artificial intelligence app.
uObject-oriented techniques
e.g., Borland C++
uVisual development environments
e.g., Microsoft Visual Basic
Trends in
Programming Languages

You might also like