3 ms·
> I think things like asan and ubsan are far more helpful even with plain C than features like smart pointers. I agree. Smart pointers are not effective safety
by pcwalton 8y ago
> I think things like asan and ubsan are far more helpful even with plain C than features like smart pointers.
I agree. Smart pointers are not effective safety features. They mostly add new ways to get use-after-free. (shared_ptr helps a bit by automatically bumping reference counts, but shared_ptr is often discouraged in modern C++, and there are lots of ways to get around this, such as "shared_ptr&".)
> I'm honestly not sure rust is going to work for those types of systems either. Sometimes you just have to poke bits into memory and I'm not sure how a super safe language will deal with that better than C.
Read the "Writing an OS in Rust" series. Even in the kernel, you can have a relatively small trusted computing base and then most of the rest of the code can be safe.