I do not want to distract from the content of the article, which is highly relevant for folks who built UIs with frameworks that are conceptually based on signals, but the way that the reading experience is designed really great, in particular the guided reading flow through the instructive code path is something that I rarely have seen done at all, and this even works pretty well on mobile. It's a delightful reminde…
I searched for the "right way" to explain this algorithm, and ultimately parsing the code was the clearest for me. This isn't always true; sometimes a graph or an interactive module has more impact; it really depends on the topic. Thanks for the feedback.
Signals, the push-pull based algorithm
31–40 of 42 posts
Re: Signals, the push-pull based algorithm
#32Now that Angular is adopting signals, building in it has become a much better experience. Mind you, the framework still has a hostile learning curve, but for those who already made that investment, it's a boon.
Re: Signals, the push-pull based algorithm
#33Overall, very nice article. A few notes: * I think the first implementation in JS land was Flapjax, which was around 2008: https://www.flapjax-lang.org/publications/ * The article didn't discuss glitch-freedom, which I think is fairly important.
[flagged]
Re: Signals, the push-pull based algorithm
#34Jane street briefly summarizes some options here: https://blog.janestreet.com/breaking-down-frp/
And they have an interesting talk on the trade-offs and how their own system, incremental, evolved: https://blog.janestreet.com/seven-implementations-of-increme...
Re: Signals, the push-pull based algorithm
#35Earlier quoted context omitted.
[flagged]
So yeah topological sorting is one element, but that global stack is a data race! You need to test set inclusion AND insert into it in an ordered way. Global mutex is gross. To do so lock-free could maybe be done with a lock free concurrent priority queue with a pair of monatomic generation counters for the priorities processed then next, then some memo of updates so that the conflicting re-update is invalidated by v…
Re: Signals, the push-pull based algorithm
#36Earlier quoted context omitted.
[flagged]
So yeah topological sorting is one element, but that global stack is a data race! You need to test set inclusion AND insert into it in an ordered way. Global mutex is gross. To do so lock-free could maybe be done with a lock free concurrent priority queue with a pair of monatomic generation counters for the priorities processed then next, then some memo of updates so that the conflicting re-update is invalidated by v…
Re: Signals, the push-pull based algorithm
#37Re: Signals, the push-pull based algorithm
#38Re: Signals, the push-pull based algorithm
#39Earlier quoted context omitted.
I wrote a whole screed here about how glitches are evil and Rx is evil for teaching people they’re normal, but then I thought about it a bit more— The system as described isn’t actually glitchy, is it? It doesn’t eagerly run any user computations, just dirtying, and that is idempotent so the order is irrelevant. It’s also a bit useless because it only allows you to pull out values of your own initiative, not subscrib…
> whether push-pull as TFA understands it has much to do with Conal Elliott’s definition. Virtually nothing that is getting sold/branded as "FRP" has anything to do with Conal Eliott's definition. I once gave a long talk about this here in Berlin, but I don't remember if there was a video. I've also explained it on twitter a bunch of times, including this memorable sequence: https://x.com/mpweiher/status/135371692632…
> Virtually nothing that is getting sold/branded as "FRP" has anything to do with Conal Eliott's definition.
True but not what I meant. The article implicitly (and, in the links at the end, explicitly) refers to his 2009 paper “Push-pull functional reactive programming”, which describes a semantic model together with an specific implementation strategy.
So I was wondering if TFA’s “push-pull” has anything to do with Elliott 2009’s “push-pull”. I don’t think so, because I remember the latter doing wholly push-based recomputation of discrete reactive entities (Events and Reactives) and pull-based only for continuous entities that require eventual sampling (Behaviors).
With that said, I find it difficult to squeeze an actual algorithm out of Elliott’s high-level, semantics-oriented discussion, and usually realize that I misunderstood or misremembered something whenever I reread that paper (every few years). So if the author went all the way to reference this specific work out of all the FRP literature, I’m willing to believe that they are implying some sort of link that I’m not seeing. I would just like to know where it is.
Re: Signals, the push-pull based algorithm
#40Earlier quoted context omitted.
So yeah topological sorting is one element, but that global stack is a data race! You need to test set inclusion AND insert into it in an ordered way. Global mutex is gross. To do so lock-free could maybe be done with a lock free concurrent priority queue with a pair of monatomic generation counters for the priorities processed then next, then some memo of updates so that the conflicting re-update is invalidated by v…
Can the reactive graph even be updated concurrently if the UI depends on it though? Because the UI is likely to run in its own single thread...