Article 5FSZB Linus Torvalds weighs in on Rust language in the Linux kernel

Linus Torvalds weighs in on Rust language in the Linux kernel

by
Jim Salter
from Ars Technica - All content on (#5FSZB)
GettyImages-919606342-800x795.jpg

Enlarge / No, not that kind of Rust. (credit: Heritage Images via Getty Images)

This week, ZDNet's Steven J. 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.

C versus Rust

As 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. 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. However, C still opens you up to nearly the entire range of catastrophic errors possible in assembly.

In particular, as a nonmemory-managed language, C opens the programmer up to memory leaks and buffer overflows. When you're done with a variable you've created, you must explicitly destroy it-otherwise, old orphaned variables accumulate until the system crashes. 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.

Read 11 remaining paragraphs | Comments

index?i=lS_-UWu-ieA:3C_68gTSMmw:V_sGLiPB index?i=lS_-UWu-ieA:3C_68gTSMmw:F7zBnMyn index?d=qj6IDK7rITs index?d=yIl2AUoC8zA
External Content
Source RSS or Atom Feed
Feed Location http://feeds.arstechnica.com/arstechnica/index
Feed Title Ars Technica - All content
Feed Link https://arstechnica.com/
Reply 0 comments