Resource-Bounded Partial Evaluation OLIVIER DANVY Computer Science Department, Aarhus University, Aarhus C, Denmark danvy@brics.dk NEVIN HENTZE AT&T Bell Laboratories, Murray Hill, NJ nch@research.att.com KAROLINE MALMKJÃR Computer Science Department, Aarhus University, Aarhus C, Denmark karoline@daimi.aau.dk PARTIAL EVALUATION Due in large part to Neil Jones s Mix project [Jones et al. 1989], the last ten years have seen a renaissance of partial evaluation.1 A partial evaluator is a tool for specializing programs and performing statically known computations. In so doing, it reduces instruction counts and this typically yields faster sometimes substantially faster programs. (In extreme cases, however, adverse cache effects can outweigh instructioncount gains.) Partial evaluation directly addresses the modularity-performance conflict: we can write generic maintainable procedures and use partial evaluation to regain the performance of dedicated code. Partial evaluation can also remove interpretive overheads associated with data structures. For example, consider an I/O formatting procedure such as fprintf in C, which usually is called with a constant control string. By partially evaluating fprintf with respect to this constant, we can remove the over- head of interpreting the string at run time. The costs of partial evaluation are twofold: program size often increases, particularly if many specialized program fragments are
/lp/association-for-computing-machinery/resource-bounded-partial-evaluation-Aw8H0icPxH