[nanomsg] State-machine diagrams

  • From: Peter Kümmel <syntheticpp@xxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sun, 10 Nov 2013 21:59:18 +0100

Hi,

I'm really fascinated about the generated state diagrams seen here.

(I'm not only fascinated about the diagrams, but ATM I only wanna
write about the state machine stuff. ;) )

Since years I'm looking for a way how to make state-machines more
comfortable and less error-prone for coding.

There are several code generators (last one I discovered was libero),
libraries from Boost, Qt, QP, and I'm sure docent others.

QP looks technically very interesting but it uses Halloween slogan
"trick or treat" translated for software developers: "Dollars or GPL".

With boost you have the known include massacre, and Qt's state-machine seems
only usable for double-click frequencies (ok, is a bit faster ;) ).

Another very interesting approach takes mbeddr.com: a cut-down C version,
modeled as DSL, with a projective editor, implemented as plugin for Jetbrain's
MPL IDE. But the most interesting part is, that it is possible to formally
check for correctness:
http://wiki.ifs.hsr.ch/SemProgAnTr/files/Model_Checking_for_State_Machines_with_mbeddr_and_NuSMV.pdf
But it's an all-or-nothing decision, you can't use it just as a lib.
And you get to much in touch with Java.

So I'm currently use switch/case again, at least for small charts.


And now I've seen this python script which extracts the logic from the code
and generates these nice graphs, and I think that maybe this is the way to go:
just use switch/case with help of a small lib and a naming convention, and when
you get lost in your deeply nested switch/case code use a tool which draws you 
a map.

And it should also be possible to extract a definition which could be checked 
by NuSMV.

Does anybody knows if such a tool/framework already exists (I don't mean such
"we save your life" commercial "enterprise" tools)?

If not, it is really worth to think about to start a new open-source project.

Many thanks,
Peter




Other related posts: