Ask HN: What are the best resources to learn Rust in 2025?
5 points by _Crownwell 10h ago 5 comments
Ask HN: Ideas to acquire "good taste" in programming?
6 points by danielciocirlan 1d ago 10 comments
DRM Panic QR code generator
62 weinzierl 27 7/4/2025, 7:47:15 AM rust-for-linux.com ↗
It has nothing to do with digital rights management.
I would not really have noticed if there wasn't this section about why rust, where arguments looks phony and clearly made up afterward to justify a decision that was already taken:
> There is no particular reason to do it in rust, I just wanted to learn rust, and see if it can work in the kernel.
Which I think is fairer. Good on him for trying to stay on top of recent developments. With Linux basically supporting Rust now so it's a valid choice, especially for a new component. Plus, it's not like this is an important features, the anti-Rust people can live perfectly fine without QR code crash dumps like they have for decades now.
I think doing this in C is an unnecessary risk (you really don't need all that many raw pointer interactions and shared struct ownership) but the security and stability of this component hardly matters. The kernel is already dead because of a bug or a hardware failure anyway, this is just making the catastrophic failure of the rest of the system a bit prettier.
Good catch the earlier comment, with that I would not even have raise an eyebrow because it is more a motivation that I find valid and not fishy like the post rationalization that is in the original post.
That being said, I still find it ridicule the attempt to emphasis on how dangerous it is to do "C code" for the kernel because not memory safe all of that, when you see for how long the kernel exist, was able thrive, with relatively few critical issues in the end compared to most software out there.
"Pronouns: He/Him" https://gitlab.com/kdj0c
My apologies to kdj0c if he's reading this.
This project is a great example of where and when Rust should be used.
"sneak" some rust in the kernel? It is exactly this kind of attitude that is slowing progress.
(I would agree the first argument is kinda wavy. If anything the panic handler has a fairly unique relationship with memory safety: it's likely to be executing in an environment where that's already gone out the window and it needs to try to assume as little as possible about what might or might not be correct that its reading from and writing to, while also its own memory safety is perhaps less critical because the system is already crashing, it's just got to get the info out before everything completely stops. Though that doesn't make it immune from security concerns. A code execution vulnerability in the handler means any panic could turn into a worse problem)
Rust vs C matters a lot more for maintainers, who read the source code - hopefully not from a machine which is currently crashing - than for the executable kernel itself.
As in: I can't be bothered to write memory safe code.