# rust is causing a lot of problems...

Source: https://www.youtube.com/watch?v=Jgq551IhquA
Recap page: https://rapidrecap.app/video/Jgq551IhquA
Generated: 2025-09-19T16:03:44.66+00:00

---
## Quick Overview

Rust is not inherently better than C for writing system utilities, and attempting to rewrite core utilities like `sort` and `cksum` in Rust can introduce performance regressions and new types of bugs, as demonstrated by the `cksum` implementation being up to 17x slower on large files.

**Key Points:**
- The `cksum` implementation in Rust is up to 17 times slower than the GNU version for large files.
- Rewriting core utilities in Rust, like `sort` and `cksum`, introduces new potential bugs and doesn't guarantee performance improvements.
- While Rust offers memory safety, it doesn't automatically prevent logical errors or performance issues in complex system utilities.
- The `sort` utility in GNU coreutils has an issue where it does not finish when processing a very large, single-line file.
- The concept of a "GNU Rust rewrite" refers to rewriting core utilities in Rust, aiming for better memory safety and performance.
- Security vulnerabilities exist in both C and Rust, and the choice of language does not automatically equate to a more secure outcome if the implementation is flawed.

![Screenshot at 00:01: The speaker is shown looking directly at the camera, gesturing with his hands while discussing the problems associated with Rust rewrites of core utilities.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-00-01.png)

**Context:** This video discusses the ongoing trend of rewriting GNU core utilities in Rust, a programming language known for its memory safety features. It highlights specific issues encountered with these rewrites, particularly concerning performance and potential bugs, using examples like the `sort` and `cksum` utilities. The discussion touches upon the debate within the developer community about the benefits and drawbacks of adopting Rust for system-level programming.

## Detailed Analysis

The video explores the challenges and potential pitfalls of rewriting GNU core utilities in Rust. The speaker begins by highlighting an issue with the `sort` utility, which fails to complete when processing a large, single-line file. This is contrasted with the general perception that Rust is a memory-safe language. The discussion then shifts to the `cksum` utility, where a Rust implementation was found to be significantly slower (up to 17x) than the traditional GNU version when handling large files. This raises questions about whether Rust automatically translates to performance gains in all scenarios, especially for complex, low-level utilities. The speaker points out that while Rust prevents memory-related bugs like buffer overflows, it doesn't inherently prevent logical errors or performance regressions. The article from LinuxSecurity.com is referenced, discussing Ubuntu's transition to Rust-based coreutils for enhanced security, but also noting potential compatibility concerns and the experimental nature of this shift. The speaker expresses skepticism about the perceived superiority of Rust in all cases, suggesting that simply rewriting code in Rust does not automatically guarantee better security or performance if the underlying logic or implementation is flawed. The video concludes by emphasizing that while Rust is a powerful language for preventing certain classes of bugs, it is not a silver bullet and careful consideration of performance and logical correctness is still crucial in system programming.

### Core Utilities Rewrite

- The GNU coreutils project is being rewritten in Rust for memory safety and performance
- The `sort` utility has an issue with large, single-line files
- The `cksum` utility in Rust is significantly slower than GNU version for large files

### Rust's Strengths and Weaknesses

- Rust prevents memory-related bugs like buffer overflows but not logical errors or performance regressions
- Rewriting in Rust does not automatically guarantee better security or performance
- Security is about more than just the language; implementation matters

### Community Discussion

- Debate exists on the benefits and drawbacks of Rust for system utilities
- Some developers express concerns about compatibility and the learning curve
- Concerns raised about the performance implications of Rust rewrites

![Screenshot at 00:02: A screenshot of a GitHub issue titled "sort does not finish for large one line file #8583" is displayed, detailing the problem.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-00-02.png)
![Screenshot at 00:11: A screenshot of a Reddit post titled "What does memory-safe \*actually\* mean" is shown, discussing the concept of memory safety in Rust.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-00-11.png)
![Screenshot at 01:10: A screenshot of a GitHub issue titled "cksum implementation up to 17x slower than GNU for some large files #8573" is displayed, highlighting performance issues.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-01-10.png)
![Screenshot at 01:53: A screenshot of a Linux terminal shows commands being run, including which sudo and ls -la $\(which sudo\), demonstrating the sudo binary.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-01-53.png)
![Screenshot at 02:41: A screenshot of a Hacker News article discussing the "GNU Coreutils Rust rewrite" is shown.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-02-41.png)
![Screenshot at 03:33: A screenshot of the "Approval Center" from ThreatLocker shows a pending request to run a suspicious PowerShell script.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-03-33.png)
![Screenshot at 03:50: A screenshot of the ThreatLocker interface shows the "Permit Application" dialog, allowing for granular control over script execution.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-03-50.png)
![Screenshot at 07:11: A screenshot of a LinuxSecurity.com article discussing Ubuntu's transition to Rust-based coreutils is displayed.](https://ss.rapidrecap.app/screens/Jgq551IhquA/00-07-11.png)
