Martin Steigerwald wrote:
Still just lurking here, more and more dissatisfied with erratic behavior related to the Linux kernel and probably some other components, but for
What things have you encountered?
With memory safe you mean written in Rust or a language with similar qualities?
Yes Rust is one example of a memory safe language. Other examples are Haskell, Java, Python, Typescript, JavaScript, Go, C#, Kotlin, Scala, Swift, Ruby, Ada and OCaml.
Assembly, C and C++ are not memory safe. There are very few memory unsafe languages other than Assembly, C and C++ that are in wide use today. According to Microsoft and Google, the majority of CVE's are caused by memory leaks. Thus, there is now a big push to have all applications written in, or re-written in, memory safe languages.
Rust does not mean you cannot write unsafe code. It just makes it harder and it is not the normal way that you should write Rust. The Rust compiler will fight you to ensure you program in a memory safe manner and it won’t successfully compile until you have met all of its demands. The exception however is that you can add a keywords, ‘unsafe’, that tells the compiler the following code is unsafe, so the compiler does not fight you to make it safe, this allows you to write unsafe code. This is not recommended however. So Rust is only safe if you don’t use the ‘unsafe’ code parameters or if you can prove the unsafe code is actually safe using formal verification methods.
These links will give a more detailed explanation than I can: https://www.memorysafety.org/docs/memory-safety/ https://en.wikipedia.org/wiki/Memory_safety https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html