4 ms·
I don't know how much C code actually uses it tbh. Most things just take a pointer. Wouldn't be easy by any means but it could be done at the scale of the Lin
by mhh__ 2y ago
I don't know how much C code actually uses it tbh.
Most things just take a pointer.
Wouldn't be easy by any means but it could be done at the scale of the Linux kernel if anyone cared enough.
- elteto 2y agoIf you use arrays in C you are using pointers and pointer decay. There’s not a lot of useful C code that doesn’t use arrays.
- mhh__ 2y agoThat's true but this is mostly the easy case where things decay in relatively trivial fashion as opposed to the "they're different but actually the same" aspect which is genuinely a bitch of change.
- LeFantome 2y agoI think that is part of his point. Most functions take a pointer, even if they are expecting an array.
- eru 2y agoThe Linux kernel already uses not standard C, but a dialect of C defined by the GCC flags they use. But if you are willing to use something-like-C-but-not-shackled-by-backwards-compatibility, then why stop at arrays and pointers? Just move all the way to D or Zig (or even Rust). These are all languages designed (partially) so that you can port an existing C system bit-by-bit over into them. Many people who can afford that, are doing that, of course. And that's why you don't really hear much about backwards incompatible developments for C. What would be the point?