Rust in Linux: Where we are and where we're going next (2024)

Rust in Linux: Where we are and where we're going next (1)

At the Linux Plumbers Conferencein Richmond, Virginia, Linux and Rust developer Miguel Ojeda gave the Linux kernel developers an update on the state of Rust in the Linux kernel. In brief, Rust Linux is continuing to mature and is getting strong support from developers and vendors, such as Cisco, Samsung, and Canonical.

Of course, Rust has been in Linux since Linus Torvalds gave the memory-safe language his blessing for the Linux 6.1 release. Now, though, Rust is taking the steps it needs to become -- along with C -- a fully-fledged member of the Linux language toolchain.

Also: How to install Linux on an old laptop to give it new life

That evalated position is because, as Microsoft Software Engineer Wedson Almeida Filho said, "We feel that Rust is now ready to join C as a practical language for implementing the kernel. It can help us reduce the number of potential bugs and security vulnerabilities in privileged code, while playing nicely with the core kernel and preserving its performance characteristics."

Specifically, as Alex Gaynor and Geoffrey Thomas explained at the 2019 Linux Security Summit, almost two-thirds of Linux kernel security holes come from memory safety issues. And where do those errors come from? Inherent weaknesses in C and C++. Rust, on the other hand, avoids these problems by using far safer application programming interfaces (APIs).

Also:8 things you can do with Linux that you can't do with MacOS or Windows

That's not to say that we're ready to retire C for Rust just yet. In fact, that day is unlikely ever to come. But Rust is definitely on its way to becoming an important language for Linux development.

Before we reach that destination, there are some challenges to overcome. As Ojeda said at the event, while the "core team has grown with new members", there's still a lot of work to be done.

That effort starts with programming tools for Rust on Linux. Some distros are already embracing Rust with open arms. For example, Ubuntu now provides "all the necessary toolchain and kernel requirements to build and test out-of-tree kernel modules."

Today, there are three major Linux Rust toolchains coming together. The first of these is GCC codegen for rustc. This toolchain compiles and can boot mainline Rust and Linux without source code changes.

Then, there'sGCC Front-End for Rust, which can be loaded by the existing rustc frontend, but benefits from GCC optimizations. Unfortunately, this project is still very much alpha code. Finally, there'sCoccinelle for Rust. Coccinelle is a tool for making large-scale Linux kernel C source code, and Coccinelle for Rust is seeking to bring this power to Rust codebases.

Also:The best Linux distros for beginners

As for the day-to-day work that's required to make Rust fully integrated with Linux, the "official" website of the initiative is now the self-explanatory Rust for Linux. This site is your one-stop source for all things Rust on Linux.

The original rust code branch, where development happened for two years, has been retired. The code is still there, but it's been frozen and archived. Moving forward, rust-nextwill be the branch that contains new Rust features to be submitted during the next merge window of the Linux kernel. This branch, as the name suggests, is part of Linux Next.

Rust-fixes, meanwhile, is the branch that contains Rust fixes for the current cycle of the Linux kernel. In addition,Rust-dev is an experimental branch for integration purposes. It's a queue for patches that "look good enough" to share and tinker with.

However, the move forward has not been straightforward. Rust on Linux developers have discovered some problems along the way. For example, while deadlocks, when two or more threads are waiting on the other to finish, are safe in Rust, because they don't result in undefined behavior, they're not safe in the Linux kernel. The programmers are working on fixing this issue.

Also:How to create a bootable Linux USB drive

The developers are also worrying about is how to deal with Rust versions. Today, developers can't guarantee that newer Rust versions will work in Linux because the latest version of Rust Linux is compatible with some unstable features. Will these features be there in the next version of Rust? Will they be backward compatible? Stay tuned.

For now, Linux Rust programmers are tracking the latest version of the Rust compiler. That's quite an unusual approach for the kernel, where the name of the game is usually to use old, proven code.

