5 ms·
Also Rust's borrowck means you can often design an API where it's really easy to fall into our old friend the pit of success with these wrapper types. Both Rus
by tialaramex 1y ago
Also Rust's borrowck means you can often design an API where it's really easy to fall into our old friend the pit of success with these wrapper types.
Both Rust's OwnedFd and Rust's Mutex<T> have analogous C++ which are used, but lacking a borrowck C++ can't express the idea "Maximum of one person can have this"
What happens if I keep a mutable reference to the Goose despite unlocking the protective mutex? In C++ the answer is you lose mutual exclusion, in Rust that doesn't compile. C++ people will say "Don't do that" but "not doing that" does not scale whereas it doesn't compile scales just fine.
- pjmlp 1y agoWhile you are right if we are using the languages on their own, like clippy is common usage on Rust land culture, it is a matter of how much similar tooling gets used on C++, which is sadly a matter of culture, or lack thereof.
- vlovich123 1y agoI’ve never seen static analysis c++ tooling that has precise errors, have you? It’s always a littered mess of useful and useless things and I’m not even so sure it would warn about holding on to an interior reference into a lock-protected data structure. Static analysis in c++ is akin to clippy but without a --fix option and many more false positives. Also clippy is more about stylistic consistency within the ecosystem and completely optional, not about safety which isn’t optional.
- pjmlp 1y agoDepends on which tools, clang tidy can be customised, Apple just did a talk at C++ Now about their custom checks for Webkit "Safe C++". Commercial tools like PVS and Coventry, or those used in high integrity computing, also allow for rule customisation. However the first step is to use anything at all, a challenge since lint was born in 1979.