Skip to main content
Log in

Duplication and partial evaluation

For a better understanding of reflective languages

  • Published:
LISP and Symbolic Computation

Abstract

This paper presents a general implementation framework for reflective languages. It allows us to systematically build reflective languages which have the following favorable properties: (1) user programs are allowed to access and change (parts of) metalevel interpreters, (2) reflective facilities are available at every level, (hence there exists conceptually an infinite tower of interpreters), and (3) the interpreter runs as efficiently as the conventional (directly implemented) metacircular interpreter when reflection is not used. Our scheme is divided into three stages. First, we define interpreters which give the operational semantics of each level, and conceptually construct the infinite tower of these interpreters. They are thenduplicated to obtain directly executed interpreters, while introducing double interpretation to maintain redefinability of interpreters. Finally, partial evaluation is employed to collapse the double interpretation into single interpretation. We illustrate our scheme by implementing a particular reflective language calledBlack in Scheme, but it is general enough to be applied to other reflective languages. The paper gives the complete Scheme implementation of Black and demonstrates some examples. We also show how a system with the delta abstraction introduced by Blond can be constructed in our framework.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abelson, H., and G. J. Sussman with J. SussmanStructure and Interpretation of Computer Programs, Cambridge: MIT Press (1985).

    Google Scholar 

  2. Danvy, O., and K. Malmkjær “Intensions and Extensions in a Reflective Tower,”Conference Record of the 1988 ACM Symposium on Lisp and Functional Programming, pp. 327–341 (July 1988).

  3. des Rivières, J. private communication, (September 1993).

  4. des Rivières, J., and B. C. Smith “The Implementation of Procedurally Reflective Languages,”Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, pp. 331–347 (August 1984).

  5. Friedman, D. P., and M. Wand “Reification: Reflection without Metaphysics,”Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, pp. 348–355 (August 1984).

  6. Ichisugi, Y., S. Matsuoka, and A. Yonezawa “RbCl: A Reflective Object-Oriented Concurrent Language without a Run-time Kernel,”Proceedings of the International Workshop on Reflection and Meta-Level Architecture, pp. 24–35 (November 1992).

  7. Jefferson, S., and D. P. Friedman “A Simple Reflective Interpreter,”Proceedings of the International Workshop on Reflection and Meta-Level Architecture, pp. 24–35 (November 1992), the extended version also appears in this volume.

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

    Google Scholar 

  9. Kiczales G. “Towards a New Model of Abstraction in Software Engineering,”Proceedings of the International Workshop on Reflection and Meta-Level Architecture, pp. 1–11 (November 1992).

  10. Rees, J., and W. ClingerRevised 3 Report on the Algorithmic Language Scheme, SIGPLAN NOTICE, Vol. 21, No. 12, (December 1986).

  11. Simmons II, J. W., S. Jefferson, and D. P. Friedman “Language Extension Via First-class Interpreters,” Indiana University Technical Report No. 362, (September 1992).

  12. Smith, B. C. “Reflection and Semantics in Lisp,”Conference Record of the 14th Annual ACM Symposium on Principles of Programming Languages, pp. 23–35 (January 1984).

  13. Wand, M., and D. P. Friedman “The Mystery of the Tower Revealed: A Non-Reflective Description of the Reflective Tower,”Conference Record of the 1986 ACM Symposium on Lisp and Functional Programming, pp. 298–307 (August 1986).

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Asai, K., Matsuoka, S. & Yonezawa, A. Duplication and partial evaluation. Lisp and Symbolic Computation 9, 203–241 (1996). https://doi.org/10.1007/BF01806113

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01806113

Keywords

Navigation