menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Statecharts

The Statecharts community on Spectrum is (along with spectrum) MOVING TO OTHER PLATFORMS: For statecharts discussions in general go to Statecharts Discussion on GitHub (link) or Gitter (link). For XState-specific questions, go to the XState discussion forum for Q&A or the Stately discord chat to chat.

Channels
Team

Hola amigxs!

December 11, 2020 at 5:15am
My name is Vic. I'm a musician/developer from Mexico based in Tokyo. I have experience with projects in backend and frontend.
Recently became very interested in XState and statecharts in general, but it's taking a while to make the connections when applied to UI. Especially communicating across machines.
Let me know if you're in Tokyo, I'll take you for a coffee/ramen (virus precautions considered)!

December 11, 2020 at 7:52am
Welcome here! Yes, Statecharts for sure bring a lot of interesting perspectives!
but it's taking a while to make the connections when applied to UI.
I don't know what you need so I just tell what I used other than the obvious great stuff at https://statecharts.github.io/ and many great presentations over at youtube, by (davidkpiano) and others :-)
I studied parts of the Horrocks book. I think the best material besides Harel's original paper is the book "Horrocks, Ian. Constructing the user interface with Statecharts. Addison-Wesley Longman Publishing Co., Inc., 1999." I've read relevant parts of it, and It was insightful and helpful. (It's not about JavaScript or the web or a front-end framework, but the principles of Statechart UI construction and its relation to interactions design is are very well described). Just skip or skim the irrelvant parts. The book is out of print, but I'll send you a good pdf if you're interested, that will spare you the trouble of visiting suspect pdf aggregating sites :-).
For leveling up your intuition for Statecharts, use this web course with videos featuring Harel himself(!). It's super accessible.
I can't contribute to the question about "communicating across machines" but there is a lot of knowledge among the forum members! Personally, In stead of going with agents for combining machines, I have chosen an alternative path, namely to use machines that do not use extended state ("context" in XState) since it's baked into the control state fringes. Then the magic starts and the machines get highly composable. In principle, I think you (could and should!) define the total dynamic i.e. the total essential state, of a web site/app in one hive-mind machine, composed of sub-machines, and the DOM rendering would be combined in a corresponding way. Agents are still relevant when there is a externally dictated need for asynchronous communication, it's not forced by composability limitations of the machine formalism. It's highly experimental work, so I don't know how it will work out, but it sure is exiting and rewarding working with state machines! While I hope that my approach with composable State machines will be relevant some day, It's highly experimental work for the time being. I'm working on a library called Omb that implements those composable Statecharts, so far I've got half a prof-of-concept implementation it's halfway implemented. This unpublished draft over at dev.to should give an idea of how composition of context-free Statecharts might be done. It's best to just glance at the code, and ignore the rest of the text; the text just me trying to figure out how it all connects, all new and exiting but for damned sure not obvious!! :-)
Keep spreading the Statechart love! :-)
PS I for sure will take you up on the offer of coffee in Tokyo when we visit next time, though I might opt for green tea or matcha :-) My wife's relatives live in the area :-)
Edited
like-fill
1

December 11, 2020 at 3:22pm
What an interesting welcome! Good to meet you Henning.
I've read the Harel paper, and was looking for more stuff to look into, so I will for sure check those resources out. Thanks for that!
And for sure man, send a message when you're in town. :)
Edited