Difference between revisions of "Courses/CcmpTylaLogIng2016 (Ing1 students)"

From LRDE

(Initialize page with contents from TWiki's Epita.CcmpTylaLogIng2015 topic.)
 
(Hide additional contents.)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:%TOPIC%}}
 
 
 
__NOTOC__
 
__NOTOC__
   
 
This page contains the log of the topics of
 
This page contains the log of the topics of
* the [[Epita/CMP1-Course|Compiler Construction Course 1 (CMP1)]],
+
* the [[Courses/CMP1|Compiler Construction Course 1 (CMP1)]],
* the [[Epita/CMP2-Course|Compiler Construction Course 2 (CMP2)]], and
+
* the [[Courses/CMP2|Compiler Construction Course 2 (CMP2)]], and
* the [[Epita/TYLA-Course|Typology of Programming Languages Course (TYLA)]]
+
* the [[Courses/TYLA|Typology of Programming Languages Course (TYLA)]]
for Ing1 students of class EPITA 2015 (i.e., from November 2012 to June 2013).
+
for Ing1 students of class EPITA 2016 (i.e., from December 2013 to June 2014).
The topic was started with the [[Epita/THL-Course|Formal Languages Lecture (THL)]].
+
The topic was started with the [[Courses/THL|Formal Languages Lecture (THL)]].
 
 
   
   
== CMP1 (%roland%) ==
+
== CMP1 ==
   
=== Lecture 1: 2012-11-21 (Grp. B) & 2012-11-22 (Grp. A), 2 hours: Introduction to the Project ===
+
=== Lecture 1: 2013-12-09 (Grp. B & A), 2 hours: Introduction to the Tiger Project ===
   
  +
# Introduction to The Tiger Project. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/tiger-project-intro.pdf tiger-project-intro.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/tiger-project-intro-handout.pdf tiger-project-intro-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/tiger-project-intro-handout-4.pdf tiger-project-intro-handout-4.pdf].
# The Tiger Project. See the lecture notes:
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/tiger-project-intro.pdf tiger-project-intro.pdf],
+
## Ressources (http://www.lrde.epita.fr/~tiger/).
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/tiger-project-intro-handout.pdf tiger-project-intro-handout.pdf] and
+
### Assignments (http://www.lrde.epita.fr/~tiger/assignments.html).
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/tiger-project-intro-handout-4.pdf tiger-project-intro-handout-4.pdf].
 
## Ressources (http://www.lrde.epita.fr/~akim/ccmp/).
 
### Assignments (http://www.lrde.epita.fr/~akim/ccmp/assignments.html).
 
 
### Appel's books.
 
### Appel's books.
### Tiger Compiler Reference Manual (http://www.lrde.epita.fr/~akim/ccmp/tiger.html).
+
### Tiger Compiler Reference Manual (http://www.lrde.epita.fr/~tiger/tiger.html).
 
### <tt>epita.cours.compile</tt>.
 
### <tt>epita.cours.compile</tt>.
 
## Goals (C++, OO, DP, Management, Several Iterations, Testing, Documenting, Maintaining, Fixing, Understanding Computers, English).
 
## Goals (C++, OO, DP, Management, Several Iterations, Testing, Documenting, Maintaining, Fixing, Understanding Computers, English).
Line 47: Line 40:
 
### Factoring the compiler components: intermediate representation(s).
 
### Factoring the compiler components: intermediate representation(s).
 
### Front-end and back-ends.
 
### Front-end and back-ends.
  +
  +
=== Lecture 2: 2013-12-16 (Grp. B & A), 2 hours: Introduction to the Tiger Project (cont.), Architecture of <tt>tc</tt> (tasks), Autotools ===
  +
  +
# Introduction (cont.)
 
## Other compilation strategies.
 
## Other compilation strategies.
 
## The Tiger Compiler pipe (annotated with tools and steps).
 
## The Tiger Compiler pipe (annotated with tools and steps).
 
### Front-end: TC-0 - TC-3 (mandatory part), TC-4 - TC-5 (optional part).
 
### Front-end: TC-0 - TC-3 (mandatory part), TC-4 - TC-5 (optional part).
 
### Back-end: TC-6 - TC-9 (optional part).
 
### Back-end: TC-6 - TC-9 (optional part).
## Misc: students should overcome Make, <tt>Makefiles</tt> and seperate compilation, etc.
+
## Misc: students should overcome Make, <tt>Makefiles</tt> and separate compilation, etc.
 
=== Lecture 2: 2012-12-10 (Grp. B & A), 2 hours: Scanner and Parser Hints ===
 
 
# Additional details and hints about the scanner and the parser: The Scanner and the Parser. See the lecture notes:
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/scanner.pdf scanner.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/scanner-handout.pdf scanner-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/scanner-handout-4.pdf scanner-handout-4.pdf].
 
## Symbols (light-weight, shared and non-mutable strings used to represent identifiers).
 
## Extra information (in addition to tokens/terminals) passed between the scanner and the parser.
 
### Semantic values.
 
### Locations.
 
## Various improvements on the scanner and the parser.
 
### Error recovery by deletion (using the <tt>error</tt> symbol).
 
### Pure (reentrant) parser and scanner.
 
 
=== Lectures 3 and 4: 2013-02-04 (Grp. A) & 2013-02-08 (Grp. B), 4 hours: Architecture of <tt>tc</tt> (tasks), Autotools, Development Tools, Abstract Syntax ===
 
 
 
# Architecture of the Tiger Compiler (<tt>tc</tt>).
 
# Architecture of the Tiger Compiler (<tt>tc</tt>).
 
## Modules: <tt>parse</tt>, <tt>ast</tt>, <tt>bind</tt>, etc.
 
