3 ms·
As a proponent of structured concurrency [1], I am happy to see this post. I personally think that Rust would be the best language ever if it did a few things:
by gavinhoward 3y ago
As a proponent of structured concurrency [1], I am happy to see this post.
I personally think that Rust would be the best language ever if it did a few things:
* Got rid of async in favor of structured concurrency built in to the language.
* Made compile times competitive with C.
I think that much of the complexity of the language would be vastly reduced by adopting structured concurrency and dropping async because of the very compatibility mentioned in the article.
I also think that Rust is unique among languages in that it would benefit most from structured concurrency because its borrow checker would interact with structured concurrency in great ways.
Compile times are still a problem, though.
[1]: https://gavinhoward.com/2019/12/structured-concurrency-definition/ https://gavinhoward.com/2019/12/structured-concurrency-defin...
- TwentyPosts 3y agoI can't say I ever understood how and why async became such a big feature for Rust. I feel like I might understand someday (when I have more experience working with async code) but for now it kind of feels like adding it to the language was a massive, severe change which severely shaped the development and future of the language for years (async traits are still a work in progress!) and I just don't understand whether async was truly the right approach here, or the one feature to prioritize above all else. As far as I know the community is (was?) still a bit divided on async, mainly because it's rough around the edges, and makes for bad compiler errors. I wouldn't be surprised if 15+ years later people will think of async as "Probably great for its time, but there are better concurrency paradigms which we should shift to." similar to the shift from inheritance to composition.
- gavinhoward 3y agoYou put into words a lot of the feeling I have about Rust.
- dmytrish 3y agoAsync might be a wrong abstraction for high-level programming: green threads/goroutines are so much easier to use. On the other hand, writing a state machine for handling concurrent events/transitions is literally async done manually. libuv, any high-performance network server, UI events handling are all like that. I agree that doing low-level async right is difficult and might be an impractically long process.
- anacrolix 3y agoI wonder if it was a mistake: it'll be really hard to undo something like async because it infects the code. Which itself should have been a warning sign.