Rust heads into the kernel?
Rust heads into the kernel?
Posted Apr 21, 2021 18:25 UTC (Wed) by ibukanov (subscriber, #3942)Parent article: Rust heads into the kernel?
Posted Apr 21, 2021 18:59 UTC (Wed)
by mpr22 (subscriber, #60784)
[Link]
When the latest version tag in the git tree is v0.3.0-beta.1, I feel it's safe to presume that the people responsible for developing it don't think it's production-ready.
Posted Apr 21, 2021 23:07 UTC (Wed)
by roc (subscriber, #30627)
[Link] (3 responses)
> Wuffs programs take longer for a programmer to write, as they have to explicitly annotate their programs with proofs of safety.
> The idea isn't to write your whole program in Wuffs, only the parts that are both performance-conscious and security-conscious.
A lot of driver code is boring. That code needs to be easy to write. In Rust it can be easy, in Wuffs not so easy.
Posted Apr 21, 2021 23:09 UTC (Wed)
by roc (subscriber, #30627)
[Link]
> No way to dynamically allocate or free memory.
Posted Apr 22, 2021 11:00 UTC (Thu)
by ibukanov (subscriber, #3942)
[Link] (1 responses)
Posted Apr 22, 2021 16:31 UTC (Thu)
by zlynx (guest, #2285)
[Link]
As I understand it the Rust panic will be wired into a kernel BUG call. Which is what it ought to be. If the code somehow avoids the explicit range checks and still executes an array[out_of_bounds] operation then that really is a BUG, unlike a memory allocation failure.
Posted Apr 23, 2021 3:01 UTC (Fri)
by tialaramex (subscriber, #21167)
[Link]
But Wuffs is a special purpose language whereas Rust isn't. For example when you ask Cargo for a new Rust program, the one you get says "Hello, World!". But Wuffs can't do that. Because that would involve I/O and Wuffs deliberately doesn't have I/O at all, it considers that to be orthogonal to its concerns entirely.
It is good for these special purpose languages to exist, particularly when they address some difficult and interesting problem such as "Wrangling Untrusted File Formats Safely". I should like to do this sometimes, and apparently Wuffs would help. But if my current problem is that my USB Foozle doesn't work, an "untrusted file format" is only at best a tiny fraction of my problem and Wuffs isn't interested in helping me with the rest of it. Whereas perhaps I can write a driver for the USB Foozle in Rust.
Today I can write a _userspace_ USB driver in Rust. Maybe my Foozle can be driven that way. If Linux Rust becomes a thing then that opens up the possibility of writing a kernel USB driver in Rust which is viable even for higher performance gizmos and is also desirable if a Foozle is important/ low-level enough that people don't really want to wait until the userspace spins up to have it working.
Rust heads into the kernel?
Rust heads into the kernel?
Rust heads into the kernel?
Rust heads into the kernel?
Rust heads into the kernel?
Wuffs