## Modules: <tt>parse</tt>, <tt>ast</tt>, <tt>bind</tt>, etc.
 
### Pure libraries providing actual services.
 
### Pure libraries providing actual services.
### Tasks (non-pure services) using a declarative system: Development Tools, section 1 (<tt>tc</tt> Tasks). See the lecture notes:
+
### Tasks (non-pure services) using a declarative system: Development Tools, section 1 (<tt>tc</tt> Tasks). See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/dev-tools.pdf dev-tools.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/dev-tools-handout.pdf dev-tools-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/dev-tools-handout-4.pdf dev-tools-handout-4.pdf].
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/dev-tools.pdf dev-tools.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/dev-tools-handout.pdf dev-tools-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/dev-tools-handout-4.pdf dev-tools-handout-4.pdf].
 
 
#### Command-line options.
 
#### Command-line options.
 
#### Declaration of dependencies.
 
#### Declaration of dependencies.
Line 106: Line 83:
 
#### Running <tt>make</tt>.
 
#### Running <tt>make</tt>.
 
#### Running <tt>./hello-world</tt>.
 
#### Running <tt>./hello-world</tt>.
  +
  +
=== Lectures 3 : 2014-02-17 (Grp. A & B), 2 hours: Autotools (cont.), Development Tools ===
  +
  +
# Autoconf and Automake (cont.)
  +
## Hands-on example (cont.)
 
### Adding a (static) library.
 
### Adding a (static) library.
 
#### Writing the client (<tt>hello.cc</tt>) and the library (<tt>greet.hh</tt> and <tt>greet.cc</tt>).
 
#### Writing the client (<tt>hello.cc</tt>) and the library (<tt>greet.hh</tt> and <tt>greet.cc</tt>).
Line 130: Line 112:
 
### Pros and cons of using multiple <tt>Makefile</tt> s in a multi-directory project.
 
### Pros and cons of using multiple <tt>Makefile</tt> s in a multi-directory project.
 
### <tt>srcdir</tt> vs <tt>builddir</tt>, running <tt>configure</tt> from a directory other than the source dir.
 
### <tt>srcdir</tt> vs <tt>builddir</tt>, running <tt>configure</tt> from a directory other than the source dir.
  +
# Development Tools. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/dev-tools.pdf dev-tools.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/dev-tools-handout.pdf dev-tools-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/dev-tools-handout-4.pdf dev-tools-handout-4.pdf].
# Development Tools. See the lecture notes:
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/dev-tools.pdf dev-tools.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/dev-tools-handout.pdf dev-tools-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/dev-tools-handout-4.pdf dev-tools-handout-4.pdf].
 
# Abstract Syntax, up to basic Visitors (sec. 2.3, p. 51) and except AST Generators (p. 613), Tagging the Abstract Syntax Tree (p. 22), Processing and Dispatching (p. 3638), Multimethods (p. 4042). See the lecture notes,
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/ast.pdf ast.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/ast-handout.pdf ast-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/ast-handout-4.pdf ast-handout-4.pdf].
 
   
=== Lecture 5: 2013-02-20 (Grp. A & B), 2 hours: Abstract Syntax ===
+
=== Lecture 4: 2014-02-21 (Grp. A & B), 2 hours: Scanner and Parser Hints ===
   
* Abstract Syntax. See the lecture notes, [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/ast.pdf ast.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/ast-handout.pdf ast-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/ast-handout-4.pdf ast-handout-4.pdf].
+
# Additional details and hints about the scanner and the parser: The Scanner and the Parser. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/scanner.pdf scanner.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/scanner-handout.pdf scanner-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/scanner-handout-4.pdf scanner-handout-4.pdf].
  +
## Symbols (light-weight, shared and non-mutable strings used to represent identifiers).
  +
## Extra information (in addition to tokens/terminals) passed between the scanner and the parser.
  +
### Semantic values.
  +
### Locations.
  +
## Various improvements on the scanner and the parser.
  +
### Error recovery by deletion (using the <tt>error</tt> symbol).
  +
### Pure (reentrant) parser and scanner.
   
=== Lecture 6: 2013-02-27 (Grp. A & B), 2 hours: Names, Identifiers and Bindings ===
+
=== Lecture 5: 2014-02-24 (Grp. A & B), 2 hours: Abstract Syntax ===
   
* Names, Identifiers and Bindings. See the lecture notes, [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/names.pdf names.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/names-handout.pdf names-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/names-handout-4.pdf names-handout-4.pdf].
+
* Abstract Syntax, up to basic Visitors (sec. 2.3, p. 51). See the lecture notes, [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/ast.pdf ast.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/ast-handout.pdf ast-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/ast-handout-4.pdf ast-handout-4.pdf].
   
  +
=== Lecture 6: 2014-02-25 (Grp. B & A), 2 hours: Abstract Syntax [in lieu of TYLA] ===
   
  +
* Abstract Syntax, up to the end. See the lecture notes, [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/ast.pdf ast.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/ast-handout.pdf ast-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/ast-handout-4.pdf ast-handout-4.pdf].
== CMP2 (%roland%) ==
 
   
=== Lecture 1: 2013-03-11 (Grp. A & B), 2 hours: Type-checking ===
+
=== Lecture 7: 2013-03-04 (Grp. B & A), 2 hours: Names, Identifiers and Bindings ===
   
  +
* Names, Identifiers and Bindings, up to Scoped Symbol Table Implementations. See the lecture notes (section 1 and 2, unfinished), [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/names.pdf names.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/names-handout.pdf names-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/names-handout-4.pdf names-handout-4.pdf].
# Types. See the lecture notes (sections 1 and 2):
 
  +
