8 ms·
> I might even start contributing once Rust is more common! as someone who's recently experimenting with Rust, why is that so? I mean if you have something in
by aulin 4y ago
> I might even start contributing once Rust is more common!
as someone who's recently experimenting with Rust, why is that so? I mean if you have something in the kernel where you could give valuable contribution, why letting the language stop you? guess any dev who can write Rust today is also a good C dev, ain't it?
- Gigachad 4y agoNot OP but I'm waiting for Rust support to be finished before I look at kernel development. Don't have any interest in writing C.
- caskstrength 4y agoEven in best case scenario Rust code will be confined to individual subsystems and drivers for a very long time. And even in these subsystems you will probably still have to interact with a lot of C code from shared data-structures in other subsystems.
- xiphias2 4y agoMost of Linux kernel is drivers, so if new drivers can be written in Rust, it's a huge win in safety for the whole world.
- ploxiln 4y agoHonestly this is a bit of a fantasy. If you love Rust and hate C, and haven't looked into kernel development before ... it's a whole different ball-game than user-space Rust. With a variety of real-world hardware, and the complexity of modern CPUs, and demands of a variety of complex user-space software, you just don't have the "guarantees" and conveniences you want, at this layer. The hardware does what it does and you just have to deal with it. User-space C code can be way easier to reason about. For a small taste see https://lkml.org/lkml/2022/9/19/1105 https://lkml.org/lkml/2022/9/19/1105
- Ar-Curunir 4y agoYes, but dealing with low-level stuff in Rust is going to be easier than doing that in C. See for example the blog post by Asahi Lina talking about how it was easier to program the M1 GPU driver in Rust than it would have been in C.
- sebzim4500 4y ago>guess any dev who can write Rust today is also a good C dev, I'm sure they have the potential, but they might not want to learn/use C. I'd certainly be much more likely to look at kernel dev if I can use rust than if I have to use C.
- xiphias2 4y agoNo, it's just not true. Just look at Google's recent Android statistics as a validation.
- coldtea 4y ago>guess any dev who can write Rust today is also a good C dev, ain't it? Quite a number of Rust devs I've read about, have never been C devs. They came from dynamic languages or Java or similar, and stuck with Rust and learned it, as a more modern features-wise and less error-prone systems language than C.
- rjsw 4y agoI would not want someone writing kernel code who can't understand what the rest of it is doing.
- coldtea 4y agoWho said those people will be writing kernel code? Rust for the Linux kernel is like 0.000001% of real life Rust use (which is not that big to begin with). And it wouldn't be used the main kernel for the most part anyways, mostly (if not exclusively) kernel drivers.
- rjsw 4y agoThis thread is about a kernel DRM driver written in Rust, writing any DRM driver requires a lot of knowledge about how the rest of the DRM subsystem and the kernel works.
- coldtea 4y agoThe subthread though is about whether "any dev who can write Rust today is also a good C dev, ain't it?", not about kernel drivers...
- dhruvdh 4y agoThere is a difference between not understanding and not wanting to write C.
- tbalsam 4y agoI'd be curious how C (and C++ for that matter) stacks up on some arbitrary "freshness" metric that measures some kind of statistic/statistics that indicate the average/median time it takes for the population of engineers to reach some particular level of "done"ness with a language. I have no idea how you would measure it, but I'm assuming that C, VBScript, Perl, sed, AWK, bash, and Haskell (please don't hurt me I'm thinking about the code maintenance, time draining nightmare that is a real-world use case of mega-scaled purely functional codebases as opposed to a mixed dynamic with a purely functional core). Curious what other languages would top the list. I'm going to assume also that some low-barrier entry scripting languages that are well designed, similar to Python, and languages that save the hypothetical, proverbial broken backs of their ancestors, like Rust, to be near the bottom of the list. I'm curious what that bottom part of the list would look like too, oddly enough. :D :))))
- fulafel 4y agoNot really. C is a simple but dangerous language where the compiler doesn't do much for you, Rust is the opposite. It's like chainsaw juggling vs bridge.
- potatochup 4y agoI used to write bare-metal C for my day job. It's pretty hard to get everything right when the language has so many sharp edges. I wouldn't want to use C for a bigger project (e.g. the kernel, drivers, a gui app) but I'd quite happily use Rust because the compiler will yell at me if I do something stupid
- Klonoar 4y agoLife is too short to desire writing in C and/C++.
- jokethrowaway 4y agoI'm not paid to contribute to the Linux kernel, albeit you may get some reputation benefits out of it. It's mostly a hobby: if it sounds fun, I might do it - otherwise no chance in hell. Contributing to a C kernel sounds like a thankless job with crappy tooling and high potential for errors - and frankly just brings back horrible memories (ahhh, the segfaults). Developing in Rust on the contrary is quite enjoyable and I'm definitely more inclined to contribute something.