4 ms·
I think one common trait is that systems programming languages have pointers and manual memory management or ctor/dtor based memory management (as opposed to a
by rpnx 3y ago
I think one common trait is that systems programming languages have pointers and manual memory management or ctor/dtor based memory management (as opposed to a garbage collector). Non-systems languages abstract away pointers with some kind of runtime.
Pointers cannot be escaped. They are how the computer actually works. Either you expose pointers to the user, and all the errors that can result, or you have an abstraction layer where the limited set of automatic transformations are known to be memory safe. Low level/systems languages operate at the pointer level, high level languages translate to pointers through a limited set of transformations that have been proven memory safe. Rust is a bit weird because it somehow figured out how to do manual memory management in a mostly safe way that didn't result in a huge amount of overhead. Basically Rust works like other systems programming languages that use pointers with the additional constraint that also you have to write "lifetimes" that formally prove to the compiler that your use of those pointers is safe. Think of it as writing C++ but also having to write a proof that your code is correct.