Pragmatics of type-directed partial evaluation [chapter]

Olivier Danvy
1996 Lecture Notes in Computer Science  
Type-directed partial evaluation stems from the residualization of arbitrary static values in dynamic contexts, given their type. Its algorithm coincides with t he o n e for coercing a s u btype value into a supertype value, which itself coincides with t he o n e of normalization in the -calculus. Type-directed partial evaluation is thus used to specialize compiled, closed programs, given their type. Since Similix, let-insertion is a cornerstone of partial evaluators for callby-value procedural
more » ... programs with computational e ects. It prevents the duplication of residual computations, and more generally maintains the order of dynamic side e ects in residual programs. This article describes the extension of type-directed partial evaluation to insert residual let expressions. This extension requires the u s e r t o annotate a r r o w t ypes with e ect information. It is achieved by d elimiting and abstracting c o n trol, comparably to c o n tinuation-based specialization in direct style. It enables type-directed partial evaluation of e ectful programs (e.g., a d e nitional lambda-interpreter for an imperative l a n guage) that are in direct style. The residual programs are in A-normal form.
doi:10.1007/3-540-61580-6_5 fatcat:i2jkkbsli5bhvab6b73w67n6am