<story><title>C++ Coroutines Do Not Spark Joy</title><url>https://probablydance.com/2021/10/31/c-coroutines-do-not-spark-joy/</url></story><parent_chain><item><author>gpderetta</author><text>There were three competing coroutines designs in front of the standard committee: stackful coroutines, from boost; C#-like stackless coroutines from MS; and zero-overhead stackless coroutines initially from chriskohlhoff (but then picked up by many others).&lt;p&gt;After a &lt;i&gt;lot&lt;/i&gt; of back and forward, the committee decided to pick the most proposal (i.e. the MS one) with the most complete implementation and potentially less ambitious. These are both good good features, but we ended up with a very complex, hard to use, design that requires unspecified compiler magic to remove all overhead.&lt;p&gt;Interestingly enough the committee went in the opposite direction for networking recently rejection the battle tested ASIO, again from chriskohlhoff, for a yet unproven design initially from Facebook, now Nvidia.&lt;p&gt;edit: personally I&amp;#x27;m a huge fan of stackfull coroutines, but I could have lived with zero overhead stackless coroutines. The current design is IMHO the worst solution. Then again, sometimes it is better to ship something than argue forever.</text></item></parent_chain><comment><author>ot</author><text>I&amp;#x27;ve been on the fence for a while about coroutines, but I have to say that libraries like folly coro do a very good job at hiding all the complexity (the library itself though is somewhat impenetrable).&lt;p&gt;Facebook is very invested in coroutines, all major internal libraries at this point have a coroutine interface (in particular Thrift auto-generates coro client interfaces), and they have enjoyed wide adoption, way beyond the small cabal of C++ gurus.&lt;p&gt;Personally what sold me is cancellation handling. It really is magical.&lt;p&gt;Are your concerns about frame allocation? Is this something that the nanosecond-latency crowd particularly cares about? :)</text></comment>
<story><title>C++ Coroutines Do Not Spark Joy</title><url>https://probablydance.com/2021/10/31/c-coroutines-do-not-spark-joy/</url></story><parent_chain><item><author>gpderetta</author><text>There were three competing coroutines designs in front of the standard committee: stackful coroutines, from boost; C#-like stackless coroutines from MS; and zero-overhead stackless coroutines initially from chriskohlhoff (but then picked up by many others).&lt;p&gt;After a &lt;i&gt;lot&lt;/i&gt; of back and forward, the committee decided to pick the most proposal (i.e. the MS one) with the most complete implementation and potentially less ambitious. These are both good good features, but we ended up with a very complex, hard to use, design that requires unspecified compiler magic to remove all overhead.&lt;p&gt;Interestingly enough the committee went in the opposite direction for networking recently rejection the battle tested ASIO, again from chriskohlhoff, for a yet unproven design initially from Facebook, now Nvidia.&lt;p&gt;edit: personally I&amp;#x27;m a huge fan of stackfull coroutines, but I could have lived with zero overhead stackless coroutines. The current design is IMHO the worst solution. Then again, sometimes it is better to ship something than argue forever.</text></item></parent_chain><comment><author>Longhanks</author><text>Eric Niebler recently switched from Facebook to NVIDIA. I wonder if that has anything to do with it.</text></comment>