Dynamic Partial Evaluation
- 179 Downloads
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.
KeywordsStatic Type Specialized Version Partial Evaluation Variable Reference Applicable Method
Unable to display preview. Download preview PDF.
- [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
- [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
- [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
- [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
- [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
- [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
- [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
- [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
- [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
- [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.
- [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
- [Ruf93]Erik Ruf. Topics in online partial evaluation. PhD thesis, Stanford Computer Systems Laboratory, March 1993.Google Scholar
- [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
- [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