3 ms·
The kernel absolutely does not do this "every few years". Linux was written from day 1 in "ANSI C", which is C89 (Edit - it was actually C89 with GNU extension
by dahfizz 4y ago
The kernel absolutely does not do this "every few years".
Linux was written from day 1 in "ANSI C", which is C89 (Edit - it was actually C89 with GNU extensions. Thanks for the corrections). Only now, after 30 years of development, are they considering moving to C99, which is itself over 20 years old.
- sanxiyn 4y ago> Linux was written in ANSI C This is laughably untrue. If it were so, ClangBuiltLinux project would have been trivial, but it was anything but. Linux was written from day 1 in GCC C, and it still is.
- cesarb 4y ago> Linux was written from day 1 in "ANSI C", which is C89. Actually, Linux was written from day 1 in the GCC dialect of C (that is, "gnu89"), using GCC extensions without worry. Compiling the kernel with clang only became possible after clang implemented nearly all GCC extensions the kernel used.
- biorach 4y agoI said > upgrading to a new edition of C OR version of gcc the latter absolutely does happen every few years. Maybe I shouldn't have lumped the C thing in with it, but whatever.
- dahfizz 4y agoSure, but bumping the minimum version of a compiler is a way different thing than taking in a new version of a language. Rust will involve a lot of the later, which is bad for the kernel IMO.
- biorach 4y agoRust puts out a new edition every 3 years or so. The list of backwards incompatibilities in the 2021 edition was pretty small. I don't think that there will be a need to migrate language versions all that often, and, based on what I've seen of how Rust handles backwards compatibility, I don't think it will be an especially big leap.
- sanxiyn 4y agoI would normally agree with this, but Rust for Linux project in fact uses lots of unstable Rust features, and unstable Rust features in fact break a lot (as they should). Unstable Rust is in fact more painful than GCC C, so pain of upgrade is a genuine con against Rust. I just think benefit is larger.
- biorach 4y agoWhich raises an interesting question... Will changes to interfaces in nightly be handled similarly to how internal kernel API changes are handled? - i.e. if your code is in-tree then the mantainers of the Rust integration will update your code to ensure compatibility with the new nightly interface.
- skitter 4y agoYou don't need to switch editions, new language feature generally are available in old editions too. For example, generic associated types, which came out two weeks ago, work fine in edition 2015.