Partial Evaluation for C

Build a partial evaluator for C programs - ie a compiler (or preprocessor) which using partial knowledge of the input to produce a more efficient program for repeated use with varying instances of the remaining input.

Partial evaluation is the idea of a compiler which takes a program together with some of its inputs, and produces an optimised program ready to be applied to the remaining inputs.

In the interpreter case, you avoid parsing, building the abstract syntax tree and repeating testing AST nodes (or bytecodes).

We would have to discuss how to go about this project. One option would be to take an existing C compiler as a starting point (e.g. GNU gcc). Another would be to build a small and simple stand-alone prototype, perhaps in a very high level language such as SML.

Equipment: Unix.

Recommended tools: C, gcc.

Suitability: This is a research-level project with enormous potential scope. The basic prerequisites are 1) insight into the theoretical background, 2) the practical ability to get complicated software to do what you want, and the imagination and clarity of thought to design a simple and effective scheme.