Reply to post: It saves time.

Rust is eating into our systems, and it's a good thing

Proton_badger

It saves time.

I feel I've spent half my time for the last few decades looking at memory related bug reports in C++ code and they're hard to reproduce and fix. No matter how expert we think we are - we're above all human and we can't keep track of it all in a complex codebase.

The amateur thinks he's that good and can manage it, the expert knows he's not.

With Rust the compiler helps us writing good code and keeping track of memory references, while still requiring us to understand how it works (unlike a black box garbage collector). The language also have a lot of other great features that are never talked about.

I was watching Asahi Lina write the M1 GPU Linux driver in Rust. What was amazing was that there were almost no crashes in the driver, even during development. She mostly had to chase down logic errors.

AsahiLina wrote this comment about the experience: "Not just secure, but more reliable! This particular GPU has a limitation that means that if the firmware crashes, the user needs to reboot the whole machine (there is no way to recover), so it's important to get it right. I use Rust's type system to manage the types and lifetimes of GPU-side pointers and data, not just the CPU side ^^

Honestly, this is the first time I've ever written anything serious in Rust, but I'm very happy with the language! I feel like it encourages good design, and then the compiler goes a long way towards making sure your implementation is correct. The firmware crashes I had yesterday were due to silly logic/setting bugs (getting a ring buffer size wrong and forgetting the last command in some command lists), and the only time the kernel side crashed was when I tried to release an imported GEM object as if were one of the driver's own. All the lifetime stuff just works, everything gets allocated and freed when it needs to be, no dangling pointers (neither on the GPU side nor the CPU side), ..."

CloudFlare had similar experiences writing their Pingora proxy and the reliability of the code in production.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon