The makers of systems programming language Rust are looking at how to adapt the language for use in the Linux kernel.
Josh Triplett, a former Intel engineer and a lead of the Rust language team, says he'd "love to see a path to incorporating Rust into the kernel", as long as it's done cautiously and doesn't upset Linux kernel creator Linus Torvalds.
"If building Rustic interfaces within the kernel requires some additional language features, we should see what enhancements to the language would best serve those requirements," he said in a mailing list discussion about a proposed Linux Plumbers Conference session on support for Rust in the Linux kernel tree.
SEE: Hiring Kit: Python developer (TechRepublic Premium)
"I've often seen the sentiment that co-evolving Linux and a C compiler would be beneficial for both; I think the same would be true of Linux and the Rust compiler," Triplett added.
The Rust session was proposed by Google engineer Nick Desaulniers, who works on compiling the Linux kernel with Clang and LLVM.
Triplett is an advocate of using Rust for systems-level programming and as a replacement for C, which has been widely used at Microsoft for Windows and within the Linux kernel. Microsoft sees value in Rust for eradicating memory-related security flaws in parts of Windows written in C and C++.
As The Register reported in June, Torvalds said the Linux kernel team is looking at having Rust interfaces for things like drivers that aren't central to the kernel.
"I'm convinced it's going to happen. It might not be Rust. But it is going to happen that we will have different models for writing these kinds of things, and C won't be the only one," said Torvalds.
In an exchange with Triplett on Friday, Torvalds made it clear he wants Rust to be kept in check for now, until the first Rust driver for the Linux kernel becomes available and the kernel team has had time to test it.
"Please make it a 'is Rust available' automatic config option," Torvalds told Triplett. "The exact same way we already do the compiler versions and check for various availability of compiler flags at config time."
SEE: Programming language rankings: R makes a comeback but there's debate about its rise
"I _don't_ want us to be in the situation where any new Rust support isn't even build-tested by default. Quite the reverse. I'd want the first Rust driver (or whatever) to be introduced in such a simple format that failures will be obvious and simple.
"The _worst_ situation to be in is that a (small) group of people start testing their very special situation, and do bad and crazy things because 'nobody else cares, it's hidden'."
Torvalds' warning probably comes as no surprise to Triplett and could explain Triplett's cautious but eager approach to rolling out Rust support in the Linux kernel. His goals include:
Update: The story has been updated to make clear that Triplett is a former Intel engineer and a lead on the Rust language team.