Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I second the use of statemachine for embedded systems.

They’re particularly ideal for embedded systems. The limited ram in many embedded systems makes a full dynamic language difficult to fit but a state chart interpreter can be very minimal while production runs can be compiled directly to code. Memory management in state charts can often be much easier to handle.

There’s also a lot of benefit to describing valid states for your system both in terms of correctness and the ability of algorithmically finding an optimal reduced state machine.

Personally I am fond of SCXML as it’s fairly concise, can include code snippets, and has a relatively well documented standard easy to display by converting to Vue/React/WebComponents. XMI with its connection to UML didn’t seem appealing to me, but this project seems pretty robust!



And anyone interested in SCXML, there’s a similar project https://github.com/tklab-tud/uscxml


> They’re particularly ideal for embedded systems.

While I agree, I think this promotes the idea that they're only good for embedded systems, especially small ones. State machines are not always the right tool for the job... only most of the time :)

State machines(or DFAs for you CS guys) are used all over. For instance, AFAIK, grep is generally implemented with a state-machine, albeit one which is dynamically constructed at run-time(which is a pretty cool concept if you ask me).


True! Statecharts are handy in lots of domains. Embedded happens to be a prime target due to the memory constraints combined with often limited behavioral requirements.

IMHO, most websites / UI's implement half of a poorly understood state machine (to roughly paraphrase the Common Lisp quip). Qt apparently also has an interesting statechart engine as well: http://blog.qt.io/blog/2017/01/23/qt-scxml-state-chart-suppo...




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: