News for hackers. Stuff that matters.
Re:Rust in the 6.2 Kernel by LAC-Tech on Friday November 18, 2022 @12:16PM (#33657979)
although it never really sacrifices any control.

It feels like it sacrifices control wrt when you allocate and free-memory.

I understand it's deterministic in rust, but it's not explicitly controllable - or at least I've seen it be.

Re:Rust in the 6.2 Kernel by loeg on Friday November 18, 2022 @12:24PM (#33658131)
You have to bring your own memory in no-std. Implicit alloc is provided by the alloc crate (part of std).
Re:Rust in the 6.2 Kernel by Others on Friday November 18, 2022 @12:25PM (#33658141)
I don’t follow. It’s exactly like C in this regard, except with Box::new instead of malloc.
Re:Rust in the 6.2 Kernel by conradev on Friday November 18, 2022 @12:30PM (#33658241)
The key difference as outlined in the article is that Box::new cannot fail in Rust, but the underlying malloc can.

In userspace it is rare enough that a Rust panic is considered acceptable behavior, but this is not the case for the kernel.

But, it is controllable for sure

Re:Rust in the 6.2 Kernel by tialaramex on Friday November 18, 2022 @01:22PM (#33659304)
Unsurprisingly the kernel's Box does not have Box::new it provides instead Box::try_new which is fallible.
Re:Rust in the 6.2 Kernel by kaba0 on Saturday November 19, 2022 @01:01PM (#33672742)
Rust is a manual memory managed language, it literally has nothing inexpressible that C could do. Hell, C is a “higher level” language in that it doesn’t have any way for SIMD instructions.

To add something concrete, you can manually free memory as well based on some dynamic property if you wish.