Live data from Hacker News

Rust in the kernel is no longer experimental

lwn.net

161–170 of 853 posts

Re: Rust in the kernel is no longer experimental

#161
post #155

Rust in the kernel feels like a red herring. For fault tolerance and security, wouldn’t it be a superior solution to migrate Linux to a microkernel architecture? That way, drivers and various other components could be isolated in sandboxes.

Go ahead and do it!

Re: Rust in the kernel is no longer experimental

#163

Not a system programmer -- at this point, does C hold any significant advantage over Rust? Is it inevitable that everything written in C is going to be gradually converted to safer languages?

For my hobby code, I'm not going to start writing Rust anytime soon. My code is safe enough and I like C as it is. I don't write software for martian rovers, and for ordinary tasks, C is more ergonomic than Rust, especially for embedded tasks. For my work code, it all comes down to SDKs and stuff. For example I'm going to write firmware for Nordic ARM chip. Nordic SDK uses C, so I'm not going to jump through infinite…

> Just like C++ never killed C, despite being perfect replacement for it

I think c++ didn't replace C because it is a bad language. It did not offer any improvements on the core advantages of C.

Rust however does. It's not perfect, but it has a substantially larger chance of "replacing" C, if that ever happens.

Re: Rust in the kernel is no longer experimental

#164

Not a system programmer -- at this point, does C hold any significant advantage over Rust? Is it inevitable that everything written in C is going to be gradually converted to safer languages?

There are certain styles of programming and data structure implementations that end up requiring you to fight Rust at almost every step. Things like intrusive data structures, pointer manipulation and so on. Famously there is an entire book online on how to write a performant linked list in idiomatic Rust - something that is considered straightforward in C. For these cases you could always use Zig instead of C

Or just build a tested unsafe implementation as a library. For example the Linked List in the standard library.

https://doc.rust-lang.org/src/alloc/collections/linked_list....

Re: Rust in the kernel is no longer experimental

#165

Not a system programmer -- at this point, does C hold any significant advantage over Rust? Is it inevitable that everything written in C is going to be gradually converted to safer languages?

you can look at rust sources of real system programs like framekernel or such things. uefi-rs etc.

there u can likely explore well the boundaries where rust does and does not work.

people have all kind of opinions. mine is this:

if you need unsafe peppered around, the only thing rust offers is being very unergonomic. its hard to write and hard to debug for no reason. Writing memory-safe C code is easy. The problems rust solves arent bad, just solved in a way thats way more complicated than writing same (safe) C code.

a language is not unsafe. you can write perfectly shit code in rust. and you can write perfectly safe code in C.

people need to stop calling a language safe and then reimplementing other peoples hard work in a bad way creating whole new vulnerabilities.

Re: Rust in the kernel is no longer experimental

#166

Earlier quoted context omitted.

I think you didn't catch their drift C will continue to be used because it always has been and always will be available everywhere, not only places no one uses :/

> C will continue to be used because it always has been and always will be available everywhere Yes, you can use it everywhere. Is that what you consider a success?

... yes?

Re: Rust in the kernel is no longer experimental

#167

Not a system programmer -- at this point, does C hold any significant advantage over Rust? Is it inevitable that everything written in C is going to be gradually converted to safer languages?

There are certain styles of programming and data structure implementations that end up requiring you to fight Rust at almost every step. Things like intrusive data structures, pointer manipulation and so on. Famously there is an entire book online on how to write a performant linked list in idiomatic Rust - something that is considered straightforward in C. For these cases you could always use Zig instead of C

what is an intrusive data structure?

Re: Rust in the kernel is no longer experimental

#168
post #155

Rust in the kernel feels like a red herring. For fault tolerance and security, wouldn’t it be a superior solution to migrate Linux to a microkernel architecture? That way, drivers and various other components could be isolated in sandboxes.

You should develop a small experimental kernel with that architecture and publish it on a mailing list.

Re: Rust in the kernel is no longer experimental

#169
post #148

> Mike: rachel and i are no longer dating > > rachel: mike that's a horrible way of telling people we're married from the meme section on that page.

> same Mike in an org wide email: thank you all for your support. Starting next week I will no longer be a developer here. I thank my manager blah blah... I will be starting my dream role as Architect and I hope to achieve success.

> Mike's colleagues: Aww.. We'll miss you.

> Mike's manager: Is this your one week's notice? Did you take up an architect job elsewhere immediately after I promoted you to architect ?!

Re: Rust in the kernel is no longer experimental

#170
post #110

Not a system programmer -- at this point, does C hold any significant advantage over Rust? Is it inevitable that everything written in C is going to be gradually converted to safer languages?

C is fun to write. I can write Rust, but I prefer writing C. I prefer compiling C, I prefer debugging C. I prefer C. It's a bit like asking with the new mustang on the market, with airbags and traction control, why would you ever want to drive a classic mustang?

It’s okay to enjoy driving an outdated and dangerous car for the thrill because it makes pleasing noise, as long as you don’t annoy too much other people with it.
Post reply on HN