3 ms·
> Async Rust is hard - and Rust in general is hard - because they don’t compromise performance for abstraction and encapsulation. I love Rust, but this is not
by bkolobara 4y ago
> Async Rust is hard - and Rust in general is hard - because they don’t compromise performance for abstraction and encapsulation.
I love Rust, but this is not completely true. Async Rust is hard because many nice features from Rust are not available in async Rust. For example, you can't have async functions in traits and always need to box return value, compromising performance just because the language is not powerful enough yet to support this.
This also leads to not having standard Read and Write traits and a bunch of fragmentation between runtimes. It's not that having it would compromise performance, it would even allow better performance than the current workarounds, but async Rust is still in development and needs time to catch up. In the meantime you need to do a bunch of awkward tradeoffs between ergonomics and performance when writing async Rust and of course it's frustrating to developers that are used to Rust being zero-cost with awesome ergonomics.
- gloryjulio 4y agoThis is very similar to c++. After transitioning to coroutine from previously semicomplete implementations like promises, our codebase become so much better. It just takes time to reach a better feature
- mrfox321 4y agowhat c++ coro library are you using, folly? i use that and it makes async programming trivial, relative to callback style programming.
- gloryjulio 4y agoYeah we use folly and we acknowledge that it's not the 'most' performant option. But we we don't have real time constraint. It's good enough