Sat Sep 25 11:25:37 CEST 2010
I'm building a reactive programming engine for a consulting project.
An interesting concept I keep running into is that of "void events".
Let's define an event as a <time,value> pair. Reactive programming
can then be seen as functions defined on events. My implementation is
strict (non-lazy) to allow integration of side effects for coupling
with the surrounding OO system.
This definition as <time,value> pairs is slightly more concrete
definition as Conal's "functions of time" definition. The main
reason is that I don't see how to otherwise add strict side-effecting
code. One could see the <time,value> pairs as a piecewise constant
representation of continuous functions. I.e. this helps reasoning
about combinations of events with different time stamps: just think
"what would the continuous function do?".
Now, think of the qualitative difference of these two entities:
1. A push-button measurement. 1 = pressed, 0 = released
2. A stream of push events.
The second one is an abstraction of the first one, but it is radically
different as there is no longer a piecewise continuous function
The question is: is this thing "real" or an artifact of some modeling
In essence, number 2 is a variant of the Dirac Impulse, a
generalized function that allows the bridge between continuous
functions and discrete structures. A Dirac Impulse represents the
derivative of a step function, allowing for discrete state updates
as an integral of impulse.
In my system they seem to serve the same purpose: a void event
resembles a state change (a derivative) in the cases where it is not
necessary or possible to indicate "by howmuch" the state changes. It
thus seems to be an artifact of the side-effecting OO integration.