

-
Mongoose
Embedded TCP/IP network stack with embedded web server, Websocket, and MQTT client (by cesanta)
I've found myself at this webpage multiple times while trying to minimize the complexity of APIs in my C projects.
My conclusion for now is that C coroutines are something to be left to the implementer. For example: Mongoose (https://github.com/cesanta/mongoose) uses event callbacks to deal with asynchronousness. It is much more pleasant to wrap a library like this in whatever thread/task primitives your system has rather than try to integrate the mythical cross-platform c couroutine.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
The "switch" method isn't too uncommon, but usually people have an init function and "state" pointer that's passed into the coroutine function. I've used this method a lot in embedded projects, where one coroutine was handling motor acceleration/deceleration while the other would simply tell it what direction to go, but I've also used it for networked libraries[1].
You don't really need to introduce macro hell for it to be manageable, though I've never found reading switch/case flow to be very enjoyable.
[1]: https://github.com/REONTeam/libmobile/blob/master/relay.c#L3...
-
I honestly like stackful coroutines if you don’t mind allocating memory for a stack.
https://github.com/Keith-Cancel/Bunki
-