by kombine · 2y ago · 0 comments
> Long ago there was an OpenSource library called Qt. When it was C++ and Widgets, it was great. Then the library lost its way and became focused on phones. It also became dramatically less "open" and much more "you have to buy a license." The C++ Widgets side of the library withered as resources were poured into a non-typesafe worthless thing called QML. This was well after making a play for the medical device market. You can't use non-typesafe junk when lives are on the line.
Their writing style is a serious turn-off.
The latest crazy Windows IP stack RCE pushed me wholly over into the "nothing new should be written in C/C++" camp. It's clear that secure reliable software can't be done in these languages, at least at scale.
The macho counter-argument of "but I can do it!" doesn't work. Maybe you can. It doesn't matter. Code will be worked on by more people than just you if it lives for a long time. Code "rots" and acquires bugs, and having the compiler catch the worst ones (memory errors, type errors) is a huge win.
No language that I'm aware of protects against bit flips or claims to have memory safety in its memory unsafe escape hatches (kind of the point).
There are formal languages that do more than Rust, but they're a lot less practical. Working on making a more practical one would be a useful exercise.
You can forbid unsafe at the Cargo.toml level in Rust. You can also just search a project for the keyword "unsafe" to subject all unsafe code to extra levels of scrutiny. Some orgs set commit rules where commits containing "unsafe" must be approved by more people or must pass through a security audit team.