What an amazing article. I really like the presentation of text scrolling together with the code. Wonder how this is done under the hood.
Signals, the push-pull based algorithm
11–20 of 42 posts
Re: Signals, the push-pull based algorithm
#12How is error handling expected to happen here?
Re: Signals, the push-pull based algorithm
#13Overall, 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.
I've gone with the universal `alien-signals` package for my project (which doesn't use a frontend framework that includes signals). They show benchmarks of being by far the fastest and have strict limits on code complexity. Those limits are also supposed to avoid glitches by design, and now at least some of that is tested[1].
Re: Signals, the push-pull based algorithm
#14I 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…
Re: Signals, the push-pull based algorithm
#15Overall, 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.
Re: Signals, the push-pull based algorithm
#16Mind 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
#17The "2 * x" is rather - why would the reaction from a change in X display many gradual increments of 1 instead of showing the final value once? And then why does Z =Y+1 instead of +1 to Y repeats all the steps again from X? That's not how real signal frameworks work, and also not how you'd imagine they should work
Then the next cascading example: ok, if Signal is a button, not the underlying mechanism behind it, then "computed 1" is also a signal, why isn't it called that? (though intuitively you'd think the moving dots are signals, not buttons)
Re: Signals, the push-pull based algorithm
#18Cheers
Re: Signals, the push-pull based algorithm
#19Overall, 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.
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 subscribe to them, but that’s fixable by notifying all subscribers after the dirtying is done, which can’t cause glitches (unless the subscribers violate the rules of the game by triggering more signals).
So now I’m confused whether all the fiddly priority-queue needlepoint is actually needed for anything but the ability to avoid recomputation when an intermediate node decides it doesn’t want to change its output despite a change in one of its inputs. I remember the priority queue being one of the biggest performance killers in Sodium, so that can’t be it, right?..
I’m also confused about whether push-pull as TFA understands it has much to do with Conal Elliott’s definition. I don’t think it does? I feel like I need to reread the paper again.
Also also, some mention of weak references would probably be warranted.