CSCI 3136 Principles of Programming Languages

Similar documents
INTRODUCTION PRINCIPLES OF PROGRAMMING LANGUAGES. Norbert Zeh Winter Dalhousie University 1/10

Concepts in Programming Languages

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

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

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

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

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

Today. An Animated Introduction to Programming. Prerequisites. Computer programming

CS 3304 Comparative Languages. Lecture 1: Introduction

Concepts of Programming Languages

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

LECTURE 1. Overview and History

MIDTERM EXAMINATION - CS130 - Spring 2005

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

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

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

Seminar in Programming Languages

Com S 541. Programming Languages I

Comp 333: Concepts of Programming Languages Fall 2016

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

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

Programming Languages, Summary CSC419; Odelia Schwartz

Why are there so many programming languages?

CS 415 Midterm Exam Spring 2002

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

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

What is programming? Elements of Programming Languages. From machine code to programming languages. What is a programming language?

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

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

Programmiersprachen (Programming Languages)

Programming Languages

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

Programming Languages 2nd edition Tucker and Noonan"

CS2303 C14 Systems Programming Concepts. Bob Kinicki

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

IA010: Principles of Programming Languages

CS A331 Programming Language Concepts

In the hardware module, you saw the basic execution of a program Programs are written in specific languages Each language has it s strengths and

CS 242. Fundamentals. Reading: See last slide

CS 314 Principles of Programming Languages


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

CSCI.4430/6969 Programming Languages Lecture Notes

Introduction to Engineering Using Robotics Experiments. Dr. Yinong Chen

A Tour of Language Implementation

CS101 Introduction to Programming Languages and Compilers

CSci 160 Computing Science I. Sarah Carruthers Fall 2017

CS 102 Lecture 1. Syllabus, history, intro

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

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

COSC 2P90 Programming Languages & Object-Orientation

Chapter 5. Names, Bindings, and Scopes

Lecture 1: Course Introduction

Compilation I. Hwansoo Han

Improving Software Cost Estimates Using the Univariate Model

Programming (ERIM) Lecture 1: Introduction to programming paradigms and typing systems. Tommi Tervonen

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

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

Introduction to Computer Science I

CS 314 Principles of Programming Languages

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

SOFTWARE ARCHITECTURE 6. LISP

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End

Programming Languages (CS )

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

Introduction to Scientific Computing Languages

Programming Language Concepts 1982, 1987, Outline. Period

Introduction to the course and basic programming concepts

Introduction to Scientific Computing Languages

The role of semantic analysis in a compiler

Lecture 15: Iteration and Recursion

Welcome to Introduction to Computer Science I

Course Announcements cs2220: Engineering Software

CSI32 Object-Oriented Programming

CSc 372 Comparative Programming Languages

1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

1DL321: Kompilatorteknik I (Compiler Design 1)

Principles of Programming Languages. Lecture Outline

Lecture 1: Introduction. 23. August, 2010

G Programming Languages - Fall 2018

Informal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility

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

CS558 Programming Languages

Lecture 1: Course Introduction

Lecture 31: Building a Runnable Program

Preliminaries. 1. Preliminaries 1.1 Administration. 1.2 Motivation 1.3 Hello, World!

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction Cyrille Berger

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

COMP 201: Principles of Programming

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

Compilation 2012 The What and Why of Compilers

Principles of Programming Languages Lecture 22

Chapter 3:: Names, Scopes, and Bindings (cont.)

Programming Paradigms

CS240: Programming in C

Introduction. A. Bellaachia Page: 1

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

Transcription:

CSCI 3136 Principles of Programming Languages Summer 2013 Faculty of Computer Science Dalhousie University 1 / 100

CSCI 3136 Principles of Programming Languages Summer 2013 Aminul Islam Faculty of Computer Science Dalhousie University 2 / 100

Basic Course Information 3 / 100

Basic Course Information Web: http://web.cs.dal.ca/~islam/3136/ 4 / 100

Basic Course Information Web: http://web.cs.dal.ca/~islam/3136/ Class: Mon & Wed 12:05-13:25 at CS 127 5 / 100

Basic Course Information Web: http://web.cs.dal.ca/~islam/3136/ Class: Mon & Wed 12:05-13:25 at CS 127 Lab: Fri 12:05-13:25 at CS Lab 3 6 / 100

Basic Course Information Web: http://web.cs.dal.ca/~islam/3136/ Class: Mon & Wed 12:05-13:25 at CS 127 Lab: Fri 12:05-13:25 at CS Lab 3 Instructor: Aminul Islam (islam@cs.dal.ca) Office: Room # 437, The Goldberg CS Building 7 / 100

