3 ms·
> Just compare how awful it is in other languages to start an async routine and read it's results when it is complete Excuse me, what? “Starting an async rout
by littlestymaar 3y ago
> Just compare how awful it is in other languages to start an async routine and read it's results when it is complete
Excuse me, what?
“Starting an async routine and getting the result” in langages with async/await is just:
// in JavaScript
let result = await doSomething();
// or in Rust:
let result = do_something().await;
Please tell me how spawning a goroutine + a channel[1] is more convenient than this. Now start adding a timeout and a cancellation to you goroutine code and see how messy it gets, where it comes for free in Rust.
[1] a necessarily bounded one, because Commander Pike said “f*ck you”.