ABSTRACT
In a procedurally reflective programming language, all programs are executed not through the agency of a primitive and inaccessible interpreter, but rather by the explicit running of a program that represents that interpreter. In the corresponding virtual machine, therefore, there are an infinite number of levels at which programs are processed, all simultaneously active. It is therefore a substantial question to show whether, and why, a reflective language is computationally tractable. We answer this question by showing how to produce an efficient implementation of a procedurally reflective language, based on the notion of a level-shifting processor. A series of general techniques, which should be applicable to reflective variants of any standard applicative or imperative programming languages, are illustrated in a complete implementation for a particular reflective LISP dialect called 3-LISP.
- 1.Allen, J. Anatomy of LISP. New York: McGraw-Hill (1978). Google ScholarDigital Library
- 2.Henderson, P. Functional Programming, Application and Implementation. Prentice-Hall, Englewood Cliffs, N.J. (1980). Google ScholarDigital Library
- 3.McCarthy, J., et al. LISP 1.5 Programmer's Manual. Cambridge, Mass.: The MIT Press (1965). Google ScholarDigital Library
- 4.Muchnick, S., and Pleban, U. "A Semantic Comparison of LISP and SCHEME", 1980 LISP Conference, Stanford, pp. 56-64 (1980). Google ScholarDigital Library
- 5.Smith, B. Reflection and Semantics in a Procedural Language, M.I.T. Laboratory for Computer Science Report MIT-TR-272 (1982a).Google Scholar
- 6.Smith, B. "The Computational Metaphor", available from the author (1982b).Google Scholar
- 7.Smith, B. "Reflection and Semantics in Lisp", 1984 ACM POPL Conference, Salt Lake City, Utah, pp. 23-35 (January 1984a). Google ScholarDigital Library
- 8.Smith, B., and des Rivières, J. "Interim 3-LISP Reference Manual", Xerox PARC ISL Report ISL-1, Palo Alto (1984, forthcoming).Google Scholar
- 9.Stoy, J. E., Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory, Cambridge: MIT Press (1977). Google ScholarDigital Library
- 10.Sussman, G, and Steele, G. "SCHEME: An Interpreter for Extended Lambda Calculus", M.I.T. Artificial Intelligence Laboratory Memo AIM-349 (1975). Google ScholarDigital Library
- 11.Sussman, G, Holloway, J., Steele, G., and Bell, A. "SCHEME-79 - LISP on a Chip", IEEE Computer, pp. 10-21 (July 1981).Google ScholarDigital Library
- 12.Steele, G., and Sussman, G. "LAMBDA: The Ultimate Imperative", M.I.T Artificial Intelligence Laboratory Memo AIM-353 (1976a). Google ScholarDigital Library
- 13.Steele, G. "LAMBDA: The Ultimate Declarative", M.I.T. Artificial Intelligence Laboratory Memo AIM-379 (1976b). Google ScholarDigital Library
- 14.Steele, G. "RABBIT: A Compiler for SCHEME (A Study in Compiler Optimization)", M.I.T. Artificial Intelligence Laboratory Technical Report AI-TR-474 (1977a). Google ScholarDigital Library
- 15.Steele, G. "Debunking the "Expensive Procedure Call" Myth", M.I.T. Artificial Intelligence Laboratory Memo AIM-443 (1977b). Google ScholarDigital Library
- 16.Steele, G., and Sussman, G., "The Revised Report on SCHEME, A Dialect of LISP", M.I.T Artificial Intelligence Laboratory Memo AIM-452 (1978a).Google Scholar
- 17.Steele, G., and Sussman, G., "The Art of the Interpreter, or, The Modularity Complex (Parts Zero, One, and Two)", M.I.T Artificial Intelligence Laboratory Memo AIM-453 (1978b). Google ScholarDigital Library
- 18.Steele, G., and Sussman, G., "Design of a LISP-Based Microprocessor", CACM 23, 11, pp. 628-645 (November 1980). Google ScholarDigital Library
Index Terms
- The implementation of procedurally reflective languages
Recommendations
Compiling a reflective language using MetaOCaml
GPCE 2014: Proceedings of the 2014 International Conference on Generative Programming: Concepts and ExperiencesA reflective language makes the language semantics open to user programs and allows them to access, extend, and modify it from within the same language framework. Because of its high flexibility and expressiveness, it can be an ideal platform for ...
Languages as libraries
PLDI '11: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and ImplementationProgramming language design benefits from constructs for extending the syntax and semantics of a host language. While C's string-based macros empower programmers to introduce notational shorthands, the parser-level macros of Lisp encourage ...
Comments