This flips that, so nodes are data, which accept functions from events, it applies that function to itself, then decides to propagate that event onwards or not.
I like it! That model works really well for this sort of visual programming demoed in the infinite canvas stuff.
> It's not dataflow! It's closely related, but it's not.
Basically, the "scopes" become constraints, and they use a hierarchical constraint solver to propagate state changes to the GUI elements, real-time, using a declarative dataflow programming model.
the Scoped Propagator model is based on two key insights:
1. by representing computation as mappings between nodes along edges, you do not need to know at design-time what node types exist.
2. by scoping the propagation to events, you can augment nodes with interactive behaviour suitable for the environment in which SPs have been embedded.
It's pretty specific to UI similar to the examples, but in terms of these big infinite canvas UIs, you have a whole bunch of objects you need to make dependant on each other, but who ALSO hold their current state statically. Subtly different from a spreadsheet, where Excel for example treats functions (=$A$2) differently from a single value (4). Functions are always derived, where as single values don't rely on anything.Like a sticky note on a canvas, should always be available to type into. But maybe we also want something else to change it's value when it changes. (key insights #2, this is for infinite canvases)
Rather than building some big god-object that stores all "root" state for the static value of things, and transforming that thru a big tree of functions you need to keep maintained, you could reverse it:
Each node only knows it's own state, but it's peers give it instructions about how to update itself to meet their business rules, for just that pairing.
The result is the same, it's a big web of functions, but now you don't have to make the distinction between "derived" state or "base" state. It's always static state, and things are just updated adhoc by these events that describe the changes without explaining "why" the "to" node has to apply them. (key insights #1, you do not need to know at design-time what node types exist.)
Compared to FRP it is perhaps a bit more declarative in the definition of scopes, but otherwise seems equivalent. I'm interested in more details on this. I'm also a bit confused by
> This model has not yet been formalised, and while the propagators themselves can be simply expressed as a function ... I have not yet found an appropriate way to express scopes and the relationship between the two.
This seems straightforward to me (e.g. a scope could be a set of types, where each distinct event has a distinct type) so I think I'm missing something here.
I encourage people to read the original Propagator Networks paper by Alexey Radul (advisor: Prof. Gerald Sussman of SICP) referenced in the Prior Work section. It's full of fascinating ideas.
bridging.mov and examples.mp4 are working as they are H.264/AVC, the other videos are H.265/HEVC
All the videos play in Safari. I have not tried Chrome.
I absolutely love Alexey Radul's dissertation. So interesting to see this article show up on the HN front page after I just published my own experiment with propagators yesterday: https://dthompson.us/posts/functional-reactive-user-interfac...
I need to learn more about the design decisions behind scoped propagators and why they deviate from "regular" propagators.
FRP systems are typically limited to acyclic graphs. The system in this article allows for cycles.
A game of cat and mouse: https://x.com/blixt/status/1797384954172625302
An analog clock: https://x.com/blixt/status/1798393279194824952
I think tools like these, with better UX and more guard rails for the code, can really help people understand logic and systems in a much more visually intuitive way. In some aspects, these propagators work similar to Excel, which I think a lot of people already have some intuition for.
For example tick(g, g') = time(g') - time(g), and change(g, g') = if node_s(g') ≠ node_s(g) then () else None where node_s(g) gets the source node of the change scope from global state g.
In practice the outputs of a scope can be computed once per state change and called an event, rather than computed on demand each time it's used, and scopes which return None don't need to be propagated. Also, I suspect it would be useful to restrict scopes to (A × B)² → None + T or even just A² → None + T, so that events are limited to propagating along chains of edges.
One of the first thing that comes to mind was is about Smalltalk, and the idea that it is about the messages and not the objects.
The next thing to come in mind is about how this allows for composition of interactions. I think it can enable highly local customization that can still receive software updates from upstream. I am thinking about how one of the problems with extensible specifications (such as XMPP) eventually lead to an ecosystem where feature updates cannot propogate easily; and we might see something like that in the Fediverse
In some sense, we can see the input of an LLM as a node, the LLM itself as a function describing the edge of the graph, and the output of the LLM as a new node.
Could be a meaningful bridge between “nocode” and code, avoiding what seems like a common pain point of eventual nocode limitations. I know there are other solutions in this space, but yours is very nicely done.
Please continue work on this, and yell out if you need collaborators.