Finite State Machines in Forth

No matter what your opinion of Forth, this is an enticing paper. J.V. Noble takes an interesting problem from rough implementation through an elegant solution which takes advantage of the compile-time features of Forth. There aren't many easily accessible papers that show how beautiful Forth can be, so this is worth taking some time to understand, especially if you've a fondness for stack-based languages.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Factor

I recently wrote a finite state machine in Factor, a language very similar to Forth (except it has dynamic typing, garbage collection and code-as-data to a further extent). It was for decoding UTF-8/16, and it turned out completely different. (I'll probably blog about it soon.) But even being relatively fluent in a stack-based language didn't make that paper very easy to read.