Post

I feel like there would be a HUGE amount of ecosystem value for Rust and async/await, if there was funding and the right dev(s) available to focus on improving: * Memory usage + copies of futures/async fns: particularly wrt overlapping data across yield * Improving codegen size/perf * opt-footguns

6 reposts49 likes

I’d also desperately appreciate some compiler diagnostics on Future stack size feel like less-experienced friends hit it often, leaving me to say “Box::pin dat shit” …but the compiler could probably tell pretty easily, at least in some cases?

None of these are *deal breakers*: and should not be a reason to NOT use async/await, IMO. But on embedded we feel the pain of increased code size + ram usage much more acutely, and sometimes it requires being careful to avoid pathological cases. That doesn't feel good.

It's probably a bit more lost in the noise on desktop on a macro scale, but I'd bet the improvement would be noticable, especially for large/complex server apps. bsky.app/profile/shar... shows it extends to causing issues with llvm opt passes too!

sharnoff@sharnoff.io

Spent the last ~month trying to figure out why compiling my website took so long. Decided to turn it into a blog post :) sharnoff.io/blog/why-rus...

I'm probably not the person to actually do this: there are much more compentent rustc devs than me, but the impression that I've always gotten is that there are known areas where improvement could be made, but finding people to chase them down and get fixed AND reviewed/merged hasn't been possible.

Code size is an issue for all languages that heavily rely on templates or generics. It's an equally big problem in the world of C++ (although C++ has more common alternatives to help keep it in check).

Yep, we notice it acutely! bsky.app/profile/jame...

James Munns@jamesmunns.com

None of these are *deal breakers*: and should not be a reason to NOT use async/await, IMO. But on embedded we feel the pain of increased code size + ram usage much more acutely, and sometimes it requires being careful to avoid pathological cases. That doesn't feel good.

Hehe, I thought so. I haven't done much embedded development, but I found situations that would greatly benefit from the ability to asynchronously execute tasks based on certain events. I guess Embassy helps a lot, but it can just be as good as the underlying foundation.

Yeah, most of these things are *avoidable* in practice: making sure you don't have large owned items in futures, try to keep nested future depth low, etc. It's just annoying you HAVE to work around papercuts.

If we’re wishlisting async improvements we’d like to see, I would love it if the ecosystem were a bit more agnostic when it comes to async runtimes. At Zed we run into a lot of headaches because we have our own async runtimes, which can make it hard to consume popular crates that are tied to tokio.

I think that is a very noble thing to want, but I think it's a separate discussion topic! The items I've listed above are all things that are exclusive to the compiler, and shouldn't require any design/rfc work: this makes the bar MUCH lower for unbounded back and forth effort.

well, definitely requires design work, and maybe even MCPs, etc. But less "user facing stability + API design work", which can make things harder to commit to if they have longer term stability commitments than "how the compiler does things today".