Abstract
Traditional treatment of scoping in programming languages considers two opposite semantics: static scoping, where the scope of a binding is a block of program text, and dynamic scoping, where a binding is in effect during the whole reduction of an expression to a value. Static scoping and dynamic scoping are however but two points in the design space of scoping mechanisms. As a result, most proposed language mechanisms that rely on some notion of scoping, such as variable bindings of course, but also more exotic ones like aspects and mixin layers, adopt either one or the other semantics. As it turns out, these two semantics are sometimes too extreme, and a mixture of both is needed. To achieve this, language designers and/or programmers have to resort to ad hoc solutions. We present a general scoping model that simply expresses static and dynamic scoping, and that goes further by allowing fine-grained exploration of the design space of scoping. The model, called scoping strategies, gives precise control over propagation and activation of language mechanisms. While we have already studied it for aspects, we hereby show that the model is not restricted to aspects, by treating in depth its application to the most standard kind of adaptation: variable bindings. We also briefly discuss its application to mixin layers, and program monitoring. We believe that research in programming language constructs can benefit from a more flexible notion of scoping that goes beyond the static/dynamic dichotomy.
- Martin Abadi, Luca Cardelli, Pierre-Louis Curien, and Jean-Jacques Lévy. Explicit substitutions. Journal of Functional Programming, 1(4):375--416, 1992.Google Scholar
Cross Ref
- Ivica Aracic, Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. An overview of CaesarJ. In Transactions on Aspect-Oriented Software Development, volume 3880 of Lecture Notes in Computer Science, pages 135--173. Springer-Verlag, February 2006. Google Scholar
Digital Library
- Alexandre Bergel, Stéphane Ducasse, and Roel Wuyts. Classboxes: A minimal module model supporting local rebinding. In Proceedings of the Joint Modular Languages Conference (JMLC'03), volume 2789 of Lecture Notes in Computer Science, pages 122--131. Springer-Verlag, 2003.Google Scholar
Cross Ref
- Dave Clarke, Pascal Costanza, and Éric Tanter. How should context-escaping closures proceed? In Workshop on Context-Oriented Programming, Genova, Italy, July 2009. To appear. Google Scholar
Digital Library
- Pascal Costanza and Robert Hirschfeld. Language constructs for context-oriented programming - an overview of ContextL. In ACM Dynamic Language Symposium (DLS 2005), San Diego, CA, USA, October 2005. Google Scholar
Digital Library
- Mariangiola Dezani-Ciancaglini, Paola Giannini, and Oscar Nierstrasz. A calculus of evolving objects. Scientific Annals of Computer Science, 18:63--98, 2008.Google Scholar
- Christopher Dutchyn, David B. Tucker, and Shriram Krishnamurthi. Semantics and scoping of aspects in higher-order languages. Science of Computer Programming, 63(3):207--239, December 2006. Google Scholar
Digital Library
- Matthias Felleisen. The theory and practice of first-class prompts. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL'88), pages 180--190. ACM Press, 1988. Google Scholar
Digital Library
- Matthias Felleisen. On the expressive power of programming languages. Science of Computer Programming, 17:35--75, 1991. Google Scholar
Digital Library
- Matthew Flatt, Gang Yu, Robert Bruce Findler, and Matthias Felleisen. Adding delimited and composable control to a production programming environment. In Proceedings of the 12th ACM SIGPLAN Conference on Functional Programming (ICFP 2007), pages 165--176, Freiburg, Germany, October 2007. ACM Press. Google Scholar
Digital Library
- Daniel P. Friedman and Mitchell Wand. Reification: Reflection without metaphysics. In Proceedings of the Annual ACM Symposium on Lisp and Functional Programming, pages 348--355, August 1984. Google Scholar
Digital Library
- James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification, 3rd edition. Addison-Wesley, 2005. Google Scholar
Digital Library
- G. Kiczales, J. Irwin, J. Lamping, J. Loingtier, C. V. Lopes, C. Maeda, and A. Mendhekar. Aspect oriented programming. In Special Issues in Object-Oriented Programming. Max Muehlhaeuser (general editor) et al., 1996.Google Scholar
- Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William Griswold. An overview of AspectJ. In Jorgen L. Knudsen, editor, Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP 2001), number 2072 in Lecture Notes in Computer Science, pages 327--353, Budapest, Hungary, June 2001. Springer-Verlag. Google Scholar
Digital Library
- Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina V. Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-oriented programming. In Mehmet Akşit and Satoshi Matsuoka, editors, Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP 97), volume 1241 of Lecture Notes in Computer Science, pages 220--242, Jyväskylä, Finland, June 1997. Springer-Verlag.Google Scholar
- Oleg Kiselyov, Chung chieh Shan, and Amr Sabry. Delimited dynamic binding. In Proceedings of the 11th ACM SIGPLAN Conference on Functional Programming (ICFP 2006), pages 26--37, Portland, Oregon, USA, September 2006. ACM Press. Google Scholar
Digital Library
- Hidehiko Masuhara, Gregor Kiczales, and Christopher Dutchyn. A compilation and optimization model for aspect-oriented programs. In G. Hedin, editor, Proceedings of Compiler Construction (CC2003), volume 2622 of Lecture Notes in Computer Science, pages 46--60. Springer-Verlag, 2003. Google Scholar
Digital Library
- Luc Moreau. A syntactic theory of dynamic binding. Higher-Order and Sympolic Computation, 11(3):233--279, 1998. Google Scholar
Digital Library
- Guillaume Pothier and Éric Tanter. Back to the future: Omniscient debugging. IEEE Software, 2009. To appear. Google Scholar
Digital Library
- Guillaume Pothier, Éric Tanter, and José Piquer. Scalable omniscient debugging. In Proceedings of the 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2007), pages 535--552, Montreal, Canada, October 2007. ACM Press. ACM SIGPLAN Notices, 42(10). Google Scholar
Digital Library
- Brian C. Smith. Reflection and semantics in Lisp. In Proceedings of the 14th Annual ACM Symposium on Principles of Programming Languages (POPL), pages 23--35, January 1984. Google Scholar
Digital Library
- Éric Tanter. Expressive scoping of dynamically-deployed aspects. In Proceedings of the 7th ACM International Conference on Aspect-Oriented Software Development (AOSD 2008), pages 168--179, Brussels, Belgium, April 2008. ACM Press. Google Scholar
Digital Library
- Éric Tanter, Johan Fabry, Rémi Douence, Jacques Noyé, and Mario Südholt. Expressive scoping of distributed aspects. In Proceedings of the 8th ACM International Conference on Aspect-Oriented Software Development (AOSD 2009), pages 27--38, Charlottesville, Virginia, USA, March 2009. ACM Press. Google Scholar
Digital Library
- Mitchell Wand, Gregor Kiczales, and Christopher Dutchyn. A semantics for advice and dynamic join points in aspect-oriented programming. ACM Transactions on Programming Languages and Systems, 26(5):890--910, September 2004. Google Scholar
Digital Library
- Alessandro Warth, Milan Stanojević, and Todd Millstein. Statically scoped object adaptation with expanders. In Proceedings of the 21st ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2006), pages 37--55, Portland, Oregon, USA, October 2006. ACM Press. Google Scholar
Digital Library
Index Terms
Beyond static and dynamic scope
Recommendations
Beyond static and dynamic scope
DLS '09: Proceedings of the 5th symposium on Dynamic languagesTraditional treatment of scoping in programming languages considers two opposite semantics: static scoping, where the scope of a binding is a block of program text, and dynamic scoping, where a binding is in effect during the whole reduction of an ...
Binding strategies and scope rules are independent
The programming language Lisp employs dynamic scope rules. Binding is usually of the shallow variety, but deep (also called funarg) binding is also available. Block-structured languages, on the other hand, use static scope rules. Here, binding is always ...
Hygienic quasiquotation in scheme
Scheme '12: Proceedings of the 2012 Annual Workshop on Scheme and Functional ProgrammingQuasiquotation in Scheme is nearly ideal for implementing programs that generate other programs. These programs lack only the ability to generate fresh bound identifiers, as required to make such code-manipulating programs hygienic, but any Scheme ...









Comments