HN Hall of Fame Weekly email

Coroutines in C (Simon Tatham, 2000)

www.chiark.greenend.org.uk Books & learning Tutorials & guides Software engineering Class of 2024-02 Hall of Fame
Screenshot of www.chiark.greenend.org.uk captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 12 calendar years, with breakout response in 2 of them.

submissions
18
submitters
16
observed span
2009–2024
peak thread · 93 comments
307 pts
latest 20+ return · 2024-02-25
307 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

I've found myself at this webpage multiple times while trying to minimize the complexity of APIs in my C projects. I think it does a lovely job explaining control flow and it has helped me to think more explicitly about storage of state on and off the stack as well as the readability consequences of different approaches. My conclusion for now is that the choice to use C coroutines is best left to the library user. For example: Mongoose (https://github.com/cesanta/mongoose)…

A really good library that we use is libco[0], it supports different architectures and mechanisms. We use it extensively on Fluent Bit[1] to manage async IO network operations (epoll + coroutines). - [0] https://byuu.org/library/libco/ - [1] https://fluentbit.io

This is very nice in theory, but in practice you can only do it in assembly language, because no commonly used high level language supports the coroutine call primitive. This might have been true when the article was written, but things are slightly different today. JavaScript, Python, and C# have picked up generator primitives that can be abused to provide limited coroutine support. Lua, with actual coroutine support, is gaining in popularity. And it will be interesting to see what…

jcl·58-point thread·

It is a little unfortunate that one of the few (or only) underlying abstraction of the machine that C chose to leave out was that of coroutines. I find this rather ironic because I have been told that PDPs, the virtual machine model that C is based on, had instruction level support for exchanging control very efficiently. I have also heard that VMs like LLVM aren't that good at portably exposing efficient exchange of control between stack frames (please correct…

srean·47-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
765

reference only — not used in Hall rules or ranking

Total comments
229

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2009-08-30Co-routines in Cscharan71
2009-09-21Coroutines in CRexxar4016
2010-05-26Coroutines in C (Simon Tatham, 2000)gjm115816
2012-11-05Breaking coding standards with coroutines in Cneur0mancer40
2013-08-20Coroutines in C (2000)gmac11
2014-11-16Coroutines in C (2000)jeffreyrogers4727
2015-08-22Coroutines in C (2000)Keyframe50
2016-02-07Coroutines in C (2000)adamnemecek4311
2016-11-02Coroutines in Cvalarauca150
2016-12-09Coroutines in Cingve21
2017-02-03Coroutines in Cingve30
2017-11-02Coroutines in C (2000)sidedishes40
2019-02-07Coroutines in C (2000)First breakoutwooby18159
2020-05-24Coroutines in CColinWright281
2023-07-08Coroutines in C (2000)Paul-Craft102
2023-07-14Coroutines in C (2000)swatson74190
2023-09-02Coroutines in C (2000)gone35111
2024-02-25Coroutines in C (2000)Hall induction · Best thread · Latest 20+ point returnColinWright30793