Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
It is possible to compose them more easily than described in the article; Lewis Baker's cppcoro library for example provides a recursive_generator<> type[0] that allows this without using any macros. It's up to the library part of coroutines to make things easy, end users are not expected to write low-level coroutine code themselves.
I wonder about the allocation elision. Return value optimization became mandatory, and some compilers can already elide calls to new/delete and malloc()/free() in normal code, so perhaps it will be possible to guarantee allocation elision in the future in the most used cases.
[0]: https://github.com/lewissbaker/cppcoro#recursive_generatort
> D suffered from [...] indecision between GC and manual memory management.
It is still suffering from that. If you want to manage memory yourself you can't use some parts of the standard library + you can't use a lot of the community packages since they assume there is a GC present.
So far it looks like the best alternative is Zig, but sadly it doesn't have some of the higher-level language features such as function overloading or macros. Jai seems to have most D features and more without the GC [0] but Zig is more likely win popular mindshare since it already is in the open + comes with a C/C++ compiler which is pretty cool.
[0] https://github.com/Jai-Community/Jai-Community-Library/wiki
I think C++ coroutines is best understood not as something you'd use directly, but as plumbing that makes existing async libraries interoperable and easier to use.
For example, Facebook's Folly has been updated to use coroutines and is being widely adopted at FB:
https://github.com/facebook/folly/tree/main/folly/experiment...
A coworker added coroutines to KJ [1] so for our purposes it’s “made it”. It’ll be more broadly useful obviously with library support in the standard. I think that’s targeted for c++23
[1] https://github.com/capnproto/capnproto/blob/master/kjdoc/tou...
They don't need it,
"Unix system programming in OCaml"