3 ms·
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 wrot
by lsllc 12y 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 http://www.zedshaw.com/essays/ragel_state_charts.html
The official docs:
http://www.complang.org/ragel/ragel-guide-6.8.pdf http://www.complang.org/ragel/ragel-guide-6.8.pdf
- maxpersson 12y agoThat 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.