Personal tools

Old-reactive

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Abstract: added purely functional aspect, in contrast with DataDriven)
m (Abstract)
Line 8: Line 8:
 
'''Reactive''' is a simple foundation for programming reactive systems functionally. Like Fran/FRP, it has a notions of (reactive) behaviors and events. Like [[DataDriven]], Reactive has a data-driven implementation. The main difference between Reactive and DataDriven are
 
'''Reactive''' is a simple foundation for programming reactive systems functionally. Like Fran/FRP, it has a notions of (reactive) behaviors and events. Like [[DataDriven]], Reactive has a data-driven implementation. The main difference between Reactive and DataDriven are
 
* Reactive builds on STM-based IVars, while DataDriven builds on continuation-based computations; and
 
* Reactive builds on STM-based IVars, while DataDriven builds on continuation-based computations; and
* The algebra of Events and reactive values (called "sources" in DataDriven) are ''purely'' functional. I couldn't figure out how to accomplish that in DataDriven.
+
* The algebra of events and reactive values (called events and sources in DataDriven) are ''purely'' functional. I couldn't figure out how to accomplish that in DataDriven.
  +
* Reactive manages (I hope) to get the efficiency of data-driven computation with a (sort-of) demand-driven architecture. For that reason, Reactive is garbage-collector-friendly, while DataDriven depends on weak references (because [[DataDriven#GC_favors_demand-driven_computation|GC favors demand-driven computation]].)
   
 
The inspiration for Reactive was Mike Sperber's [[http://www-pu.informatik.uni-tuebingen.de/lula/deutsch/publications.html Lula]] implementation of FRP. Mike used blocking threads, which I had never considered for FRP. While playing with the idea, I realized that I could give a very elegant and efficient solution to caching, which DataDriven doesn't do. (For an application <hask>f <*> a</hask> of a varying function to a varying argument, caching remembers the latest function to apply to a new argument and the last argument to which to apply a new function.)
 
The inspiration for Reactive was Mike Sperber's [[http://www-pu.informatik.uni-tuebingen.de/lula/deutsch/publications.html Lula]] implementation of FRP. Mike used blocking threads, which I had never considered for FRP. While playing with the idea, I realized that I could give a very elegant and efficient solution to caching, which DataDriven doesn't do. (For an application <hask>f <*> a</hask> of a varying function to a varying argument, caching remembers the latest function to apply to a new argument and the last argument to which to apply a new function.)

Revision as of 19:04, 10 December 2007


Contents

1 Abstract

Reactive is a simple foundation for programming reactive systems functionally. Like Fran/FRP, it has a notions of (reactive) behaviors and events. Like DataDriven, Reactive has a data-driven implementation. The main difference between Reactive and DataDriven are

  • Reactive builds on STM-based IVars, while DataDriven builds on continuation-based computations; and
  • The algebra of events and reactive values (called events and sources in DataDriven) are purely functional. I couldn't figure out how to accomplish that in DataDriven.
  • Reactive manages (I hope) to get the efficiency of data-driven computation with a (sort-of) demand-driven architecture. For that reason, Reactive is garbage-collector-friendly, while DataDriven depends on weak references (because GC favors demand-driven computation.)
The inspiration for Reactive was Mike Sperber's [Lula] implementation of FRP. Mike used blocking threads, which I had never considered for FRP. While playing with the idea, I realized that I could give a very elegant and efficient solution to caching, which DataDriven doesn't do. (For an application
f <*> a
of a varying function to a varying argument, caching remembers the latest function to apply to a new argument and the last argument to which to apply a new function.)

As with DataDriven, Reactive provides instances for Monoid, Functor, Applicative, and Monad.

Besides this wiki page, here are more ways to find out about Reactive:

Please leave comments at the Talk page.

2 IVars

3 Events and reactive values

4 Constant-optimized functions