Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PE
[go: Go Back, main page]

 
  DAIMI

PEIOOL

Partial Evaluation for Imperative and Object-Oriented Languages

This is the web page for the 2nd-part course Partial Evaluation for Imperative and Object-Oriented Languages [PEIOOL] taught here at DAIMI during the 4th quarter (spring 2004).

  Course description

This course gives an introduction to the program specialization technique of partial evaluation and its application to imperative and object-oriented languages (C and Java). We will cover the enabling principles and provide an insight into the advanced program analysis techniques needed to specialize realistic programs. Interactive sessions and a practical project will provide hands-on experience.

Partial evaluation is a program transformation technique that specializes programs to their usage context. Partial evaluation can be seen as a highly aggressive form of optimization that transforms the program according to invariants provided by the programmer. During the course we will investigate its applications within domains such as automatic compiler generation, image processing, operating systems, and scientific computations.

  Examination
  Course plan
using
Date Content Litterature Assignment
31/3 Generative programming:
  • programs that generate programs
  • macros (CPP and M4) and (quasi)quotation
  • printf
  • template metaprogramming in C++
  • examples: power (with exponent and operator) and image convolution filters
  • Slides (with random pieces of code)
(none)
6/4 Lectures cancelled: vacation
13/4 Basics of PE for imperative languages:
  • RECAP: generative programming using printf
  • two-color (two-level) programming
  • partial evaluation: basic idea
  • specialization of C-like code
  • binding-time analysis of C-like code
  • overview of Tempo
  • hands-on experience: Stibitz building
Skim Chapter 10 of Generative Programming: Methods, Tools and Applications. Krzysztof Czarnecki and Ulrich W. Eisenecker, Addison-Wesley 2000. [HANDOUT]
Read Tutorial Notes on Partial Evaluation. Charles Consel and Olivier Danvy. Proceedings of POPL93, the 1993 ACM Symposium on Principles of Programming Languages, pp. 493-501.
Read appropriate parts of the M4 manual: C-h i m M4 RET in Emacs
Exercise 1: power and convolution filter using generative programming techniques
20/4 Advanced topics in PE for imperative languages:
  • Partial evaluation for C: BTA and specialization
  • Systematic walkthrough: basic blocks, conditionals, loop, and methods
  • Pointers galore: pointer operators, alias analysis, static-and-dynamic binding times
  • Understanding the BTA: static vs. dynamic flow of control, specialization points
Read Chapter 11 of Partial Evaluation and Automatic Program Generation, without worrying about 11.6 and 11.7.
A Uniform Approach for Compile-Time and Run-Time Specialization
tempo/examples/README.txt: Learn to use Tempo. Email me whether you could get through (1)-(4) and the source code of exercise (5), with timings (is it faster?).
28/4 Lectures were cancelled :( Static and Dynamic Program Compilation by Interpreter Specialization
Accurate Binding-Time Analysis for Imperative Languages: Flow, Context, and Return Sensitivity
(Some papers contain various formalizations, and not all of you have the background for understanding those parts, so feel free to skip them; an informal understanding is sufficient.)
Specialize the convolution example from exercise 1, using Tempo.
Measure the speedup, comparing to your generative programming version if you have one.
Include the specialized program in the answer.
5/5More BTA and specialization:
  • BTA and specialization of functions
  • "All the other statements"
  • Advanced issues in BTA: various kinds of sensitivity
  • Working with structures in Tempo
  • Precision of the alias analysis
Effective Specialization of Realistic Programs via Use Sensitivity
Optional reading (will not be covered in class): Towards Bridging the Gap Between Programming Languages and Partial Evaluation
Exercise 4: bytecode interpreter specialization
12/5 Basics of PE for object-oriented languages:
  • Conceptual issues
  • Specializing operations on objects
  • Specializing complete programs
  • JSpec: using Tempo for specializing Java programs
Partial Evaluation for Class-Based Object-Oriented Languages
Automatic Program Specialization for Java
Exercise 5: structured interpreter specialization and power using function pointers
19/5 More about PE for object-oriented languages
  • Overview of PE for OO languages
  • Advanced specialization: the visitor pattern
  • Specializing Java programs
  • Declarative specialization
  • Exercises (?)
  • BEER!
Declarative Specialization for Object-Oriented-Program Specialization
Supporting objects in run-time bytecode specialization
Exercise 6: specializing object-oriented programs using Tempo

  Practicalities