Published
- 3 min read
The Rust Evangelism Strike Force
On today’s episode of self-inserting into a community I know far too little about (bro thinks he’s on the team).
Knock Knock
Knocks on your repository door.
“Excuse me, sir. Do you have a moment to talk about Rewrite It In Rust?”
We are annoying. We know it. We show up in C++ subreddits. We brigade Hacker News threads. We open PRs on 20-year-old C libraries asking if they’ve considered switching build systems to Cargo. We are moral crusaders, and we are absolutely right.
Memory Safety is a Moral Imperative
70% of all high-severity security vulnerabilities are memory safety issues. Buffer overflows, use-after-free, double-free.
Writing C++ in 2024 is like driving a car without a seatbelt, while chugging vodka, on a road made of ice. Sure, you can do it safely if you are Michael Schumacher. But you aren’t.
So then, regrettably, choosing to use an unsafe language for critical infrastructure is negligence.
Checking Borrows
The first time I wrote Rust, I fought the Borrow Checker. And I lost.
I tried to pass a variable to a function, and the compiler screamed at me. “CANNOT MOVE OUT OF BORROWED CONTENT.” “LIFETIME ‘A DOES NOT OUTLIVE LIFETIME ‘B.”
But then, Stockholm Syndrome set in.
I realized the compiler isn’t screaming at me because it hates me. It’s screaming at me because I was about to do something stupid.
The compiler is a strict martial arts master. It whacks me with a stick every time my form is sloppy. It is frustrating. But after 6 months, I don’t fear segfaults anymore. I sleep better at night.
Fearless Concurrency
I vividly remember the first time I wrote a multi-threaded web server in Rust.
In C or Java, touching threads is like playing with a loaded gun. You have to be so careful. Mutexes, Semaphores, Atomic references… one slip up and you have a Heisenbug that only appears in production on Fridays.
In Rust, the compiler simply won’t let you write a data race. If you try to share mutable state across threads without a Mutex, the code won’t compile. This leads to fearless concurrency. I can write aggressive, highly parallel code, and just trust it. It is a superpower. It makes me feel like a wizard.
The Ecosystem
Cargo. Just… Cargo.
If you have ever written a Makefile, or dealt with CMake, or suffered through Python’s pip vs poetry vs conda hell, then using Cargo feels like stepping into the future.
cargo build. cargo test. cargo doc. It just works. It handles dependencies, builds, documentation, benchmarks, and publishing. There is nothing more to be said. (again, from my limited Rust developer cosplay experience)
We Are (Maybe) A Cult
Maybe we don’t need to rewrite curl in Rust. (Wait, someone already did that).
Maybe we don’t need to rewrite the Linux Kernel in Rust. (Wait, Linus Torvalds already approved Rust in the kernel).
We are winning. The revolution is televised.
But we must stay humble. We must remember that C++ is still faster in some niche cases (maybe).
But deep down, we know the truth. The crab is inevitable. Your codebase will be carcinized.