+ All Categories
Home > Documents > Types of PL - Sajilal

Types of PL - Sajilal

Date post: 13-Jan-2016
Category:
Upload: bama-raja-segaran
View: 14 times
Download: 0 times
Share this document with a friend
Description:
hg
21
Types of Computer Types of Computer Languages Languages 24 July 2007 24 July 2007 Syarilla Iryani Syarilla Iryani Ahmad Ahmad Saany Saany GS GS 19011 19011 Teh Phoey Teh Phoey Lee Lee GS18487 GS18487 Mohd Yunus Mohd Yunus bin bin Sharum Sharum GS19143 GS19143 Sajilal Divakaran Sajilal Divakaran GS18625 GS18625 Mohd Zali Mohd Zali GS18971 Koh Tieng Wei Koh Tieng Wei GS18788 GS18788 Hyder Natiq Hyder Natiq GS????? GS????? SAK6200 ADVANCED PROGRAMMING LANGUAGES
Transcript
Page 1: Types of PL - Sajilal

Types of ComputerTypes of Computer

Languages Languages

24 July 200724 July 2007

Syarilla IryaniSyarilla Iryani AhmadAhmad Saany Saany GSGS19011 19011

Teh PhoeyTeh Phoey LeeLee GS18487GS18487

Mohd YunusMohd Yunus bin bin Sharum Sharum GS19143 GS19143

Sajilal DivakaranSajilal Divakaran GS18625 GS18625

Mohd Zali Mohd Zali GS18971

Koh Tieng WeiKoh Tieng Wei GS18788GS18788

Hyder NatiqHyder Natiq GS?????GS?????

SAK6200 ADVANCED PROGRAMMING LANGUAGES

Page 2: Types of PL - Sajilal

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

Page 3: Types of PL - Sajilal

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

Page 4: Types of PL - Sajilal

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.

Page 5: Types of PL - Sajilal

Levels of Programming Languages

High-level programclass Triangle {

...

float surface()

return b*h/2;

}

class Triangle {

...

float surface()

return b*h/2;

}

Low-level program

LOAD r1,b

LOAD r2,h

MUL r1,r2

DIV r1,#2

RET

LOAD r1,b

LOAD r2,h

MUL r1,r2

DIV r1,#2

RET

Executable Machine code00010010010001010010

01001110110010101101

001...

00010010010001010010

01001110110010101101

001...

Page 6: Types of PL - Sajilal

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

Page 7: Types of PL - Sajilal

Generation of Programming Languages

First Generation LanguagesMachine

0000 0001 0110 1110

0100 0000 0001 0010

Second Generation LanguagesAssembly

LOAD x

ADD R1 R2

Third Generation LanguagesHigh-level imperative/object oriented

public Token scan ( ) {

while (currentchar == ‘ ’

|| currentchar == ‘\n’)

{….} }

Fourth Generation LanguagesDatabase

select fname, lname

from employee

where department=‘Sales’

Fifth Generation LanguagesFunctional Logic

fact n = if n==0 then 1 uncle(X,Y) :- parent(Z,Y), brother(X,Z).

else n*(fact n-1)

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

SQL

Lisp, SML, Haskel, Prolog

Page 8: Types of PL - Sajilal

Programming Language Genealogy

Page 9: Types of PL - Sajilal

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.

Page 10: Types of PL - Sajilal

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).

Page 11: Types of PL - Sajilal

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

Page 12: Types of PL - Sajilal

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

Page 13: Types of PL - Sajilal

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

Page 14: Types of PL - Sajilal

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++

Page 15: Types of PL - Sajilal

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

Page 16: Types of PL - Sajilal

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

Page 17: Types of PL - Sajilal

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)

Page 18: Types of PL - Sajilal

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)

Page 19: Types of PL - Sajilal

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).

Page 20: Types of PL - Sajilal

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

Page 21: Types of PL - Sajilal

Any Question

Thanks for your attention!!!


Recommended