I have been watching the CMU Advanced Database Systems course lectures on YouTube and have been trying to implement some pieces of a database in Rust as I watch. I have been impressed with how easy Rust makes some of the high-level code (thank you, pattern matching, enums, Option type, et al.). The tooling is also incredible, thanks to Cargo, rustup, and Clippy. However, writing the kind of code that is necessary for databases, memory allocators, device drivers, and other classic "systems" software seems difficult at times.
Guaranteed memory safety may not be conducive to software that has a core need to manage memory. For example, a database needs to pack values together in contiguous memory and interpret the type of the data at runtime. This is not too difficult but requires the use of
unsafe code - and losing the memory safety of the Rust compiler. Is Rust's memory safety desirable in a low-level programming language? At what point should the burden for preventing bugs be placed on the compiler, and at what point should it be on the developer and a good suite of unit tests?
I don't love C++, but I wonder if it could lead to simpler implementations of low-level software.