Live data from Hacker News

Show HN: µFSM – A state chart library for embedded applications

github.com

21–30 of 35 posts

Re: Show HN: µFSM – A state chart library for embedded applications

#21
post #9

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…

> 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).

Re: Show HN: µFSM – A state chart library for embedded applications

#23
I'm impressed by this and like it a lot.

If you don't mind a 'drive-by' feature request: it would be fantastic if you were to support the PlantUML state DSL:

http://plantuml.com/state-diagram

That would push me from "interesting proof of concept" to figuring out how to use it in projects.

Re: Show HN: µFSM – A state chart library for embedded applications

#24
post #4

A must read for anyone interested https://statecharts.github.io/ Also I highly recommend to check out `xstate` TypeScript library. It's a breeze to work with it.

Can't stress how great that resource truly is in understanding statecharts, which are state-machines but with lots of extra details that actually make them usable at scale in large projects.

Re: Show HN: µFSM – A state chart library for embedded applications

#26

Earlier quoted context omitted.

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…

> 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 constr…

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...

Re: Show HN: µFSM – A state chart library for embedded applications

#27
post #9

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…

Depending on the application, I'll use a Finite State Machine pattern, but if I need something more complex I'll use QM QP/C (which is uses a hierarchical state machine pattern).

So it's good to see others using Quantum Leaps RTOS. It take a little bit to set up the environment and understand some of the bounds, but I really enjoying using their QM Modeling tool[1], I would recommend it. I would mainly use it for the logic and abstract out the code in separate files, so that you are not maintaining code in the GUI tool.

[1] http://www.state-machine.com/products/#QM

Re: Show HN: µFSM – A state chart library for embedded applications

#28
post #22

Is there a programming language where FSM are a first class citizen?? And not just a library??

Yes. Erlang has http://erlang.org/doc/man/gen_statem.html

It is part of the Erlang's standard library. SSH and SSL state and connection management has been re-written recently to use this built-in module.

Here is a video of Raimo Niskanen, the author, describing the module:

https://www.youtube.com/watch?v=f_jl6MR3kXQ

The title is "The tool that you never knew that you always wanted", which was borrowed from another member of the community (Jesper L. Andersen)

Re: Show HN: µFSM – A state chart library for embedded applications

#29
post #4

A must read for anyone interested https://statecharts.github.io/ Also I highly recommend to check out `xstate` TypeScript library. It's a breeze to work with it.

Thanks so much for the praise (I created `xstate`)! I'm working hard on making it fully SCXML-compatible.

Re: Show HN: µFSM – A state chart library for embedded applications

#30
post #4

A must read for anyone interested https://statecharts.github.io/ Also I highly recommend to check out `xstate` TypeScript library. It's a breeze to work with it.

Thanks so much for the praise (I created `xstate`)! I'm working hard on making it fully SCXML-compatible.

Thank you for your work on it!
Post reply on HN