2 ms·
The problem is that async in Rust is, as other people have put it, viral. Example: I have some stuff in my hobby application that is executing in a WASM virtua
by cmrdporcupine 4y ago
The problem is that async in Rust is, as other people have put it, viral.
Example: I have some stuff in my hobby application that is executing in a WASM virtual machine. That's not async, simple and synchronous.
But I have two other parts: one that talks to FoundationDB, and another that receives websocket connections. Both use Tokio & Async.
Now I'm in a pickle every time I want to hold or pass around some state in my WASM pieces, because the async stuff ends up pushing its constraints all the way down. Want some piece of mutability? Some piece that doesn't Send or Copy? Good luck.
There's ways around it all, but it complicates the design. The 'async' pieces at the front end up propagating all the way down.
It's hard to explain fully without you being in my code, but suffice it to say,
I agree with others: async in Rust is half-baked. That should be evident enough simply from the fact that you can't even yet put async functions in traits.
- zamalek 4y ago> you can't even yet put async functions in traits. I find the compiler reminding me constantly that I can't. I don't worry much about the viral nature of async, but this annoys me so much.