ABSTRACT
Programming idioms, design patterns and application libraries often introduce cumbersome and repetitive boilerplate code to a software system. Language extensions and external DSLs (domain specific languages) are sometimes introduced to reduce the need for boilerplate code, but they also complicate the system by introducing the need for language dialects and inter-language mediation. To address this, we propose to extend the structural reflective model of the language with object layouts, layout scopes and slots. Based on the new reflective language model we can 1) provide behavioral hooks to object layouts that are triggered when the fields of an object are accessed and 2) simplify the implementation of state-related language extensions such as stateful traits. By doing this we show how many idiomatic use cases that normally require boilerplate code can be more effectively supported.
We present an implementation in Smalltalk, and illustrate its usage through a series of extended examples.
- le}Bak02aL. Bak, G. Bracha, S. Grarup, R. Griesemer, D. Griswold, and U. Hölzle. Mixins in Strongtalk. In ECOOP '02 Workshop on Inheritance, June 2002.Google Scholar
- R. Barcia, G. Hambrick, K. Brown, R. Peterson, and K. Bhogal. Persistence in the enterprise: a guide to persistence technologies. IBM Press, first edition, 2008. ISBN 9780768680591. Google ScholarDigital Library
- K. Beck and E. Gamma. Test infected: Programmers love writing tests. Java Report, 3 (7): 51--56, 1998.Google Scholar
- A. Bergel, S. Ducasse, O. Nierstrasz, and R. Wuyts. Stateful traits and their formalization. Journal of Computer Languages, Systems and Structures, 34 (2--3): 83--108, 2008. ISSN 1477--8424. 10.1016/j.cl.2007.05.003. Google ScholarDigital Library
- A. Bergel, S. Ducasse, and L. Renggli. Seaside -- advanced composition and control flow for dynamic web applications. ERCIM News, 72, Jan. 2008\natexlabb.Google Scholar
- G. Bierman. First-class relationships in an object-oriented language. In ECOOP, pages 262--286. Springer-Verlag, 2005. 10.1007/11531142_12. Google ScholarDigital Library
- D. G. Bobrow, K. Kahn, G. Kiczales, L. Masinter, M. Stefik, and F. Zdybel. Commonloops: Merging lisp and object-oriented programming. In Proceedings OOPSLA '86, ACM SIGPLAN Notices, volume 21, pages 17--29, Nov. 1986. Google ScholarDigital Library
- G. Bracha. Executable grammars in Newspeak. Electron. Notes Theor. Comput. Sci., 193: 3--18, 2007. ISSN 1571-0661. 10.1016/j.entcs.2007.10.004. Google ScholarDigital Library
- G. Bracha and W. Cook. Mixin-based inheritance. In Proceedings OOPSLA/ECOOP '90, ACM SIGPLAN Notices, volume 25, pages 303--311, Oct. 1990. Google ScholarDigital Library
- Django. Django. http://www.djangoproject.com.Google Scholar
- S. Ducasse, O. Nierstrasz, N. Scharli, R. Wuyts, and A. P. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems (TOPLAS), 28 (2): 331--388, Mar. 2006. ISSN 0164-0925. 10.1145/1119479.1119483. Google ScholarDigital Library
- G. Ferreira, E. Loureiro, and E. Oliveira. A java code annotation approach for model checking software systems. In Proceedings of the 2007 ACM symposium on Applied computing, SAC '07, pages 1536--1537, New York, NY, USA, 2007. ACM. ISBN 1--59593--480--4. 10.1145/1244002.1244330. Google ScholarDigital Library
- D. Flanagan. JavaScript: The Definitive Guide. O'Reilly & Associates, second edition, Jan. 1997. ISBN 1--56592--234--4. Google ScholarDigital Library
- M. Fowler. Language workbenches: The killer-app for domain-specific languages, June 2005. http://www.martinfowler.com/articles/languageWorkbench.html.Google Scholar
- A. Goldberg and D. Robson. Smalltalk 80: the Language and its Implementation. Addison Wesley, Reading, Mass., May 1983. ISBN 0--201--13688-0. Google ScholarDigital Library
- P. Hudak. Modular domain specific languages and tools. In P. Devanbu and J. Poulin, editors, Proceedings: Fifth International Conference on Software Reuse, pages 134--142. IEEE Computer Society Press, 1998. Google ScholarDigital Library
- G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-Oriented Programming. In M. Aksit and S. Matsuoka, editors, Proceedings ECOOP '97, volume 1241 of phLNCS, pages 220--242, Jyvaskyla, Finland, June 1997. Springer-Verlag.Google Scholar
- E. Meijer, B. Beckman, and G. Bierman. LINQ: reconciling object, relations and XML in the .NET framework. In SIGMOD '06: Proceedings of the 2006 ACM SIGMOD international conference on Management of data, pages 706--706, New York, NY, USA, 2006. ACM. ISBN 1--59593--434-0. 10.1145/1142473.1142552. Google ScholarDigital Library
- A. Paepcke. PCLOS: Stress testing CLOS experiencing the metaobject protocol. In Proceedings OOPSLA/ECOOP '90, ACM SIGPLAN Notices, volume 25, pages 194--211, Oct. 1990. Google ScholarDigital Library
- A. Paepcke. User-level language crafting. In Object-Oriented Programming: the CLOS perspective, pages 66--99. MIT Press, 1993. Google ScholarDigital Library
- Pharo. Pharo. http://www.pharo-project.org.Google Scholar
- Python. Python. http://www.python.org.Google Scholar
- L. Renggli, S. Ducasse, and A. Kuhn. Magritte -- a meta-driven approach to empower developers and end users. In G. Engels, B. Opdyke, D. C. Schmidt, and F. Weil, editors, Model Driven Engineering Languages and Systems, volume 4735 of LNCS, pages 106--120. Springer, Sept. 2007. ISBN 978--3--540--75208-0. 10.1007/978--3--540--75209--7_8. Google ScholarDigital Library
- L. Renggli, T. Gîrba, and O. Nierstrasz. Embedding languages without breaking tools. In T. D'Hondt, editor, ECOOP'10: Proceedings of the 24th European Conference on Object-Oriented Programming, volume 6183 of LNCS, pages 380--404, Maribor, Slovenia, 2010. Springer-Verlag. ISBN 978--3--642--14106--5. 10.1007/978--3--642--14107--2_19. Google ScholarDigital Library
- M. Stiegler. The E language in a walnut, 2004. www.skyhunter.com/marcs/ewalnut.html.Google Scholar
- D. Ungar and R. B. Smith. Self: The power of simplicity. In Proceedings OOPSLA '87, ACM SIGPLAN Notices, volume 22, pages 227--242, Dec. 1987. 10.1145/38765.38828. Google ScholarDigital Library
- T. Wrigstad, P. Eugster, J. Field, N. Nystrom, and J. Vitek. Software hardening: a research agenda. In Proceedings for the 1st workshop on Script to Program Evolution, STOP '09, pages 58--70, New York, NY, USA, 2009. ACM. ISBN 978--1--60558--543--7. 10.1145/1570506.1570513. Google ScholarDigital Library
Index Terms
- Flexible object layouts: enabling lightweight language extensions by intercepting slot access
Recommendations
Flexible object layouts: enabling lightweight language extensions by intercepting slot access
OOPSLA '11Programming idioms, design patterns and application libraries often introduce cumbersome and repetitive boilerplate code to a software system. Language extensions and external DSLs (domain specific languages) are sometimes introduced to reduce the need ...
Mixing source and bytecode: a case for compilation by normalization
Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation ...
Mixing source and bytecode: a case for compilation by normalization
OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applicationsLanguage extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation ...
Comments