News for hackers. Stuff that matters.
Re:Zig – Type Resolution Redesign and Language Changes by microtonal on Wednesday March 11, 2026 @06:14AM (#47333734)
It is kind of interesting that the Linux kernel is slowly adopting Rust, whereas Zig seems like it would be a more natural fit?

I know, timelines not matching up, etc.

Re:Zig – Type Resolution Redesign and Language Changes by nasretdinov on Wednesday March 11, 2026 @06:35AM (#47333859)
Memory safety by default in kernel sounds like a good idea :). However I don't think that C is being _replaced_ by Rust code, it's rather that more independent parts that don't need to deeply integrate with the existing C constructs can be written in a memory safe language, and IMO that's a fine tradeoff
Re:Zig – Type Resolution Redesign and Language Changes by andrepd on Wednesday March 11, 2026 @06:32AM (#47333841)
Definitely not. Rust gives you a tangible benefit in terms of correctness. It's such a valuable benefit that it outweighs the burden of incorporating a new language in the kernel, with all that comes with it.

Zig offers no such thing. It would be a like-for-like replacement of an unsafe old language with an unsafe new one. May even be a better language, but that's not enough reason to overcome the burden.

Re:Zig – Type Resolution Redesign and Language Changes by dnautics on Wednesday March 11, 2026 @08:49AM (#47334891)
actually that's not true at all. Zig offers you some more safety than C. And it also affords you a compiler architecture and stdlib that is so well designed you could probably bolt on memory safety relatively easily as a 3rd party static checker

https://github.com/ityonemo/clr

Re:Zig – Type Resolution Redesign and Language Changes by simonask on Wednesday March 11, 2026 @09:18AM (#47335200)
"More safety than C" is an incredibly low bar. These are hygiene features, which is great, but Rust offers a paradigm shift. It's an entirely different ballpark.
Re:Zig – Type Resolution Redesign and Language Changes by dnautics on Wednesday March 11, 2026 @11:18AM (#47336760)
negative. For example bounds checking is turned on by default in Zig, which prevents classes of overflow safety errors.
Re:Zig – Type Resolution Redesign and Language Changes by simonask on Thursday March 12, 2026 @03:47AM (#47347696)
I don't think you've necessarily understood the scope and impact of the borrow checker. Bounds checking is just a sane default (hygiene), not a game changer.
Re:Zig – Type Resolution Redesign and Language Changes by dnautics on Thursday March 12, 2026 @04:42PM (#47356785)
I mean, I'm the author of this?

https://github.com/ityonemo/clr

so yes, I understand that it's important. It doesn't need to be in the compiler though? I think it's likely the case that you also don't need to have annotations littering the language.

Re:Zig – Type Resolution Redesign and Language Changes by simonask on Friday March 13, 2026 @08:20AM (#47363451)
I wish you good luck! Successive attempts to achieve similar levels of analysis without annotations have failed in the C++ space, but I look forward to reading your results.
Re:Zig – Type Resolution Redesign and Language Changes by dnautics on Friday March 13, 2026 @02:57PM (#47368205)
yeah afaik you cant easily intercept c++ at a meaningful IR in the same way as you can zig. Zig's AIR is almost perfect for this kind of thing.
Re:Zig – Type Resolution Redesign and Language Changes by keybored on Wednesday March 11, 2026 @06:34AM (#47333851)
And “if you enjoy C++/if you enjoy C” are gross oversimplifications.
Re:Zig – Type Resolution Redesign and Language Changes by smj-edison on Wednesday March 11, 2026 @10:04AM (#47335728)
I believe Rust is mainly being used for driver development, which seems a great fit (there's so many people of different skill levels who write Linux drivers, so this should help avoid bad driver code being exploited). It may also end up in the core systems, but it also might not fit there as well.
Re:Zig – Type Resolution Redesign and Language Changes by lionkor on Wednesday March 11, 2026 @10:19AM (#47335903)
And Zig isn't stable yet
Re:Zig – Type Resolution Redesign and Language Changes by lII1lIlI11ll on Thursday March 12, 2026 @12:02PM (#47352828)
It is not about timelines. Linux Torvalds doesn't spend nights reading bunch of books with crabs on their covers rewriting random bits and pieces of the kernel in Rust. It is basically a dedicated group of people sponsored by megacorps doing the heavy lifting. If megacorps wanted Zig we could have had it in the kernel instead (Linux might have rejected it though, not sure what he thinks of it).