Re:Why you should, actually, rewrite some of it in Rust
by pjmlp on Thursday July 13, 2017 @11:33AM
(#14762144)
Not really, the part you are missing is that it is easier and cheaper not to have C or C++ compilers available at all.
Re:Why you should, actually, rewrite some of it in Rust
by kazinator on Thursday July 13, 2017 @12:36PM
(#14762727)
No, what I mean that if those same people were running a C++ shop rather than a Java shop, they could be equally and just as effectively draconian in their enforcement.
Re:Why you should, actually, rewrite some of it in Rust
by pjmlp on Thursday July 13, 2017 @01:11PM
(#14763053)
Ah I get your point, but static analysers and sanitizers aren't able to find all unsafe issues, specially if binary dependencies are involved.
This is why on Solaris there is OS support via SPARC instructions to enforce bounds and valid pointer use, for example.
Stuff you don't want in C++ code can be rejected by a pre-commit hook which scans code. That header can't be #include-ed, that crazy operator can't be used, etc.
Also, with open source compilers, you can implement your own warnings. (Been there, done that; in the role of an embedded distro/kernel/toolchain person some years ago, I hacked g++ with custom warnings).
If there is something we don't want in C++, and it doesn't "grep" well, we may be able to diagnose its presence in the compiler and treat that as an error.