HN user

EricWF

16 karma
Posts0
Comments4
View on HN
No posts found.

The changes literally landed in the past three days; The implementation is theoretically perfect, but once it's (seriously) observed by users it will decay into bugs. That's just basic quantum CS. :-)

Libc++ coroutines are production ready!

But seriously, the library implementation for coroutines is just a shallow wrapper around compiler builtins.

Therefore libc++ is probably bug free, but Clang certainly isn't.

EDIT: "probably bug free" == famous last words.

If you understand the internals they're anything but pythonic. Coroutines can be a zero overhead abstraction in the some cases.

For example here is a test that verifies the optimized output for a simple (and misnamed) integer generator compiled at -O2. Notice the arguments to `print` are integer literals. (https://github.com/GorNishanov/clang/blob/Experiments/test/C...)

I'm no python expert, but I suspect C++ optimizes this code better.