Rust Is Hard, Or: The Misery of Mainstream Programming
Rust does not have to be this hard.<p>Most of the pain here come from the unholy trifactor: combining async, lifetimes and dynamic dispatch with trait object closures; which is indeed very awkward in practice.<p>Async support is incredibly half-baked. It was released as an MVP, but that MVP has not improved notably in almost three years.<p>There are lots of ideas, some progress on the fundamental language features required (GAT, existential types, ...) and the random RFC here and there, but progress is painfully slow.<p>This isn&#x27;t because no one cares, but because Rusts async implementation (which is very cool due to the low overhead) and its interactions with the other language features require complicated extensions to the type system. It does seem to me like there might be a lack of resources&#x2F;coordination&#x2F;vision ever since the Mozilla layoffs, but that&#x27;s a different topic.<p>If you can avoid async I would recommend doing so. The problem is that the entire ecosystem has completely shifted to async. There are almost no active &#x2F; popular libraries related to network IO that haven&#x27;t switched over.<p>To be clear: using async is fine if you know what you are doing, and it can provide incredible performance. But if you do, keep it simple: avoid lifetimes and most importantly:  don&#x27;t attempt advanced trait shenanigans - if you do need traits, just returned BoxFutures without lifetimes, throw in lots of clone(), share as little data as possible, use Arc&lt;tokio::sync::Mutex&lt;_&gt;&gt;,  and call it a day.