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.
- C. Elliott and P. Hudak, Functional reactive animation. In Proceedings of ICFP 1997, pp. 263--273 Google ScholarDigital Library
- C. Elliott. Declarative event-oriented programming. In Proceedings of PPDP 2000 Google ScholarDigital Library
- E. Scholz. Imperative streams -- a monadic combinator library for synchronous programming. In Proceedings of ICFP 1998 Google ScholarDigital Library
- D. Syme, A. Granicz, and A. Cisternino. Expert F#, Reactive, Asynchronous and Concurrent Programming. Apress, 2007.Google Scholar
- E. Meijer. LiveLabs Reactive Framework. Lang.NET Symposium 2009, Available at: http://tinyurl.com/llreactiveGoogle Scholar
- 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 Scholar
- E. Meijer, B. Beckman, G. Bierman. LINQ: reconciling object, relations and XML in the .NET framework. In Proceedings of COMAD 2006 Google ScholarDigital Library
- T. Petricek, D. Syme. Collectable event chains in F#. To appear as MSR Technical Report.Google Scholar
- Microsoft. Reactive Extensions for .NET. Retrieved from: http://msdn.microsoft.com/en--us/devlabs/ee794896.aspx,2010Google Scholar
- P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice, LUSTRE: A declarative language for programming synchronous systems. In Proceedings of POPL 1987. Google ScholarDigital Library
- F. Boussinot and R. de Simone, The Esterel language. In proceedings of the IEEE, vol. 79, pp. 1293--1304, 1991.Google ScholarCross Ref
- 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 ScholarDigital Library
- J. Armstrong, R. Virding, C. Wikström and M. Williams, Concurrent Programming in ERLANG, 2nd ed. Prentice Hall International Ltd., 1996. Google ScholarDigital Library
- D. Kafura, D. Washabaugh, and J. Nelson, Garbage collection of actors. In OOPSLA'90, vol. 25(10), pp. 126--134 Google ScholarDigital Library
- A. Vardhan and G. Agha, Using Passive Object Garbage Collection Algorithms for Garbage Collection of Active Objects. In Proceedings of ISMM'02 Google ScholarDigital Library
- G. Agha. Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge, Mass., 1986. Google ScholarDigital Library
- Z. Wan and P. Hudak. Functional Reactive Programming from First Principles. In Proceedings of PLDI, 2000 Google ScholarDigital Library
- T. Petricek and J. Skeet. Real-World Functional Programming, Chapter 16, Manning, 2010. Google ScholarDigital Library
- D. Syme. Simplicity and Compositionality in Asynchronous Programming through First Class Events. Online at: http://tinyurl.com/composingevents, Retrieved: Jan 2010Google Scholar
- D. Syme. Initializing Mutually Referential Abstract Objects. In Proceedings of ML Workshop, 2005Google Scholar
- G. Schechter. Simulating "Weak Delegates" in the CLR. Online at: http://tinyurl.com/weakdelegates, Retrieved: Feb 2010Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- The JQuery Project. jQuery. Available at http://jquery.comGoogle Scholar
- B. Hayes. Ephemerons: a new finalization mechanism. In Proceedings of OOPSLA 1997. Google ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Collecting hollywood's garbage: avoiding space-leaks in composite events
Recommendations
Collecting hollywood's garbage: avoiding space-leaks in composite events
ISMM '10The 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 ...
Age-based garbage collection
Modern generational garbage collectors look for garbage among the young objects, because they have high mortality; however, these objects include the very youngest objects, which clearly are still live. We introduce new garbage collection algorithms, ...
A generational on-the-fly garbage collector for Java
PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementationAn on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
Comments