3 ms·
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 lang
by andrepd 7mo ago
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.
- dnautics 7mo agoactually 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 https://github.com/ityonemo/clr
- simonask 7mo ago"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.
- dnautics 7mo agonegative. For example bounds checking is turned on by default in Zig, which prevents classes of overflow safety errors.
- deleted 7mo ago[deleted]
- simonask 7mo agoI 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.
- dnautics 7mo agoI mean, I'm the author of this? https://github.com/ityonemo/clr 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.
- simonask 7mo agoI 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.
- dnautics 7mo agoyeah 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.