Reactive programming is powerful, but often overlooked due to obscure syntax. Given int x,y,z; we can write z=x+y for immediate assignment. What if we could also write z~=x+y to ensure z is recalculated formulaically whenever x or y change, plus when(z) {..} to monitor changes?
-
-
Replying to @TimSweeneyEpic
If I were to do this using the functional idioms already available to me in a largely imperative language, I’d define z = () => x() + y() and let the runtime take care of optimization/ memoization. The idea of a monitor could be abstracted out into a monad covering x and y calls.
1 reply 0 retweets 0 likes
Replying to @mengwong
Yes, that’s another interesting pattern that emerges on top of a transactional memory system: Memoize a function whose sole effect is reading the heap, and cache the dependencies to ensure re-evaluation only if they change.
8:51 PM - 3 Feb 2019
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.