Functional Reactive Programming

Apr 20, 2008 18:11

Recently I was reading Conal Elliott's draft paper Simply Efficient Functional Reactivity.

It's a great paper and his blog has a lot more information and a good introduction to FRP and what makes it interesting; better than I can write. Many implementations of FRP pay a big performance penalty communicating "nothing happened" between parts of the ( Read more... )

Leave a comment

Comments 8

zqfmbg April 21 2008, 02:44:02 UTC
Wish I could read it all in one go, but this makes my brain hurt.

Reply


Related Work anonymous April 21 2008, 17:37:47 UTC
I found this on Reddit. Just so you know about it, I have been working on things from a similar perspective. You can find my work so far here. I am using threads for caching reasons, but I am using STM for the timing guarantees you speak of here. I have a problem with these guarantees at the moment, brought about by the multithreading, but I expect to have it sorted out soon.

- Jake

Reply

Re: Related Work ryani April 21 2008, 21:30:04 UTC
Interesting, but you have a big problem (and this big problem is the reason why I went down this path in the first place). Every time the "time" variable changes in your Clockwork class, every future in that class that was sitting in "retry" gets re-evaluated; you have the same "propogation of non-events" problem that standard demand-driven FRP has. Conal pointed this out in the comments of his blog post when I suggested this type for Future:

newtype Future a = Fut (Time -> Maybe (Time, a)); this type for future is a function that takes the current time and returns the time the event occurred (if in the past) or Nothing (if in the future). Of course, if you pass in a time that is actually in the future, the function is free to block until that time occurs--in that case it's just slow to compute.

But it has the same problem; in order to figure out the state of the world you need to work back through all the dependencies, and that means updating each event on each time change. The goal of the data-driven system is that updates to ( ... )

Reply

Re: Related Work anonymous April 21 2008, 23:51:17 UTC
"Every time the 'time' variable changes in your Clockwork class, every future in that class that was sitting in 'retry' gets re-evaluated"

What makes you say that? The only function that is dependent on the global time variable is the fire function.

Reply

Re: Related Work anonymous April 22 2008, 18:15:15 UTC
I think I should clarify ( ... )

Reply


Leave a comment

Up