This article is more than 1 year old
Linus Torvalds says Rust is coming to the Linux kernel 'real soon now'
Maintainer lack of familiarity won't be an issue, chief insists, citing his own bafflement when faced with Perl
At The Linux Foundation's Open Source Summit in Austin, Texas on Tuesday, Linus Torvalds said he expects support for Rust code in the Linux kernel to be merged soon, possibly with the next release, 5.20.
At least since last December, when a patch added support for Rust as a second language for kernel code, the Linux community has been anticipating this transition, in the hope it leads to greater stability and security.
In a conversation with Dirk Hohndel, chief open source officer at Cardano, Torvalds said the patches to integrate Rust have not yet been merged because there's far more caution among Linux kernel maintainers than there was 30 years ago.
"A lot of people actually think we're somewhat too risk averse," said Torvalds. "So when it comes to Rust, it's been discussed for multiple years by now. It's getting to the point where real soon now, we will actually have it merged in the kernel. Maybe next release."
Torvalds however did his best to dampen enthusiasm expressed by the applauding audience.
"Before the Rust people get all excited," the Linux kernel creator and chief said. "Right? You know who you are. To me, it's a trial run, right? We want to have [Rust's] memory safety. So there are real technical reasons why Rust is a good idea in the kernel.
"But at the same time, it's one of those things: We tried C++ 25-plus years ago and we tried it for two weeks and then we stopped trying it. So to me, Rust is a way to try something new. And hopefully, it works out, and people have been working on it a lot, so I really hope it works out because otherwise they'll be bummed."
- Rusty Linux kernel draws closer with new patch adding support for Rust as second language
- Latest patches show Rust for Linux project making great strides towards the kernel
- Linus Torvalds launches Linux kernel 5.13 after seven release candidates
- Huawei dev flamed for 'useless' Linux kernel code contributions
Analysis firm SlashData last month published a report stating that the Rust development community has almost tripled over the past two years, from just 0.6 million developers in Q1 2020 to 2.2 million in Q1 2022. For the seventh straight year, Rust was voted the most loved programming language in the annual StackOverflow Survey.
Hohndel asked Torvalds whether the introduction of Rust code will make the maintenance of Linux code harder due to the introduction of a language and patterns that are less familiar.
Torvalds said he doesn't see that as a significant issue, and said there have been other languages in the kernel, such as those used in the build subsystem.
"I'm quite used to seeing Perl code or our make files," Torvalds said. "Our makefiles are makefiles in name only. They are an unholy mess of various macros and other helper functions that are really hard to understand. And I'm in the situation where if somebody sends me a patch with some of the scripting and the makefiles, I don't even pretend to understand Perl. I'm one of those people who think that Perl is a write-only language."
Torvalds said he's perfectly happy to trust maintainers, at least until they screw up.
"Then I sometimes am overly impolite," he said. "And if I've been impolite to any of you in the audience, I apologize. It's a personal failing of mine and I mean that, very seriously."
If I've been impolite to any of you in the audience, I apologize. It's a personal failing of mine and I mean that, very seriously
"In a loving way," Hohndel interjected, in an effort to ameliorate his guest's confession.
"No," Torvalds responded, eliciting laughter from the audience. "I wish I could say that. I have had to apologize multiple times. So let me preemptively apologize to the Rust people."
Torvalds said he is aware people are concerned that not everyone involved will understand Rust and he's fine with that.
"People don't understand the VM subsystem, even when it's written in C," he said. "So the language is usually not the biggest hindrance to understanding." ®