[Haskell-cafe] reactive? was Re: Incremental trasnformations (not
ryani.spam at gmail.com
Mon Dec 29 04:28:19 EST 2008
2008/12/28 Luke Palmer <lrpalmer at gmail.com>:
> Adaptive programming is sortof the opposite of reactive programming, the way
> I see it. Adaptive is imperative (that's the best word I have for it), i.e.
> you have a bunch of variables and your code decides which one to change.
> Whereas reactive programming, at the very heart (i.e. I would expect every
> reactive semantics to obey this), is declarative. That is, the way
> something behaves depends only on where it was defined, and not at all on
> how it is used.
I'm not sure I agree with this analysis; Reactive can be implemented
on top of Adaptive, and vice versa.
Yes, adaptive sort-of about mutation, but if you take a time step as
"some input variables updated", you can easily see how a Reactive
event stream implements an adaptive computation. Similarily, Conal's
implementation of Reactive is mostly about how futures interact; it's
easy to see how futures can be implemented as Adaptive objects on top
of input sources showing the current time and the other inputs to the
In fact I think if you look at Magnus Carlsson's Haskell Adaptive
package, I think you'll find that there isn't really much mention of
mutation at all, except at the point of "update the inputs and tell me
what output I get". This is much the same as Reactive where some
underlying system is updating the inputs (mouse position, keyboard
events, etc.) and giving you the new output.
More information about the Haskell-Cafe