Remix.run Logo
thomashabets2 5 hours ago

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.

Matl 4 hours ago | parent | next [-]

For one, I am glad I don't have to color my functions like your typical async.

thomashabets2 an hour ago | parent [-]

I agree that this is the big problem with Rust's async story.

But like I said, in my opinion this compares with Go not having an async story at all.

osigurdson 3 hours ago | parent | prev [-]

Go's async story is great, as there is no function coloring at all. That being said, I don't like Go's syntax very much. The runtime is great though.