AMP-Spring2008
From PLSwiki
Advanced Models and Programs, part 2 (SMP2), Spring 2008 (course code: SASP F2008)
This is the course page for Advanced Models and Programs.
Exam date
Thursday June 12th Friday June 13th (4A22)
Hand-in status
Practical and administrative matters
- Lectures: Monday 9 -12 (Room 2A18), Wednesday 13-15 (Room 2A18).
- Exercise labs: Wednesday 15-17 (Room 2A52).
- The course period is 16 weeks half time (15 ects). The course will consist of five blocks, covering different themes, with weekly lectures and exercises; and a substantial four-week group project within one of the themes, resulting in a project report.
- The weekly exercises must be handed in, and at least 9 of the 11 exercises must be approved to pass the course. You are allowed to work in groups to solve the exercises, but each individual student must write his/her solution up individually and hand it in by him/herself. The project must be done in groups (2-4 persons in each group) and the project report must be presented in an oral exam, where questions may be asked in all themes of the course.
Topics
(TO BE UPDATED)
- The themes of the course are:
- Dynamic object oriented languages and meta programming
- Lexing, parsing and compilation: From source code to abstract syntax to stack machine code
- Real and abstract machines
- Program generation in Scheme
- Static Analysis; in particular, Data-Flow Analysis
- ...
- ...
Plan
| Week | Date | Teacher | Topic | Materials | Assignments |
|---|---|---|---|---|---|
| 05 | Mon 28 Jan | KØ | Smalltalk Basics | Squeak by Example Chap 1-4 | Week 1 |
| 05 | Wed 30 Jan | KØ | Smalltalk Meta programming | Squeak by Example Chap 5,6,12 | |
| 06 | Mon 04 Feb | KØ | Open applications | Open Implementation Design Guidelines Towards a New Model of Abstraction in the Engineering of Software | |
| 06 | Wed 06 Feb | KØ | Exception Handling Continuations light | Fully Object Oriented Exceptions Seaside | Week 2 |
| 07 | Mon 11 Feb | KØ | Ruby | Selected sections from Programming Ruby -The Pragmatic Programmer's Guide | |
| 07 | Wed 13 Feb | KØ | Self and Beta - non-standard object models | SELF: The Power of Simplicity Virtual Classes A powerful mechanism in object-oriented programming | Week 3 |
| 08 | Mon 18 Feb | PS | Abstract syntax, interpretation and checking; lexing and parsing | Mogensen sections 2.1-2.8 and 3.1-3.6. Sestoft PLC chapters 1-3. Slides | |
| 08 | Wed 20 Feb | PS | Compilation and stack machines | Coco/R User Manual pages 1-17, 23-29. Sestoft PLC chapters 1-3 and 7.2. Slides | Week 4 |
| 09 | Mon 25 Feb | PS | Micro-C and pointers | Kernighan and Ritchie chapter 5. Sestoft PLC chapters 6-7. Slides | |
| 09 | Wed 27 Feb | PS | Bytecode, abstract machines, and real machines | Sestoft PLC chapters 10-11. Sestoft: Numeric performance in C, C# and Java. Ecma-335, partition I, section 12.3. Richter, chapter 1. Slides | Week 5 |
| 10 | Mon 03 Mar | PS | Scheme and multi-stage programs | Dybvig sections 2.1-2.7, 6.1. Sestoft PLC chapter 14 Slides | |
| 10 | Wed 05 Mar | LB | ML intro + expression evaluation | Harper Ch. 2-3-4 Slides | Week 6 |
| 11 | Mon 10 Mar | LB | ML intro + interpretation + compilation | Harper Ch. 5-6-7 Slides | |
| 11 | Wed 12 Mar | LB | ML intro: data types and higher-order functions | Harper Ch. 9-10-11 Slides | |
| 12 | Mon 17 Mar | Easter holiday | |||
| 12 | Wed 19 Mar | Easter holiday | |||
| 13 | Mon 24 Mar | Easter holiday | |||
| 13 | Wed 26 Mar | LB | ML vs OO: the expression problem | Torgersen ECOOP'04 paper | |
| 14 | Mon 31 Mar | CB | 3 hour (interactive) lecture on Introduction: Undecidability, Static Analysis, Data-Flow Analysis, and Control-Flow Graphs | Slides Lecture Notes Chapters 1, 2, and 5; i.e., pages 3-6 + 15-17. | |
| 14 | Wed 02 Apr | CB | 4 hour (interactive) lecture on "Extraterrestrial Mathematics" (Partial-Orders, Lattices, Monotone Functions, Fixed-Points, ...) and connection to Data-Flow Analysis | Slides How to solve recursive equations Lecture Notes Chapter 4; i.e., pages 11-15. | Hand-in 9A |
| 15 | Mon 07 Apr | CB | 3 hour (interactive) lecture on Data-flow Analyses in practice; we'll study examples | Slides Lecture Notes Chapter 6; pages 17-19 + 28-32. | |
| 15 | Wed 09 Apr | CB | WORKSHOP on Data-flow Analysis (no lecture); we'll be making analyses :-) | Slides Relations as least fixed points of Inference Systems Lecture Notes Chapter 6; pages 19-32. | Hand-in 10B |
| 16 | Mon 14 Apr | MS | intro see [1] for slides | ||
| 16 | Wed 16 Apr | MS | partial derivative regular expression pattern matching | ||
| 17 | Mon 21 Apr | MS | 0900-1000: Presentation of project proposals (see below). | ||
| 17 | Wed 23 Apr | MS |
In weeks 18-21, Mon 30 Apr - Wed 21 May, students work on their project. Projects must be handed in no later than Wednesday 21 May at 1500.
Literature and materials
-
For Mon 28 January - Wed 13 February:
- Main readings mentioned under the specific days above
- This is the squeak image used for the Squeak examples.
- There are the Ruby files used on Monday the 11th February.
-
For Monday 18 February to Monday 3 March (Peter Sestoft):
- Torben Mogensen: Basics of compiler design
- Coco/R lexer and parser generator, User Manual pages 1-17, 23-28
- Peter Sestoft: Programming Language Concepts, version 0.34, 2006.
- There is a large number of supporting files for the Programming Language Concepts notes.
- Expressions.ATG, lexer and parser specification for simple expressions
- Expressions.cs, interpreter, checker, compiler for simple expressions
- Machine.cs, stack machine to evaluate compiled expressions and execute compiled micro-C programs
- ex1.txt, a tiny "program" in the expression language
- A Makefile for Assignment 4 with Mono and Linux, thanks to Martin Kjeldsen.
- Kernighan & Ritchie: The C Programming Language, 1988, pages 93-110. (About pointers and pointer arithmetics). This will be handed out in paper form.
- MicroC.ATG, lexer and parser specification for micro-C
- MicroC.cs, interpreter, checker and compiler for micro-C
- test-c.zip, a bunch of micro-C test programs and an input file a.in
- Selsort.cs and Selsort.java, programs for Assignment 8
- Ecma-335 Common Language Infrastructure specification, the standardization of Microsoft CLR and Microsoft Intermediate Language, June 2006
- Jeffrey Richter: CLR via C#, Microsoft Press 2006, pages 3-22.
- Lindholm and Yellin: The Java Virtual Machine specification, Addison-Wesley 1999
- The Intel x86 machine code is described in two documents: Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 2A: Instruction Set Reference, A-M and Volume 2B: Instruction Set Reference, N-Z. Warning: This is more than 1200 pages in total.
- A more compact description of x86 instructions is found in appendix B of the manual for the open source x86 assembler "nasm"
- Assembly programs (x86, for Linux): tryadd.asm and tryfac.asm
- Peter Sestoft: Numeric performance in C, C# and Java, ITU 2007.
- The PLT Scheme/DrScheme system, available for multiple platforms. First time you use it, Select Language | Choose language | PLT Scheme | Textual. To time evaluation of expression e, evaluate (time e).
- The SCM system by Aubrey Jaffer. Neat and simple system, especially for Linux; slightly more complicated to install under Windows.
- R Kent Dybvig: The Scheme Programming Language, MIT Press 2003
-
For Wed 05 March to 26 March (Lars Birkedal):
- ML literature: Robert Harper: Programming in Standard ML (draft book)
- Mads Torgersen: The Expression Problem Revisited, in ECOOP'04.
-
For Wed March 31 to April 09 (Claus Brabrand):
- Michael I. Schwartzbach: Lecture Notes on Static Analysis, BRICS research center, Uni. Aarhus.
- Claus Brabrand: How to Solve Recursive Equations (of monotone functions over lattices), ITU, April 3, 2008.
Course project proposals
- Proposed by Peter Sestoft:
- Slides with proposal details
- Change the MicroC compiler to generate x86 code in the form of input for the NASM assembler.
- Extend the MicroC compiler to handle more of real C, such as struct types, switch, break, continue, malloc/free.
- Code duplication discovery in Microsoft Dynamics NAV application code. In collaboration with Microsoft Development Center Copenhagen.
- Write an interpreter -- in Standard ML, Scheme, Java or C# -- for a substantial subset of the Icon language, or for SETL or another "unusual" language.
- Performance engineering for a managed platform (JVM, .NET) and modern x86 cpus. Consider either numeric intensive code (matrix multiplication), or object-intensive code such as the C5 collection library. Investigate bottlenecks using profiling, and experiment with alternative implementations and target platforms.
- Write a generator of specialized serialization/deserialization methods in C# (to XML or Json).
- Proposed by Lars Birkedal:
- Study the type inference problem for Mini ML and solve associated problems by paper and pencil (proving selected properties of the type system and the algorithm by induction).
- Implement the type inference algorithm W for Mini ML.
- Proposed by Claus Brabrand:
- Make a Data-Flow Analysis and implement it such that it can analyze (and optimize) programs written in (a subset of) some familiar language (e.g., Java, C#, ...)
- Slide with proposal
- Proposed by Andrzej Wasowski:
- Proposed by Kasper Østerbye:
- Use of continuations in webservers. We briefly looked at that in the course, but here I suggest to dive in and understand it in detail. And to make an assesment of the performance characteristics of such a solution.
- Dissect a debugger. We can look at the debugging interface to Java, or dissect the Smalltalk debugger.
- Build a Java version of the Squeak "find method" (the tool in which you write an example input/output and it suggest methods that give that result).
- As always, your suggestions are better than mine.
Project rules
Actual projects for May 2008
- Paul Brønnum: Extension of MicroC compiler [PS]
- Till Blume, Tijs Slaats, Roland Schlosser: Code duplication discovery in Microsoft Dynamics NAV [PS]
- Andreas Møller Holst, Ramakrishnananda Karidas: Code duplication discovery in Microsoft Dynamics NAV [PS]
- Jon Eikholm, Jack Lee: Compiling MicroC to x86 code [PS]
- {Kevser Andersen, Jørn Schou-Rode, Jeppe Larsen, Dario Pacino}: Having fun with Data-Flow Analyses [CB]
- {Adrian Sobotta, Andreas Nørgaard, Jonas Hubert, Morten Boysen}: Also having fun with Data-Flow Analyses [CB]
- Nicolo Perra: Distributed Transactions [MS]
Examination
The official course description says:
"The project report must be presented in an oral exam, where questions may be asked in all themes of the course. A single grade is given, based on the project and the oral exam."
and
"Ekstern censur, [7-trinsskala], B4: Mundtlig eksamen med skriftlige arbejder men uden forberedelsestid ved eksamen."
We allow 15+15N minutes for examination of a group consisting of N students. In the examination, 10+7N minutes are spent presenting and discussing the project work, and 8N minutes are spent asking questions in other areas of the course. The latter questions relate to the problems posed in the 11 mandatory exercises. Due to the ridiculous new exam laws, each student will be examined individually in the 8N minutes part - where we might ask supplementary questions about the project as well.
Evaluation (Intended Learning Outcomes)
The course has two parts as detailed under course form below - a regular course followed by a project.
After the course, the students are expected to be able to:
- describe relevant concepts within the themes of the course,
- account for the practical applications of the covered constructs, and
- compare selected techniques and constructions within a single of the course themes.
On the basis of the project, the student are expected to be able to:
- apply relevant methods and techniques in the chosen project
- argue for the overall design-decisions in the project, and
- relate project and theory.
Teachers
- Kasper Østerbye (KØ)
- Peter Sestoft (PS)
- Lars Birkedal (LB)
- Claus Brabrand (CB)
- Martin Sulzmann (MS)
