skip to main content
10.1145/2048066.2048138acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Flexible object layouts: enabling lightweight language extensions by intercepting slot access

Published:22 October 2011Publication History

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.

References

  1. 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 ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Beck and E. Gamma. Test infected: Programmers love writing tests. Java Report, 3 (7): 51--56, 1998.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Bergel, S. Ducasse, and L. Renggli. Seaside -- advanced composition and control flow for dynamic web applications. ERCIM News, 72, Jan. 2008\natexlabb.Google ScholarGoogle Scholar
  6. G. Bierman. First-class relationships in an object-oriented language. In ECOOP, pages 262--286. Springer-Verlag, 2005. 10.1007/11531142_12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Bracha and W. Cook. Mixin-based inheritance. In Proceedings OOPSLA/ECOOP '90, ACM SIGPLAN Notices, volume 25, pages 303--311, Oct. 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Django. Django. http://www.djangoproject.com.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. D. Flanagan. JavaScript: The Definitive Guide. O'Reilly & Associates, second edition, Jan. 1997. ISBN 1--56592--234--4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Fowler. Language workbenches: The killer-app for domain-specific languages, June 2005. http://www.martinfowler.com/articles/languageWorkbench.html.Google ScholarGoogle Scholar
  15. A. Goldberg and D. Robson. Smalltalk 80: the Language and its Implementation. Addison Wesley, Reading, Mass., May 1983. ISBN 0--201--13688-0. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Paepcke. User-level language crafting. In Object-Oriented Programming: the CLOS perspective, pages 66--99. MIT Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Pharo. Pharo. http://www.pharo-project.org.Google ScholarGoogle Scholar
  22. Python. Python. http://www.python.org.Google ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. Stiegler. The E language in a walnut, 2004. www.skyhunter.com/marcs/ewalnut.html.Google ScholarGoogle Scholar
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Flexible object layouts: enabling lightweight language extensions by intercepting slot access

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
          October 2011
          1104 pages
          ISBN:9781450309400
          DOI:10.1145/2048066
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 46, Issue 10
            OOPSLA '11
            October 2011
            1063 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/2076021
            Issue’s Table of Contents

          Copyright © 2011 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 22 October 2011

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate268of1,244submissions,22%

          Upcoming Conference

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader