logoalt Hacker News

smwtoday at 12:05 PM1 replyview on HN

Rust's async story is much less ergonomic than go's -- mostly because of lack of garbage collection. That might be a good reason by itself?


Replies

thomashabets2today at 1:17 PM

Does Go actually have an async story? I know that question risks starting a semantic debate, so let me be more specific.

Go allows creating lightweight threads to the point where it's a good pattern to just spin off goroutines left and right to your heart's content. That's more of a concurrency primitive than async. Sure, you combine it with a channel, and you've created an async future.

The explicit passing of contexts is interesting. I initially thought it would be awkward, but it works well in practice. Except of course when you need to call a blocking API that doesn't take context.

And in environments where you can run a multitasking runtime, that's pretty cool. Rust's async is more ambitious, but has its drawbacks.

Go's concurrency story (I wouldn't call it an async story) is way more yolo, as is the rest of the Go language. And in my experience that Go yolo tends to blow up in more hilarious ways once the system is complex enough.

show 2 replies