3 ms·
The C++ Core Guidelines Checker, in combination with the Guidelines Support Library, is supposed to bring Rust-like memory safety guarantees to C++. Has anyone
by corysama 10y ago
The C++ Core Guidelines Checker, in combination with the Guidelines Support Library, is supposed to bring Rust-like memory safety guarantees to C++. Has anyone here had a chance to try it out?
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
https://github.com/Microsoft/GSL https://github.com/Microsoft/GSL
https://msdn.microsoft.com/en-us/library/mt762841.aspx https://msdn.microsoft.com/en-us/library/mt762841.aspx
https://blogs.msdn.microsoft.com/vcblog/2016/10/12/cppcorecheck/ https://blogs.msdn.microsoft.com/vcblog/2016/10/12/cppcorech...
Microsoft has been embracing the idea. But, the GSL and Checker are both compiler-independent.
- hsivonen 10y agoI very much doubt that Core Guidelines Checker can do the job of the Rust borrow checker without the lifetime info the borrow checker needs. Is there some doc that explains how the Core Guidelines Checker could achieve Rust-like safety given what it has to work with?
- corysama 10y agohttp://www.stroustrup.com/resource-model.pdf http://www.stroustrup.com/resource-model.pdf discussion https://news.ycombinator.com/item?id=10907573 https://news.ycombinator.com/item?id=10907573
- Manishearth 10y agoIIRC it's simultaneously not 100% safe because it can't stop R-W bugs (iterator invalidation, etc), and also more restrictive because it allows a smaller set of lifetime relations. This may have changed since I last saw it, which was admittedly quite a while ago. Still, major improvement. Could very well be "enough", practically speaking.
- gpderetta 10y agoAs far as I understand it is still, unfortunately, pretty much vaporware; i.e. no actual checker exists yet that can check the lifetime constraints. Edit: apparently MS did release an experimental version that can check a small subset of the rules.