Live data from Hacker News

Retiring from the Rust for Linux Project – Wedson Almeida Filho

lore.kernel.org

41–50 of 107 posts

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

#41

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?

The problem as I see it is that maintaining two API languages implies that one must always “chase” the other if the primary language is refactored. In a single-language codebase, a single refactor can fix all of the related code more easily, unless the maintainer is an expert in both.

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

#42

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 lib…

imagine the semantic malebolge that would emerge if they used C++ in the kernel. It would be a nightmare if not managed carefully.

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

#43

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?

My understanding is the Linux kernel devs are refusing to explain the API and put it down in writing with clear documentation on what the contract is, and then they further gaslight and twist the situation with messaging like "you're trying to convince everyone to switch over to the religion as promulgated by Rust" (direct quote from a Kernel dev). Basically the worst of the worst behavior.

Have you considered trying to understand the perspectives of people in the C kernel dev camp? This seems awfully biased towards a hermeneutic of “C developer bad, Rust developer good”.

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

#44
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…

> Rust in the kernel does not and has never meant C developers will have to learn Rust

That seems incorrect. If I am writing software which interacts with a component, then I need to be able to read it to understand what it’s doing. So if a software system includes Rust, then developers of the system will need to at least be able to read it.

That’s not saying anything bad about Rust, at all: it’s just a property of developing in a shared codebase.

Full disclosure: I dislike C but can read it, and I cannot read Rust. Rust sounds like it really is an improvement over C in many ways, but it does seem to suffer from some social problems. As a Lisp user, I can sympathise.

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

#45
> I truly believe the future of kernels is with memory-safe languages. I am no visionary but if Linux doesn't internalize this, I'm afraid some other kernel will do to it what it did to Unix.

This is why I want to work on multi-kernel NixOS — I want to make this threat as credible as possible.

If ever new kennel requires one to switch to an entirely different user land arbitrarily, they're just imposing stupid switching costs that hamper competition. If you can easily get your experimental kernel and rig it up with NixOS, we could have a real renaissance for systems programming.

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

#46
post #40

Earlier quoted context omitted.

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.

Nope.

RfL was accepted as an experiment[0], with the understanding that it CAN be ejected again if the evaluation fails. Its mandate was as an opt-in functionality, primarily left for individual maintainers to decide on whether to use and leaf-nodes to use.

It is very likely that this was the very best the RfL project could hope for at that time. Had they pushed for first-class citizenship, other contributors would, sensing the impending impact on their work, likely have revolted and the proposal would have been rejected.

So here we are - this is what the RfL people of the time chose over rejection. No one is changing the game on the RfL devs - if you contribute, you are doing so knowing that this is the official state of affairs.

The problem arises because while individual device drivers and subsystem maintainers indeed can opt-in, bindings provided by RfL impact contributors and maintainers who otherwise wish to avoid using Rust. Namely, if you write Rust bindings for my subsystem and my changes break those bindings, what then ? Am I barred from maintaining my subsystem because you decided to wrap the API for a language I don't know ?

This is not the same as some C code consuming my subsystem breaks on a change, which I can easily fix. This means I now have to read those bindings, understand how they wrap my C API and how their expose API differs from mine (remember: idiomatic (fat) Rust bindings is the goal). I am now on the hook for bindings I had no say in providing or designing?

If you don't understand how this can seem problematic, or how this can seem like maintainers are being forced into learning Rust and maintaining bindings which may well be a non-trivial layer in between the C API and consuming Rust code, then I don't know how to make the problem easier to grasp.

Essentially, it's a very simple instance of "your freedom to swing your hands ends at the point where my face begins" - someone (the RfL binding writers) are swinging their fists about, hitting some maintainers on the nose, and being surprised that said maintainers are angry about that.

[0] - https://docs.kernel.org/rust/

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

#47
post #17

Earlier quoted context omitted.

Ted's objection is perfectly reasonable, and the way that Linux works and has always worked internally. If an internal (not userspace) API changes then code that uses that API has to be fixed. He also quite reasonably says that it'll take time to understand the trade-offs of encoding constraints into the type system.

Bringing out silly and absurd strawmen attacks like "you're trying to convince everyone to switch over to the religion as promulgated by Rust" is anything but "perfectly reasonable".

maybe. but is it really FALSE?

anyway, the point of the resignation is not wanting to deal with all this, not necessarily taking a side, so I’m not even disagreeing with you. But obviously, it is a disagreeable atmosphere. I don’t find that debatable, even if that’s due to people feeling paranoid about a (nonexistent?) rust religious takeover.

I think we can all admit Rust definitely has its ideologues and cult acolytes.

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

#49
post #35
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…

> 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 fo…

> 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?

I'm pretty sure they are just asking for emailing. Just a short shift to getting changes in advance some of the time rather than none of the time. It didn't sound like they were asking to cross the divide from Partition Tolerance + Availability to Partition Tolerance + Consistency, merely shifting things a step in that direction (I think the CAP theorem applies everywhere).

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

#50

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…

> 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.

Rust has seen slight interest, but saying that companies like Microsoft are 'moving towards adopting Rust' is just flat out wrong (you realise MS make their own language stack, right? and that it's far more used than Rust?). There's probably more ActionScript 3 in production at MS than Rust.

On the nine year point, your assumption appears to be that Zig is trying to learn from Rust and is behind, but I'm not sure what you're basing this on. Zig isn't trying to do what Rust does, and has no reason to try to relive Rust's growing pains - instead, Zig is trying sand away the rougher edges of C. Zig is not chasing nine years of Rust, it's building on fifty years of C.

Imho, the momentum isn't for moving to Rust, the momentum is for trying to bring memory safety to systems programming (as distinct from most other programming, where GC'd languages are already dominant). Personally, I quite like Rust, but these are early days, and it is not yet clear that Rust will be the language that wins this fight. The history of computing is littered with examples of the slightly less elegant but more practical tool triumphing over the pure but inflexible one.

Post reply on HN