7 ms·
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
by masfoobar 2y ago
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 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.
- computably 2y agoRust'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.
- masfoobar 2y ago> 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 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++.
- mustache_kimono 2y ago> When you compare Rust to something like Odin 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.
- 2y ago
- simjnd 2y ago> 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 https://vt.social/@lina/113045455229442533
- masfoobar 2y agoI 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.
- 2y ago
- timeon 2y agoZig is not comparable to Rust in memory safety.