Thursday, November 17, 2011

State machines in Perl

I just did a quick CPAN search and turned up a number of interesting packages:
  • FSA::Rules is the package I initially started building a wrapper for. It's actually pretty nice, and has a couple of constructs that my last post probably is missing.
  • Parse::FSM builds a parser based on an FSM constructed laboriously by function call.
  • State::ML provides a utility for converting XML-encoded state machines into other things or even code. I like the code generation aspect!
  • Win32::CtrlGUI::State is a slick little state-machine controller for Win32 GUIs.
  • Basset::Machine builds a state machine class in much the same way Term::Shell builds a command line shell.
All pretty cool aspects of the state-machine paradigm. If you really wanted to start getting into the semantic programming approach writ large, you'd think of ways to produce code generators for any of these starting from a Decl state machine description, and ways to organize that kind of code generator family into a semantic domain.

No comments:

Post a Comment