Live data from Hacker News

Designing state machines

drivy.engineering

1–10 of 58 posts

Re: Designing state machines

#3
In regard to tip 4, I've been using statesman[1] which allows you to store the transitions as table backed active record objects along with any contextual metadata.

Depending on how much auditability you need on why transitions happened, this may be preferable to papertrail.

[1] https://github.com/gocardless/statesman

Re: Designing state machines

#4
post #2

There is good tool for making diagrams (so state machines as well) called mermaid[1], just by writing simple readable text. [1] https://github.com/knsv/mermaid

I wanted to like Mermaid, then I realized it was just a neutered version of GraphViz. I had wanted to write a Mermaid-to-Graphviz compiler but never got around to it.

It produces pretty ugly graphs that can't be exported to any other format. Meanwhile just about ever graph manipulation program (e.g. Gephi) can handle GraphViz DOT format.

Re: Designing state machines

#7
I can't recommend Akka's state machines enough. It's an incredibly simple and rock solid state machines built right into the library. (http://doc.akka.io/docs/akka/snapshot/scala/fsm.html) We're already on a Play/Scala backend so adding these was incredibly easy for us, but I think they're one of the hidden amazing features of the akka/scala world.

Re: Designing state machines

#8

I can't recommend Akka's state machines enough. It's an incredibly simple and rock solid state machines built right into the library. ( http://doc.akka.io/docs/akka/snapshot/scala/fsm.html ) We're already on a Play/Scala backend so adding these was incredibly easy for us, but I think they're one of the hidden amazing features of the akka/scala world.

I just looked through and I may have missed it but do you know if this does distributed FSM management?

Re: Designing state machines

#9
yes,and now skip all the bs and grab yourself a real tool http://twysf.users.sourceforge.net/#A6 with a real manual http://twysf.users.sourceforge.net/ccide_man.shtml .combine this with m4 and generate efficient working code for luajit and c.and as a bonus you learn m4,a macro processor that can take output from cli programs and insert it inside your source code.much more pragmatic than lisp

Re: Designing state machines

#10
post #4
post #2

There is good tool for making diagrams (so state machines as well) called mermaid[1], just by writing simple readable text. [1] https://github.com/knsv/mermaid

I wanted to like Mermaid, then I realized it was just a neutered version of GraphViz. I had wanted to write a Mermaid-to-Graphviz compiler but never got around to it. It produces pretty ugly graphs that can't be exported to any other format. Meanwhile just about ever graph manipulation program (e.g. Gephi) can handle GraphViz DOT format.

I didn't know GraphViz. I have to try it. DOT language looks very similar to Mermaid.

It was too hard to make that compiler or you have encountered another problem?

Post reply on HN