News for hackers. Stuff that matters.
Re:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by angelochecked on Thursday August 29, 2024 @01:05PM (#41392978)
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?
Re:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by mlindner on Thursday August 29, 2024 @04:24PM (#41394909)
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.
Re:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by binary132 on Friday August 30, 2024 @08:32AM (#41400066)
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:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by mlindner on Saturday August 31, 2024 @05:55AM (#41407677)
I'm a C developer. What I see from some in the C kernel dev camp is a refusal to participate, and further an active attempt to stonewall progress. The Rust devs have been highly accommodating in every possible way, but that's just not enough for them.
Re:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by yeputons on Friday August 30, 2024 @06:35AM (#41399435)
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:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by binary132 on Friday August 30, 2024 @08:30AM (#41400051)
imagine the semantic malebolge that would emerge if they used C++ in the kernel. It would be a nightmare if not managed carefully.
Re:One of the Rust Linux Kernel Devs Steps Down – Cites Nont... by binary132 on Friday August 30, 2024 @08:28AM (#41400039)
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.