Coroutines in C

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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.
coderabbit.ai
featured
Nutrient - The #1 PDF SDK Library
Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.
nutrient.io
featured
  1. 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.

  2. 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.

    CodeRabbit logo
  3. libmobile

    An implementation of the Mobile Adapter GB protocol, to connect to custom game servers.

    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...

  4. Bunki

    A simple C coroutine library.

    I honestly like stackful coroutines if you don’t mind allocating memory for a stack.

    https://github.com/Keith-Cancel/Bunki

  5. rfcs

    RFCs for changes to Rust

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that C is
the 6th most popular programming language
based on number of references?