Was Rust in the Linux Kernel a Mistake?
Today’s Issue: "Cargo for Python", Rust adventure on Illumos, and how Parmaksız turned boredom into a livestreaming adventure
Hello, Rustaceans!
While Programmers Day may have passed, we wanted to send a belated shoutout to all the brilliant minds behind the Rust community. Your dedication and hard work continue to shape the future of programming. Cheers 🥂!
In this issue, we’ll highlight the drama in the Rust for Linux team, share a useful Rust tip, spotlight an amazing Rust project, and share some incredible links of the week.
Welcome to issue 39.
THE MAIN THING
Was Rust in the Linux Kernel a Mistake?
There’s been a lot of discussion within the Rust community following the resignation of core maintainer of Rust for Linux, Wedson Almeida Filho, after four years of leadership.
Rust for linux (was founded in 2020) with the aim of adding support for Rust language to the Linux kernel. Ever since, the project which was meant to augment the Linux Kernel has been nothing short of a dramatic rollercoaster.
This came to an extreme end when Wedson stepped down from the project citing “nontechnical nonsense”. Below is a short summary and what we think of the current situation.
The Promise of Rust
Rust’s type system and ownership model which guarantees memory-safety and thread-safety has been seen to be a great addition to the Linux kernel. Rust's promise of eliminating certain class of bugs inherent in C such as buffer overflows and null pointer dereferences further solidifies the compelling reason for its introduction.
Rust has succeeded in some projects, including the NVMe driver. It has shown that Rust can match, and sometimes exceed, C's performance. The M1 GPU and Android Binder drivers, written in Rust, were well received. They prove Rust can handle complex, high-performance tasks. While Rust has enjoyed its good side, it has also provided shortcomings in some areas such are gaming with Loglog dev team dropping Rust after 3 years.
The Roadblocks
Integrating Rust into the Linux kernel has not been without significant hurdles. The reason for resignation of Wedson, sheds light on some of the deeper issues. Wedson resignation was driven by frustration with what he calls "nontechnical nonsense" and resistance from a subset of the C for Linux kernel maintainer team.
Ted Ts’o, a prominent linux kernel maintainer, expressed his reluctance to learn Rust during a presentation by Wedson. His comment, "You're not going to force all of us to learn Rust," reflects the resistance to adapting Rust and the associated overhead of maintaining both Rust and C codebases.
Writing correct code, which is essential for critical projects like the Linux kernel, demands a deep understanding and considerable investment in learning. The time commitment needed to become proficient in Rust may be seen as a hurdle for developers accustomed to C.
Could the time invested in rewriting Linux kernel Drivers in Rust be worthwhile if it leads to a memory-safe kernel that also eliminates other classes of bugs currently prominent?
Rust’s tooling and compiler infrastructure, is not yet mature and stable in comparison to C. While this currently is an eminent issue and the reason for reluctancy to shift to Rust. As the project matures so will be most of the tooling around it. The resistance to Rust inclined to the tooling perspective and familiarity can be justified but until when? especially when we have bugs that crop up like whack a mole.
It is not just about technical issues but also about the cultural and political dynamics of the kernel development process. The resistance from some Linux Kernel developers, who view Rust as an unwelcome disruption, adds a layer of complexity that goes beyond mere code.
A Cultural Shift or a Dead End?
While the core of the debate is whether Rust represents a necessary evolution or an overambitious experiment. On one hand, Rust’s potential to improve safety and performance in kernel development could be substantial.
From what we have noticed is that the Rust for linux project has been suppressed by technical infightings, resistance to change, and the inherent challenges of introducing a new language into an established codebase.
I do believe that for Rust to succeed in the Linux kernel, a shift is needed and one that embraces new paradigms which are helpful in one way or another. This shift would involve not just technical adaptation but also a willingness to engage in constructive dialogue and collaboration among kernel developers.
After Thought
In the grand scheme of things, the question of whether Rust is a mistake is still open. The technical benefits are clear, but the resistance from key figures and the ongoing political struggles have made Rust’s integration a challenging endeavour.
Whether Rust will ultimately become a mainstay in the Linux kernel or a cautionary tale of a thwarted innovation remains to be seen. For now, the Rust for Linux project continues to be a high-stakes game of code and culture, with its future hanging in the balance.
What is your thought on all this?
References:
RUST TIP
Using zip()
to Combine Iterators
When working with multiple collections in Rust, you often need to process corresponding elements together. The zip() function is a powerful tool for combining two iterators into one, pairing their elements into tuples. This allows you to efficiently handle parallel data.
How It Works
The
zip()
function takes two iterators and produces an iterator of tuples. It returns a new iterator that will iterate over two other iterators, returning a tuple where the first element comes from the first iterator, and the second element comes from the second iterator.In other words, it zips two iterators together, into a single one. If either iterator returns None, next from the zipped iterator will return None. If the first iterator returns None, zip will short-circuit and next will not be called on the second iterator.
Example
fn main() {
let a = vec![1, 2, 3];
let b = vec![4, 5, 6];
// consumes the vectors and creates
// iterators that yield owned values.
let zipped: Vec<(i32, i32)> = a.into_iter()
.zip(b.into_iter())
.collect();
println!("{:?}", zipped); // Output: [(1, 4), (2, 5), (3, 6)]
}
Use Cases
Parallel Processing: Use
zip()
to process corresponding elements from two collections in parallel.Data Transformation: Use it when you need to combine data from different sources for simultaneous manipulation.
PROJECT SPOTLIGHT 💡
uv - "Cargo for Python"
The talented team at Astral is back with another innovative tool, uv. In a previous issue, we introduced ruff (an incredibly fast Python linter and code formatter, also created by this fantastic team).
Uv is a blazing-fast Python package installer and resolver, written in Rust. It aims to be the most efficient and reliable Python package manager.
We’ve all been there. Using Python package managers sometimes feels like living in an episode of Game of Thrones: Lots of drama, and nothing is ever simple.
Uv tackles these frustrations by offering lightning-speed installations and streamlined dependency management.
Here is what makes uv tick:
Lightning Speed. uv boasts blazing-fast installation times, leaving pip in the dust. It's like the Usain Bolt of Python package installers, getting you up and running in a flash.
Effortless Dependency Management. uv streamlines dependency management, handling all the complexities behind the scenes. Say goodbye to tangled dependency trees and hello to a smooth, frustration-free experience.
Drop-in Replacement. uv seamlessly integrates with your existing workflow. It works like a charm with familiar commands like pip install and pip-compile, making the transition effortless.
Dependency version overrides. Need a specific version? uv lets you take control.
Alternative resolution strategies. Fine-tune dependency resolution to fit your needs.
Global cache. Uv saves you time by reusing downloaded packages.
Advanced error messages. Uv gives you clear and actionable insights into dependency conflicts.
Uv is built with the vision of a comprehensive "Cargo for Python" offering a one-stop tool for all your python project management needs. The cherry on top is that Uv is open-source on Github.
AWESOME LINKS OF THE WEEK 🔗
The brilliant minds at Copper released copper-rs, a purpose-built, Rust-native software engine for robotics. Now, your robots can outcompile you too.
The team at Immunant ported the C-based dav1d decoder to Rust, keeping performance in check. Read how they’re fine-tuning this decoder to run as fast as it’s safe.
Andrew Duffy wrote an article on random access string compression with FSST and Rust.
Redox OS v 0.9.0 is here with improved process/thread lifecycle and signaling. It's so good your processes will be saying 'thread-fully awesome!'
Till Wegmüller's latest Rust adventure on illumos is proof that even operating systems can appreciate a good love affair. Especially when it involves userland tools and a Rust-ified networking stack.
Densumesh authored How we Built 300μs Typo Detection for 1.3M Words in Rust.
Ryan Winter released lisp-in-rs-macros—a Lisp interpreter powered entirely by Rust macros. Because why not have your macros interpret everything?!
Timothy Wolodzko released prolog-rs, a minimal Prolog interpreter implemented in Rust.
Denis Varlakov wrote on the Dfns blog about What’s So Hard About Hashing Data? He explores the challenges of hashing structured data securely and introduces the udigest library, a Rust solution for unambiguous encoding.
Learn how Orhun Parmaksız turned boredom into a livestreaming adventure!
Do you have a challenging Rust problem/Tip you'd like to share with fellow Rustaceans? We'd be more than happy to feature them in a future issue, with full credit given to you. Submit your challenges or tips to us via email rustaceanseditors@gmail.com.
BEFORE YOU GO 👋
You're Rust Bytes biggest fans, and we love to see it. Here are a few ways you can help us spread the word:
❤️ Recommend Rust Bytes to your friends.
🤳 Connect with us on our socials: X, Rustaceans Publication.
📨 Email us at rustaceanseditors@gmail.com feedback is welcome.
☕️ Support our editors and Buy Us Coffee.
That's all for now, Rustaceans. Hope you finish up those books you wanted to read soon.
John & Elley.