You are on page 1of 21

Types of Computer

Languages
24 July 2007

Syarilla Iryani Ahmad Saany


Teh Phoey Lee
Mohd Yunus bin Sharum
Sajilal Divakaran
Mohd Zali
Koh Tieng Wei
Hyder Natiq

GS19011
GS18487
GS19143
GS18625
GS18971
GS18788
GS?????

SAK6200 ADVANCED PROGRAMMING LANGUAGES

What is a Programming Language?

A set of rules that provides a way of telling a


computer what operations to perform.
A set of rules for communicating an algorithm
A linguistic framework for describing
computations
Symbols, words, rules of grammar, rules of
semantics
Syntax and Semantics

Three types of programming language


All programming languages are artificial.
We can identify three types of programming
language:
Machine languages
Assembly languages
High-level languages

Why Are There So Many


Programming Languages
Why do some people speak French?
Programming languages have evolved over time as better
ways have been developed to design them.
First programming languages were developed in the 1950s
Since then thousands of languages have been developed
Different programming languages are designed for different
types of programs.

Levels of Programming Languages


High-level program

Low-level program

class
class Triangle
Triangle {{
...
...
float
float surface()
surface()
return
return b*h/2;
b*h/2;
}}
LOAD
LOAD r1,b
r1,b
LOAD
LOAD r2,h
r2,h
MUL
MUL r1,r2
r1,r2
DIV
DIV r1,#2
r1,#2
RET
RET

00010010010001010010
00010010010001010010
Executable Machine code 01001110110010101101
01001110110010101101
001...
001...

Types of Programming Languages


High Level Languages
Use statements that resemble English phrases combined with
mathematical terms needed to express the problem or task being
programmed.
Transportable: NOT-Hardware dependent.
Because programs are not written in 1s and 0s, the computer must first translate
the program before it can be executed.

Assembly Language

2nd generation language


Replaced binary digits with mnemonics (e.g., ADD) programmers could more easily
understand

Machine Languages
1st generation programming language
Considered a low-level language because it involves basic coding using
the binary symbols 1 and 0

Generation of Programming Languages


First Generation Languages
Machine
0000 0001 0110 1110
0100 0000 0001 0010

Second Generation Languages


Assembly
LOAD x
ADD R1 R2

Third Generation Languages


High-level imperative/object oriented
public Token scan ( ) {
while (currentchar ==
|| currentchar == \n)
{.} }

Fortran, Pascal, Ada, C, C++, Java, C#

Fourth Generation Languages


Database
select fname, lname
from employee
where department=Sales

SQL

Fifth Generation Languages


Functional
fact n = if n==0 then 1
else n*(fact n-1)

Logic
uncle(X,Y) :- parent(Z,Y), brother(X,Z).

Lisp, SML, Haskel, Prolog

Programming Language Genealogy

Need for High Level Languages


Limitations of Low Level Languages
difficult to program in
machine oriented: instructions are based on what the
processor can do.

programs will run on one processor only.


Advantages of High Level Languages
easier to program in
more like English
problem oriented: instructions are based on the type of
things the programmer wishes to do.

programs may run on different machines.

Features of High Level Languages

Extensive vocabulary of key words, symbols and


sentences.
A single instruction is very powerful and may be
translated into many machine language
instructions.
Libraries of subroutines available.
You must obey the syntax of the language (the
rules).

Language Categories
Programming Languages can be categorised in
many different ways. Some of the categorise are as
follows:
Procedural Languages

Nonprocedural Languages
Imperative Languages
Declarative Languages
Functional Languages

Logic Languages
Objected Oriented Languages
Fourth Generation
Fifth Generation
Scripting Languages

Please notes some these categories overlap, and some languages


belong to more than one category

Language Categories

Imperative Languages
A language which operates by a sequence of commands that change the value of
data elements.
Central features are variables, assignment statements, and iteration
Language control structures direct the computer to execute an exact sequence of
statements.
Examples: C, Pascal, Fortran, Basic, C

Functional Languages
A functional language is one that operates by use of higher-order functions, building
that manipulate functions directly without ever appearing to manipulate data.
Main means of making computations is by applying functions to given parameters
Examples: LISP, Scheme. Miranda, ML, Hope and HQL

