by gavinhoward · 3y ago · 0 comments
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-defin...
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.
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.