3 ms·
Recently tried writing some async Rust to compare the error handling when nested async calls are made to how errors are handled in Go, and it seemed like the tr
by badrequest 3y ago
Recently tried writing some async Rust to compare the error handling when nested async calls are made to how errors are handled in Go, and it seemed like the trivial example I was trying to write up simply couldn't be done without involving Tokio. That barrier simply doesn't exist in Go, or C#, or Typescript.
For instance, you apparently cannot `await` in the main function without a decorator you import from, you guessed it: Tokio.
- lmm 3y agoYou need an async runtime to run async code yes, and Rust's isn't built in. Why does that matter though? Rust has a decent package manager; add the dependency and move on.
- cchance 3y agoWhy are you trying to avoid Tokio lol, tokio is the defacto async runtime in rust, saying you're trying to avoid it is like saying you're trying to avoid async while writing async, somehow people act like if they merged tokio into std and instead of #[tokio::main] or whatever you had to do #[async::main] it would somehow be better. Once you stop fighting the fact that tokio = async rust for 99% of cases, things are quite smooth.
- galangalalgol 3y agoTokio simply doesn't meet the ise case of some people doing wasm, and many people doing embedded. That isn't a huge deal, just don't use it right? Except many otherwise usable crates seem to adopt tokio unnecessarily.
- cmrdporcupine 3y agoYour "lol" is entirely inappropriate.
- yencabulator 3y agoIf Tokio was the final answer, https://github.com/tokio-rs/tokio-uring/ https://github.com/tokio-rs/tokio-uring/ wouldn't exist.