logoalt Hacker News

sunshowerslast Friday at 8:41 PM3 repliesview on HN

I think a key distinction is that in many application-level languages, each thing you await exists autonomously and keeps doing things in the background whether you await it or not. In system-level languages like Rust (and presumably Zig) the things you await are generally passive, and only make forward progress if the caller awaits them.

This is an artifact of wanting to write async code in environments where "threads" and "malloc" aren't meaningful concepts.

Rust does have a notion of autonomous existence: tasks.


Replies

m11alast Friday at 9:16 PM

I think that notion is very specific to Rust's design.

Golang for example doesn't have that trait, where the user (or their runtime) must drive a future towards completion by polling.

show 1 reply
Retr0idlast Friday at 8:53 PM

Thanks, this clears things up for me.

I suppose I conflated "asynchrony" (as defined in the article) and "async" as a syntax feature in languages I'm familiar with.

jayd16last Friday at 10:18 PM

Thank you so much for the added context. This explains the article very well.