The port's author, Sylvestre Ledru-a Mozilla director and Debian developer-describes it as being in working condition, though not yet production ready. Fast forward to 2021Ī significant amount of work has been done on Rust in the kernel since the 2020 Linux Plumber's Conference, including on a Rust-language port of GNU Coreutils. Enabling automatic checks for Rust-compiler presence simply meant that it should be as easy as possible to get any potential submissions built (and automatically tested) properly like any other kernel code would. This didn't mean that Rust-code submissions would be accepted into the kernel willy-nilly. Torvalds didn't seem horrified at the idea-in fact, he requested that Rust compiler availability be enabled by default in the kernel-build environment. To be clear, the idea isn't an entire, ground-up rewrite of the kernel in Rust-merely the addition of new code, written in Rust, which interfaces cleanly with existing kernel infrastructure. Linux Plumbers 2020Īt the Linux Plumbers conference in 2020, kernel developers began seriously discussing the idea of using Rust language inside the kernel. Rust, like Google's Go, is one of a new generation of languages which aims to hit somewhere in between-it provides the raw speed, flexibility, and most of the direct mapping to hardware functionality that C would while offering a memory-safe environment. Similarly, high-level languages automatically reclaim "orphaned" RAM via garbage collection-if a function creates a variable which can only be read by that function, then the function terminates, the language will reclaim the variable once it's no longer accessible. A large part of the additional safety they offer comes from implicit memory management-the language itself will refuse to allow you to stuff 16K of data into a 2K buffer, thereby avoiding buffer overflows. High-level languages-such as PHP, Python, or Java-aim to be both easier to read and write and safer to write code in. Similarly, you must allocate memory to store data in-and if your attempt to put too much data into too-small an area of RAM, you'll end up overwriting locations you shouldn't. When you're done with a variable you've created, you must explicitly destroy it-otherwise, old orphaned variables accumulate until the system crashes. In particular, as a nonmemory-managed language, C opens the programmer up to memory leaks and buffer overflows. However, C still opens you up to nearly the entire range of catastrophic errors possible in assembly. The great thing about C is that it's not assembly language-it's considerably easier to read and write, and it's generally much closer to directly portable between hardware architectures. C versus RustĪs of now, the Linux kernel is written in the C programming language-essentially, the same language used to write kernels for Unix and Unix-like operating systems since the 1970s. Vaughan-Nichols asked Linus Torvalds and Greg Kroah-Hartman about the possibility of new Linux kernel code being written in Rust-a high performance but memory-safe language sponsored by the Mozilla project. Heritage Images via Getty Images reader comments 210 with
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |