One person's program is another program's data.
– Olivier Danvy
Tiark Rompf, Fall 2014, 3 credits
Meetings are Monday, 12:30pm to 1:20pm LWSN 3162, and Wednesday, 10:30am to 12:10pm LWSN 3162.
Check back here regularly for updates (pro tip: watch the source repository on GitHub to be notified of any changes)
Metaprogramming is the art of writing computer programs that write or manipulate other programs (or possibly themselves) as data. Common examples include interpreters, compilers, program analyzers, program generators and program transformers.
Why is metaprogramming useful? Just as programming is about automating tedious or repetitive tasks, metaprogramming is about automating tedious or repetitive programming tasks. A key use is making high-level programs run fast, by automating otherwise tedious program optimizations - either through an optimizing compiler or by making the program itself generate efficient low-level code.
In this course, we will look at common uses of metaprogramming, study metaprogramming patterns, and do some practical metaprogramming in Scala.
The course will be research oriented: there will be no lectures. Instead, we will read and discuss original research papers. There will be some older papers for context and some brand new ones from the forefront of metaprogramming research.
The course will be hands-on: programming is fun, so why just read and talk about it? We will have small weekly programming assignments during the first half of the course, and participants will pick a course project for the second half.
Every week we will have 1 or 2 papers on a common topic and a small related programming assignment. All participants read the papers, write a short (0.5 page) summary, and solve the programming assignment. Then we meet and discuss the papers and the solutions to the assignment.By mid-term, you will propose a course project, which is ideally related to your other research interests. For example, if you’re into image processing, a cool project would be a program generator for image processing kernels. Projects can be done in groups of two, and include a final presentation and a short report (+/- 4 pages). Grading will be 25% participation in class, 25% paper summaries, 25% programming assignments, 25% course project. Prerequisites: curiosity! Some experience with programming languages, interpreters, compilers etc is a plus.
Interpreters and meta-circularity
From interpreters to compilers
Metaobject protocols and exotypes
Self-modifying interpreters and meta-tracing
Program generators for performance
Probabilistic and logic programming
Semantics, Interpreters, Compilers, Abstract interpretation, Program analysis, Partial evaluation, Supercompilation, Generative programming, Embedded languages, Macros, Reflection