| Glad to see statecharts still getting attention! I created XState, a JS/TS library for authoring, executing, and visualizing state machines/statecharts: https://github.com/statelyai/xstate I've been working on it for 10+ years. The main thing I've learned is that statecharts are most valuable when they're treated as executable behavior, not just documentation. That doesn't mean you need to use them everywhere or model everything with them. They're most useful when you have behavior where the answer to "what happens next?" depends on both the current state & the event. A statechart can act as an oracle for questions like: "Given I'm in this state, when this event happens, what is the next state, and what effects should run?" I'm close to releasing an alpha of the next major version of XState, focused on better ergonomics, type safety, and composability, as well as a new visualizer/editor. There's also an open-source basic statechart visualizer here: https://sketch.stately.ai For the formal/spec side, SCXML is worth reading: https://www.w3.org/TR/scxml Also worth reading the original paper by David Harel: https://www.weizmann.ac.il/math/harel/sites/math.harel/files... |
This was a talk I gave at Laracon that was my stab at distilling my thinking about State Machines, State Charts etc.
https://www.youtube.com/watch?v=1A1xFtlDyzU