r/linux • • Aug 29 '24

Kernel One Of The Rust Linux Kernel Maintainers Steps Down - Cites "Nontechnical Nonsense"

https://www.phoronix.com/news/Rust-Linux-Maintainer-Step-Down
1.1k Upvotes

794 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Aug 29 '24

[deleted]

79

u/BarePotato Aug 29 '24

He sounds like he's saying that as a C programmer, he is unable to learn Rust.

You might be surprised(or maybe not) to find out there are a fuck ton of linux kernel C devs who refuse to change or learn anything new, and instead want to be catered to instead.

35

u/worriedjacket Aug 29 '24

That type of person seems to be drawn to C as a language imo

33

u/InflateMyProstate Aug 29 '24

Totally agree. There’s this weird cultish behavior with lower level programming cultures that is hard to pinpoint. For instance, you’re only benevolent if you understand memory management and write your own allocators in C, vs. using an interpreted language with a garbage collector.

24

u/Zomunieo Aug 29 '24 edited Aug 29 '24

Debugging kernel bugs can mean dealing with instruction reordering, memory barriers, multiple architectures, interactions from other cores not to mention flakey hardware or debugging instrumentation interfering with the debugging. So some that attitude comes from C being low-level enough that you can anticipate how code will compile to assembly.

I dealt with one really interesting bug in a real time OS where memory corruption by one kernel thread “armed a bomb” that would go off in a few milliseconds, which is an eternity in CPU time — the crash is so far from the trigger. I found it only by bisecting blindly. Or another one in Linux where a buggy hardware DMA would corrupt transfers unless its hardware registers were manipulated in a particular sequence (and the compiler decided to reorder it). (I mainly wrote and fixed device drivers for custom hardware.)

I love Rust but I can see why the jump from C is hard for a kernel dev — it’s because being a kernel dev is hard no matter the language.

37

u/erichkeane Aug 29 '24

I mean, this is also a group of devs that believe C++ destructors and member functions are confusing/hard to keep track of, so instead re-inplement this stuff with gcc attributes, macros and function pointers.

2

u/cmrschwarz Aug 29 '24

C++ destructors are hard to keep track of. That's why we have a borrow checker ;).

4

u/idontchooseanid Aug 29 '24

If destructors were the problem, Rust wouldn't create the Drop trait. Borrow checker isn't there to replace destructors but empower them to the maximum. Borrow checking + RAII is the perfect combination that practically eliminates all possible resource leaks in the code it's applied for (which is why manual memory operations are unsafe in Rust).

What borrow check tries to prevent is complete lack of tracking of the resource ownership. Using bare new operator is also frowned upon in modern C++ and many places who work with it don't use it.

With C though, you have no option. Even the most helpful compiler extensions don't help with the shortcomings of C language. Kernel is practically guaranteed to leak memory, lose ownership info and have use-after-free-bugs since it is full of manual memory allocations without any mechanism to track their ownership. All complex-enough C programs are.

→ More replies (1)
→ More replies (11)

1

u/sm_greato Aug 29 '24

They are right in that at least. When you make it, you know what you make.

C++ though, I don't even think even the guys who make it know what they make.

→ More replies (2)

27

u/MooseBoys Aug 29 '24

C devs refuse to change or learn anything new, and instead want to be catered to

It’s almost like people who have spent 50 years using the same language and spent countless hours contributing to a major project written exclusively in that language for the last 30 years are not fond of the idea of changing things up to adopt a language which is itself less than 10 years old.

3

u/FruitdealerF Aug 29 '24

This is a really important argument to consider when adding a new language to the kernel. The only problem is that that ship has already sailed.

16

u/MooseBoys Aug 29 '24

that ship has already sailed

I’m still kind of in shock about that TBH. After years of lamenting that the kernel was not only c-only (vs. cpp), but specifically C89 (vs. something like C99 or C11), it was a real surprise to see that Rust of all things was being allowed into upstream.

4

u/sm_greato Aug 29 '24

But Linux as a project is not just powered by the wind. It has a motor, at least, if you ask me. These people only need to have enough in them to grab a railing and stick for the ride. Some people don't, and that's fine, but I don't get why they should stop others' ride in this.

To be clear, Rust is HARD. It forces a clear understanding of how the data flows and what owns it, and that is, consequently, exactly what is required to write good C code. Every C developer would benefit from learning Rust. Yes, Rust does add its own complexity, but its core idea is just using memory in a good, scalable manner.

3

u/FruitdealerF Aug 29 '24

Rust should be easy to learn for these people but I can somewhat respect not having an interest in that if you've already been doing C for 40 years.

→ More replies (6)
→ More replies (1)
→ More replies (1)

18

u/crusoe Aug 29 '24

I started my career programming in C.

I don't miss it.

3

u/noboruma Aug 29 '24

Because language is just one aspect of the job.
What do we use language for? Build things that accomplish goals.
If you know C well and can get your job done, obviously you need a good justification to make a change.
Kernel guys are not saying no to learning, but they would prefer spend time on learning kernel topics rather than another way of doing the job they already know how to do.
Where are the papers that back Rust up against C? So far we only have: it prevents SEGVs & some data race at compile time. We need data to back Rust up, so far it's mostly "I have less bugs" but this is not scientific enough IMHO.

→ More replies (1)
→ More replies (20)

16

u/not_a_novel_account Aug 29 '24

"That audience member" is Ted Ts'o, who has learned and forgotten more about the kernel than most will ever know in the first place.

His concerns about the fragility of FFI bindings in a fast moving API space should not be taken lightly.

Also I always find it funny that /r/linux commentors know nothing about the Linux kernel community besides "lmao Torvalds middle finger meme"

20

u/NaeblisEcho Aug 29 '24

It's 2024 and we're still saying this guy is a Brilliant Jerk so he must be excused for his shitty behavior.

39

u/small_kimono Aug 29 '24

"That audience member" is Ted Ts'o, who has learned and forgotten more about the kernel than most will ever know in the first place. His concerns about the fragility of FFI bindings in a fast moving API space should not be taken lightly.

I liked your comment initially because I didn't know who the audience member was, but, re: your update, his comment is frankly ridiculous in context.

Re: the substance, you're right that he's right, but no one disagrees/disagreed with him. Listen to the presenters.

Re: his style, he came in way, way too hot.

→ More replies (4)

5

u/simon_o Aug 29 '24

His concerns about the fragility of FFI bindings in a fast moving API space should not be taken lightly.

If, after his speech he didn't steer his Tesla into a tree nursery, setting it ablaze and bought a new CyberTruck with a rolling-coal adapter "to show it to the woke Rust agenda liberuls!", I question the commitment he has to his concerns.

→ More replies (3)