Basic Course Information Web: http://web.cs.dal.ca/~islam/3136/ Class: Mon & Wed 12:05-13:25 at CS 127 Lab: Fri 12:05-13:25 at CS Lab 3 Instructor: Aminul Islam (islam@cs.dal.ca) Office: Room # 437, The Goldberg CS Building Office Hour: Fri 11:00-12:00 8 / 100

Textbooks and Other Material 9 / 100

Textbooks and Other Material Class slides are available online 10 / 100

Textbooks and Other Material Class slides are available online Recommended text: Michael L. Scott. Programming Language Pragmatics, 3rd edition 2009 11 / 100

Textbooks and Other Material Class slides are available online Recommended text: Michael L. Scott. Programming Language Pragmatics, 3rd edition 2009 More relevant books listed on the course web site (some of them are available on-line) 12 / 100

Textbooks and Other Material Class slides are available online Recommended text: Michael L. Scott. Programming Language Pragmatics, 3rd edition 2009 More relevant books listed on the course web site (some of them are available on-line) Other links can be found at course web site 13 / 100

Evaluation and Plagiarism Policy Evaluation Plagiarism policy 14 / 100

Evaluation Evaluation and Plagiarism Policy 40% assignments (Five) Plagiarism policy 15 / 100

Evaluation and Plagiarism Policy Evaluation 40% assignments (Five) 20% midterm exam Plagiarism policy 16 / 100

Evaluation and Plagiarism Policy Evaluation 40% assignments (Five) 20% midterm exam 40% final exam Plagiarism policy 17 / 100

Evaluation and Plagiarism Policy Evaluation 40% assignments (Five) 20% midterm exam 40% final exam Plagiarism policy Assignments and exams must be done individually 18 / 100

Evaluation and Plagiarism Policy Evaluation 40% assignments (Five) 20% midterm exam 40% final exam Plagiarism policy Assignments and exams must be done individually Any use of reference material (book, web,... ) must be acknowledged 19 / 100

Evaluation and Plagiarism Policy Evaluation 40% assignments (Five) 20% midterm exam 40% final exam Plagiarism policy Assignments and exams must be done individually Any use of reference material (book, web,... ) must be acknowledged According to Faculty policy, any suspected case of plagiarism is referred to the Academic Integrity Officer and may be forwarded to the Senate Discipline Committee. Details at http: //www.cs.dal.ca/graduate/studentinfo/plagiarism 20 / 100

How is This Course Useful? 21 / 100

How is This Course Useful? Help choose the most appropriate language for the job, evaluate trade-offs 22 / 100

How is This Course Useful? Help choose the most appropriate language for the job, evaluate trade-offs Make it easier to learn new languages 23 / 100

How is This Course Useful? Help choose the most appropriate language for the job, evaluate trade-offs Make it easier to learn new languages Learn to simulate useful features in languages that lack them 24 / 100

How is This Course Useful? Help choose the most appropriate language for the job, evaluate trade-offs Make it easier to learn new languages Learn to simulate useful features in languages that lack them? 25 / 100

Course Outline Contents Introduction Lexical analysis and automata theory Syntactic Analysis and Context-Free Grammars Semantic analysis Names, scopes, and binding Control flow Data types and object-oriented programming Specialized topics Tutorials Perl Scheme/Lisp Prolog 26 / 100

Course Outline Contents Introduction Programming language, History, Paradigms Implementation Lexical analysis and automata theory Syntactic Analysis and Context-Free Grammars Semantic analysis Names, scopes, and binding Control flow Data types and object-oriented programming Specialized topics Tutorials Perl Scheme/Lisp Prolog 27 / 100

We know Something in Common 28 / 100

We know Something in Common C 29 / 100

We know Something in Common C C++ 30 / 100

We know Something in Common C C++ C# 31 / 100

We know Something in Common C C++ C# Java 32 / 100

We know Something in Common C C++ C# Java JavaScript 33 / 100

We know Something in Common C C++ C# Java JavaScript Perl 34 / 100

We know Something in Common C C++ C# Java JavaScript Perl PHP 35 / 100

We know Something in Common C C++ C# Java JavaScript Perl PHP Python 36 / 100

We know Something in Common C C++ C# Java JavaScript Perl PHP Python Ruby 37 / 100

We know Something in Common C C++ C# Java JavaScript Perl PHP Python Ruby SQL 38 / 100

We know Something in Common C C++ C# Java JavaScript Perl PHP Python Ruby SQL According to langpop.com, 10 most cited programming languages 39 / 100

Principles of Programming Language 40 / 100

Principles of Programming Language? 41 / 100

Principles of Programming Language? Human Language Programming Language 42 / 100

Principles of Programming Language? Human Language Vocabulary Programming Language 43 / 100

Principles of Programming Language? Human Language Vocabulary Programming Language Key words 44 / 100

Principles of Programming Language? Human Language Programming Language Grammar 45 / 100

