Live data from Hacker News

Retiring from the Rust for Linux Project – Wedson Almeida Filho

lore.kernel.org

31–40 of 107 posts

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#31

I try to sit on the fence when it comes to Rust and the Linux kernel. On one end, is Rust the right choice to be included... over others such as Zig or (perhaps) Odin? Are we 10 years too soon to include a "safe language" ???? Then again, we have Linus Torvolds who, in the last 20 years, has been hell-bent against including C++ in the kernel despite backlash.. yet.. he has accepted Rust a year or so ago. He obviously…

Rust's 1.0 was 2015. It's been 9 years.

It's been adopted for core components in Firefox, and Chromium/Android are likewise moving towards adopting Rust. In general, Rust has seen broad industry adoption from the likes of FAANG, M$, etc.

As far as I know, while alternatives like Zig may have their merits, they are simply nowhere close to Rust in terms of maturity and adoption. Not only would it take a decade for them to play catch-up, there's huge uncertainty around whether they will ever reach that point. So even if you assume Rust is approximately average on whatever technical axes, pragmatic concerns suggest it's the only real option.

Of course, one can always argue Linux has no need to adopt any new language. I don't think there is any serious concern that Linux will end up with no C programmers left to write kernel code.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#32

[flagged]

A short resignation email on a mailing list is about as little drama as I can imagine for, well, resigning. Perhaps by "drama" you're referring to the linked video, but watching the clip, the only drama I see is accusations like "You're trying to convince everyone to switch over to the religion as promulgated by Rust." Regardless of the technical issues, that's an ad hominem with zero technical merit.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#33

I try to sit on the fence when it comes to Rust and the Linux kernel. On one end, is Rust the right choice to be included... over others such as Zig or (perhaps) Odin? Are we 10 years too soon to include a "safe language" ???? Then again, we have Linus Torvolds who, in the last 20 years, has been hell-bent against including C++ in the kernel despite backlash.. yet.. he has accepted Rust a year or so ago. He obviously…

> I understand the backlash especially veterans who have put in their efforts on the kernel and have no wish to learn Rust. I am sure there are plenty of Rust people throwing their world views opinions yet barely wrote anything decent in C, if at all.

If you watch the video Wedson linked to in his email, you will see a fragment of the typical experience of a Linux Rust kernel maintainer. Rust in the kernel does not and has never meant C developers will have to learn Rust, but despite that fact a lot of C kernel developers who have been doing an insane amount of gatekeeping, deliberately treating Rust as a second-class citizen out of spite.

Asahi Lina who has written the kernel part of the Apple M-series GPU driver in Rust has had a LOT to say about what interacting with kernel developers have been like: https://vt.social/@lina/113045455229442533

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#34
post #5
post #4

i encourage everyone to watch the linked video [0]. reminds me of the recent non-technical arguments made in the freebsd thread [1]. git mailing lists have such a greybeard IRC vibe to them. i will, from now on, use "only accepts patches per mail" as a proxy for "not worth suggesting new ideas to" for all projects. it's a stupid proxy. correlation and causation and all that. but it's a very useful one for your sanity…

I did, I'm actually puzzled he referenced this. You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. That this discussion repeats itself can only be taken to be either: 1) Evil C programmers are stodgy and old, and can't/won't get with the program, boo! 2) The Rust minority has, as of ye…

> You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors.

What change exactly is being imposed? Rust has been accepted, so that parts of the kernel can be written in either Rust or C. Nobody is pushing for an entire kernel rewrite in Rust. Nobody is pushing out C maintainers.

> The Rust minority has, as of yet, failed to properly answer what happens when C APIs change in either signature or semantics, either of which can break the Rust bindings.

He answers in the very video: there is a process and it is communication. When a C API change which can break the Rust bindings, you email the maintainer responsible for the Rust bindings. It's as simple as that.

> If broken bindings indeed can hold back changes, then C changes are held back by Rust and indeed then the onus is on the committer to either forego improving/evolving the C API or pick up Rust and fix the bindings also. In that case, yes, the Rust bindings will either freeze the C API or force the individual contributor to learn Rust.

This is already happening with C development anyway, when an API change causes drivers maintained by different people to be updated, but nobody is saying "C changes are held back by C".

> That people repeat their concerns isn't an expression of stupidity any more than a result of the people driving Rust into the kernel have yet to properly communicate how they envision this process to work, I suppose.

But in this video, you see someone driving Rust into the kernel communicating how they envision this process to work, and a guy adopting a hostile tone claiming to be an engineer and calling another language a religion. This isn't concern, this is discrimination.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#35
post #34
post #5

Earlier quoted context omitted.

I did, I'm actually puzzled he referenced this. You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. That this discussion repeats itself can only be taken to be either: 1) Evil C programmers are stodgy and old, and can't/won't get with the program, boo! 2) The Rust minority has, as of ye…

> You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. What change exactly is being imposed? Rust has been accepted, so that parts of the kernel can be written in either Rust or C. Nobody is pushing for an entire kernel rewrite in Rust. Nobody is pushing out C maintainers. > The Rust min…

> He answers in the very video: there is a process and it is communication. When a C API change which can break the Rust bindings, you email the maintainer responsible for the Rust bindings. It's as simple as that.

This is a gross oversimplification. So after emailing, do you wait for the rust bindings to be fixed? Do you just get your changes merged regardless? Does the rust bindings maintainer have a say in what form your change takes? Can this hold back a release?

> This is already happening with C development anyway,...

As I understand it, the rule is if you change something that breaks other code, it is your responsibility to fix it (e.g. callers and such). This is obviously straightforward if you know C.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#36

I'm out of my depth here, and I don't fully understand. From what I gather, Rust restricts the possible pathways in the problem space to ensure certain assumptions in the API and to manage memory safely. Is the issue that C allows for more freedom in exploring all possible pathways, or is the problem rooted only to cultural or else?

It seems to me that C and Rust approach library APIs with different mindsets.

Warning: lots of stereotypes follow.

Rust believes APIs should be [close to] impossible to use incorrectly. So we get rich type system, contracts, and other kinds documentation. All corner cases are either impossible because of the type or explicitly written down in the contract. If UB happens because user wrote incorrect code, that's a library's bug because it did not defend against it.

C believes the programmer. Documentation typically mentions happy path and some popular errors only. Lots of assumptions are implicit, like thread-safety, reentrance, (lack of) NULLs, lifetimes of inputs/outputs. It's up to the user of the library to figure out restrictions if their usecase is not in the documentation. Common sense and knowledge of C traditions helps. If UB happens because the user did something a bit out of the usual, it's on the user.

That brings us to different mindsets of library developers.

In Rust you typically write code while proving that it's correct in all theoretically possible cases, otherwise the code does not even compile. If it becomes too hard, you refactor API, possibly making the implementation harder. But your API is kind of nice in the kind.

In C you take whatever piece of code you found to be useful, extract it in a function or two and use in the project. If you happen to need that exact code somewhere else, you use it. There is no need to prove that the code always works or that it's a sound abstraction. If it works, it works. If it stops working in some case because of a bad API design, then you decide whether it's worth refactoring or not. That makes the initial implementation simpler, but it lacks contracts by design.

So I attribute it to cultural differences between "C programmers" and "Rust programmers". For Rust programmers, "full function contract" is a must, so documenting it seems easy. For C programmers, "full function contract" is not required for writing working code in 95% of cases, so documenting it is extra chore with no benefit.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#37

I try to sit on the fence when it comes to Rust and the Linux kernel. On one end, is Rust the right choice to be included... over others such as Zig or (perhaps) Odin? Are we 10 years too soon to include a "safe language" ???? Then again, we have Linus Torvolds who, in the last 20 years, has been hell-bent against including C++ in the kernel despite backlash.. yet.. he has accepted Rust a year or so ago. He obviously…

Rust's 1.0 was 2015. It's been 9 years. It's been adopted for core components in Firefox, and Chromium/Android are likewise moving towards adopting Rust. In general, Rust has seen broad industry adoption from the likes of FAANG, M$, etc. As far as I know, while alternatives like Zig may have their merits, they are simply nowhere close to Rust in terms of maturity and adoption. Not only would it take a decade for them…

> Rust's 1.0 was 2015. It's been 9 years.

That is still pretty young... and just because something has reached 1.0 (lets say ready for production use) does not mean there wont be any major changes following it.

As I mentioned, I am not a Rust programmer, but I would not be surprised there has been a lot of changes since 1.0 -- and, potentially, if you had a kernel with lots of Rust code.. trying to do upgrades is likely going to be a lot more work when compared to a language like C.

When you compare Rust to something like Odin - this is a language that attempts to be a proper improvement over C without the typical gotchas or quirks that C has kept for many years. It does not add new features for the sake of it... it is generally "complete" despite not reaching version 1.0 (though it is used in production software)

https://x.com/jakubtomsu_/status/1808091029188567497

> I don't think there is any serious concern that Linux will end up with no C programmers left to write kernel code

That isn't what I was saying. I am just being realistic that in order for Linux to thrive for the next 30 years, we have to accept that the younger generation are not likely focusing on the C language. There will be many, of course -- but could be significantly less than the numbers today. With this, I think this is the main reason, with Linus in his mid-50s now, why Rust has been accepted.

In my opinion, if Linus was still in his early 30s today, he might have rejected Rust the same way as he has C++.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#38
post #33

