Hacker News new | ask | show | jobs
by rgovostes 1929 days ago
Tangentially related, I've been thinking about how it is somewhat difficult to describe state machines in regular textual code, and it would be nice to have a drag-and-drop visual interface for mapping out the states and transitions, then tie regular code to the transition events.

Is there anything like that out there? Or a good open source diagramming library that might lend itself to prototyping this?

3 comments

You might be interested in XState[0] and its visualizer[1]. It is not drag and drop, but it does provide a nice visualization that can help debug state logic. I imagine it’s possible to extend it to support visual manipulation and code generation.

Project is JS/TS-specific, however.

[0] https://github.com/davidkpiano/xstate

[1] https://xstate.js.org/viz/?gist=bbcb4379b36edea0458f597e5eec...

Thanks for sharing!

> It is not drag and drop

> I imagine it’s possible to extend it to support visual manipulation and code generation

It will be soon ;-)

QtCreator has a SCXML based visual editor for state charts https://doc.qt.io/qtcreator/creator-scxml.html
Thank you! This looks very much like it would fit my needs, and I love that the output is an XML file I can integrate with other tools.
Yakindu comes to mind as one (if you aren't allergic to eclipse :-) )

https://www.itemis.com/en/yakindu/state-machine/