Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note that C++ offers async as a library and not as a programming language feature which Bjarne Stroustrup is strongly against. He talk more about why in "The Design and Evolution of C++" but i don't have the material at hand. As far as i remember, his main argument was that there is no concurrency model to fit them all and thus it doesn't worth to add new syntax and semantics for a specific model except to make the PL more complex and harder to implement.


> Note that C++ offers async as a library and not as a programming language feature which Bjarne Stroustrup is strongly against.

https://www.modernescpp.com/index.php/c-20-coroutines-the-fi...


There's no executor in the standard library for asynchronous work, the C++20 coroutines implementation lets you plug in your own

Dummy event loop example:

https://gcc.godbolt.org/z/fo18xW


coroutines themselves have nothing todo with async/await.


I wonder what that co_await keyword is for then


No without compiler support you can't do async in a library. Rust also does async in library so to speak.


The main piece is stackless coroutines which definitely aren't a library.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: