Eli Bendersky personal blog
Co-routines as an alternative to state machines (2009)
When you have to traverse some sort of a nested data structure (say, a binary tree), one approach is to create a stack that remembers where in the tree you are. Another, much more elegant approach, is to write the function recursively. A recursive function employs the machine stack used to implicitly implement…
- Points
- 131
- HN comments
- 100
- Submissions
- 2
- Cited by
- 5 commenters
Software EngineeringSystems & Performance2014
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Apr 30, 2014 | Co-routines as an alternative to state machines (2009) by adamnemecek | 131 | 69 |
| Aug 29, 2009 | Co-routines as an alternative to state machines by gthank | 73 | 31 |
Cited in comments
Linked from 7 Hacker News comments by 5 different people, from Oct 2010 to Jun 2025.
Most recent:
- zackmorris · Jun 9, 2025
- mrtracy · Feb 22, 2023
- eliben · Dec 18, 2018
- zackmorris · Oct 18, 2013
- chubot · Feb 10, 2013
- krosaen · Jan 8, 2011