Skip to content

Freedom to Crash

The Linux kernel mailing list got heated over whether to merge Rust code. Linus said he would override the C maintainers and merge it anyway.

The resistance makes sense. Decades of C. A codebase built over decades in C. Concerns about hidden performance costs behind new abstraction layers. But Linus was clear. Rust's memory safety improves kernel quality. Code safety over maintainer sentiment.

I think Rust replacing C++ is a matter of time.

Memory safety guaranteed at compile time. Ownership and borrowing turn dangling pointers and data races into compiler errors. Landmines that C++ programmers stepped on for decades, erased by language design. Rust entered the Linux kernel. Android pivoted to Rust. Microsoft is rewriting parts of Windows in Rust. The direction is set.

C++ trusts humans too much. Dangling pointers, double frees, buffer overflows — all the programmer's responsibility. The language stops nothing. Free, and proportionally dangerous.

Rust's borrow checker is strict. Code won't compile. It demands you rewrite. Stressful until you get used to it. But the moment it compiles, a class of memory safety is proven. What C++ left to prayer, the compiler certifies.

Still, I want to write in whatever language I choose. At least for open source.

At work, the case for Rust will only grow stronger. Team productivity, maintenance costs, security. The rational choice is Rust. But in personal projects, I want to write C++ that segfaults sometimes. I want the freedom to crash. There are views you can't see from inside a safe cage.

Of course, I end up staring at core dumps more often than at the view.