Logic Languages
A logic language deals with predicates or relationships p(X,Y).
Rule-based (rules are specified in no particular order)
It allows a programmer to describe the logical structure of a problem rather than
prescribe how a computer is to go about solving it.
Example: Prolog, SASL, LOGLIST, FUNLOG

Language Categories
Procedural programming language
A Procedural programming language provides the means for a programmer to
precisely each step in performance of task.
Through the language, step-by-step instructions on how the task is to be done
The programmer specifies language statements to perform a sequence of
algorithmic steps.
Examples: Ada, BASIC, C, C++, COBOL, Fortran, Pascal, Fourth, Algol68, and
Modula-2
Nonprocedural programming language
In a nonprocedural language the programmer tells the computer, through the
language, what must be done, but leaves the details of how to perform the task to
the language itself.
For examples: Dbase, ADS, SQL
Note that fourth-generation languages are all considered nonprocedural.
Visual Programming Languages (GUI)
Languages that use a mouse, icons, or symbols on the screen and pull-down
menus to develop programs
Examples: Visual C++, Visual Basic

Language Categories

Markup
New; not a programming per se, but used to specify the layout
of information in Web documents
Scripting languages (commonly called scripting programming
languages or script languages) are computer programming
languages that are typically interpreted and can be typed
directly from a keyboard. Thus, scripts are often distinguished
from programs, because programs are converted permanently
into binary executable files (i.e., zeros and ones) before they
are run.
Examples: XHTML, XML Language Categories

Object-oriented Languages
Languages that allow interaction of programming objects,
including data elements and the actions that will be performed
on them
It define uses classes, inheritance and polymorphism
Examples: Java, C++

Fifth Generation Languages

Combines rule-based code generation, component management, visual programming


techniques, and reuse management
The 5GL are supposed to make communication with computers as easy as
communication with another person and possibly with the same tools Voice
and Vision
Knowledge-based management
An approach to the development of computer programs in which you do not
tell a computer how to do a job, but what you want it to do
A goal of computer language developers (Natural Language)
Example: Computer, please calculate the total number of people taking SAK6200.
A lot more difficult than it seems
total number
people
taking
CS 1511

Evolution of Programming Languages


1951 current
Programming Methodologies Influences
1950s and early 1960s: Simple applications; worry about machine
efficiency
Late 1960s: People efficiency became important; readability, better
control structures
structured programming
top-down design and step-wise refinement
Late 1970s: Process-oriented to data-oriented
data abstraction
Middle 1980s: Object-oriented programming
Data abstraction + inheritance + polymorphism

Program Domains

Scientific applications
Large number of floating point computations
Fortran
Business applications
Produce reports, use decimal numbers and characters
COBOL
Artificial intelligence
Symbols rather than numbers manipulated
LISP
Systems programming
Need efficiency because of continuous use
C
Web Software
Eclectic collection of languages: markup (e.g., XHTML), scripting (e.g.,
PHP), general-purpose (e.g., Java)

Program Domains

Commercial
very like English, avoids mathematical notation, very good file
handling facilities. e.g.. COBOL
Scientific
extensive computational ability, in-built mathematical
functions, can handle mathematical expressions, array
handling. e.g. FORTRAN
Special Purpose
tailor made for specific problems eg CSL (simulation), Coral
(process control), Ada (real time systems e.g. controlling a
fighter plane), SQL (database ), Prolog (artificial intelligence),
LISP (List processing and artificial intelligence)

Program Domains

Multipurpose
useful over a variety of application areas eg. BASIC (easy to
learn and use), C (more difficult but more standard and
powerful)
Applications Generators
4th generation languages used to generate programs.
Generally used for very specific range of tasks eg generating
input forms.
Operating system command languages
most operating systems respond to commands and can also
read files that contain a sequence of OS commands. The OS
may also have the ability to store things in variable and to call
other command files (and even to pass parameters to these
files).

References

Software Engineering Fundamentals, Ali Behforooz and Frederick J.


Hudson
http://www.levenez.com/lang/
http://www.scriptol.org/encyclopedia.html
http://www.jvoegele.com/software/langcomp.html
http://en.wikipedia.org/wiki/Comparison_of_programming_languages
http://www-cs-faculty.stanford.edu/~knuth/taocp.html
http://www.cs.fsu.edu/~engelen/courses/COP402001/notes1_4.pdf

Any Question

Thanks for your attention!!!

You might also like