I try to sit on the fence when it comes to Rust and the Linux kernel. On one end, is Rust the right choice to be included... over others such as Zig or (perhaps) Odin? Are we 10 years too soon to include a "safe language" ???? Then again, we have Linus Torvolds who, in the last 20 years, has been hell-bent against including C++ in the kernel despite backlash.. yet.. he has accepted Rust a year or so ago. He obviously…

> I understand the backlash especially veterans who have put in their efforts on the kernel and have no wish to learn Rust. I am sure there are plenty of Rust people throwing their world views opinions yet barely wrote anything decent in C, if at all. If you watch the video Wedson linked to in his email, you will see a fragment of the typical experience of a Linux Rust kernel maintainer. Rust in the kernel does not a…

I have watched the video.

I am not ignoring or denying there isn't individuals throwing their toys out of the pram when follow-up discussions should remain respectful and mature.

On one end, I get it. Linux kernel is a BIG project. I assume it is still the biggest Free/Open Source project today. Many developers involved in this project genuinely care about it. These big projects will NOT go down well if a release contains bugs. By having another language in the equation is likely to cause tension especially code breakages. Now, these guys need to learn Rust! When a language like Rust is given a lot of push today I can understand their anger when it can feel like it is pushed into the kernel too soon too quickly.

I am not defending these guys - I am just saying I get it. However, on the other end, I do not want to see a project contain over the top reactions when it is not needed. The guy in the video could have handled his responses better and more professionally.

Maybe (and I am assuming, here) a number of Linux kernel developers that behave like this may not have worked in a corporate environment, and have not learned that certain behaviours are not acceptable. Probably have not been a team lead in a project, either. They might be effing good programmers, tho!

That is an assumption, of course. I could say the same thing about Linus, as his responses could/should be handled better over the lifetime of the Linux kernel. Of course, the kernel is HIS BABY and I understand if he gets annoyed reviewing CRAP code.

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#39
post #34
post #5

Earlier quoted context omitted.

I did, I'm actually puzzled he referenced this. You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. That this discussion repeats itself can only be taken to be either: 1) Evil C programmers are stodgy and old, and can't/won't get with the program, boo! 2) The Rust minority has, as of ye…

> You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. What change exactly is being imposed? Rust has been accepted, so that parts of the kernel can be written in either Rust or C. Nobody is pushing for an entire kernel rewrite in Rust. Nobody is pushing out C maintainers. > The Rust min…

Theodore Ts'o, the person you are implying is not an engineer, started working on Linux in 1991. Just look at the MAINTAINERS file of the Linux kernel source tree. You'll find Theo maintaining several critical pieces, including leading the ext4 file system development, but really, take a look.

Just to underline this. You are calling the credibility of a man whose code has most assuredly had a hand in storing your files, whether on your laptops/workstations or servers you've deployed to. A person who has been contributing for nearly *32 years*.

How about we flip this around ? Here's a person who's been a large part of the success of the Linux kernel project for 32 years, and here's this presumptuous group coming in left field, telling him he's doing it all wrong and that it's time to get with the program or buzz off.

People like him, the old guard, the core contributors, the main drivers of maintenance, should absolutely be heard. Linux is what it is today because of them. It's too precious to entrust to a bunch of well-meaning, but somewhat preachy and largely unproven developers.

-----

So he comes off rude. But how come the people driving the Rust integration into the kernel are still ducking the hard discussion?

It is almost as if everything is proceeding under the banner of "just an experiment" until, hopefully, a switch can be flipped and it becomes required, and everyone either has to maintain those bindings or see their patches rejected. Even better, then people who never wanted to pick up Rust, has to, or twiddle their thumbs in the background until some kindly soul decides to provide the updates to the bindings.

Would you labor under such uncertainty and creeping adoption for a year or two, raise the points ad nauseam, get no concrete answers and NOT, at some point, lose your patience ?

Re: Retiring from the Rust for Linux Project – Wedson Almeida Filho

#40
post #34

Earlier quoted context omitted.

> You have a minority who wants to impose a change, and the concerns outlined in that video by the audience member reflects genuine concerns from many other maintainers and contributors. What change exactly is being imposed? Rust has been accepted, so that parts of the kernel can be written in either Rust or C. Nobody is pushing for an entire kernel rewrite in Rust. Nobody is pushing out C maintainers. > The Rust min…

Theodore Ts'o, the person you are implying is not an engineer, started working on Linux in 1991. Just look at the MAINTAINERS file of the Linux kernel source tree. You'll find Theo maintaining several critical pieces, including leading the ext4 file system development, but really, take a look. Just to underline this. You are calling the credibility of a man whose code has most assuredly had a hand in storing your fil…

> Would you labor under such uncertainty and creeping adoption for a year or two, raise the points ad nauseam, get no concrete answers and NOT, at some point, lose your patience ?

Yep, that's what was happening to the RfL devs.

Post reply on HN