Advertisement

Dynamic Partial Evaluation

  • Gregory T. Sullivan
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2053)

Abstract

Dynamic partial evaluation performs partial evaluation as a side effect of evaluation, with no previous static analysis required. A completely dynamic version of partial evaluation is not merely of theoretical interest, but has practical applications, especially when applied to dynamic, reflective programming languages. Computational reflection, and in particular the use of meta-object protocols (MOPs), provides a powerful abstraction mechanism, providing programmatic “hooks” into the interpreter semantics of the host programming language. Unfortunately, a runtime MOP defeats many optimizations based on static analysis (for example, the applicable methods at a call site may change over time, even for the same types of arguments). Dynamic partial evaluation allows us to apply partial evaluation techniques even in the context of a meta-object protocol. We have implemented dynamic partial evaluation as part of a Dynamic Virtual Machine intended to host dynamic, reflective object-oriented languages. In this paper, we present an implementation of dynamic partial evaluation for a simple language — a lambda calculus extended with dynamic typing, subtyping, generic functions and multiple dispatch.

Keywords

Static Type Specialized Version Partial Evaluation Variable Reference Applicable Method 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [BN00]
    Mathias Braux and Jacques Noyé. Towards partially evaluating reflection in java. In Proceedings of the 2000 ACM SIGPLAN Workshop on Evaluation and Semantics-Based Program Manipulation (PEPM-00), pages 2–11, N.Y., January 22–23 2000. ACM Press.Google Scholar
  2. [CC99]
    Craig Chambers and Weimin Chen. Efficient multiple and predicate dispatching. In Loren Meissner, editor, Proceeings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages & Applications (OOPSLA’99), volume 34.10 of ACM Sigplan Notices, pages 238–255, N.Y., November 1–5 1999. ACM Press.CrossRefGoogle Scholar
  3. [Cha92]
    Craig Chambers. The Design and Implementation of the Self Compiler, an Optimizing Compiler for Object-Oriented Programming Languages. Ph D thesis, Computer Science Department, Stanford University, March 1992.Google Scholar
  4. [CN96]
    Charles Consel and François Noël. A general approach for run-time specialization and its application to C. In ACM, editor, Conference record of POPL’ 96, 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages: papers presented at the Symposium: St. Petersburg Beach, Florida, 21–24 January 1996, pages 145–156, New York, NY, USA, 1996. ACM Press.Google Scholar
  5. [DCG95]
    Jeffrey Dean, Craig Chambers, and David Grove. Selective specialization for object-oriented languages. In Proceedings of the ACM SIGPLAN’95 Conference on Programming Language Design and Implementation (PLDI), pages 93–102, La Jolla, California, 18–21 June 1995. SIGPLAN Notices 30(6), June 1995.Google Scholar
  6. [EKC98]
    Michael Ernst, Craig Kaplan, and Craig Chambers. Predicate dispatching: A unified theory of dispatch. In Eric Jul, editor, ECOOP’ 98—Object-Oriented Programming, volume 1445 of Lecture Notes in Computer Science, pages 186–211. Springer, 1998.CrossRefGoogle Scholar
  7. [GJSB00]
    James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification Second Edition. The Java Series. Addison-Wesley, Boston, Mass., 2000.Google Scholar
  8. [JGS93]
    Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International, International Series in Computer Science, June 1993. ISBN number 0-13-020249-5 (pbk).Google Scholar
  9. [KdB91]
    G. Kiczales, J. des Rivières, and D.G. Bobrow. The Art of the Meta-Object Protocol. MIT Press, Cambridge (MA), USA, 1991.Google Scholar
  10. [Mae87]
    Pattie Maes. Concepts and experiments in computational reflection. In Norman Meyrowitz, editor, Proceedings of the 2nd Annual Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA’ 87), pages 147–155, Orlando, FL, USA, October 1987. ACM Press.CrossRefGoogle Scholar
  11. [MMAY95]
    Hidehiko Masuhara, Satoshi Matsuoka, Kenichi Asai, and Akinori Yonezawa. Compiling away the meta-level in object-oriented concurrent reflective languages using partial evaluation. In OOPSLA’ 95 Conference Proceedings: Object-Oriented Programming Systems, Languages, and Applications, pages 300–315. ACM Press, 1995.Google Scholar
  12. [MY98]
    Hidehiko Masuhara and Akinori Yonezawa. Design and partial evaluation of meta-objects for a concurrent reflective language. In Eric Jul, editor, ECOOP’ 98—Object-Oriented Programming, volume 1445 of Lecture Notes in Computer Science, pages 418–439. Springer, 1998.CrossRefGoogle Scholar
  13. [PAB+95]_Calton Pu, Tito Autrey, Andrew Black, Charles Consel, Crispin Cowan, Jon Inouye, Lakshmi Kethana, Jonathan Walpole, and Ke Zhang. Optimistic incremental specialization: Streamlining a commercial operating system. In Proc. 15th ACM Symposium on Operating Systems Principles, Copper Mountain CO (USA), December 1995. http://www.irisa.fr/EXTERNE/projet/lande/consel/papers/spec-sosp.ps.gz.
  14. [PMI88]
    Calton Pu, Henry Massalin, and John Ioannidis. The synthesis kernel. In USENIX Association, editor, Computing Systems, Winter, 1988., volume 1, pages 11–32, Berkeley, CA, USA, Winter 1988. USENIX.Google Scholar
  15. [Ruf93]
    Erik Ruf. Topics in online partial evaluation. PhD thesis, Stanford Computer Systems Laboratory, March 1993.Google Scholar
  16. [SLCM99]
    U.P. Schultz, J. L. Lawall, C. Consel, and G. Muller. Towards automatic specialization of Java programs. Lecture Notes in Computer Science, 1628:367–--, 1999.Google Scholar
  17. [VCC97]
    Eugen N. Volanschi, Charles Consel, and Crispin Cowan. Declarative specialization of object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA-97), volume 32, 10 of ACM SIGPLAN Notices, pages 286–300, New York, October 5–9 1997. ACM Press.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Gregory T. Sullivan
    • 1
  1. 1.Artificial Intelligence LaboratoryMassachusetts Institute of TechnologyUSA

Personalised recommendations