Abstract
To support development tools like debuggers, runtime systems need to provide a meta-programming interface to alter their semantics and access internal data. Reflective capabilities are typically fixed by the Virtual Machine (VM). Unanticipated reflective features must either be simulated by complex program transformations, or they require the development of a specially tailored VM. We propose a novel approach to behavioral reflection that eliminates the barrier between applications and the VM by manipulating an explicit tower of first-class interpreters. Pinocchio is a proof-of-concept implementation of our approach which enables radical changes to the interpretation of programs by explicitly instantiating subclasses of the base interpreter. We illustrate the design of Pinocchio through non-trivial examples that extend runtime semantics to support debugging, parallel debugging, and back-in-time object-flow debugging. Although performance is not yet addressed, we also discuss numerous opportunities for optimization, which we believe will lead to a practical approach to behavioral reflection.
- }}H. Abelson, G. J. Sussman, and J. Sussman. Structure and interpretation of computer programs. MIT electrical engineering and computer science series. McGraw-Hill, 1991. ISBN 0-262-01077-1. Google Scholar
Digital Library
- }}A. Adya, J. Howell, M. Theimer, W. J. Bolosky, and J. R. Douceur. Cooperative task management without manual stack management. In ATEC '02: Proceedings of the General Track of the annual conference on USENIX Annual Technical Conference, pages 289--302, Berkeley, CA, USA, 2002. USENIX Association. ISBN 1-880446-00-6. Google Scholar
Digital Library
- }}A. Black, S. Ducasse, O. Nierstrasz, D. Pollet, D. Cassou, and M. Denker. Pharo by Example. Square Bracket Associates, 2009. ISBN 978-3-9523341-4-0.Google Scholar
- }}C. F. Bolz and A. Rigo. How to not write virtual machines for dynamic languages. In 3rd Workshop on Dynamic Languages and Applications, 2007.Google Scholar
- }}C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: Pypy's tracing jit compiler. In ICOOOLPS '09: Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Lan- guages and Programming Systems, pages 18--25, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-541-doi: 10.1145/1565824.1565827. Google Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}J. Brant, B. Foote, R. Johnson, and D. Roberts. Wrappers to the rescue. In Proceedings European Conference on Object Oriented Programming (ECOOP'98), volume 1445 of LNCS, pages 396--417. Springer-Verlag, 1998. Google Scholar
Digital Library
- }}S. Chiba, G. Kiczales, and J. Lamping. Avoiding confusion in metacircularity: The meta-helix. In K. Futatsugi and S. Mat- suoka, editors, Proceedings of ISOTAS '96, volume 1049 of Lecture Notes in Computer Science, pages 157--172. Springer, 1996. ISBN 3-540-60954-7. Google Scholar
Digital Library
- }}C. T. H. Daniel P. Friedman and E. Kohlbecker. Programming with continuations. Technical Report 151, Indiana University, Nov. 1984.Google Scholar
Cross Ref
- }}M. Denker. Sub-method Structural and Behavioral Reflection. PhD thesis, University of Bern, May 2008.Google Scholar
- }}M. Denker, S. Ducasse, A. Lienhard, and P. Marschall. Sub- method reflection. In Journal of Object Technology, Special Issue. Proceedings of TOOLS Europe 2007, volume 6/9, pages 231--251. ETH, Oct. 2007.Google Scholar
- }}M. Denker, M. Suen, and S. Ducasse. The meta in meta-object architectures.In Proceedings of TOOLS EUROPE 2008, volume 11 of LNBIP, pages 218--237. Springer-Verlag, 2008. doi: 10.1007/978-3-540-69824-1 13.Google Scholar
- }}T. D'Hondt. Are bytecodes an atavism?In Self-Sustaining Systems: First Workshop, S3 2008 Potsdam, Germany, May 15--16, 2008 Revised Selected Papers, pages 140--155. Springer-Verlag, Berlin, Heidelberg, 2008. ISBN 978-3-540-89274-8. doi: 10.1007/978-3-540-89275-5 8. Google Scholar
Digital Library
- }}R. Douence and M. Südholt. A generic reification technique for object-oriented reflective languages. Higher Order Symbol. Comput., 14(1):7--34, 2001. ISSN 1388-3690. doi: 10.1023/A:1011549115358. Google Scholar
Digital Library
- }}S. Ducasse. Evaluating message passing control techniques in Smalltalk. Journal of Object-Oriented Programming (JOOP), 12(6):39--44, June 1999.Google Scholar
- }}B. Ford. Parsing expression grammars: a recognition-based syntactic foundation. In POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 111--122, New York, NY, USA, 2004. ACM. ISBN 1-58113-729-X. doi: 10.1145/964001. 964011. Google Scholar
Digital Library
- }}A. Goldberg and D. Robson. Smalltalk 80: the Language and its Implementation. Addison Wesley, Reading, Mass., May 1983. ISBN 0-201-13688-0. Google Scholar
Digital Library
- }}K. Gybels, R. Wuyts, S. Ducasse, and M. D'Hondt. Inter-language reflection -- a conceptual model and its implementation. Journal of Computer Languages, Systems and Struc- tures, 32(2-3):109--124, July 2006. doi: 10.1016/j.cl.2005.10.003. Google Scholar
Digital Library
- }}T. Harris and K. Fraser. Language support for lightweight transactions. In Object-Oriented Programming, Systems, Languages, and Applications, pages 388--402. ACM Press, New York, NY, USA, Oct. 2003. doi: 10.1145/949305.949340. Google Scholar
Digital Library
- }}C. T. Haynes, D. P. Friedman, and M. Wand. Continuations and coroutines. In LFP '84: Proceedings of the 1984 ACM Symposium on LISP and functional programming, pages 293--298, New York, NY, USA, 1984. ACM. ISBN 0-89791-142-3. doi: 10.1145/800055.802046. Google Scholar
Digital Library
- }}U. Hölzle, C. Chambers, and D. Ungar.Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In P. America, editor, Proceedings ECOOP '91, volume 512 of LNCS, pages 21--38, Geneva, Switzerland, July 1991. Springer-Verlag. Google Scholar
Digital Library
- }}M. H. Ibrahim. Reflection and metalevel architectures in object-oriented programming (workshop session). In OOP- SLA/ECOOP '90: Proceedings of the European conferenc. Google Scholar
Digital Library
- }}on Object-oriented programming addendum: systems, languages, and applications, pages 73--80, New York, NY, USA, 1991. ACM Press. ISBN 0-89791-443-0.Google Scholar
- }}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. doi: 10.1145/263700.263754. Google Scholar
Digital Library
- }}G. Kiczales. Beyond the black box: Open implementation. IEEE Software, Jan. 1996. Google Scholar
Digital Library
- }}G. Kiczales, J. des Rivières, and D. G. Bobrow. The Art of the Metaobject Protocol. MIT Press, 1991. ISBN 0-262-11158-6. Google Scholar
Digital Library
- }}G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In Proceedings ECOOP 2001, number 2072 in LNCS, pages 327--353. Springer Verlag, 2001. Google Scholar
Digital Library
- }}A. Lienhard. Dynamic Object Flow Analysis. Phd thesis, University of Bern, Dec. 2008.Google Scholar
- }}A. Lienhard, T. Giîrba, and O. Nierstrasz. Practical object- oriented back-in-time debugging. In Proceedings of the 22nd European Conference on Object-Oriented Programming (ECOOP'08), volume 5142 of LNCS, pages 592--615. Springer, 200ISBN 978-3-540-70591-doi: 10.1007/ 978-3-540-70592-5 25. ECOOP distinguished paper award. Google Scholar
Digital Library
- }}P. Maes. Concepts and experiments in computational reflection. In Proceedings OOPSLA '87, ACM SIGPLAN Notices, volume 22, pages 147--155, Dec. 1987. Google Scholar
Digital Library
- }}J. Malenfant, M. Jacques, and F.-N. Demers. A tutorial on behavioral reflection and its implementation. In Proceedings of Reflection, pages 1--20, 1996.Google Scholar
- }}J. McAffer. A Meta-level Architecture for Prototyping Object Systems. Ph.D. thesis, University of Tokyo, Sept. 1995.Google Scholar
- }}J. McAffer. Engineering the meta level. In G. Kiczales, editor, Proceedings of the 1st International Conference on Metalevel Architectures and Reflection (Reflection 96), San Francisco, USA, Apr. 1996.Google Scholar
- }}L. Renggli, T. Gîrba, and O. Nierstrasz. Embedding languages without breaking tools. In T. D'Hondt, editor, ECOOP 2010: Proceedings of the 24th European Conference on Object-Oriented Programming, Maribor, Slovenia, volume 6183 of LNCS, pages 380--404. Springer-Verlag, 2010. To appear. Google Scholar
Digital Library
- }}L. Rodríguez, É. Tanter,and J.Noyé. Supportingdynamic crosscutting with partial behavioral reflection: a case study. In Proceedings of the XXIV International Conference of the Chilean Computer Science Society (SCCC 2004), Arica, Chile, Nov. 2004. IEEE.Google Scholar
Cross Ref
- }}D. Röthlisberger, M. Denker, and É. Tanter. Unanticipated partial behavioral reflection. In Advances in Smalltalk -- Proceedings of 14th International Smalltalk Conference (ISC 2006), volume 4406 of LNCS, pages 47--65. Springer, 2007. ISBN 978-3-540-71835-2. doi: 10.1007/978-3-540-71836-9 3. Google Scholar
Digital Library
- }}J. W. Simmons, S. Jefferson, and D. P. Friedman. Language extension via first-class interpreters. Technical Report 362, Indiana University Computer Science Department, Sept. 1992.Google Scholar
- }}B. C. Smith. Reflection and Semantics in a Procedural Language. Ph.D. thesis, MIT, Cambridge, MA, 1982.Google Scholar
- }}A. Strauss. Dynamic aspects -- an AOP implementation for Squeak. Master's thesis, University of Bern, Nov. 2008.Google Scholar
- }}É. Tanter. Reflection and open implementations. Technical Report TR/DCC-2009-13, University of Chile, Nov. 2009.Google Scholar
- }}É. Tanter, J. Noyé, D. Caromel, and P. Cointe. Partial behavioral reflection: Spatial and temporal selection of reification. In Proceedings of OOPSLA '03, ACM SIGPLAN Notices, pages 27--46, nov 2003. Google Scholar
Digital Library
- }}D. Ungar, A. Spitz, and A. Ausch. Constructing a metacircular virtual machine in an exploratory programming environment. In OOPSLA '05: Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 11--20, New York, NY, USA, 2005. ACM. ISBN 1-59593-193-7. doi: 10.1145/ 1094855.1094865. Google Scholar
Digital Library
- }}M. Wand and D. Friedman. The Mystery of the Tower Revealed: A Non-Reflective Description of the Reflective Tower. In P. M. North-Holland and D. Nardi, editors, Meta-level Architectures and Reflection, pages 111--134, 1988.Google Scholar
- }}R. Wuyts and S. Ducasse. Symbiotic reflection between an object-oriented and a logic programming language. In ECOOP 2001 International Workshop on MultiParadigm Programming with Object-Oriented Languages, 2001.Google Scholar
Index Terms
Pinocchio: bringing reflection to life with first-class interpreters
Recommendations
Pinocchio: bringing reflection to life with first-class interpreters
OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applicationsTo support development tools like debuggers, runtime systems need to provide a meta-programming interface to alter their semantics and access internal data. Reflective capabilities are typically fixed by the Virtual Machine (VM). Unanticipated ...
Building efficient and highly run-time adaptable virtual machines
DLS '16Programming language virtual machines (VMs) realize language semantics, enforce security properties, and execute applications efficiently. Fully Reflective Execution Environments (EEs) are VMs that additionally expose their whole structure and behavior ...
Building efficient and highly run-time adaptable virtual machines
DLS 2016: Proceedings of the 12th Symposium on Dynamic LanguagesProgramming language virtual machines (VMs) realize language semantics, enforce security properties, and execute applications efficiently. Fully Reflective Execution Environments (EEs) are VMs that additionally expose their whole structure and behavior ...







Comments