Re:Tokio 1.0 – async runtime for Rust
by sanxiyn on Wednesday December 23, 2020 @04:52PM
(#25522665)
Zig's "colorblind" async is very exciting for this reason: https://kristoff.it/blog/zig-colorblind-async-await/
[ Parent
| on HN ]
Re:Tokio 1.0 – async runtime for Rust
by haberman on Wednesday December 23, 2020 @05:02PM
(#25522781)
I'm skimming your link trying to understand the design. It sounds like there is a global flag for whether the whole program is in evented or blocking mode?
> during compile-time, it’s possible to inspect if the overall program is in evented mode or not, and properly designed code might decide to move to a threaded model when in blocking mode, for example.
Re:Tokio 1.0 – async runtime for Rust
by sanxiyn on Wednesday December 23, 2020 @05:16PM
(#25522905)
Yes, it's a top level application decision, not a library decision. In fact, this is exactly how allocation and unwinding is handled in Rust.
Re:Tokio 1.0 – async runtime for Rust
by zozbot234 on Thursday December 24, 2020 @10:09AM
(#25528079)
So, it's like the choice of a Tokio executor? That's a top-level default, too.
Sounds like a horribly complex special case. I'd far rather just have higher-kinded types and be able to write sometimes-async code using normal polymorphism (like I do in Scala all the time).