Re:Why Is SQLite Coded in C and not Rust
by gcr on Wednesday October 15, 2025 @08:03AM
(#45591103)
Modern compilers like clang and GCC both have static analysis for some of this. Check out the undefined behavior sanitizer.
[ Parent
| on HN ]
Re:Why Is SQLite Coded in C and not Rust
by humanrebar on Wednesday October 15, 2025 @08:47AM
(#45591596)
Sanitizers are technically dynamic analysis. They instrument built programs and analyze them as they run.
Re:Why Is SQLite Coded in C and not Rust
by simonask on Wednesday October 15, 2025 @10:34AM
(#45593255)
As the other person pointed out, these are two different things. Sanitizers add runtime checks (with zero consideration for performance - don’t use these in productions). Static analysis runs at compile time, and while both GCC and Clang are doing amazing jobs of it, it’s still very easy to run into trouble. The mostly catch the low-hanging fruit.
The technical reason is that Rust-the-language gives the compiler much more information to work with, and it doesn’t look like it is possible to add this information to the C or C++ languages.