We have succeeded in extending offline partial evaluation of Scheme to include reflective features, i.e., eval, apply, and call/cc. The main problem to overcome is a representation problem. We have specified a binding-time type system which solves the representation problem and outlined a specializer which reduces binding-time annotated programs. The type system is amenable to efficient type reconstruction. We have applied our specializer to realistic examples, e.g., parser generation.
Our treatment of call/cc is quite conservative, as dynamically closed code may be safely transmitted through a static continuation. Also, the ``return type'' of a continuation need not be identical for all applications of the continuation as it never returns. As the detection of dynamically closed lambdas would require a different type of static function we have not attempted to add the more liberal treatment to our system.
We have not considered uses of eval which modify the subject program or the running interpreter. This is an interesting subject of its own.
It would be interesting to investigate the combination of our system with polymorphic binding-time analysis [15] and/or binding-time coercions [12]. Coercions might also prove useful to transform between completely static and memoized functions.
A final aspect of Scheme that has not been addressed so far is the direct use of mutable variables. The indirect solution which deals with global variables as dynamic abstract data types [6] works in our framework as well, but a direct treatment has not been realized (except for the C language [1]).