3 ms·
Asynchronous code is the bees knees Async/await is a horrible fit for Rust. > Some of this criticism is valid. async code is a little hard to wrap your head a
by worik 2y ago
Asynchronous code is the bees knees
Async/await is a horrible fit for Rust.
> Some of this criticism is valid. async code is a little hard to wrap your head around, but that’s true with many other concepts in Rust, like the borrow checker and the weekly blood sacrifices. Many popular async libraries are explicitly tied to heavyweight crates like tokio and futures, which aren’t good picks for many types of programs. There are also a lot of language features that need to be released for async to be used without an annoying amount of Boxing dynamic objects.
Yes. So don't do it
It is entirely possible to write asynchronous code without using asyc/await.
async/await is a fun paradigm for garbage collected systems. It is a horrible mess in Rust
- 0x1ceb00da 2y agoIt's the only real solution if you need tens of thousands of concurrent tasks. Real threads use too much memory.
- smw 2y agoOr you use something like goroutines or Elixir processes where green threads are preemptively scheduled.
- worik 2y agoThat is a false dichotomy. There are other options than async/await and threads. In my heart that is my main objection to async/await in Rust. It has "poisoned the well" for asynchronous programming. Where people think it is async/await or threads We have been doing asynchronous programming for many decades.