Principles of Programming Language? Human Language Programming Language Grammar Grammar 46 / 100

Principles of Programming Language? Human Language Programming Language Proper Name/Noun (e.g., Gosling is the...) 47 / 100

Principles of Programming Language? Human Language Programming Language Proper Name/Noun (e.g., Gosling is the...) Variable Name (e.g., int x = 3;) 48 / 100

Principles of Programming Language? Human Language Programming Language... 49 / 100

Principles of Programming Language? Human Language Programming Language...... 50 / 100

Principles of Programming Language? Human Language Vocabulary Grammar Proper Name/Noun (e.g., Gosling is the...)... Programming Language Key words Grammar Variable Name (e.g., int x = 3;)... 51 / 100

Difference between Human Language and Programming Language Colorless green ideas sleep furiously. John is a married bachelor. 52 / 100

Brief history of Programming Languages 53 / 100

Machine language Brief history of Programming Languages 54 / 100

Machine language Brief history of Programming Languages Hello world example in Machine language 1100111001110000011111000000010000111110000111 0000110011111000011000100000100111110001000000 1000001111100010000000000000000010001111100100 55 / 100

Assembly language Brief history of Programming Languages 56 / 100

Brief history of Programming Languages Assembly language Hello world example in Assembly language for the IBM-PC (i386) dosseg.model small.stack 100h.data hello_message db Hello, World!,0dh,0ah, $.code main proc mov ax,@data mov ds,ax mov ah,9 mov dx,offset hello_message int 21h mov ax,4c00h int 21h main endp 57 end / 100 main

Brief history of Programming Languages FORTRAN (1957), COBOL (1959), BASIC (1964), C (1972) 58 / 100

Brief history of Programming Languages FORTRAN (1957), COBOL (1959), BASIC (1964), C (1972) Hello world example in FORTRAN program helloworld write (*,*) Hello, world. end program helloworld 59 / 100

Brief history of Programming Languages LISP (1959) Scheme (1975), Common Lisp (1984) 60 / 100

Brief history of Programming Languages Hello world example in LISP LISP (1959) Scheme (1975), Common Lisp (1984) (DEFUN HELLO-WORLD () (PRINT (LIST HELLO WORLD))) 61 / 100

Brief history of Programming Languages Prolog (1973) 62 / 100

Prolog (1973) Brief history of Programming Languages Hello world example in Prolog?- write( Hello world. ), nl. Hello world. true.?- 63 / 100

Brief history of Programming Languages Simula (1967), Smalltalk (1980), C++ (1985), Java (1995), C# (2002) 64 / 100

Brief history of Programming Languages Hello world example in Java class HelloWorldApp { public static void main(string[] args){ System.out.println("Hello World!"); } } Simula (1967), Smalltalk (1980), C++ (1985), Java (1995), C# (2002) 65 / 100

Brief history of Programming Languages Perl (1987), Python (1990s), JavaScript (1995), PHP (1995), 66 / 100

Programming Paradigms 67 / 100

Programming Paradigms Imperative programming 68 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL 69 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) 70 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming 71 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java 72 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java Functional programming 73 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java Functional programming Lisp, Scheme, ML, Haskell 74 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java Functional programming Lisp, Scheme, ML, Haskell Logic programming 75 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java Functional programming Lisp, Scheme, ML, Haskell Logic programming Prolog, VisiCalc 76 / 100

Programming Paradigms Imperative programming assemblers, FORTRAN, BASIC, COBOL Structured programming (ALGOL, Pascal, C) Object-oriented programming Smalltalk, C++, Java Functional programming Lisp, Scheme, ML, Haskell Logic programming Prolog, VisiCalc 77 / 100

78 / 100

Why So Many Programming Languages? 79 / 100

Why So Many Programming Languages? Evolution 80 / 100

Why So Many Programming Languages? Evolution Special purpose 81 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference 82 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? 83 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power 84 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn 85 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn Easy to implement 86 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn Easy to implement Open-source 87 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn Easy to implement Open-source Good compilers (e.g., FORTRAN) 88 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn Easy to implement Open-source Good compilers (e.g., FORTRAN) Economics, patronage, inertia 89 / 100

Why So Many Programming Languages? Evolution Special purpose Personal preference What makes a programming language successful? Expressive power Easy to learn Easy to implement Open-source Good compilers (e.g., FORTRAN) Economics, patronage, inertia 90 / 100

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end.

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end. Implementation 97 / 100

{calculate greatest common divisor} program gcd(input, output); var i, j : integer; begin read(i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln(i); end. Compiler/ Interpreter Implementation 98 / 100

99 / 100

How is This Course Useful? Help choose the most appropriate language for the job, evaluate trade-offs Make it easier to learn new languages Learn to simulate useful features in languages that lack them? 100 / 100