A related issue is that there's growing interest in backporting Rust support into long-term support (LTS) versions of Linux, specifically 5.15 and 6.1. Some people are especially showing interest in the super LTS Linux 6.1 kernel. However, Linux doesn't generally allow backports into LTS Linuxes. So, if you really, really want fully featured Rust support in an older LTS kernel, you're going to need to pay for it in one way or the other.

Another general rule that Rust developers have decided they're going to try to "break" is the rule against duplicate drivers. Usually, no one wants anyone wasting time reinventing the wheel, but some maintainers are open to the idea of experimenting with Rust, by starting simple with a driver they're already familiar with.

Also: If you want to try BSD, GhostBSD might be your best bet

Still, others have expressed an interest in writing Rust drivers, but the required abstractions are not there, and merging would break the "no code without an expected in-tree user" rule. So, Ojeda and his merry crew of Rust developers have requested an exception for Rust drivers.

These movements are small steps forward, but they're all critical for making Rust equal to C as a Linux programming language. Based on the high interest I saw at Plumbers, I fully expect that Rust will, eventually, get there.

Linux

  • The best Linux laptops for consumers and developers
  • Want to save your aging computer? Try these 5 Linux distributions
  • The best distros for beginners
  • How to enable Linux on your Chromebook (and why you should)
Rust in Linux: Where we are and where we're going next (2024)
Top Articles
Understanding IMEI Phone Tracking: How Does It Work?
Research Guides: Budget and Appropriations: Budgets and Appropriations - Federal
Urist Mcenforcer
Botw Royal Guard
Math Playground Protractor
Air Canada bullish about its prospects as recovery gains steam
Driving Directions To Fedex
What Happened To Dr Ray On Dr Pol
OSRS Fishing Training Guide: Quick Methods To Reach Level 99 - Rune Fanatics
My Boyfriend Has No Money And I Pay For Everything
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Green Bay Press Gazette Obituary
Wal-Mart 140 Supercenter Products
Jesse Mckinzie Auctioneer
City Of Spokane Code Enforcement
Erin Kate Dolan Twitter
Ap Chem Unit 8 Progress Check Mcq
Cooking Fever Wiki
Wgu Admissions Login
Wildflower1967
Beau John Maloney Houston Tx
Funny Marco Birth Chart
Hartland Liquidation Oconomowoc
Virginia New Year's Millionaire Raffle 2022
Satisfactory: How to Make Efficient Factories (Tips, Tricks, & Strategies)
Kaitlyn Katsaros Forum
Mj Nails Derby Ct
European city that's best to visit from the UK by train has amazing beer
Move Relearner Infinite Fusion
Dmv In Anoka
Farm Equipment Innovations
Sandals Travel Agent Login
Vivification Harry Potter
Kiddie Jungle Parma
Used Safari Condo Alto R1723 For Sale
DIY Building Plans for a Picnic Table
Pixel Combat Unblocked
Ravens 24X7 Forum
Swgoh Boba Fett Counter
The Hoplite Revolution and the Rise of the Polis
Why The Boogeyman Is Rated PG-13
ATM Near Me | Find The Nearest ATM Location | ATM Locator NL
Michael Jordan: A timeline of the NBA legend
Mixer grinder buying guide: Everything you need to know before choosing between a traditional and bullet mixer grinder
Mid America Irish Dance Voy
Xxn Abbreviation List 2023
The best bagels in NYC, according to a New Yorker
Smite Builds Season 9
Sam's Club Gas Price Sioux City
Pelican Denville Nj
Dr Seuss Star Bellied Sneetches Pdf
Latest Posts
Article information

Author: Roderick King

Last Updated:

Views: 6262

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Roderick King

Birthday: 1997-10-09

Address: 3782 Madge Knoll, East Dudley, MA 63913

Phone: +2521695290067

Job: Customer Sales Coordinator

Hobby: Gunsmithing, Embroidery, Parkour, Kitesurfing, Rock climbing, Sand art, Beekeeping

Introduction: My name is Roderick King, I am a cute, splendid, excited, perfect, gentle, funny, vivacious person who loves writing and wants to share my knowledge and understanding with you.