Find Related products on Amazon

Shop on Amazon

Philosophy of Coroutines (2023)

Published on: 2025-05-26 17:23:35

Philosophy of coroutines [Simon Tatham, initial version 2023-09-01, last updated 2025-03-25] [Coroutines trilogy: C preprocessor | C++20 native | general philosophy ] Introduction I’ve been a huge fan of coroutines since the mid-1990s. I encountered the idea as a student, when I first read The Art of Computer Programming . I’d been programming already for most of my childhood, and I was completely blown away by the idea, which was entirely new to me. In fact, it’s probably not an exaggeration to say that in the whole of TAOCP that was the single thing that changed my life the most. Within a few months of encountering the idea for the first time, I found myself wanting to use it in real code, during a vacation job at a (now defunct) tech company. Sadly I was coding in C at the time, which didn’t support coroutines. But I didn’t let that stop me: I came up with a C preprocessor trick that worked well enough to fake them, and did it anyway. The trick I came up with has limitations, ... Read full article.