4 ms·
The way C is written in the kernel is really unlike the C you typically encounter in the wild. Try reading it and tell me how comprehensible you find it and how
by recuter 4y ago
The way C is written in the kernel is really unlike the C you typically encounter in the wild. Try reading it and tell me how comprehensible you find it and how easily people ramp up into kernel contributions.
and we have yet to see tangible benefits of using Rust
Is that the royal we? Have you actually (successfully) tried writing something in it?
I am surprised Linus agreed to this given that he doesn’t like C++
Maybe Linus has lost the plot after decades of careful stewardship. Or maybe it is an opportune moment for a closer second look. Who knows.
Sometimes that is what I try to do when my expectations are subverted if I care enough about the subject.
- megous 4y agoIt's quite like any other C codebase, especially the driver code Rust is targetting initially.
- bigfishrunning 4y agoThe main problem with C++ is it's insistence on being an almost-superset of C. Rust has no such hang-ups
- dezgeg 4y agoCan you share some concrete examples where you think "kernel C" is really unlike normal C? Sure, there will be couple of additional things the programmer needs to be aware of (e.g. special care needed when inside interrupt handlers and when holding spinlocks) but overall it doesn't visually look that different.
- recuter 4y agohttps://docs.kernel.org/process/coding-style.html https://docs.kernel.org/process/coding-style.html
- skemper911 4y agoMacros, the ugly side of C, Rust. Shame Zig didn't come before rust, imagining kernel data structures written in Zig, brings a smile. Right on point that kernel style C is its own unique world, with a steep learning curve, so lets add Rust with its own steep learning curve. Rust readability isn't any better than kernel C, guess I'm missing the 10,000 hours of reading Rust. ./KISS
- pjmlp 4y agoWill use after free with Zig code also bring a smile?
- skemper911 4y agoOf course it would a big oops simile, but use after free isn't something that has happened to me in 40 years but I keep testing for it in other peoples code ;)