* TC's Binder explained.
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/type-checking.pdf type-checking.pdf],
 
  +
** Traversal and use of the symbol tables.
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/type-checking-handout.pdf type-checking-handout.pdf] and
 
  +
** Chunks (ast::TypeDecs, ast::FunctionDecs) and how they are processed by bind::Binder.
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/type-checking-handout-4.pdf type-checking-handout-4.pdf].
 
  +
  +
  +
== CMP2 ==
  +
  +
=== Lecture 1: 2014-03-14 (Grp. A & B), 2 hours: Names, Identifiers and Bindings, Type-checking ===
  +
  +
# Names, Identifiers and Bindings: Complications. See the lecture notes (section 3), [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/names.pdf names.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/names-handout.pdf names-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/names-handout-4.pdf names-handout-4.pdf].
  +
# Types. See the lecture notes (sections 1 and intro to section 2): [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/type-checking.pdf type-checking.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/type-checking-handout.pdf type-checking-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/type-checking-handout-4.pdf type-checking-handout-4.pdf].
  +
  +
=== Lecture 2: 2014-03-18 (Grp. B & A), 2 hours: Type-checking ===
  +
  +
# Types. See the lecture notes (up to the end): [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/type-checking.pdf type-checking.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/type-checking-handout.pdf type-checking-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/type-checking-handout-4.pdf type-checking-handout-4.pdf].
 
# Some details on the implementation of types and type-checking within the Tiger Compiler.
 
# Some details on the implementation of types and type-checking within the Tiger Compiler.
 
## Hierarchy of types (<tt>src/type/</tt>)
 
## Hierarchy of types (<tt>src/type/</tt>)
Line 161: Line 156:
 
### Implementing atomic types: singletons.
 
### Implementing atomic types: singletons.
 
### Resolving aliased types: <tt>Named</tt> and <tt>actual()</tt>.
 
### Resolving aliased types: <tt>Named</tt> and <tt>actual()</tt>.
  +
# Sequent Calculus
  +
## In English: "If ''alpha'' is of type '''Int''' in the context ''Gamma'' and ''beta'' is of type '''Int''' in the context ''Gamma'', then ''alpha'' + ''beta'' is of type '''Int''' in the context ''Gamma''."
  +
## Using symbols (where &#8866; ("tee" or "turnstile") is the symbol meaning "yields" or "proves"): <math>\frac{\Gamma\vdash\alpha:Int \quad \Gamma\vdash\alpha:Int}{\Gamma\vdash\alpha+\beta:Int} </math>
  +
## Examples of type rules: addition of 2 integers, if-then-else, if-then, addition of 3 integers, comparison of two variables, etc.
  +
## Type inference
  +
### <tt>(''a'' ? ''b'' : ''c'') > 0</tt>
  +
### <tt>(''a'' ? ''b'' : ''f''(''b'')) > 0</tt>
  +
### <tt>(''a'' ? ''b'' : ''f''(''c'')) > 0</tt>
   
=== Lecture 2: 2013-04-25 (Grp. A & B), 2 hours: Intermediate languages ===
+
=== Lecture 3: 2014-04-28 (Grp. B) & 2014-04-29 (Grp. A), 2 hours: Intermediate languages ===
   
# Intermediate languages. See the lecture notes (up to section 4.1 (included), except dynamic allocation, non-local variables & static link, calling conventions, Ix, translation of complex expressions, proper explanation of frame::{Access,Frame} vs translate::{Access,Level}):
+
# Intermediate languages. See the lecture notes (up to section 4.1 (included), except details about intermediate representations (sec. 1.1), details dynamic allocation (sec 2.1), non-local variables & static link (sec. 2.2)): [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
 
   
=== Lecture 3: 2013-05-02 (Grp. A & B), 2 hours: Intermediate languages, Canonization (Linearization) ===
+
=== Lecture 4: 2014-05-26 (Grp. B) & 2014-05-27 (Grp. A), 2 hours: Intermediate languages (cont.), Canonization ===
   
