3 ms·
Yes - Rust can be complicated. However it doesn't have to be. There's nobody forcing you to use Pin. Even async code doesn't do, if you just stick to using libr
by Matthias247 4y ago
Yes - Rust can be complicated. However it doesn't have to be. There's nobody forcing you to use Pin. Even async code doesn't do, if you just stick to using library functions, don't write any Future implementation manually and just stick to async-trait.
There's even nobody forcing you to use async code. In fact it might be the wrong choice for > 99% of use-cases, since it adds complexity and limits on which functions can be called in certain places, adds limitations like not being able to perform recursive function calls, and can even lead to higher latencies (no preemption) and more memory usage (for `Future` state allocations) than the boring synchronous versions.
I've worked together with multiple teams building > 30 applications/services in Rust and had seen even > 100 engineers in those teams picking up Rust successfully. So for me there's more than enough datapoints that it's complexity is manageable after an initial rampup period of 1-3 month.
To be fair: What I definitely haven't found is engineers outside the Rust core group that really understands how async and Pin work - usually people just put async in function definitions and .await where the compiler asks and assume that will do it's job - which is mostly good enough. So yes, I definitely second that those details are hard. And even I - as someone who contributed to async/await standardization and was active in the async working group am giving up mentally in the new discussions around Pin/poll_fn safety. But as I said earlier - knowing Pin is not necessary to write programs successfully in Rust.
- xiaodai 4y agoYes - C++ can be complicated. However it doesn't have to be. There's nobody forcing you to use templates......
- pradn 4y agoThis is true, though. You can write most programs with simple use of types as template rags for containers, and defining only simple templates, where you just abstract over the given type itself in a “find and replace” way (no type traits, sfinae, template overload / recursion stuff).
- csande17 4y agoC++ can be unsafe. However it doesn't have to be. There's nobody forcing you to use pointers...
- deleted 4y ago[deleted]
- kazinator 4y ago> There's nobody forcing you to use Pin ... ... in your greenfield solo project with no legacy code or third party contributors.
- distcs 4y ago> There's nobody forcing you to use Pin. This kind of argument does not work in community and professional projects where you do get forced to use the features that your colleagues or predecessors have used in the codebase.
- Matthias247 4y agoIn that case you hopefully have colleagues that are able to help on those questions. And if predecessors have moved on, teams should typically be empowered to make changes to the codebase which make the code understandable and maintainable for them (but sure - I am fully aware about that these changes are not easy to get prioritized in a business sense).