Skip to main content

Integrating Partial Evaluators into Interpreters

  • Conference paper
  • First Online:
Semantics, Applications, and Implementation of Program Generation (SAIG 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2196))

Abstract

This paper describes our first step towards the integration of partial evaluation into standard interpretation. The two main issues in this integration are the treatment of heap objects and side-effects. To enable specialization with respect to the heap objects that are allocated beforehand in standard evaluation, specialization is performed with respect to the heap state at specialization time rather than based on a program text input so far. To avoid duplication of heap objects, direct references to heap objects are allowed in the specialized programs, in addition to the use of the conventional let-insertion technique. Despite our modest approach on side-effects that we allow partial evaluation of only side-effect free portions of a program, the resulting system covers some typical cases, such as the use of partial evaluation during an interactive debugging session. It also enables us to specialize a (side-effect free) program with respect to cyclic data structures, which was not easy before. We formalize this integration using store semantics and state its correctness. The system is implemented in Scheme and various examples are tested. Among them, we show specialization of a ray tracing program.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Andersen, P. H. “Partial Evaluation Applied to Ray Tracing,” Software Engineering in Scientific Computing, pp. 78–85, DIKU report D-289 (1996).

    Google Scholar 

  2. Asai, K. “Binding-Time Analysis for Both Static and Dynamic Expressions,” In A. Cortesi and G. Filé, editors, Static Analysis (LNCS) 1694), pp. 117–133 (September 1999).

    Chapter  Google Scholar 

  3. Asai, K., H. Masuhara, and A. Yonezawa “Partial Evaluation of Call-by-value λ-calculus with Side-effects,” ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM '97), pp. 12–21 (June 1997).

    Google Scholar 

  4. Asai, K., S. Matsuoka, and A. Yonezawa “Duplication and Partial Evaluation-For a Better Understanding of Reflective Languages-,” Lisp and Symbolic Computation, Vol. 9, Nos. 2/3, pp. 203–241, Kluwer Academic Publishers (May/June 1996).

    Article  Google Scholar 

  5. Balat, V., and O. Danvy “Strong Normalization by Type-Directed Partial Evaluation and Run-Time Code Generation,” In X. Leroy and A. Ohori editors, Types in Compilation (LNCS 1473) pp. 240–252 (March 1998).

    Chapter  Google Scholar 

  6. Bondorf, A., and O. Danvy “Automatic autoprojection of recursive equations with global variables and abstract data types,” Science of Computer Programming, Vol.16, pp. 151–195, Elsevier (1991).

    Article  MATH  Google Scholar 

  7. Consel, C. “A Tour of Schism: A Partial Evaluation System for Higher-Order Applicative Languages,” Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM‘93), pp. 145–154 (June 1993).

    Google Scholar 

  8. Consel, C., P. Jouvelot, and P. Ørbæk “Separate Polyvariant Binding Time Reconstruction,” Ecole des Mines, CRI Report A/261 (October 1994).

    Google Scholar 

  9. Consel, C., and F. Noёl “A General Approach for Run-Time Specialization and its Application to C,” Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp. 145–156 (January 1996).

    Google Scholar 

  10. Danvy, O. “Type-Directed Partial Evaluation,” Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp. 242–257 (January 1996).

    Google Scholar 

  11. Danvy, O., and A. Filinski “Abstracting Control,” Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160(June 1990).

    Google Scholar 

  12. Flanagan, C., A. Sabry, B. F. Duba, and M. Felleisen “The Essence of Compiling with Continuations,” Proceedings of the ACM SIGPLAN ‘93 Conference on Programming Language Design and Implementation (PLDI), pp. 237–247 (June 1993).

    Google Scholar 

  13. Futamura, Y. “Partial evaluation of computation process-an approach to a compiler-compiler,” Systems, Computers, Controls, Vol. 2, No. 5, pp. 45–50, (1971), reprinted as Higher-Order and Symbolic Computation, Vol. 12, No. 4, pp. 381-391, Kluwer Academic Publishers (December 1999).

    Google Scholar 

  14. Glück, R., and J. Jørgensen “An Automatic Program Generator for Multi-Level Specialization,” Lisp and Symbolic Computation, Vol. 10, No. 2, pp. 113–158, Kluwer Academic Publishers (July 1997).

    Article  Google Scholar 

  15. Guenter, B., T. B. Knoblock, E. Ruf “Specializing Shaders,” Proceedings of SIGGRAPH 95 (Computer Graphics Proceedings) pp. 343–350 (1995).

    Google Scholar 

  16. Hatcliff, J. “An Introduction to Online and Offline Partial Evaluation Using a Simple Flowchart Language,” In J. Hatcliff, T. Æ. Mogensen, and P. Thiemann editors, Partial Evaluation, Practice and Theory (LNCS 1706), pp. 20–82 (1999).

    Google Scholar 

  17. Hölzle, U., C. Chambers, and D. Ungar “Debugging Optimized Code with Dynamic Deoptimization,” Proceedings of the ACM SIGPLAN ‘92 Conference on Programming Language Design and Implementation (PLDI), pp. 32–43 (June 1992).

    Google Scholar 

  18. Hornof, L., C. Consel, and J. Noyé “Effective Specialization of Realistic Programs via Use Sensitivity,” In Van Hentenryck P., editor, Static Analysis (LNCS 1302), pp. 63–73 (1997).

    Google Scholar 

  19. Jones, N. D., C. K. Gomard, and P. Sestoft Partial Evaluation and Automatic Program Generation, New York: Prentice-Hall (1993).

    MATH  Google Scholar 

  20. Lawall, J. L., and O. Danvy “Continuation-Based Partial Evaluation,” Proceedings of the 1994 ACM Conference on Lisp and Functional Programming, pp. 227–238 (June 1994).

    Google Scholar 

  21. Lee, P., and M. Leone “Optimizing ML with run-time code generation,” Proceedings of the ACM SIGPLAN ‘96 Conference on Programming Language Design and Implementation (PLDI), pp. 137–148 (May 1996).

    Google Scholar 

  22. Mogensen, T. Æ. “The Application of Partial Evaluation to Ray-Tracing,” Master’s thesis, DIKU, University of Copenhagen (1986).

    Google Scholar 

  23. Ruf, E. Topics in Online Partial Evaluation, Ph.D. thesis, Stanford University (March 1993). Also published as Stanford Computer Systems Laboratory technical report CSL-TR-93-563.

    Google Scholar 

  24. Taha, W. Multi-Stage Programming: Its Theory and Applications, Ph.D. thesis, Oregon Graduate Institute of Science and Technology (November 1999).

    Google Scholar 

  25. Thiemann, P. J. “Cogen in Six Lines,” Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP'96), pp. 180–189 (May 1996).

    Google Scholar 

  26. Thiemann, P. J., and D. Dussart “Partial Evaluation for Higher-Order Languages with State,” Available at http://www.informatik.uni-freiburg.de/~thiemann/papers/mlpe.ps.gz.

  27. Volanschi, E. N., C. Consel, G. Muller, and C. Cowan “Declarative Specialization of Object-Oriented Program,” Proceedings of the 1997 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA ‘97), pp. 286–300, (October 1997).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Asai, K. (2001). Integrating Partial Evaluators into Interpreters. In: Taha, W. (eds) Semantics, Applications, and Implementation of Program Generation. SAIG 2001. Lecture Notes in Computer Science, vol 2196. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44806-3_8

Download citation

  • DOI: https://doi.org/10.1007/3-540-44806-3_8

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42558-8

  • Online ISBN: 978-3-540-44806-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics