Online type-directed partial evaluation for dynamically-typed languages

Eijiro Sumii, Naoki Kobayashi

研究成果: Article査読

5 被引用数 (Scopus)

抄録

This article presents an alternative method of type-directed partial evaluation, which is simpler and more efficient than previous methods. Unlike previous methods, it is straightforwardly applicable to functional languages with various powerful type systems. As an extreme instance, this article mainly deals with a dynamically-typed functional language like Scheme. The key idea is to extend primitive value destructors such as function application and pair destruction (car and cdr), so that they generate residual code when their operands are dynamic. It unnecessitates an operation in type-directed partial evaluation called reflection, which was the major cause of complication and inefficiency in previous methods. We formalize our method as an extension of two-level λ-calculus, and prove it correct. Furthermore, we show that our type-directed partial evaluator can be derived from a simple online syntax-directed partial evaluator with higher-order abstract syntax, by the same transformation as an offline program-generator-generator (cogen) is derived from an offline syntax-directed partial evaluator. This clarifies why type-directed partial evaluation is faster than ordinary syntax-directed partial evaluation, and implies that we can obtain more powerful par-tial evaluators by replacing the underlying syntax-directed partial evaluator with more sophisticated ones.

本文言語English
ページ(範囲)38-62
ページ数25
ジャーナルComputer Software
17
3
出版ステータスPublished - 2000
外部発表はい

ASJC Scopus subject areas

  • ソフトウェア

フィンガープリント

「Online type-directed partial evaluation for dynamically-typed languages」の研究トピックを掘り下げます。これらがまとまってユニークなフィンガープリントを構成します。

引用スタイル