Very nice! Anything that allows something more sophisticated than switch:case in embedded systems are welcome! Also, state machines are way too often overlooked as a proper model for embedded systems architecture. My guess is that proper implementation may become hard (specially if you want to nest them), and there are lots of hardware engineers doing firmware. In my case, when I want to use a state machine for a pro…
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 st…
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).