2 ms·
> safety was always part of the culture. That's a joke right? https://en.cppreference.com/w/cpp/utility/optional/operator* https://en.cppreference.com/w/cpp/ut
by masklinn 8y ago
> safety was always part of the culture.
That's a joke right? https://en.cppreference.com/w/cpp/utility/optional/operator* https://en.cppreference.com/w/cpp/utility/optional/operator* screams the exact opposite of "safety is part of the culture". And last I checked std::expected currently under specification does the exact same thing.
> A big part of C++'s culture was that we don't need to write unsafe C code unless we really must.
Because you've got plenty of unsafe C++ you can write instead?
- pjmlp 8y agoIt is no joke, the language offers the tools for security conscious developers not to write plain C, while being able to easily write safe wrappers to C libraries. And since no one is going to rewrite all UNIX derived OSes and their C userland into Rust, that kind of compatibility is desired. Anyone that spends a couple of minutes going through C++ conference talks knows that the community does care about how to make those language features to good use. When was the last C conference with security related talks?
- bluejekyll 8y agoTools like bindgen have made exposing C headers to Rust pretty simple and easy to integrate C into Rust projects. I don’t really think it’s that much different than the C/C++ macro style used for crossing that bridge between the two languages at the end of the day.
- pjmlp 8y agoIt is, there is no bridge as C is a C++ subset, so you can just #include and code away. Naturally that convenience is also the cause of our beloved CVEs.
- bluejekyll 8y agoWhile that’s true in principle, what I was getting at is that often there are CPP macros to make the C <-> C++ bindings more native between the two envs.