logoalt Hacker News

Signals, the push-pull based algorithm

67 pointsby mpweiherlast Saturday at 8:31 AM24 commentsview on HN

Comments

noelwelshtoday at 7:40 AM

Overall, 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.

show 3 replies
evikstoday at 9:37 AM

The visual examples are rather misleading:

The "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)

fabianholzertoday at 7:29 AM

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 reminder on how a dynamic medium can be more than the simulation of print on screens.

show 1 reply
tubstoday at 9:55 AM

Why create an array each time it iterates a Set rather than just iterating the Set?

show 2 replies
mockingloristoday at 9:40 AM

Beautiful presentation... @willybrauner, I would like to read your spin on a follow-up piece on `glitch-freedom`. But in all honesty, this journal entry/post is a work of art; a testament to your journey as a technologist!.

Cheers

show 1 reply
cloogshicertoday at 7:47 AM

What an amazing article. I really like the presentation of text scrolling together with the code. Wonder how this is done under the hood.

show 1 reply
cmacleod4today at 8:10 AM

Nice presentation, looks like the same thing I implemented in Tcl here: https://wiki.tcl-lang.org/page/ReacTcl :-)

rienbdjtoday at 8:08 AM

Sodium (and the book that goes with it) is a great resource too https://github.com/SodiumFRP/sodium

danieltanfh95today at 7:25 AM

How is error handling expected to happen here?

show 2 replies
Tade0today at 9:29 AM

Now 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.

Morpheus_Matrixtoday at 8:13 AM

[dead]