anyone who thinks statecharts are interesting shou...
# thinking-together
g
anyone who thinks statecharts are interesting should check out microstates.js:

https://youtu.be/zWEg4-bGot0

i
Oh cool. The tooling Josh and I are building for ourselves is based on a mixture of StateCharts, dataflow, and queries.
one of the main things missing from Eve was some sort of state machine-like abstraction
the language I designed based on everything we'd learned through Eve was dataflow with state machines embedded in it, but it turns out if you flip that the other way around you get something pretty neat
our early experiments seem very promising so far 🙂
❤️ 2
g
i stumbled into this after investigating something called “the sam architecture” which lacks enough specifics for me to feel like i’m understanding it—based on paxos (seems like unnecessarily to me)—but if you can grok it, might also be helpful as it separates mutations (transitions in state machines), messaging (events), model (guards and transactions), and views
might just be a more muddled version of what you’re working on, though
but state machines with dataflow embedded seems to line up with my very shaky understanding of it—any time state changes it might trigger another “action” (message)—which really seems like wrapping dataflow around FSMs to me. but i should maybe stay off slack after midnight
o
And SAM acrhitecture is strongly inspired by temporal logic of actions (TLA) from Leslie Lamport which is a theory background to reason about concurrent systems. It aims to proove algorithms correctness using a formalism which specify both actions and state with formulas. It is kind of state with transitions.
d
Copy code
// actions compute proposals
const proposal = {incrementBy: 1}

// the model accepts, partially accepts or rejects the proposals
model.accept(proposal)
    // compute the new state representation
    .then(state => representation(state))
    // share the state representation
    .then(render)
The corollary in the Object Network architecture is what I call "Functional Observer" - the state of an object is a function of its current state and the state of peer objects observed through links. So peer objects can "propose" changes but it's up to the target whether or not to change state. I call proposals "intentions": when there's an intention of an object on another - simply by virtue of its current state - it puts the system "in tension" (see what I did thar? 😄 ) and this tension only resolves when either the intention state is abandoned or the target does something to its own state to react to it. That is a robust model as there are no ephemeral "actions" or messages, just a global state where things are settled or waiting to settle, thus giving eventual consistency and emergent behaviour from local rules.