Hacker News new | ask | show | jobs
by lsllc 4288 days ago
I prefer to use Ragel as a DSL for FSMs, it'll generate Go code along with other languages. Adrian Thurston has done a fantastic job with Ragel.

Zed Shaw wrote a great essay about state charts in Ragel:

http://www.zedshaw.com/essays/ragel_state_charts.html

The official docs:

http://www.complang.org/ragel/ragel-guide-6.8.pdf

1 comments

That looks really cool, awesome to be able to generate static FSM code. I use my FSM (and started to use Jake Gordon's) when I need a lightweight state variable, a step up from a collection of bools when it starts to get messy with lots of ands and ors.