5 ms·
Does it have coroutines? Python has had them since 2.5 (2005) and Golang has obviously had them since the beginning. When will C++ finally catch up?
by ericfrederich 9y ago
Does it have coroutines? Python has had them since 2.5 (2005) and Golang has obviously had them since the beginning.
When will C++ finally catch up?
- Sharlin 9y agoCatch up? Everyone has their favorite feature; I could ask you when Python is going to catch up with C++ on static typing, or when Go is going to catch up with C++ on generics. Anyway, Go goroutines and Python generators are very different beasts. Because the term "coroutine" can refer to very different things, implementing any single interpretation of the term would likely leave proponents of other interpretations disappointed. Coroutine support for C++ has been in progress for several years now, and some fundamental design questions have been quite controversial. However, there's now a Technical Specification out [0] and, if all goes well, it should be on track for inclusion in the C++20 standard. [0] http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/n4680.pdf http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/n4680.pd...
- adgasf 9y agoThis is a strange comment. Co-routines in C++ will be very different to co-routines in a VM language.
- pjmlp 9y agoActually co-routines in Kotlin and Scheme are quite similar to C++ idea.
- deleted 9y ago[deleted]
- pjmlp 9y agoWhen will Python finally get rid of the GIL and offer AOT compilation to native code?
- martincmartin 9y agoThere are already coroutine libraries for C++. I've used folly's Fibers with great success. https://github.com/facebook/folly/tree/master/folly/fibers https://github.com/facebook/folly/tree/master/folly/fibers
- ska 9y agoYou do realize that holding up Python as an example of modernity based on only taking about 15 years to implement an idea from the 1950s is a bit odd, right? For that matter whole game is more than a little silly.
- lallysingh 9y agoThis: http://open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4680.pdf http://open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4680.pd... is supported in LLVM 5's clang.
- nly 9y agoBoost has 3 different coroutine libraries (Boost.Coroutine, Boost.Coroutine2 and Boost.Fiber). Boost.Fiber has Go-like channels[0] for example, and Boost.Coro has facilities for using coroutines like generators (by using Boost.Range) [0] http://www.boost.org/doc/libs/1_65_1/libs/fiber/doc/html/fiber/synchronization/channels/buffered_channel.html http://www.boost.org/doc/libs/1_65_1/libs/fiber/doc/html/fib...