4 Aug 21:35
FSM Review Announcement
From: Martin Vuille <martin <at> jpmvrealtime.com>
Subject: FSM Review Announcement
Newsgroups: gmane.comp.lib.boost.announce
Date: 2008-08-04 19:36:42 GMT
Subject: FSM Review Announcement
Newsgroups: gmane.comp.lib.boost.announce
Date: 2008-08-04 19:36:42 GMT
The formal review for Andrey Semashev's Finite State Machines (FSM) library is scheduled for August 11th to 20th. Quoting from the documentation: "The main goals of the library are: * Simplicity. It should be very simple to create state machine using this library. * Performance. The state machine infrastructure should not be very time and memory-consuming in order to be applicable in more use cases. * Extensibility. A developer may want to add more states to the existing state machine, and this addition should be relatively safe since it shouldn't interfere with the existing states. The developer should also be able to specify additional transitions and events for the machine with minimum modifications to the existing code." "The following compilers are known to have problems or most likely will have ones: * Microsoft Visual C++ 6.0 and 7.0. Most probably will fail to compile due to lack of partial template specialization support. * Borland C++ Builder 5.5.1 (free version). Fails to compile due to lack of partial template specialization and in-class using declarations support. Some other minor problems also have been noticed. Newer versions of the compiler have not been tested. * OpenWatcom 1.5. Fails to compile due to problems with Boost.MPL code. Newer versions of the compiler have not been tested.(Continue reading)
Nested states would be nice. I looked through the "C++ Template
Metaprogramming" book as another reference when developing our internal
implementation. I didn't get too fancy in our own but some protocol's like
FIX for instance has many, many dark corners. I would see nested states as
simply a further restriction on the matching of the from state. This could
provide further optimizations as a well designed transition table could
reduce the set of states to match against. However, I'm not quite sure how
that plays out in a design with the enter/exit state handlers, transition
handlers, et al.
The finite state machine I came up with for the FIX protocol was well over 50
transitions. I implemented ours so that the from state could be boost::any
which acts acts like '.' in regexps and I suppose means our implementation
should be renamed kmt::nfsm. It was a zero-cost implentation as it simply
adds one last transition to each from state's action linked-list.I was able
to get the transition list down to 22 with that one feature. Mostly all the
different error conditions that you want to handle gracefully in a text
protocol originally designed in the 1980's and still used by finance