FSMs are trivial in languages with tail-call optimization (Lisp et. al., ML, Haskell .. even
Lua!). It is true, though, that most of these languages are not geared towards low-level bit
manipulation.
C--, perhaps. It's a C-like language used by the Haskell team as their intermediate language,
a sort of souped-up assembler.
Posted Mar 29, 2008 12:39 UTC (Sat) by man_ls (subscriber, #15091)
[Link]
Oops, you are right: FSMs are indeed easier to implement in those languages. My big mouth again.
They are still pretty hard to follow and understand. Which is of course the concern of the author of gold. But maybe even this can be alleviated with functional programming; on the 7th Antual ICFP Programming Contest functional languages were shown to be an order of magnitude better at writing input for FSMs than imperative languages. I'm not so sure any longer.
So thanks for the clarification, and please disregard my earlier uninformed comment about a red herring.