COMP205 Comparative Programming Languages

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
CS115 Introduction to Programming
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Lecture 1: Overview of Computers & Programming
CSI 3125, Preliminaries, page 1 Programming languages and the process of programming –Programming means more than coding. –Why study programming languages?
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
Overview of Programming Paradigms
1 ) Definition 2) Note on structured and modular programming, and information hiding 3) Example imperative languages 4) Features of imperative languages.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Programming Languages Structure
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Chapter-01 Introduction to Computers and C++ Programming.
314450: PROGRAMMING PARADIGMS Teaching scheme: Examination Scheme: Lectures: 3 Hours/Week Theory: 100 Marks OBJECTIVE: To understand the basic building.
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
CLASSIFICATION OF PROGRAMMING LANGUAGES
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
AS Computing Introduction to Programming. What is a Computer Program? A list of instructions that a computer must work through, in a logical sequence,
The Evolution of the Object Model OOAD. The Evolution of the Object Model software engineering trends observed The shift in focus from programming-in-the-small.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
CS101 Introduction to Computing Lecture Programming Languages.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Computer Concepts 2014 Chapter 12 Computer Programming.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
110-A1 Central Processing Unit Main Memory Monitor Disk Keyboard mouse What's a Computer? Network CPU: (stupid) brain of the computer can do very simple.
CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05.
PROGRAMMING LANGUAGES
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
6. Program Translation CS100: The World of Computing John Dougherty Haverford College.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
Introduction to OOP CPS235: Introduction.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
ICT PROGRAMMING INTRODUCTION. WHAT & WHY PROGRAMMING Programming is a process of developing computer programs Computer program is a set of instructions.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
High-level language programming paradigms. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
Programming Language Paradigms ITSK2314 Lecture 3.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
MODULE 1 : WHY PROGRAMMING LANGIUAGES - Overview Programming fundamentals is about knowing how to give instructions in a computer language to the computer.
Programming Languages 2nd edition Tucker and Noonan
Programming paradigms
Concepts of Programming Languages
Introduction to programming languages, Algorithms & flowcharts
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Computer Programming (BCT 1113)
Introduction to programming languages, Algorithms & flowcharts
Evolution and History of Programming Languages
CSCI-235 Micro-Computer Applications
课程名 编译原理 Compiling Techniques
Programming Languages and Translators
Developing Applications
Introduction to programming languages, Algorithms & flowcharts
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Programming Languages 2nd edition Tucker and Noonan
Introduction to Computer Programming
Principles of Programming Languages
Overview of Programming Paradigms
Presentation transcript:

COMP205 Comparative Programming Languages Grant Malcolm (grant@csc.liv.ac.uk) Introduction to programming languages The imperative paradigm The functional paradigm Other paradigms and concluding remarks

BOOKS TUTORIALS Day Time Monday 15:00-17:00 Tucker, A. and Noonan, R. Programming Languages: Principles and Paradigms. McGraw-Hill, 2002. Sebesta, R.W. Concepts of Programming Languages (5th ed.). Addison Wesley, 2002. TUTORIALS Day Time Monday 15:00-17:00 Four COMP2XX tutorial slots have been timetabled Tuesday 14:00-16:00 Thursday 11:00-13:00 Friday 10:00-12:00

INTRODUCTION TO PROGRAMMING PARADIGMS http:/www.csc.liv.ac.uk/~grant/ Teaching/COMP205/ Paradigms and the classification of languages Program structure and programming languages as communications media Complexity and program processing

CLASSIFICATION OF PROGRAMMING LANGUAGES To facilitate discussion on any subject it is convenient to group together similar facets of the subject according to some grouping notion. Computer programming languages are no exception. Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

OPERATION OF A COMPUTER PROGRAM A computer program resides in primary memory where it is represented as a set of machine instructions which in turn are represented as sequences of binary digits. At any point in time the computer is said to be in a particular state. A central feature of the state is the instruction pointer which points to the next machine instruction to be executed. The execution sequence of a group of machine instructions is known as the flow of control.

