Apr 27, 2026 — 13 min — Systems Notes
State Machines in Go, Elixir, Swift, and Zig
Why a Go retry loop ran forever because the attempt counter lived on the loop instead of the state, and what the runtime guarantees of Elixir, Swift, and Zig change about which state-machine idioms are honest in each.
Outcome: Reader can pick the right state-machine idiom for their language by recognizing which runtime guarantees the language ships, distinguish a true finite-state machine from unidirectional data flow, and avoid the cross-language mistake of treating one language's idiom as the universal pattern.