4 ms·
I think the main reason it's in C++ is because of its async executor, Seastar. There's a similar Rust project called Glommio but seems still very early.
by zinclozenge 5y ago
I think the main reason it's in C++ is because of its async executor, Seastar. There's a similar Rust project called Glommio but seems still very early.
- throwaway81523 5y agoSeastar is sort of a C++-ification of node.js. Now that C++20 has coroutines, I wonder if those could have been used instead of all that chained method stuff.
- enedil 5y agoSeastar already uses coroutines, however coroutines without Seastar reactor (and all the utilities for IO) are useless by themselves. You still need a way to schedule what's being done when.
- throwaway81523 5y agoHmm ok I haven't looked at Seastar in a while, but it used to depend on Node-like control inversion where you'd pass an explicit lambda to each action, telling the action what to do next. That meant unwinding the handler for a given event into a bunch of nested lambdas. Coroutine would let you write them in a more traditional sequential style, where you'd have a return to the scheduler whenever something could block. Yes you have to write a layer of async io under everything, but that's how any OS works, more or less.
- biggestdummy 5y agoGlommio was created by Glauber Costa, one of the early contributors to Seastar (and Scylla). The resemblance between the two is not coincidence. https://glaubercosta-11125.medium.com/c-vs-rust-an-async-thread-per-core-story-28c4b43c410c https://glaubercosta-11125.medium.com/c-vs-rust-an-async-thr...