Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

The second Futamura projection for type-directed partial evaluation

Published: 01 November 1999 Publication History

Abstract

The second Futamura projection describes the automatic generation of non-trivial generating extensions by applying a partial evaluator to itself. We derive an ML implementation of the second Futamura projection for Type-Directed Partial Evaluation (TDPE). Due to the differences between `traditional', syntax-directed partial evaluation and TDPE, this derivation involves several conceptual and technical steps. These include a suitable formulation of the second Futamura projection and techniques for using TDPE to specialize type-indexed programs. In the context of the second Futamura projection, we also compare and relate TDPE with conventional offline partial evaluation.
We demonstrate our technique with several examples, including compiler generation for Tiny, a prototypical imperative language.

References

[1]
O. Danvy. Type-directed partial evaluation. In Proceedings of POPL '96, pages 242-257. ACM Press, 1996.]]
[2]
O. Danvy. Pragmatic aspects of type-directed partial evaluation. In Partial Evaluation, Proceedings, volume 1110 of LNCS, pages 73-94. Springer-Verlag, 1996.]]
[3]
O. Danvy. A simple solution to type specialization. In K. G. Larsen, S. Skyum, and G. Winskel, editors, Proceedings of ICALP '98, number 1443 in LNCS, pages 908-917, 1998.]]
[4]
O. Danvy. Type-directed partial evaluation. In Partial Evaluation - Practice and Theory; Proceedings of the 1998 DIKU Summer School, number 1706 in LNCS, pages 367-411. Springer-Verlag, 1998.]]
[5]
O. Danvy and M. Rhiger. Compiling actions by partial evaluation, revisited. Technical Report BRICS-RS-98-13, BRICS, Department of Computer Science, University of Aarhus, 1998.]]
[6]
O. Danvy and R. Vestergaard. Semantics-based compiling: A case study in type-directed partial evaluation. In Proceedings of PLILP '9~, number 1140 in LNCS, pages 182-197. Springer-Verlag, 1996.]]
[7]
A. Filinski. Representing monads. In Proceedings of POPL '9~, pages 446-457. ACM Press, 1994.]]
[8]
A. Filinski. A semantic account of type-directed partial evaluation. In Proceedings of PPDP '99, number 1702 in LNCS, pages 378-395. Springer-VerIag, 1999.]]
[9]
Y. Futamura. Partial evaluation of computation process- an approach to a compiler-compiler. Higher-Order and Symbolic Computation, 12(4), 1999. Reprinted from Systems - Computers. Controls 2(5), 1971.]]
[10]
B. Grobauer and Z. Yang. The second Futamura projection for type-directed partial evaluation. Research Series RS-99- 40, BRICS, Department of Computer Science, University of Aaxhus, 1999.]]
[11]
C. K. Holst and J. Launchbury. Handwriting cogen to avoid problems with s~atic typing. In Draft Proceedings, ~th Annual Glasgow Workshop on Functional Programming, pages 210-218. Glasgow University, 1991.]]
[12]
N. D. Jones. Challenging problems in partial evaluation and mixed computation. In D. Bj0rner, A. P. Ershov, and N. D. Jones, editors, Partial Evaluation and Mixed Computation, pages 1-14. North-Holland, 1988.]]
[13]
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hail International, 1993.]]
[14]
N. D. Jones, P. Sestoft, and H. S0ndergaard. MIX: A selfapplicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation, 2(1):9-50~ 1989.]]
[15]
L. C. Paulson. Compiler generation from denotational semantics. In B. Lorho, editor, Methods and Tools for Compiler Construction, pages 219-250. Cambridge University Press, 1984.]]
[16]
M. Rhiger. Deriving a statically typed type-directed partial evaluator. In O. Danvy, editor, Proceedings of PEPM '99, Technical report BRICS-NS-99-1, BRICS, Department of Computer Science, University of Aarhus, pages 25-29, 1999.]]
[17]
M. Rhiger. Run-time code generation for type-directed partial evaluation. Progress report, BRICS PhD School, University of Aarhus. Available at http://www .brits. dk/-mrhiger, Dec. 1999.]]
[18]
Z. Yang. Encoding types in ML-like languages, in Proceed-]]

Cited By

View all
  • (2019)Encoding types in ML-like languagesTheoretical Computer Science10.1016/j.tcs.2003.11.017315:1(151-190)Online publication date: 4-Jan-2019
  • (2001)Normalization by evaluation for the computational lambda-calculusProceedings of the 5th international conference on Typed lambda calculi and applications10.5555/1754621.1754638(151-165)Online publication date: 2-May-2001

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 34, Issue 11
Nov. 1999
113 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/328691
Issue’s Table of Contents
  • cover image ACM Conferences
    PEPM '00: Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
    January 2000
    113 pages
    ISBN:1581132018
    DOI:10.1145/328690
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 November 1999
Published in SIGPLAN Volume 34, Issue 11

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)31
  • Downloads (Last 6 weeks)8
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Encoding types in ML-like languagesTheoretical Computer Science10.1016/j.tcs.2003.11.017315:1(151-190)Online publication date: 4-Jan-2019
  • (2001)Normalization by evaluation for the computational lambda-calculusProceedings of the 5th international conference on Typed lambda calculi and applications10.5555/1754621.1754638(151-165)Online publication date: 2-May-2001

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media