* Intermediate languages (dynamic allocation, non-local variables & static link, calling conventions, Ix, translation of complex expressions, proper explanation of frame::{Access,Frame} vs translate::{Access,Level}). See the lecture notes (remaining sections up to section 4.1): [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
+
# Intermediate languages: details about intermediate representations (sec. 1.1), details dynamic allocation (sec 2.1), non-local variables & static link (sec. 2.2). See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
* Canonization (Linearization). See the lecture notes (section 4.2, up to slide 100): [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
+
# Canonization. See the lecture notes (section 4.2): [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
   
=== Lecture 4: 2013-05-06 (Grp. A & B), 2 hours: Canonization (Basic Blocks, Traces), Microprocessors, Instruction Selection ===
+
=== Lecture 5: 2014-06-06 (Grp. B & A), 2 hours: Microprocessors, Instruction Selection, Introduction to Liveness Analysis ===
   
* Canonization (Basic Blocks, Traces). See the lecture notes (up to the end): [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
+
# Microprocessors, Instruction Selection. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/instr-selection.pdf instr-selection.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/instr-selection-handout.pdf instr-selection-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/instr-selection-handout-4.pdf instr-selection-handout-4.pdf].
  +
# Examples of MonoBURG input files from the Tiger Compiler (Tree to MIPS).
* Microprocessors, Instruction Selection. See the lecture notes: [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/instr-selection.pdf instr-selection.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/instr-selection-handout.pdf instr-selection-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/instr-selection-handout-4.pdf instr-selection-handout-4.pdf].
 
  +
# Liveness Analysis. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/liveness.pdf liveness.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/liveness-handout.pdf liveness-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/liveness-handout-4.pdf liveness-handout-4.pdf].
* Examples of MonoBURG input files from the Tiger Compiler (Tree to MIPS).
 
   
=== Lecture 5: 2013-05-30 (Grp. A & B), 2 hours: Liveness Analysis, Register Allocation ===
+
=== Lecture 6: 2014-06-09 (Grp. B) & 2014-06-10 (Grp. A), 2 hours: Liveness Analysis, Register Allocation ===
   
* Liveness Analysis. See the lecture notes: [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/liveness.pdf liveness.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/liveness-handout.pdf liveness-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/liveness-handout-4.pdf liveness-handout-4.pdf].
+
# Liveness Analysis. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/liveness.pdf liveness.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/liveness-handout.pdf liveness-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/liveness-handout-4.pdf liveness-handout-4.pdf].
* Register Allocation: Coloring by Simplification, Spilling, Coalescing, Precolored Nodes, Caller- and Callee-Saved Registers, Implementation, Alternatives to Graph Coloring. See the lecture notes: [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/regalloc.pdf regalloc.pdf], [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/regalloc-handout.pdf regalloc-handout.pdf] and [http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/regalloc-handout-4.pdf regalloc-handout-4.pdf].
+
# Register Allocation: Coloring by Simplification, Spilling, Coalescing, Precolored Nodes, Caller- and Callee-Saved Registers, Implementation, Alternatives to Graph Coloring. See the lecture notes: [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/regalloc.pdf regalloc.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/regalloc-handout.pdf regalloc-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/regalloc-handout-4.pdf regalloc-handout-4.pdf].
   
  +
<!--
=== Lecture 6: 2013-06-13 (Grp. A & B), 2 hours: Selected Topics About the Future of Languages and Compilation ===
 
  +
=== Additional contents : Selected Topics About the Future of Languages and Compilation ===
   
 
* Two presentations about languages and compilation:
 
* Two presentations about languages and compilation:
** [http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf Modules] (e.g. a module system for the C language family), by Douglas Gregor (Apple) at the [http://llvm.org/devmtg/2012-11/ 2012 LLVM Developers' Meeting].
+
** [http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf Modules] (a module system for the C language family), by Douglas Gregor (Apple) at the [http://llvm.org/devmtg/2012-11/ 2012 LLVM Developers' Meeting].
 
** [https://github.com/boostcon/cppnow_presentations_2013/blob/master/thu/concepts-lite.pdf?raw=true Concepts Lite: Constraining Template Arguments with Predicates], by Andrew Sutton, Bjarne Stroustrup and Gabriel Dos Reis (Texas A&M University) at [http://cppnow.org/ C++Now 2013].
 
** [https://github.com/boostcon/cppnow_presentations_2013/blob/master/thu/concepts-lite.pdf?raw=true Concepts Lite: Constraining Template Arguments with Predicates], by Andrew Sutton, Bjarne Stroustrup and Gabriel Dos Reis (Texas A&M University) at [http://cppnow.org/ C++Now 2013].
  +
-->
   
   
== TYLA (%roland%) ==
+
== TYLA ==
   
=== Lecture 1: 2013-02-27 (Grp. B & A), 2 hours: History of Computing and Programming Languages ===
+
=== Lecture 1: 2014-02-27 (Grp. A & B), 2 hours: History of Computing ===
   
  +
* History of Computing: A Short Computer History Chronology (section 1). See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/history.pdf history.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/history-handout.pdf history-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/history-handout-4.pdf history-handout-4.pdf].
# History of Computing. See the lecture notes,
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/history.pdf history.pdf],
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/history-handout.pdf history-handout.pdf] and
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/history-handout-4.pdf history-handout-4.pdf].
 
# History of Programming Languages: FOTRAN, Algol (section 1.1 and 1.2). See the lecture notes,
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/early-languages.pdf early-languages.pdf],
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/early-languages-handout.pdf early-languages-handout.pdf] and
 
[https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/early-languages-handout-4.pdf early-languages-handout-4.pdf].
 
   
=== Lecture 2: 2013-03-06 (Grp. B & A), 2 hours: History of Programming Languages, Object-Oriented History ===
+
=== Lecture 2: 2014-03-07 (Grp. B & A), 2 hours: History of Computing and Programming Languages ===
   
* History of Programming Languages. See the lecture notes, [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/early-languages.pdf early-languages.pdf], [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/early-languages-handout.pdf early-languages-handout.pdf] and [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/early-languages-handout-4.pdf early-languages-handout-4.pdf].
+
# History of Computing: Some Early Machines (section 2). See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/history.pdf history.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/history-handout.pdf history-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/history-handout-4.pdf history-handout-4.pdf].
* Object-Oriented History: Simula, Smalltalk-72, Smalltalk-76. See the lecture notes, [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/object.pdf object.pdf], [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/object-handout.pdf object-handout.pdf] and [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/object-handout-4.pdf object-handout-4.pdf].
+
# History of Programming Languages: The Very First Ones: FORTRAN, Algol, COBOL (Section 1). See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/early-languages.pdf early-languages.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/early-languages-handout.pdf early-languages-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/early-languages-handout-4.pdf early-languages-handout-4.pdf].
   
=== Lecture 3: 2013-03-13 (Grp. B & A), 2 hours: Object-Oriented History, Subprograms ===
+
=== Lecture 3: 2014-03-11 (Grp. B & A), 2 hours: History of Programming Languages, Object-Oriented History ===
   
* Object-Oriented History: Smalltalk-80, C++. See the lecture notes, [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/object.pdf object.pdf], [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/object-handout.pdf object-handout.pdf] and [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/object-handout-4.pdf object-handout-4.pdf].
+
# History of Programming Languages: The Second Wave: APL, PL/I, BASIC, Pascal & Heirs (Section 2) and The Finale (Section 3). See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/early-languages.pdf early-languages.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/early-languages-handout.pdf early-languages-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/early-languages-handout-4.pdf early-languages-handout-4.pdf].
* Subprograms (sections 1 and 2). See the lecture notes, [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/subprograms.pdf subprograms.pdf], [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/subprograms-handout.pdf subprograms-handout.pdf] and [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/subprograms-handout-4.pdf subprograms-handout-4.pdf].
+
# Object-Oriented History: Simula. See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/object.pdf object.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/object-handout.pdf object-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/object-handout-4.pdf object-handout-4.pdf].
   
=== Lecture 4: 2013-03-20 (Grp. B & A), 2 hours: Subprograms, Some Traits of Functional Programming Languages ===
+
=== Lecture 4: 2014-03-19 (Grp. B & A), 2 hours: Object-Oriented History: Smalltalk ===
   
* Subprograms. See the lecture notes, [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/subprograms.pdf subprograms.pdf], [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/subprograms-handout.pdf subprograms-handout.pdf] and [https://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/subprograms-handout-4.pdf subprograms-handout-4.pdf].
+
# Object-Oriented History: Smalltalk. See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/object.pdf object.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/object-handout.pdf object-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/object-handout-4.pdf object-handout-4.pdf].
** In-depth explanation of the example of the numerical differentiation in Haskell.
 
* Some Traits of Functional Programming Languages.
 
** Currying, partially applied functions, closures.
 
** Pure vs impure languages.
 
** Lazy vs strict evaluation, equational reasoning, infinite lists.
 
*** <tt>loop.hs</tt> (lazy evaluation, terminates)
 
*** <tt>loop.ml</tt> (strict evaluation, does not terminate)
 
*** <tt>loop-lazy.ml</tt> (local/partial lazy evaluation, terminates)
 
   
  +
=== Lecture 5: 2014-03-25 (Grp. B & A), 2 hours: Some Traits of Functional Programming Languages, Generic Programming ===
loop.hs:
 
  +
%begin haskell%
 
  +
# Object-Oriented History: Smalltalk, C++. See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/object.pdf object.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/object-handout.pdf object-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/object-handout-4.pdf object-handout-4.pdf].
  +
# Generic Programming, except Template Metaprogramming (section 4.2). See the lecture notes, [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/generic.pdf generic.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/generic-handout.pdf generic-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/generic-handout-4.pdf generic-handout-4.pdf].
  +
# Subprograms (sections 1 and 2). See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/subprograms.pdf subprograms.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/subprograms-handout.pdf subprograms-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/subprograms-handout-4.pdf subprograms-handout-4.pdf].
  +
  +
<!--
  +
=== Additional contents ===
  +
  +
# Subprograms. See the lecture notes, [https://www.lrde.epita.fr/~tiger/lecture-notes/slides/tyla/subprograms.pdf subprograms.pdf], [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts/tyla/subprograms-handout.pdf subprograms-handout.pdf] and [https://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/tyla/subprograms-handout-4.pdf subprograms-handout-4.pdf].
  +
## In-depth explanation of the example of the numerical differentiation in Haskell.
  +
# Some Traits of Functional Programming Languages.
  +
## Currying, partially applied functions, closures.
  +
## Pure vs impure languages.
  +
## Lazy vs strict evaluation, equational reasoning, infinite lists.
  +
### <tt>loop.hs</tt> (lazy evaluation, terminates)
  +
### <tt>loop.ml</tt> (strict evaluation, does not terminate)
  +
### <tt>loop-lazy.ml</tt> (local/partial lazy evaluation, terminates)
  +
<tt>loop.hs</tt>:
  +
<syntaxhighlight lang="haskell">
 
main =
 
main =
 
let y = 0
 
let y = 0
Line 235: Line 240:
 
in
 
in
 
f (loop y)
 
f (loop y)
  +
</syntaxhighlight>
%end%
 
  +
<tt>loop.ml</tt>:
 
  +
<syntaxhighlight lang="ocaml">
loop.ml:
 
%begin haskell%
 
 
let y = 0 in
 
let y = 0 in
 
let rec loop z = if z > 0 then z else loop z in
 
let rec loop z = if z > 0 then z else loop z in
Line 244: Line 248:
 
f (loop y)
 
f (loop y)
 
;;
 
;;
  +
</syntaxhighlight>
%end%
 
  +
<tt>loop-lazy.ml</tt>:
 
  +
<syntaxhighlight lang="ocaml">
loop-lazy.ml:
 
%begin haskell%
 
 
let y = 0 in
 
let y = 0 in
 
let rec loop z = if z > 0 then z else loop z in
 
let rec loop z = if z > 0 then z else loop z in
Line 253: Line 256:
 
f (lazy (loop y))
 
f (lazy (loop y))
 
;;
 
;;
  +
</syntaxhighlight>
%end%
 
  +
# Genericity in Haskell. See the lecture notes (in section 2.3): [http://www.lrde.epita.fr/~tiger/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf], [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and [http://www.lrde.epita.fr/~tiger/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
 
  +
-->
=== Lecture 5: 2013-03-25 (Grp. B & A), 2 hours: Type-checking, Generic Programming ===
 
 
# Sequent Calculus
 
## In English: "If ''alpha'' is of type '''Int''' in the context ''Gamma'' and ''beta'' is of type '''Int''' in the context ''Gamma'',
 
then ''alpha'' + ''beta'' is of type '''Int''' in the context ''Gamma''."
 
## Using symbols (where &#8866; ("tee" or "turnstile") is the symbol meaning "yields" or "proves"):
 
<center>
 
<math xmlns="http://www.w3.org/1998/Math/MathML">
 
<semantics>
 
<mfrac>
 
<mrow>
 
<mo stretchy="false">&#915;</mo>
 
<mi>&#8866;</mi>
 
<mo stretchy="false">&#945;</mo>
 
<mi mathvariant="normal">:</mi>
 
<mtext>Int</mtext>
 
<mi/>
 
<mo stretchy="false">&#915;</mo>
 
<mi>&#8866;</mi>
 
<mi mathvariant="italic">&#946;</mi>
 
<mi mathvariant="normal">:</mi>
 
<mtext>Int</mtext>
 
</mrow>
 
<mrow>
 
<mo stretchy="false">&#915;</mo>
 
<mi>&#8866;</mi>
 
<mrow>
 
<mo stretchy="false">&#945;</mo>
 
<mo stretchy="false">+</mo>
 
<mi mathvariant="italic">&#946;</mi>
 
</mrow>
 
<mi mathvariant="normal">:</mi>
 
<mtext>Int</mtext>
 
</mrow>
 
</mfrac>
 
</semantics>
 
</math>
 
</center>
 
## Examples of type rules: addition of 2 integers, if-then-else, if-then, addition of 3 integers, comparison of two variables, etc.
 
## Type inference
 
### <tt>(''a_ ? _b'' : _c_) > 0</tt>
 
### <tt>(''a_ ? _b'' : ''f_ (_b'')) > 0</tt>
 
### <tt>(''a_ ? _b'' : ''f_ (_c'')) > 0</tt>
 
# Generic Programming (sections 1, 2 and 3). See the lecture notes,
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/generic.pdf generic.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/generic-handout.pdf generic-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/generic-handout-4.pdf generic-handout-4.pdf].
 
# Genericity in Haskell. See the lecture notes (in section 2.3):
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/ccmp/intermediate.pdf intermediate.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/ccmp/intermediate-handout.pdf intermediate-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/ccmp/intermediate-handout-4.pdf intermediate-handout-4.pdf].
 
   
  +
