by masfoobar · 2y ago · 0 comments
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 sees Rust in a completely different manner compared to C++ -- even though you could write crap code in Rust as well.
I get it -- the amount of harcore C programmers are likely shrinking. This means, over time, the linux kernel will eventually have less maintainers. It seems, to me, that Linus accepts reality that he is getting older (54) and wont be the maintainer forever. The younger generation are going to be the back-bone of keeping the project alive and if they are NOT focusing their efforts on C.. then what are they focusing on?
Rust, as good as it is, does have hype riding behind it. We also have other "Nu" languages which are eventually getting their stable releases in the coming months/years. Again, is Rust the right choice?
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.
Seems like everyone has an opinion even if their views on the opposite end is lacking.
As I say I try to sit on the fence. I have not focused my efforts on Rust but I don't actively object to it. I am just skeptical it has been added too soon to the project... but that is my opinion.
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.
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++.
Should there be some duty to approach reality in these comments?
Odin and Zig are interesting, but they are niche compared to Rust, right now. I say this knowing Rust is pretty niche itself! But Rust is on a different planet right now compared to where Odin and Zig are, etc.
> In my opinion, if Linus was still in his early 30s today, he might have rejected Rust the same way as he has C++.
I'm not sure what this says about Linus in his 30s, or the current retrogressive mood of certain C programmers. Whatever it is -- it is a (cosmic!) appeal to authority instead of a well reasoned analysis of why we should listen to this speculative Linus in his 30s, instead of Linus today.
What is wrong comparing Odin to Rust... or Zig to Rust.. or Zig to Odin? These languages exists and should not be ignored simply for being labeled as `niche`
The previous commenter referred Rust as being stable because it was version 1.0 nearly 10 years ago.. and I responded why this does not mean as much as people think. From 1.0 to (now) 1.80.1 -- how much change has Rust gone through? I would take a guess and say A LOT! I am sure Rust will get more changes in the next 10 years!
This is why I think adding Rust to the kernel is 10 years premature. How much changes will need to be done to the Rust code in the next 10 years... I am guessing a lot. Comparing that with C, it is now going through the process of moving from C89 to C11. Once moved to C11 is unlikely to move for quite some time.
Just because I bring up Odin and make (valid) points why it is a better C.. does not imply I think it should be added to the Kernel. It is a young language (like Zig) and I think they both have an interesting future ahead of them. I am just as interested seeing their journey in the next 10 years.. not just Rust.
> I'm not sure what this says about Linus in his 30s
I am just stating that it is hard to know REALLY what Linus thinks about Rust. I use Age as an example because he is likely making decisions, whether he agrees or not, for the future of the kernel beyond himself. He wont be maintainer forever. Thats all I say/write on this.
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.
There has been a number of languages in 20 years that have been given hype - some more than others... yet slowly disappear into the corner.
Ruby and Clojure are 2 examples in the last 13 years. Today, I rarely hear about them (though I am sure they could still be popular in certain places)
To me, Rust is different to these examples.. and more comparable to the sort of hype and popularity Java got back in the 90s. Point is Rust is not going away like these other examples... and the fact Microsoft has included Rust in their kernel (like Linux as and, I believe, BSD) tells you a lot.
Microsoft are likely to still push their stack (.NET, etc) for frontend development. However, for their low-level+high performance codebase, likely behind their azure infrastructure, I would not be surprised if they start going with Rust.
Personally, I would love to see languages like Odin and Zig be more popular but I think Rust is going to dominate many areas in programming. Does not mean Zig or Odin wont be successful, it just wont get that fanbase Rust has, imo. The question you have to ask (like Java) is -- is it really the best choice for its features... or by its push/popularity.
Rust definitely has more going for it than some of the earlier hype cycles. That being said, and speaking from my own experience with Rust, there are some design choices that I suspect may pose a barrier for its widespread adoption. Rewriting small discrete components while maintaining C interop is a very fine use case for Rust - building and maintaining a large, complex, and stateful system wholly in Rust is quite another. I'd be very, very surprised if Microsoft switched en masse to Rust for their bare metal stack, at least with Rust in its current shape.
Clojure is a great parallel to bring up here, and should serve as a cautionary tale for Rust: Java was unpopular, Clojure showed that a better way was possible - but was itself just a bit too alien and hard to work with for many Java devs - so the more-familiar Kotlin swept in and carried the day. I have a sneaking suspicion that this might happen again, with C/C++ in the role of Java, Rust in the role of Clojure, and _ in the role of Kotlin. I don't quite know what the _ will be yet, but I suspect it will be a lot more accommodating to grizzled C wizards than Rust is. (I'm keeping an eye on Zig.)
Microsoft is making Rust a first-class system at Microsoft and investing 10 million dollars towards it apparently:
https://twiiit.com/dwizzzleMSFT/status/1720134540822520268 (nitter)
https://x.com/dwizzzleMSFT/status/1720134540822520268 (twitter)
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
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.
I don't see how this case would be different.
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.
I think the key point of contention here is that the Rust maintainers are insisting this isn't the case. For them, they retain oversight on the Rust bindings, not the C components they reference. What they expect is that when a breaking change happens, they are able to reach out to maintainers of the C component and get documentation, issue threads, etc that might help them resolve those issues.
For Ts'o, maybe the concern is that producing the docs would be onerous, or that in reality they may have to provide more than the minimum expected level of support. I don't personally think the former is a reasonable complaint. I think the latter has grounds for discussion and compromise. And if he is passionate about the kernel as a project, he should introspect about how likely it is that the community will retain or expand its strength as he throws loud public tantrums voluntary contributions to it.