LECTURER | Andrea Corradini <andrea@di.unipi.it> |
Timetable | Monday 11-13, Room Fib N1
Thursday 16-18, Room Fib C1 Friday 14-16, Room Fib C1 |
Office hours | Click here
To fix a date, send an email to <andrea@di.unipi.it> |
Presentation of the course
Preliminary test |
Slides: PLP-2016-01.pdf | |||
Languages and Abstract Machines Compilation and interpretation schemes Cross compilation and bootstrapping |
Slides: PLP-2016-02.pdf | [GM], Chapter 1; [Scott], Chapter 1 (sections 1-4 to 1-6). | ||
Cross compilation and bootstrapping Overview of a syntax-directed compiler front-end (Context-Free) Grammars, Chomsky hierarchy; Parse trees; Ambiguity, associativity and precedence. |
Slides: PLP-2015-03.pdf | [ALSU], Chapter 2. | ||
Overview of a syntax-directed compiler front-end Lexical analysis; Intermediate code generation; Static checking |
Slides: PLP-2016-04.pdf | [ALSU], Chapter 2. | ||
5 |
Sep. 30, 2016 |
Lexical analysis: Implementing critical parts of a scanner |
Slides: PLP-2016-05.pdf |
[ALSU], Chapter 3. |
6 |
Oct. 3, 2016 |
Towards generation of Lexical Analyzers |
Slides: PLP-2016-06.pdf |
[ALSU], Chapter 3. |
7 |
Oct. 3, 2016 |
Exercises on the topics presented so far, in particular on grammars and languages, Regular Expressions, Finite State Automata, Lexical Analysis. |
Proposed exercises: ES-PLP-2016-01-lexer.pdf |
You are invited to continue solving the exercises at home. If you have doubts about the text or want to discuss a solution with me, send me an email. |
8 |
Oct. 6, 2016 |
From DFAs to Regular Expressions and backwards
|
Slides: PLP-2016-07.pdf, up to page 29. |
[ALSU], Chapters 3, 4. |
9 |
Oct. 13, 2016 |
Top-Down Parsing |
Slides: PLP-2016-07.pdf, all. |
[ALSU], Chapter 4. |
10 |
Oct. 14, 2016 |
Bottom-up Parsing |
Slides: PLP-2016-08.pdf, all;
|
[ALSU], Chapter 4. |
11 |
Oct. 17, 2016 |
Bottom-up Parsing |
Slides: PLP-2016-09.pdf, all. |
[ALSU], Chapter 4. |
12 |
Oct. 17, 2016 |
Exercises on Parsing |
Proposed exercises: ES-PLP-2016-02-parser.pdf |
You are invited to continue solving the exercises at home. If you have doubts about the text or want to discuss a solution with me, send me an email. |
13 |
Oct. 20, 2016 |
Syntax-Directed Translation |
Slides: PLP-2016-10.pdf |
[ALSU], Chapter 5. |
14 |
Ott. 21, 2016 |
Intermediate Representations |
Slides: PLP-2016-11.pdf, up to page 25. |
[Scott] Chapter 6.5, [ALSU] Chapter 6. |
15 |
Oct. 24, 2016 |
Use of backpatching lists. |
Slides: PLP-2016-11.pdf, all. |
[ALSU] Chapter 6 and 8. |
16 |
Oct. 27, 2016 |
Local vs. Global Optimization, DAG Based Optimization, Peephole Optimization and other techniques. |
Slides: PLP-2016-12c.pdf, all [slides on target machine addressing modes modified - November 7]. |
[ALSU] Chapter 8 |
17 |
Oct. 28, 2016 |
Exercises |
Proposed exercises: ES-PLP-2016-03-syntax-directed.pdf |
You are invited to continue solving the exercises at home. If you have doubts about the text or want to discuss a solution with me, send me an email. |
-- |
Nov. 4, 2016 |
First Midterm Exam |
Where? Room B |
It is necessary to register at URL https://esami.unipi.it/esami2/index.php before Nov. 2, 2016. The exam will be about the material presented during the lectures up to and including Lessons 14 and 15 on "Syntax-Directed Translation to Intermediate Representation", (slides PLP-2016-11). This is covered by Chapter 1 of [GM], Chapter 1 (sec. 1-4 to 1-6) of [Scott], and Chapters 2, 3 (excluding Sec. 3.9), 4 (excluding Sec. 4.7.5 and 4.7.6), 5 and 6 (excluding Sections 6.3, 6.4.3, 6.4.4, 6.5, 6.7.4 and 6.8) of [ALSU]. |
19 |
Nov. 7, 2016 |
Code generation. |
Slides: PLP-2016-14.pdf |
[ALSU] Chapter 8. |
20 |
Nov. 10, 2016 |
Global, Machine Independent Optimization; Data Flow Analysis. |
Slides: PLP-2016-15.pdf |
[ALSU] Chapter 9. |
21 |
Nov. 11, 2016 |
The Dataflow Framework for Global Analysis |
Slides: PLP-2016-16b.pdf |
[ALSU] Chapter 9. |
22 |
Nov. 14, 2016 |
Loops in Control Flow Graphs |
Slides: PLP-2016-17.pdf |
[ALSU] Chapter 9. |
23 |
Nov. 17, 2016 |
Programming Languages and Abstraction |
Slides: PLP-2016-18.pdf |
[Scott] Chapter 3, [GM] Chapter 4 and 5. |
24 |
Nov. 18, 2016 |
Exercises |
Proposed exercises: ES-PLP-2016-04-optimization.pdf |
You are invited to continue solving the exercises at home. If you have any doubt about the text or want to discuss a solution with me, send me an email. |
25 |
Nov. 21, 2016 |
Static Scoping | Slides: PLP-2016-19.pdf |
[Scott] Chapter 3, [ALSU] Section 2.7, [GM] Chapter 4 and 5. |
26 |
Nov. 24, 2016 |
Dynamic Scoping and its implementation |
Slides: PLP-2016-20.pdf |
[Scott] Sections 3.6 and 7.1, [GM] Sections 4.3, 5.5 and 8.1. |
27 |
Nov. 25, 2016 |
Type checking |
Slides: PLP-2016-21.pdf |
[Scott] Sections 7.2-4, [GM] Sections 8.2-6, [ALSU] Section 6.3.
|
28 |
Nov. 28, 2016 |
Array allocation and layout; Generating intermediate code for array declaration and access; Strings; Disjoint unions; Variant and discriminated records; Algebraic data types and active patterns; Java classes as union types; Value Model and Reference Model of variables; Pointers; Techniques for avoiding dangling pointers; Pointers and Recursive Types; Pointers and Arrays in C. |
Slides: PLP-2016-21.pdf |
[Scott] Chapter 7, [GM] Chapter 8, [ALSU] Chapter 6.
|
29 |
Dec. 1, 2016 |
Functional programming languages; Introduction to Haskell; Lazyness; Towards Type Classes in Haskel; Generic Polimorphisms vs. Overloading. |
Slides: PLP-2016-22.pdf, up to page 45. |
[Scott] Chapter 10, [GM] Chapter 11, [Mitchell] Chapter 5 (Introduction to Haskell), Chapter 6 (Type Systems, Type Inference, and Polymorphism) and Chapter 7 (Type classes in Haskell).
The GHC compiler for Haskell can be downloaded at http://www.haskell.org/platform |
30 |
Dec. 2, 2016 |
Type Classes in Haskell; Constructor Classes; Monads and the Maybe Monad; Monads as Containers and as Computations. |
Slides: PLP-2016-22.pdf, all. |
[Mitchell] Chapter 7 (Type classes in Haskell) |
31 |
Dec. 9, 2016 |
Exercises on Static/Dynamic Scoping, Deep/Shallow Binding, Type errors, Evaluation order, Allocation of Arrays. |
Proposed exercises: ES-PLP-2016-05-scopes.pdf |
You are invited to continue solving the exercises at home. If you have any doubt about the text or want to discuss a solution with me, send me an email. |
32 |
Dec. 12, 2016, morning |
Haskell: the IO Monad; Type inference in ML/Haskell |
Slides: PLP-2016-23.pdf, all. |
Reading material about Haskell Monads:
[PeytonJohnes2008], up to page 18 (on the Moodle page) |
33 |
Dec. 12, 2016, afternoon |
Control Structures: Iterators, Recursion and Continuation Passing Style; |
Slides: PLP-2016-25.pdf |
http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html |
34 |
Dec. 15, 2016 |
The Stream API in Java 8 |
Slides:
PLP-2016-26.pdf, all. |
http://docs.oracle.com/javase/tutorial/collections/streams/index.html |
35 |
Dec. 16, 2016 |
Exercises on Haskell and Functional Programming Languages. |
| |
-- |
Dec. 19, 2016 |
Second Midterm Exam The text and proposed solutions are on the Moodle page of the course. |
Where? Room A1 |
It is necessary to register at URL https://esami.unipi.it/esami2/index.php before Dec. 16, 2016.
The exam will be about the material presented during the lectures from Lesson 16 ("Control-Flow Graphs", "Local and Global Optimization", slides PLP-216-12c) up to Lesson 33, slides PLP-2016-25 ("Iterators, Recursion and Continuation Passing Style"). The midterm exam will NOT include questions about Monads and Java 8 (Lambda expressions and Stream API).
|