MACHINE CODE Thus, a program running on a computer is simply a sequence of bits. A program in this format is said to be in machine code. We can write programs in machine code: 23fc 0000 0001 0000 0040 0cb9 0000 000a 0000 0040 6e0c 06b9 0000 0001 0000 0040 60e8

ASSEMBLY LANGUAGE Assembly language (or assembler code) was our first attempt at producing a mechanism for writing programs that was more palatable to ourselves. Of course a program written in machine code, in order to “run”, must first be translated (assembled) into machine code. movl #0x1,n compare: cmpl #oxa,n cgt end_of_loop acddl #0x1,n bra compare end_of_loop:

HIGH LEVEL LANGUAGE From the foregoing we can see that assembler language is not much of an improvement on machine code! A more problem-oriented (rather than machine-oriented) mechanism for creating computer programs would also be desirable. Hence the advent of high(er) level languages commencing with the introduction of “Autocodes”, and going on to Algol, Fortran, Pascal, Basic, Ada, C, etc.

Classification of programming languages: Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

CHRONOLOGICAL CLASSIFICATION OF PROGRAMMING LANGUAGES 1940s Prelingual phase: Machine code 1950s Exploiting machine power: Assembler code, Autocodes, first version of Fortran 1960s Increasing expressive power: Cobol, Lisp, Algol 60, Basic, PL/1 --- but most “proper” programming still done in assembly language.

1970s Fighting the “software crisis”: Reducing machine dependency – portability. Increasing program correctness -Structured Programming, modular programming and information hiding. Examples include Pascal, Algol 68 and C.

1980s reducing complexity – object orientation, functional programming. 1990s exploiting parallel and distributed hardware (going faster!), e.g. various parallel extensions to existing languages and dedicated parallel languages such as occam. 2000s Genetic programming languages, DNA computing, bio-computing?

THE SOFTWARE CRISIS The phrase software crisis alludes to a set of problems encountered in the development of computer software during the 1960s when attempting to build larger and larger software systems using existing development techniques. As a result: 1.Schedule and cost estimates were often grossly inaccurate. 2.Productivity of programmers could not keep up with demand. 3.Poor quality software was produced. To address these problems the discipline of software engineering came into being.

Classification of programming languages: Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

LANGUAGE GENERATIONS Classification 1st Machine languages 2nd Assembly languages 3rd Procedural languages 4th Application languages (4GLs) 5th AI techniques, inference languages 6th Neural networks (?), others….

Classification of programming languages: Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

LANGUAGE LEVELS OF ABSTRACTION . (Bal and Grune 94) Level Instructions Memory handling Low level languages Simple machine-like instructions Direct memory access and allocation High level languages Expressions and explicit flow of control Memory access and allocation through operators Very high level languages Fully abstract machine Fully hidden memory access and automatic allocation

Classification of programming languages: Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

DECLARATIVE v NON-DECLARATIVE PROGRAMMING Languages can also be classified by the emphasis they put on “what is to be achieved” against “how it is to be achieved”. The first are said to be declarative (e.g. functional and logic languages). The second is said to be non-declarative or procedural (e.g. imperative languages).

Classification of programming languages: Machine, Assembler and High Level Languages Chronological order of development Generations Levels of abstraction (from machine level) Declarative v Non-declarative Paradigms

PROGRAMMING PARADIGMS? In science a paradigm describes a set of techniques that have been found to be effective for a given problem domain (i.e somebody somewhere must believe in it). A paradigm can typically be expressed in terms of a single principle (even if this is in fact an over simplification). This principle must be supported by a set of techniques. In the context of programming languages we say that a paradigm induces a particular way of thinking about the programming task.

We can identify four principal programming paradigms: Imperative (e.g. Pascal, Ada, C). Object-oriented (e.g. Java). Functional (e.g. Haskell, SML). Logic (e.g. Prolog).

PROGRAMMING MODELS The 4 main programming paradigms aim at solving general programming problems, but sometimes there are additional aspects to a problem which require us to “tweak” a paradigm. The result is not a new paradigm but a programming model founded on a particular paradigm. An example is parallel or distributed programming.

SUMMARY Classification of languages: Paradigms Programming models Machine, assembler & high level Chronological order Generations Levels of abstraction Declarative v Non-declarative. Paradigms Programming models