Better handling of integer wraparound in the kernel
Better handling of integer wraparound in the kernel
Posted Feb 11, 2024 18:18 UTC (Sun) by Hi-Angel (guest, #110915)In reply to: Better handling of integer wraparound in the kernel by adobriyan
Parent article: Better handling of integer wraparound in the kernel
That's not really fair regarding C. C is an ancient language, which was designed when there was very little understanding in what's good or bad. For example, it is these days that we know that 90% of values inside a function are immutable, so everything should be constant by default with "mutability" being an opt-in. So now that we know that, it is implemented in Rust.
However, if you were a programmer working on this in ≈1989, you wouldn't know about any of this. I think it's fair to presume that C was designed to the best of the knowledge of its time. It's just we know more than the people living back then.
      Posted Feb 11, 2024 18:35 UTC (Sun)
                               by farnz (subscriber, #17727)
                              [Link] 
       Go back a bit from 1989 - C's development starts in 1972, and the first K&R book is 1978. But, as with most languages, C was not cutting-edge for its day; there's nothing in C that wasn't well-understood for the decade or so before development started, and (as you'd expect) some of C's features are things that PL research knew to be bad by 1978.
 This is not exactly surprising; Rust doesn't take much, if anything, from post 1990s research, despite being a 2015 language release whose development started in 2006. At least in part, this happens because most people have seen and agree on the status of older work; newer work relies on people first noticing it, and then pushing it to their development community.
      
           
     
    Better handling of integer wraparound in the kernel
      
           