1 CO3225 Programming Language: Theory and Practice Low Aim is a Crime, but not high ambition Overview Instructor • Dr. Seyed Mohamed Buhari • PhD from Malaysia – 2003 • Research: Optimizing the search of Access Control Lists for IP Packet Filtering Applications. • Taught at Malaysia, Germany & Saudi Arabia. • Email: mibuhari@yahoo.com (OR) mibuhari@fos.ubd.edu.bn (OR) mibuhari@gmail.com • Extension: 1926 • Office Location: HEP [Student and Staff Centre] • Class Timings & Location: • • • • Mon [9:00 – 9:50AM] – FSM 2.15/2.16 Tue [2:10 – 3:00PM] – FSM 2.30/2.31 Thu [10:10 – 11:00AM] – FSM 1.15/1.16 Sat [9:00 – 12:00PM] – FSM 1.19 Overview 2 CO 3225 • Programming Language: Theory and Practice • Its not just learning a language course. • The main goal is to introduce the fundamental concepts in programming languages. • Emphasis will be on principles of language design, semantics and implementation strategies. • Introduces formal syntax and semantics. • Practically it focuses on many languages like C/C++, Java, Prolog, … • Notes at http://fosel.ubd.edu.bn Overview 3 Book References • [Tuc] Programming Languages Principles and Paradigms – Allen Tucker & Robert Noonan • [Seb] Concepts in Programming Languages – Robert Sebesta • [Kur] Formal Syntax and Semantics – Slonnger & Kurtz • [SK] Programming Language: Application & Interpretation – www.cs.brown.edu/sk/ • [Dan] A Concise Introduction to Computer Languages – Daniel Cooke • [Joh] Concepts in Programming Languages – John C. Mitchell • [Sey] Foundations of Programming Languages – Seyed H. Roosta • [Ben] Understanding Programming Languages – M. Ben-ari • [Lou] Programming Languages Principles and Practice – Kenneth C. Louden • [Ter] Programming Languages Design and Implementation – Terrence W. Pratt • Contains appendices on various languages. • [Aho] Principles of Compiler Design – Aho & Ullman Overview 4 Schedule • Introduction and Overview [Tuc-Ch1, Seb-Ch1&Ch2, Joh-P6,P8,P52, Dan-Ch1, Sey-Ch1, Ben-Ch1] • Paradigms • History • Syntax [Tuc-Ch2, Joh-P12, Kur-Ch1, Dan-Ch2, Aho-Ch3,4,5] • BNF, Regular Grammar • Context-Free Grammar • Syntax Analysis [Ambiguity, Variations] • Syntax & Semantics [Tuc-Ch2, Kur-Ch1&Ch4, Dan-Ch3] • Abstract Syntax • Abstract Syntax Trees • Recursive Descent Parsing Overview 5 Schedule • Type Systems & Semantics [Tuc-Ch3, Kur-Ch8, Ch9&Ch11, Dan-Ch4] • Verification & Inference • Operational Semantics • Axiomatic Semantics • Denotational Semantics • Verification & Inference • Functional Programming [Tuc-Ch8, Dan-Ch7, Lou-Ch11, Sey-Ch12,13, Joh-Ch5] • Lambda Calculus, Types, Function Declaration, Expression Evaluations • Lisp/Scheme • Debug Overview 6 Schedule • Logic Programming [Tuc-Ch9, SK-Ch32-34, Seb-Ch16, Kur-Ch6, Dan-Ch8] • Logic, Predicates & Horn • Prolog: Facts, Variables, Queries • Imperative Programming [Tuc-Ch4-6, Seb-Ch5,6,7,8&9, Lou–Ch6-9, Dan-Ch5, Ter-Ch5,6,8-11, Sey-Ch6&7, Joh-Ch6-9, Ben-Ch4-11] • Naming & Variables • Types, Values, Expressions (Casting, Semantics, Operator Overloading) • Selection, Loops, subroutine, coroutine, recursion • Memory Management [Tuc-Ch5, Seb-Ch6, SK-Ch21] • Overall Structure • Methods, Run-time Stack • Pointers • Arrays, Records • Structures • Memory Leaks & Garbage Collection Overview 7 Schedule • Exception Handling [Tuc-Ch6, SK-Ch21] • Techniques • Model • Object Oriented Programming [Tuc-Ch7, Seb-Ch12, SKCh29&31, Dan-Ch6, Sey-Ch8&9, Joh-Ch10-12] • Data Abstraction • Object Orientation Model • Inheritance, polymorphism, Abstract Classes, Late binding Overview 8 Schedule • Event Driven [Tuc-Ch10] • Foundation • Programming Paradigms • Applets • Concurrent Programming [Tuc-Ch11] • • • • Concepts Inter-process Communication Deadlocks, Semaphores, Monitors Synchronization • Others • • • • • Constraint, Aspect-oriented Lazy & Eager Evaluation [SK-Ch3] Closure, Reflection Continuation [SK-Ch15-20] Algorithm & Action Semantics [Kur-Ch12, Ch13] Overview 9 CO 3225 • Class Timings • Mon [12:00 – 2PM] – FSM 1.21 • Tue [8 – 9AM] – FSM 1.19 • Sat [9:00 – 12:00PM] – FSM 1.19 • Regularity • Slides and Projector usage • Assignments [3] – 10% each • Final 3 Hours Exam – 70% Overview 10 Weekly Schedule 11 Week Chapters Week Chapters 1 Introduction, Overview 8 Functional Languages, HW #2 2 Data Types, Design Principles 9 Logical Languages 3 Syntax Analysis 10 Logical Languages, HW #3 4 Syntax Analysis 11 Imperative Languages 5 Semantics 12 Imperative Languages 6 Semantics, HW #1 13 OOP 7 Functional Languages 14 OOP Overview Before We Get Started • Tell me if you don’t understand • Tell me if I am too fast or too slow • Tell me if you are unhappy with the course • Tell me before or after the lecture, during exercises, in my office, in the corridors, in the coffee room, by email, … Overview 12