|
|
Subscribe / Log in / New account

A pair of Rust kernel modules

A pair of Rust kernel modules

Posted Sep 15, 2022 21:13 UTC (Thu) by thecodedmessage (guest, #160911)
In reply to: A pair of Rust kernel modules by PengZheng
Parent article: A pair of Rust kernel modules

This poster is saying some true things in a loaded way to make them seem bad when they're actually reasonable. Rust is a tool, and it can't do everything that people sometimes carelessly claim about it. But that doesn't mean C++ is just as good, or that Rust experts make these claims.

Rust does not eliminate all bugs. It's true that Rust's safety features only prevent the behaviors that they're designed to prevent. Of course that's true -- no programming language can prevent all bugs, but Rust's safety features do prevent some very bad types of memory corruption that are infamous for causing problems in C and C++. Additionally, even 'unsafe' Rust does a better job at preventing those failures than C++, which in many cases doesn't even give you any tools to manage the problem, relying instead entirely on the programmer.

And yes, they tried to eliminate memory leaks in safe code and then realized that wasn't an achievable goal in line with their other goals. That doesn't mean that Rust is bad. Rust is much better at preventing memory leaks than C++, but it is still possible to leak memory. It's way harder to do by accident, though.

Rust is better than C++. The fact that it's not utopian or perfect doesn't mean that it's not better.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds