ABSTRACT
Code executed in a fully reflective system switches back and forth between application and interpreter code. These two states can be seen as contexts in which an expression is evaluated. Current language implementations obtain reflective capabilities by exposing objects to the interpreter. However, in doing so these systems break the encapsulation of the application objects. In this paper we propose safe reflection through polymorphism, i.e. by unifying the interface and ensuring the encapsulation of objects from both the interpreter and application context. We demonstrate a homogeneous system that defines the execution semantics in terms of itself, thus enforcing that encapsulation is not broken.
- N. Adams and J. Rees. Object-oriented programming in scheme. In Conference Record of the 1988 ACM Conference on Lisp and Functional Programming, pages 277--288, Aug. 1988. Google ScholarDigital Library
- K. Auer. Reusability through self-encapsulation. In Pattern languages of program design, pages 505--516. ACM Press/Addison-Wesley Publishing Co., 1995. Google Scholar
- G. Bracha and D. Ungar. Mirrors: design principles for meta-level facilities of object-oriented programming languages. In Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'04), ACM SIGPLAN Notices, pages 331--344, New York, NY, USA, 2004. ACM Press. Google ScholarDigital Library
- K. Gybels, R. Wuyts, S. Ducasse, and M. D'Hondt. Inter-language reection - a conceptual model and its implementation. Journal of Computer Languages, Systems and Structures, 32(2-3):109--124, July 2006. Google ScholarDigital Library
- D. Ingalls, T. Kaehler, J. Maloney, S. Wallace, and A. Kay. Back to the future: The story of Squeak, a practical Smalltalk written in itself. In Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA'97), pages 318--326. ACM Press, Nov. 1997. Google ScholarDigital Library
- D. H. Lorenz and J. Vlissides. Pluggable reection: decoupling meta-interface and implementation. In ICSE '03: Proceedings of the 25th International Conference on Software Engineering, pages 3--13, Washington, DC, USA, 2003. IEEE Computer Society. Google ScholarDigital Library
- P. Maes. Concepts and experiments in computational reection. In Proceedings OOPSLA '87, ACM SIGPLAN Notices, volume 22, pages 147--155, Dec. 1987. Google ScholarDigital Library
- I. Piumarta and A. Warth. Open reusable object models. Technical report, Viewpoints Research Institute, 2006. VPRI Research Note RN-2006-003-a.Google Scholar
- A. Rigo and S. Pedroni. PyPy's approach to virtual machine construction. In Proceedings of the 2006 conference on Dynamic languages symposium, OOPSLA '06: Companion to the 21st ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pages 944--953, New York, NY, USA, 2006. ACM. Google ScholarDigital Library
- N. Schärli, A. P. Black, and S. Ducasse. Object-oriented encapsulation for dynamically typed languages. In Proceedings of 18th International Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA'04), pages 130--149, Oct. 2004. Google ScholarDigital Library
Index Terms
- Safe reflection through polymorphism
Recommendations
Zero-overhead metaprogramming: reflection and metaobject protocols fast and without compromises
PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and ImplementationRuntime metaprogramming enables many useful applications and is often a convenient solution to solve problems in a generic way, which makes it widely used in frameworks, middleware, and domain-specific languages. However, powerful metaobject protocols ...
Mirror-based reflection in AmbientTalk
This paper introduces a novel mechanism to perform intercession (a form of reflection) in an object-oriented programming language with the goal of making the language extensible from within itself. The proposed mechanism builds upon a mirror-based ...
Zero-overhead metaprogramming: reflection and metaobject protocols fast and without compromises
PLDI '15Runtime metaprogramming enables many useful applications and is often a convenient solution to solve problems in a generic way, which makes it widely used in frameworks, middleware, and domain-specific languages. However, powerful metaobject protocols ...
Comments