4 ms·
Okay, but how many man-centuries have we spent fixing buffer overflows in C because the type system can't check that without breaking reverse compatibility? Re
by kerkeslager 7y ago
Okay, but how many man-centuries have we spent fixing buffer overflows in C because the type system can't check that without breaking reverse compatibility?
Reverse compatibility isn't free.
- deleted 7y ago[deleted]
- musicale 7y agoPeople have made memory-safe compilers for ANSI C (e.g. Fail-Safe C.) Unfortunately clang and gcc don't (yet?) have --safe or an x86-64-safe compilation target.
- kerkeslager 7y agoYes, but without major semantic changes to the language to go the direction of i.e. Rust, you're relying on bounds checking to make it memory safe. If you're using C for performance reasons, adding bounds checking is a break in reverse compatibility, because it happens at run time and drastically degrades performance in some cases.
- philwelch 7y agoIt’s not like C is the only programming language to have never broken backwards compatibility, or that conflating byte arrays and strings is as dangerous as buffer overflow.
- kerkeslager 7y agoYou're right, but it's the oldest that you mentioned, which is why it has the most serious signs of age. C originated 50 years ago: give Python 50 years of development without breaking any backwards compatibility and you'd have a programming language with many of the same kinds of problems.