|
|
Log in / Subscribe / Register

Rust lacunae

Rust lacunae

Posted Jun 11, 2021 12:14 UTC (Fri) by roc (subscriber, #30627)
In reply to: Rust lacunae by ncm
Parent article: Rewriting the GNU Coreutils in Rust

"Modern C++" doesn't give you memory safety. It's still easy to create dangling references and the standard library doesn't do array bounds checks. If modern C++ provided memory safety, "writing at a level of abstraction that confines risky operations to trusted libraries", Google, Microsoft, etc would not be adopting Rust.

> the resulting panic cannot be presumed to clean up properly before exiting. This sort of thing is hard to get right, and only comes with maturity.

GNU coreutils can't even be bothered handling SIGPIPE when stdout is a closed pipe. "Graceful exit" is not their forté.

OTOH, in Rust RAII is *the* way to clean up resources, and panics run those drop handlers, so Rust panics generally clean up after themselves quite well.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


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