# Finite State Machines in Forth: A 1994 Guide to Cleaner Code

Original title: Finite State Machines in Forth (1994)

> Hacker News story 49223964 · language: en · submitted 2026-08-08
> Web version: https://zeli.app/story/49223964
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 85 · by [ofalkaed](<https://news.ycombinator.com/user?id=ofalkaed>) · 💬 3
[original](<https://www.forth.org/literature/noble.html>) · [HN discussion](<https://news.ycombinator.com/item?id=49223964>)

## Summary

This 1994 note by J.V. Noble presents methods for building deterministic and nondeterministic finite state automata in Forth, emphasizing a one-to-one mapping between code and state tables. It critiques nested IF clauses for being slow and hard to maintain, and offers three implementations: a brute-force CASE approach, a more factored method, and an elegant table-driven technique using defining words. The note includes a detailed example for parsing fixed-point numbers.

## Key quote

> The 'best' method produces a one-to-one relation between the definition and the state table of the automaton.

---

## Cite

- Page: https://zeli.app/story/49223964
- Date: 2026-08-08
- Source: forth.org (https://www.forth.org/literature/noble.html)
- Hacker News: https://news.ycombinator.com/item?id=49223964

## Other languages

- zh: https://zeli.app/zh/story/49223964 · markdown: https://zeli.app/zh/story/49223964.md
- ja: https://zeli.app/ja/story/49223964 · markdown: https://zeli.app/ja/story/49223964.md
- ko: https://zeli.app/ko/story/49223964 · markdown: https://zeli.app/ko/story/49223964.md
- de: https://zeli.app/de/story/49223964 · markdown: https://zeli.app/de/story/49223964.md
- es: https://zeli.app/es/story/49223964 · markdown: https://zeli.app/es/story/49223964.md