<!--
=== Lecture 6: 2013-03-26 (Grp. A & B), 2 hours: Genericity in C++, the Standard Template Library (STL) and Template Metaprogramming, OOP vs GP ===
 
  +
=== Additional contents: Genericity in C++, the Standard Template Library (STL) and Template Metaprogramming, OOP vs GP? ===
   
# Generic Programming (sections 4). See the lecture notes,
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/slides/tyla/generic.pdf generic.pdf],
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts/tyla/generic-handout.pdf generic-handout.pdf] and
 
[http://www.lrde.epita.fr/~akim/ccmp/lecture-notes/handouts-4/tyla/generic-handout-4.pdf generic-handout-4.pdf].
 
 
# More on GP, concepts and links between GP and OOP.
 
# More on GP, concepts and links between GP and OOP.
 
## OOP vs OOP
 
## OOP vs OOP
Line 326: Line 276:
 
### "Concepts light" proposal
 
### "Concepts light" proposal
 
### By Mixing OOP and GP
 
### By Mixing OOP and GP
#### The Curiously Recurring Template Pattern (CRTP).
+
#### The Curiously Recurring Template Pattern (CRTP). Mixing two kinds of relations between a base class (top) and a derived class (bottom), in opposite ways:
Mixing two kinds of relations between a base class (top) and a derived class (bottom), in opposite ways:
 
 
##### Inheritance (top-down).
 
##### Inheritance (top-down).
 
##### Parameter passing (bottom-up).
 
##### Parameter passing (bottom-up).
Line 334: Line 283:
 
##### Static conversion to exact type (instead of <tt>dynamic_cast</tt> in traditional OOP)
 
##### Static conversion to exact type (instead of <tt>dynamic_cast</tt> in traditional OOP)
 
##### Implementing static dispatch based on abstractions.
 
##### Implementing static dispatch based on abstractions.
  +
-->

Latest revision as of 17:57, 9 June 2014


This page contains the log of the topics of

for Ing1 students of class EPITA 2016 (i.e., from December 2013 to June 2014). The topic was started with the Formal Languages Lecture (THL).


CMP1

Lecture 1: 2013-12-09 (Grp. B & A), 2 hours: Introduction to the Tiger Project

  1. Introduction to The Tiger Project. See the lecture notes: tiger-project-intro.pdf, tiger-project-intro-handout.pdf and tiger-project-intro-handout-4.pdf.
    1. Ressources (http://www.lrde.epita.fr/~tiger/).
      1. Assignments (http://www.lrde.epita.fr/~tiger/assignments.html).
      2. Appel's books.
      3. Tiger Compiler Reference Manual (http://www.lrde.epita.fr/~tiger/tiger.html).
      4. epita.cours.compile.
    2. Goals (C++, OO, DP, Management, Several Iterations, Testing, Documenting, Maintaining, Fixing, Understanding Computers, English).
    3. Non goals (Compiler Construction).
    4. Rules of the Game.
      1. No copy between groups.
      2. Tests are part of the project (test cases and frameworks should not be exchanged).
      3. Fixing mistakes earlier is better.
      4. Work between groups is encouraged as long as they don't cheat.
    5. Tests.
      1. Tests matter.
      2. Rules.
        1. A bug => a test.
        2. A suspicious behavior => one or several tests to isolate it.
        3. Don't throw away tests!
        4. Don't exchange tests! (bis repetita).
    6. C Compilation model (cpp, cc1, as, ld).
    7. Width of a compiler (granularity of compiled entities).
    8. Tiger Compiler pipeline (front end only)
    9. Compilers handling multiple input (sources languages) and multiple outputs (target assembly languages/processors).
      1. The case of GCC.
      2. Factoring the compiler components: intermediate representation(s).
      3. Front-end and back-ends.

Lecture 2: 2013-12-16 (Grp. B & A), 2 hours: Introduction to the Tiger Project (cont.), Architecture of tc (tasks), Autotools

  1. Introduction (cont.)
    1. Other compilation strategies.
    2. The Tiger Compiler pipe (annotated with tools and steps).
      1. Front-end: TC-0 - TC-3 (mandatory part), TC-4 - TC-5 (optional part).
      2. Back-end: TC-6 - TC-9 (optional part).
    3. Misc: students should overcome Make, Makefiles and separate compilation, etc.
  2. Architecture of the Tiger Compiler (tc).
    1. Modules: parse, ast, bind, etc.
      1. Pure libraries providing actual services.
      2. Tasks (non-pure services) using a declarative system: Development Tools, section 1 (tc Tasks). See the lecture notes: dev-tools.pdf, dev-tools-handout.pdf and dev-tools-handout-4.pdf.
        1. Command-line options.
        2. Declaration of dependencies.
        3. Actual computations delegated to pure libraries.
    2. Driver (tc.cc).
      1. Instantiates a tasks manager, used to record all existing tasks at start-up and later compute the steps to performe according to the dependencies of the invoked tasks.
      2. Workflow computed by the task manager from the options passed to the driver, triggering corresponding tasks and their dependencies ( la Make).
      3. Error management: catches exceptions (including misc::error) and displays error messages.
  3. Autoconf and Automake
    1. History: Unix, Unices, configuration systems (imake, configure), portability issues (broken tools, broken/missing functions, libraries, etc.).
    2. Generating configure with Autoconf
      1. The choice of (a subset of) the Bourne Shell for portability reasons.
      2. Generating to encapsulate tests, simplify, shorten and reuse shell script bits.
      3. Using the M4 macro language.
      4. Autotools Diagram: Autoconf.
    3. Generating Makefile (s) with Automake and configure.
      1. Generating to simplify and shorten portable Makefile bits.
      2. Substituting variables (@VAR@) in Makefile.in using configure (BTW: variables listed in configure --help).
      3. Completing the Autotools diagram: Automake.
      4. Developer side vs User side.
    4. A word on aclocal.
    5. Hands-on example.
      1. A simple program.
        1. Writing hello-world.cc.
        2. Adding Makefile.am.
        3. Running autoscan.
        4. Adjusting config.scan to create config.ac (initializing Automake, avoiding autoheader).
        5. Running alocal, automake -a -c (and installing helpers) and autoconf.
        6. Running ./configure.
        7. Running make.
        8. Running ./hello-world.

Lectures 3 : 2014-02-17 (Grp. A & B), 2 hours: Autotools (cont.), Development Tools

  1. Autoconf and Automake (cont.)
    1. Hands-on example (cont.)
      1. Adding a (static) library.
        1. Writing the client (hello.cc) and the library (greet.hh and greet.cc).
        2. Adjusting Makefile.am (lib_LIBRARIES vs noinst_LIBRARIES), and configure.ac (AC_PROG_RANLIB).
        3. Updating by running make (and not the Autotools).
        4. Compiling the client (hello) by adjusting Makefile.am (in particular, link to libgreet.a using hello_LDADD).
        5. Running make again.
        6. Running ./hello.
      2. Adding tests.
        1. TESTS in Makefile.am and make check.
        2. Compiling test-only (not installed) programs: check_PROGRAMS.
      3. Distributing.
        1. make dist.
        2. make distcheck.
        3. Don't forget to adjust the arguments of AC_INIT in configure.ac.
      4. Installing.
        1. make install.
        2. configure --prefix, $prefix, $bindir, $libdir, etc. and bin_, lib_ prefixes of primaries (PROGRAMS, LIBRARIES, etc.).
        3. make uninstall (careful, very limited).
    2. Misc.
      1. Generating tests with configure (e.g. so that they can find $srcdir).
      2. Changing variables (e.g. CXXFLAGS) at the configuration step (=./configure CXXFLAGS...=; global) or at the build step (=make CXXFLAGS...=; local).
      3. autoheader and config.h: getting rid of limitations of using -D options to pass options to the compiler.
      4. Pros and cons of using multiple Makefile s in a multi-directory project.
      5. srcdir vs builddir, running configure from a directory other than the source dir.
  2. Development Tools. See the lecture notes: dev-tools.pdf, dev-tools-handout.pdf and dev-tools-handout-4.pdf.

Lecture 4: 2014-02-21 (Grp. A & B), 2 hours: Scanner and Parser Hints

  1. Additional details and hints about the scanner and the parser: The Scanner and the Parser. See the lecture notes: scanner.pdf, scanner-handout.pdf and scanner-handout-4.pdf.
    1. Symbols (light-weight, shared and non-mutable strings used to represent identifiers).
    2. Extra information (in addition to tokens/terminals) passed between the scanner and the parser.
      1. Semantic values.
      2. Locations.
    3. Various improvements on the scanner and the parser.
      1. Error recovery by deletion (using the error symbol).
      2. Pure (reentrant) parser and scanner.

Lecture 5: 2014-02-24 (Grp. A & B), 2 hours: Abstract Syntax

Lecture 6: 2014-02-25 (Grp. B & A), 2 hours: Abstract Syntax [in lieu of TYLA]

Lecture 7: 2013-03-04 (Grp. B & A), 2 hours: Names, Identifiers and Bindings

  • Names, Identifiers and Bindings, up to Scoped Symbol Table Implementations. See the lecture notes (section 1 and 2, unfinished), names.pdf, names-handout.pdf and names-handout-4.pdf.
  • TC's Binder explained.
    • Traversal and use of the symbol tables.
    • Chunks (ast::TypeDecs, ast::FunctionDecs) and how they are processed by bind::Binder.


CMP2

Lecture 1: 2014-03-14 (Grp. A & B), 2 hours: Names, Identifiers and Bindings, Type-checking

  1. Names, Identifiers and Bindings: Complications. See the lecture notes (section 3), names.pdf, names-handout.pdf and names-handout-4.pdf.
  2. Types. See the lecture notes (sections 1 and intro to section 2): type-checking.pdf, type-checking-handout.pdf and type-checking-handout-4.pdf.

Lecture 2: 2014-03-18 (Grp. B & A), 2 hours: Type-checking

  1. Types. See the lecture notes (up to the end): type-checking.pdf, type-checking-handout.pdf and type-checking-handout-4.pdf.
  2. Some details on the implementation of types and type-checking within the Tiger Compiler.
    1. Hierarchy of types (src/type/)
      1. src/type/README.
      2. Implementing atomic types: singletons.
      3. Resolving aliased types: Named and actual().
  3. Sequent Calculus
    1. In English: "If alpha is of type Int in the context Gamma and beta is of type Int in the context Gamma, then alpha + beta is of type Int in the context Gamma."
    2. Using symbols (where ⊢ ("tee" or "turnstile") is the symbol meaning "yields" or "proves"):
    3. Examples of type rules: addition of 2 integers, if-then-else, if-then, addition of 3 integers, comparison of two variables, etc.
    4. Type inference
      1. (a ? b : c) > 0
      2. (a ? b : f(b)) > 0
      3. (a ? b : f(c)) > 0

Lecture 3: 2014-04-28 (Grp. B) & 2014-04-29 (Grp. A), 2 hours: Intermediate languages

  1. Intermediate languages. See the lecture notes (up to section 4.1 (included), except details about intermediate representations (sec. 1.1), details dynamic allocation (sec 2.1), non-local variables & static link (sec. 2.2)): intermediate.pdf, intermediate-handout.pdf and intermediate-handout-4.pdf.

Lecture 4: 2014-05-26 (Grp. B) & 2014-05-27 (Grp. A), 2 hours: Intermediate languages (cont.), Canonization

  1. Intermediate languages: details about intermediate representations (sec. 1.1), details dynamic allocation (sec 2.1), non-local variables & static link (sec. 2.2). See the lecture notes: intermediate-handout.pdf and intermediate-handout-4.pdf.
  2. Canonization. See the lecture notes (section 4.2): intermediate.pdf, intermediate-handout.pdf and intermediate-handout-4.pdf.

Lecture 5: 2014-06-06 (Grp. B & A), 2 hours: Microprocessors, Instruction Selection, Introduction to Liveness Analysis

  1. Microprocessors, Instruction Selection. See the lecture notes: instr-selection.pdf, instr-selection-handout.pdf and instr-selection-handout-4.pdf.
  2. Examples of MonoBURG input files from the Tiger Compiler (Tree to MIPS).
  3. Liveness Analysis. See the lecture notes: liveness.pdf, liveness-handout.pdf and liveness-handout-4.pdf.

Lecture 6: 2014-06-09 (Grp. B) & 2014-06-10 (Grp. A), 2 hours: Liveness Analysis, Register Allocation

  1. Liveness Analysis. See the lecture notes: liveness.pdf, liveness-handout.pdf and liveness-handout-4.pdf.
  2. Register Allocation: Coloring by Simplification, Spilling, Coalescing, Precolored Nodes, Caller- and Callee-Saved Registers, Implementation, Alternatives to Graph Coloring. See the lecture notes: regalloc.pdf, regalloc-handout.pdf and regalloc-handout-4.pdf.


TYLA

Lecture 1: 2014-02-27 (Grp. A & B), 2 hours: History of Computing

Lecture 2: 2014-03-07 (Grp. B & A), 2 hours: History of Computing and Programming Languages

  1. History of Computing: Some Early Machines (section 2). See the lecture notes, history.pdf, history-handout.pdf and history-handout-4.pdf.
  2. History of Programming Languages: The Very First Ones: FORTRAN, Algol, COBOL (Section 1). See the lecture notes, early-languages.pdf, early-languages-handout.pdf and early-languages-handout-4.pdf.

Lecture 3: 2014-03-11 (Grp. B & A), 2 hours: History of Programming Languages, Object-Oriented History

  1. History of Programming Languages: The Second Wave: APL, PL/I, BASIC, Pascal & Heirs (Section 2) and The Finale (Section 3). See the lecture notes, early-languages.pdf, early-languages-handout.pdf and early-languages-handout-4.pdf.
  2. Object-Oriented History: Simula. See the lecture notes, object.pdf, object-handout.pdf and object-handout-4.pdf.

Lecture 4: 2014-03-19 (Grp. B & A), 2 hours: Object-Oriented History: Smalltalk

  1. Object-Oriented History: Smalltalk. See the lecture notes, object.pdf, object-handout.pdf and object-handout-4.pdf.

Lecture 5: 2014-03-25 (Grp. B & A), 2 hours: Some Traits of Functional Programming Languages, Generic Programming

  1. Object-Oriented History: Smalltalk, C++. See the lecture notes, object.pdf, object-handout.pdf and object-handout-4.pdf.
  2. Generic Programming, except Template Metaprogramming (section 4.2). See the lecture notes, generic.pdf, generic-handout.pdf and generic-handout-4.pdf.
  3. Subprograms (sections 1 and 2). See the lecture notes, subprograms.pdf, subprograms-handout.pdf and subprograms-handout-4.pdf.