Skip to main content

Worlds: Controlling the Scope of Side Effects

  • Conference paper
ECOOP 2011 – Object-Oriented Programming (ECOOP 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6813))

Included in the following conference series:

Abstract

The state of an imperative program—e.g., the values stored in global and local variables, arrays, and objects’ instance variables—changes as its statements are executed. These changes, or side effects, are visible globally: when one part of the program modifies an object, every other part that holds a reference to the same object (either directly or indirectly) is also affected. This paper introduces worlds, a language construct that reifies the notion of program state and enables programmers to control the scope of side effects. We investigate this idea by extending both JavaScript and Squeak Smalltalk with support for worlds, provide examples of some of the interesting idioms this construct makes possible, and formalize the semantics of property/field lookup in the presence of worlds. We also describe an efficient implementation strategy (used in our Squeak-based prototype), and illustrate the practical benefits of worlds with two case studies.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Balzer, R.M.: EXDAMS—EXtendable debugging and monitoring system. AFIPS Spring Joint Computer Conference 34, 567–580 (1969)

    Google Scholar 

  2. Bergel, A., Ducasse, S., Nierstrasz, O.: Classbox/J: Controlling the scope of change in Java. In: OOPSLA 2005: Proceedings of 20th International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 177–189. ACM Press, New York (2005)

    Google Scholar 

  3. Bergel, A., Ducasse, S., Wuyts, R.: Classboxes: A minimal module model supporting local rebinding. In: Böszörményi, L., Schojer, P. (eds.) JMLC 2003. LNCS, vol. 2789, pp. 122–131. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  4. Bracha, G.: Monkey Patching (blog post) (2008), http://gbracha.blogspot.com/2008/03/monkey-patching.html

  5. Burckhardt, S., Baldassion, A., Leijen, D.: Concurrent programming with revisions and isolation types. In: OOPSLA 2010 (October 2010)

    Google Scholar 

  6. Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM Transactions on Programming Languages and Systems 28(3) (May 2006)

    Google Scholar 

  7. Denker, M., Gîrba, T., Lienhard, A., Nierstrasz, O., Renggli, L., Zumkehr, P.: Encapsulating and exploiting change with changeboxes. In: ICDL 2007: Proceedings of the 2007 International Conference on Dynamic Languages, pp. 25–49. ACM Press, New York (2007)

    Google Scholar 

  8. Ducasse, S., Lienhard, A., Renggli, L.: Seaside: A flexible environment for building dynamic web applications. IEEE Software 24(5), 56–63 (2007)

    Article  Google Scholar 

  9. ECMA International. ECMA-262: ECMAScript Language Specification. European Association for Standardizing Information and Communication Systems, Geneva, Switzerland, third edition (December 1999)

    Google Scholar 

  10. Feldman, S.I., Brown, C.B.: IGOR: a system for program debugging via reversible execution. ACM SIGPLAN Notices 24(1), 112–123 (1989)

    Article  Google Scholar 

  11. Ford, B.: Packrat parsing: simple, powerful, lazy, linear time, functional pearl. In: ICFP 2002: Proceedings of the seventh ACM SIGPLAN International Conference on Functional Programming, pp. 36–47. ACM Press, New York (2002)

    Chapter  Google Scholar 

  12. Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. In: POPL 2004: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 111–122. ACM Press, New York (2004)

    Google Scholar 

  13. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley Professional, Reading (1995)

    MATH  Google Scholar 

  14. Hårris, T., Marlow, S., Peyton-Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP 2005: Proceedings of the tenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 48–60. ACM Press, New York (2005)

    Google Scholar 

  15. Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-Oriented Programming. Journal of Object Technology (JOT) 7(3), 125–151 (2008)

    Article  Google Scholar 

  16. Ingalls, D., Kaehler, T., Maloney, J., Wallace, S., Kay, A.: Back to the future: the story of Squeak, a practical Smalltalk written in itself. SIGPLAN Notices 32(10), 318–326 (1997)

    Article  Google Scholar 

  17. Jefferson, D.R.: Virtual time. ACM Transactions on Programming Languages and Systems 7(3), 404–425 (1985)

    Article  Google Scholar 

  18. Johnson, G.F., Duggan, D.: Stores and partial continuations as first-class objects in a language and its environment. In: POPL19’88: Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 158–168. ACM Press, New York (1988)

    Google Scholar 

  19. Kay, A., Ingalls, D., Ohshima, Y., Piumarta, I., Raab, A.: Proposal to NSF (2006), http://www.vpri.org/pdf/NSF_prop_RN-2006-002.pdf (granted on August 31, 2006)

  20. Kay, A., Piumarta, I., Rose, K., Ingalls, D., Amelang, D., Kaehler, T., Ohshima, Y., Thacker, C., Wallace, S., Warth, A., Yamamiya, T.: Steps toward the reinvention of programming (first year progress report) (2007), http://www.vpri.org/pdf/steps_TR-2007-008.pdf

  21. Kung, H.T., Robinson, J.T.: On optimistic methods for concurrency control. ACM Transactions on Database Systems 6(2), 213–226 (1981)

    Article  Google Scholar 

  22. Morrisett, J.G.: Generalizing first-class stores. In: SIPL 1993: Proceedings of the ACM SIGPLAN Workshop on State in Programming Languages, pp. 73–87 (1993)

    Google Scholar 

  23. Nandivada, V.K., Jagannathan, S.: Dynamic state restoration using versioning exceptions. Higher-Order and Symbolic Computation 19(1), 101–124 (2006)

    Article  MATH  Google Scholar 

  24. Okasaki, C.: Purely functional data structures. Cambridge University Press, Cambridge (1999)

    MATH  Google Scholar 

  25. Reed, D.P.: Naming and synchronization in a decentralized computer system (PhD dissertation). Technical Report TR-205, Massachusetts Institute of Technology, Cambridge, MA, USA (1978)

    Google Scholar 

  26. Reed, D.P.: Designing Croquet’s TeaTime: a real-time, temporal environment for active object cooperation. In: OOPSLA 2005: Companion to the 20th annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 7–7. ACM Press, New York (2005)

    Chapter  Google Scholar 

  27. Shavit, N., Touitou, D.: Software transactional memory. In: PODC 1995: Proceedings of the 12th Annual ACM Symposium on Principles of Distributed Computing, pp. 204–213 (1995)

    Google Scholar 

  28. Smith, R.B., Ungar, D.: A simple and unifying approach to subjective objects. Theor. Pract. Object Syst. 2(3), 161–178 (1996)

    Article  Google Scholar 

  29. Tanter, E.: Contextual values. In: DLS 2008: Proceedings of the 2008 Dynamic Languages Symposium, pp. 1–10. ACM Press, New York (2008)

    Chapter  Google Scholar 

  30. Warth, A.: OMeta/JS website, http://www.tinlizzie.org/ometa-js/

  31. Warth, A.: Experimenting with Programming Languages. PhD dissertation, University of California, Los Angeles (2009)

    Google Scholar 

  32. Warth, A., Piumarta, I.: OMeta: an Object-Oriented Language for Pattern-Matching. In: OOPSLA 2007: Companion to the 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, ACM Press, New York (2007)

    Google Scholar 

  33. Warth, A., Stanojević, M., Millstein, T.: Statically scoped object adaptation with Expanders. In: OOPSLA 2006: Proceedings of the 21st ACM SIGPLAN International Conference on Object-Oriented Programming Systems, Languages, and Applications, pp. 37–56. ACM Press, New York (2006)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Warth, A., Ohshima, Y., Kaehler, T., Kay, A. (2011). Worlds: Controlling the Scope of Side Effects. In: Mezini, M. (eds) ECOOP 2011 – Object-Oriented Programming. ECOOP 2011. Lecture Notes in Computer Science, vol 6813. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22655-7_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22655-7_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22654-0

  • Online ISBN: 978-3-642-22655-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics