General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Similar documents
Principles of Programming Languages. Lecture Outline

Introduction. A. Bellaachia Page: 1

Chapter 1. Preliminaries

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

Chapter 1. Preliminaries

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Chapter 1 Preliminaries

Concepts of Programming Languages

Programming Languages, Summary CSC419; Odelia Schwartz

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed

Com S 541. Programming Languages I

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Design & Implementation Overview

Concepts in Programming Languages

Low-Level Languages. Computer Programs and Programming Languages

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Why are there so many programming languages?

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Language Translation, History. CS152. Chris Pollett. Sep. 3, 2008.

CSCI 3136 Principles of Programming Languages

Programming Languages

COSC 2P90 Programming Languages & Object-Orientation

Compilation I. Hwansoo Han

Chapter 2 Preview. Preview. History of Programming Languages. History of Programming Languages. History of Programming Languages

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

LECTURE 18. Control Flow

What is a programming language?

Why study Programming Language Concepts? Chapter One. Language Evaluation Criteria. Programming Domains. Readability Writability Reliability Cost

Continuations provide a novel way to suspend and reexecute

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current

CS321 Languages and Compiler Design I. Winter 2012 Lecture 1

Programming Languages 2nd edition Tucker and Noonan"

LECTURE 1. Overview and History

Discovering Computers 2008

Programming Paradigms

Discovering Computers Chapter 13 Programming Languages and Program Development

Introduction to Programming Languages. CSE 307 Principles of Programming Languages Stony Brook University

A Tour of Language Implementation

Programmiersprachen (Programming Languages)

Logic Programming II & Revision

1/14/2014. Introduction to CSE 1325 Object Oriented Programming (Using Java) Introduction (Cont.) Introduction

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Introduction to Engineering Using Robotics Experiments. Dr. Yinong Chen

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

CSc 372. Comparative Programming Languages. 2 : Functional Programming. Department of Computer Science University of Arizona

Programming Language Concepts 1982, 1987, Outline. Period

Introduction P L COS 301. Fall School of Computing and Information Science University of Maine. Introduction COS 301.

Introduction to Scientific Computing Languages

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Functional Programming. Big Picture. Design of Programming Languages

Introduction to Scientific Computing Languages

SOFTWARE ARCHITECTURE 6. LISP

Imperative Programming

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

2. Evolution of the Major Programming languages

Chapter 2. Pseudocodes: Speedcoding. 2.2 Minimal Hardware Programming: Pseudocodes. Evolution of the Major Programming Languages

NOTE: Answer ANY FOUR of the following 6 sections:

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Evolution of PL s. EECS 476, Prog. Lang. Design/ page 1

Chapter 11 :: Functional Languages

CSc 372 Comparative Programming Languages

8/23/18. Programming Language Genealogy The Evolution of Programming Languages. Zuse s Plankalkül. Plankalkül Syntax. Machine Code

Comp 333: Concepts of Programming Languages Fall 2016

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

COMP 201: Principles of Programming

Chapter 5. Names, Bindings, and Scopes

Chapter 2. 5 * B => A V 6 7 (subscripts) S 1.n 1.n (data types)

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

New Programming Paradigms

Lecture 1: Course Introduction

CS 3304 Comparative Languages. Lecture 1: Introduction

Final-Term Papers Solved MCQS with Reference

Programming Language Pragmatics

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

G Programming Languages Spring 2010 Lecture 1. Robert Grimm, New York University

CSCI.4430/6969 Programming Languages Lecture Notes

Concepts of Programming Languages

CS558 Programming Languages

Chapter 2. Evolution of the Major Programming Languages

Lecture 1: Course Introduction

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2015 Euiseong Seo

Lecture 15: Iteration and Recursion

CS2303 C14 Systems Programming Concepts. Bob Kinicki

PLAGIARISM. Administrivia. Course home page: Introduction to Programming Languages and Compilers

Introduction to Programming Languages and Compilers. CS164 11:00-12:00 MWF 306 Soda

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way

Programming Languages 1. Introduction. Oscar Nierstrasz

Introduction to.net, C#, and Visual Studio. Part I. Administrivia. Administrivia. Course Structure. Final Project. Part II. What is.net?

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Seminar in Programming Languages

Control Abstraction. Hwansoo Han

CS 314 Principles of Programming Languages

Objective: To learn meaning and concepts of programming. Outcome: By the end of this students should be able to describe the meaning of programming

! Broaden your language horizons. ! Study how languages are implemented. ! Study how languages are described / specified

Transcription:

General Concepts Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design 1

Abstractions in Programming Languages Abstractions hide details that are relevant only to the internal structure of each part. Abstractions provide complexity control 2

Assembly language abstract instruction codes to symbols abstract memory locations to symbols High level languages Data and Control Basic, Structured, Unit, Parallel 3

Basic Data Abstractions abstract memory locations to simple variables closely supported by hardware char, integer, real, decimal, boolean Structured Data Abstractions Structured variables arrays, records, structs, classes, lists may be built-in or user-defined 4

Simple Control Abstractions assignment, jump Structured Control Abstractions Guarded Commands nestable sets of instructions guarded by tests: if, switch, while,... Procedural Abstractions abstracts several actions into a single action provides control over program interactions two parts: declaration and invocation 5

Unit Data and Control Abstractions stand-alone part of a program controlled interface data encapsulation information hiding C++ class, Ada package, Modula- 2 module, components(component Object Model, CORBA), containers, libraries Parallel Control Abstractions Threads (Java) within Java Processes (Java) outside Java Tasks (Ada) 6

Computational Paradigms imperative functional logic object-oriented event-driven concurrent 7

Turing Completeness A language that has enough mechanisms to describe any computation that a Turing machine can perform is called Turing Complete. 8

Illustrative Example GCD The greatest common divisor of a and 0 is a The greatest common divisor of a and b is the same as the greatest common divisor of b and the remainder of a divided by b. GCD will be computed only for nonnegative integers 9

GCD Iterative Version gcd(aa, bb) begin a = aa; b = bb; if (b!=0) then repeat rem = a mod b; a = b; b = rem; until (b == 0); return(a); end; 10

GCD Recursive Version gcd(a, b) begin if (b = 0) then return a else return gcd(b, a mod b) end; 11

Imperative Paradigm imperative or procedural languages model: von Neumann machine Fortran, C, Pascal, Algols characteristics control: instruction sequencing, assignment, loops, and selection data: variables that represent memory locations A programming language is Turing Complete if it has integer variables and arithmetic and sequentially executes statements, which include assignment, selection and loop statements. 12

Functional Paradigm functional or applicative languages model: recursive function theory 1940 s: Alonzo Church, λ-calculus less dependent on machine model easier to reason about behavior Lisp, ML, Miranda, FP, Scheme characteristics control: function call (basic mechanism) and recursion data: function parameters and function values 13

A programming language is Turing Complete if it has integer values, arithmetic functions on those values, and a mechanism for defining new functions using existing functions, selection, and recursion. 14

Logic Paradigm logic or declarative languages model: symbolic logic far removed from machine model very high level language Prolog, SQL, RPG, CLP characteristics control: Horn clause resolution data: variables that represent partial computations 15

Object-Oriented Paradigm object-oriented languages model: interaction among objects, each of which has its own data and operations Simula67, SmallTalk, Eiffel, C++ characteristics control is provided by operations on objects data is provided by variables in objects 16

Event-Driven Paradigm continuous loop that responds to unpredictable events events generated by keystrokes, mouse clicks, or robot sensors Visual Basic, Java 17

Concurrent Paradigm collection of cooperating processes SIMD, MIMD share information (messages or shared memory) run asynchronously (synchronization mechanisms needed) SR, Linda, HPF, Ada 18

Implementation compilers, interpreters, hybrid systems a computation is written in source language a computation is carried out in machine language implementation is the interface between source code and its execution implementation depends on the operating system for resource management, i/o, file management, editors and other functions 19

Compilers compiler phases: lexical analysis, syntactic analysis, semantic analysis, intermediate code generation, optimization, code generation compilation followed by linking and loading operations program executes independently from compiler 20

Interpreters interpreter provides a software simulation of the hardware program executes under control of the interpreter slow because high-level statements are decoded needs more space better debugging possible 21

Hybrids generate intermediate code, as in the compiler interpret intermediate code, as in the interpreter Perl, Java (byte code is the intermediate, interpreted by JVM) 22

Preprocessors not actually an implementation method processes commands embedded in source code before compilation expands macros, copies files into the program 23

Application Domains Scientific data: floating point, arrays and matrices control: loops and selection efficiency Fortran, Algol 60 and descendants Business data: characters and decimal numbers control: decimal arithmetic large reports COBOL 24

AI data: list control: symbolic computation, creation of code Lisp, Prolog, now C Systems control: low level features efficiency PL/S, BLISS, Extended Algol, C Web presentation + computation XHTML, Java, JavaScript, PHP 25

Influences on Success Technical Influence:Adherence to Design Goals Fortran - efficiency of execution Cobol - English-like readability Algol60 - block structure for expression of algorithms Pascal - simplicity and promotion of top-down design 26

Non-Technical Influences Availability, price and quality of translators Politics, timing, geography, markets Examples C - promoted by availability of Unix PL/I - supported by IBM Ada - required by DoD Algol popular in Europe IBM supported Fortran in US stack-based machine not well understood in US 27

Influences on Design Computer Architecture Programming Methodology Implementation Method Execution Model Programming Environment Language Paradigms Intended Use 28

Computer Architecture procedural languages based on von Neumann machine functional languages generally not so close Lisp machine: TI explorer stack languages generally not so close stack machine: Burroughs 5500 29

Programming Methodology should be supported by language Algol 60 structured programming Simula 67, Ada data abstraction Pascal top down design Smalltalk, C++ Java, Python, Ruby object model Ada concurrency dataflow Linda, HPF parallel programming new languages evolve as new methodologies develop 30

Implementation Method interpreted or compiled? some features are better supported by one method or the other features that need to be determined during execution fit interpreters features that can be determined before execution fit compilers 31

Intended Use Special Purpose abstractions can be built in often used for general purposes examples rapid prototyping (VB) beginners(logo,basic) database (sql) graphics(logo, VPython) real-time (Ada) 32

General Purpose facilities for user-defined abstractions often designed for a particular use examples C - system programming Lisp - symbolic computation Fortran - numerical computing Ada - concurrency and real-time programming 33