Affiliation:
1. Oregon Graduate Institute of Science & Technology, P.O. Box 91000, Portland, OR
Abstract
Recently, Olivier Danvy introduced a new, simple method for implementing powerful partial evaluators, namely type-directed partial evaluation[9]. He introduced a partial evaluator for the simply-typed lambda calculus (§2). This paper explores the possibility of using the same techniques over a lambda calculus with a richer type system. We generalize and extend Danvy's work in four ways:1. Our system handles a much richer language than that presented by Danvy, including all of the features functional programmers have come to expect, such as polymorphism (§5), inductive datatypes (§10), and recursion (§9).2. Our system includes a new systematic treatment of primitive operators (§7) and the propagation of residualized code (§7.1). This question has either been ignored or treated in an ad-hoc manner in previous work.3. Our system handles non-closed terms (§6). This makes type-directed partial evaluation much more practically useful, and can easily be extended to work in languages with parameterized module systems.4. Our system makes the whole process more efficient, by using a lazy, on-demand implementation (§8). The laziness of our implementation also causes the code produced to be more abstract and compact. Using this lazy implementation we have observed speedup ratios in the range 2--10, and code compactness improvements of more than 10 in some cases.All these extensions are made possible by a key technical innovation, namely,
embedding types in values
.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献