News for hackers. Stuff that matters.
Re:C++ Coroutines Do Not Spark Joy by adrian_b on Friday April 05, 2024 @04:21AM (#39939931)
> Weird that the yield statement is conflated with coroutines instead of iterators/generators.

The concept of coroutines (Melvin E. Conway in 1963; who was also the source of FORK/JOIN) predates by a decade that of iterators/generators (which come from Alphard and CLU).

The term "yield" had already been used for many years for coroutines before being used for iterators/generators.

Usually the use of "yield" is not ambiguous, because the context is clear.

Re:C++ Coroutines Do Not Spark Joy by gpderetta on Friday April 05, 2024 @09:59AM (#39942470)
To go full circle, before python had built-in async/await, it was emulated (in twisted applications for example) via yield.