skip to main content
10.1145/1806651.1806662acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

Collecting hollywood's garbage: avoiding space-leaks in composite events

Published:05 June 2010Publication History

ABSTRACT

The reactive programming model is largely different to what we're used to as we don't have full control over the application's control flow. If we mix the declarative and imperative programming style, which is usual in the ML family of languages, the situation is even more complex. It becomes easy to introduce patterns where the usual garbage collector for objects cannot automatically dispose all components that we intuitively consider garbage.

In this paper we discuss a duality between the definitions of garbage for objects and events. We combine them into a single one, to specify the notion of garbage for reactive programming model in a mixed functional/imperative language and we present a formal algorithm for collecting garbage in this environment.

Building on top of the theoretical model, we implement a library for reactive programming that does not cause leaks when used in the mixed declarative/imperative model. The library allows us to safely combine both of the reactive programming patterns. As a result, we can take advantage of the clarity and simplicity of the declarative approach as well as the expressivity of the imperative model.

References

  1. C. Elliott and P. Hudak, Functional reactive animation. In Proceedings of ICFP 1997, pp. 263--273 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. C. Elliott. Declarative event-oriented programming. In Proceedings of PPDP 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. E. Scholz. Imperative streams -- a monadic combinator library for synchronous programming. In Proceedings of ICFP 1998 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Syme, A. Granicz, and A. Cisternino. Expert F#, Reactive, Asynchronous and Concurrent Programming. Apress, 2007.Google ScholarGoogle Scholar
  5. E. Meijer. LiveLabs Reactive Framework. Lang.NET Symposium 2009, Available at: http://tinyurl.com/llreactiveGoogle ScholarGoogle Scholar
  6. A. Benveniste, P. Caspi, S. Edwards, N. Halbwachs, P. Le Guernic, R. De Simone. The Synchronous Languages Twelve Years Later. In Proceedings of the IEEE, vol. 91, pp. 64--83, 2003Google ScholarGoogle Scholar
  7. E. Meijer, B. Beckman, G. Bierman. LINQ: reconciling object, relations and XML in the .NET framework. In Proceedings of COMAD 2006 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Petricek, D. Syme. Collectable event chains in F#. To appear as MSR Technical Report.Google ScholarGoogle Scholar
  9. Microsoft. Reactive Extensions for .NET. Retrieved from: http://msdn.microsoft.com/en--us/devlabs/ee794896.aspx,2010Google ScholarGoogle Scholar
  10. P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice, LUSTRE: A declarative language for programming synchronous systems. In Proceedings of POPL 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. Boussinot and R. de Simone, The Esterel language. In proceedings of the IEEE, vol. 79, pp. 1293--1304, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  12. G. Berry and G. Gonthier, The Esterel Synchronous Programming Language: Design, Semantics, Implementation. In Science of Computer Programming vol. 19, no. 2, pp 87--152, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Armstrong, R. Virding, C. Wikström and M. Williams, Concurrent Programming in ERLANG, 2nd ed. Prentice Hall International Ltd., 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Kafura, D. Washabaugh, and J. Nelson, Garbage collection of actors. In OOPSLA'90, vol. 25(10), pp. 126--134 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Vardhan and G. Agha, Using Passive Object Garbage Collection Algorithms for Garbage Collection of Active Objects. In Proceedings of ISMM'02 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. Agha. Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge, Mass., 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Z. Wan and P. Hudak. Functional Reactive Programming from First Principles. In Proceedings of PLDI, 2000 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. T. Petricek and J. Skeet. Real-World Functional Programming, Chapter 16, Manning, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. D. Syme. Simplicity and Compositionality in Asynchronous Programming through First Class Events. Online at: http://tinyurl.com/composingevents, Retrieved: Jan 2010Google ScholarGoogle Scholar
  20. D. Syme. Initializing Mutually Referential Abstract Objects. In Proceedings of ML Workshop, 2005Google ScholarGoogle Scholar
  21. G. Schechter. Simulating "Weak Delegates" in the CLR. Online at: http://tinyurl.com/weakdelegates, Retrieved: Feb 2010Google ScholarGoogle Scholar
  22. O. Agesen, D. Detlefs and J. Eliot B. Moss. Garbage Collection and Local Variable Type-Precision and Liveness in Java Virtual Machines. In Proceedings of PLDI 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Shaham, E. K. Kolodner and M. Sagiv. Estimating the Impact of Heap Liveness Information on Space Consumption in Java. In Proceedings of ISMM 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. L. Meyerovich, A. Guha, J. Baskin, G. Cooper, M. Greenberg, A. Bromfield, S. Krishnamurthi. Flapjax: A Programming Language for Ajax Applications. In OOPSLA 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. The JQuery Project. jQuery. Available at http://jquery.comGoogle ScholarGoogle Scholar
  26. B. Hayes. Ephemerons: a new finalization mechanism. In Proceedings of OOPSLA 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. T. Petricek, D.Syme. Collecting Hollywood's Garbage Avoiding Space-Leaks in Composite Events (Extended version) Available at: http://tomasp.net/academic/event-chains.aspx Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Collecting hollywood's garbage: avoiding space-leaks in composite events

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
    ISMM '10: Proceedings of the 2010 international symposium on Memory management
    June 2010
    140 pages
    ISBN:9781450300544
    DOI:10.1145/1806651
    • General Chair:
    • Jan Vitek,
    • Program Chair:
    • Doug Lea
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 45, Issue 8
      ISMM '10
      August 2010
      129 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1837855
      Issue’s Table of Contents

    Copyright © 2010 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: 5 June 2010

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate72of156submissions,46%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader