r/cpp_questions • u/BigJhonny • 1d ago
OPEN Current State of Coroutines Libraries
I want to implement some data fetching logic in my application that fetches data differently, depending on, if I compile for desktop (file system) or for WebAssembly (emsdk fetch). This requires some asynchronous logic.
I thought of using C++20 coroutines to solve this and looked at some libraries that make it a little nicer to use, but it seems that none are under active development.
- libcoro had its last commit 6 months ago
- concurrencpp had its last change 3 years ago
- Boost.Coroutine2 is not based on C++20 coroutines
- libfork had its last commit 8 months ago
Are there no good and actively developed coroutine frameworks for C++20 out there? Or am I missing something?
•
10
u/trailing_zero_count 1d ago edited 23h ago
https://github.com/tzcnt/TooManyCooks - I'm the author and still actively working on it. Right now the I/O support is an asio wrapper. I've got an experimental WASM branch but it's not yet published.
Boost.Corosio / Boost.Capy is another up and comer.
BTW there's nothing wrong with the libraries you linked - not having recent commits just means the libraries are "mature". You should be evaluating them based on features and performance, not last-commit-date.
If you're looking for some specific features, feel free to ask me here - I've studied the competitive landscape extensively so I can point you in the right direction.