@mjg59 Is it an oversimplification for me to say that null-terminated strings were a mistake? Because it really seems like null-terminated strings were a mistake.
@mjg59 Couldn't you build that into the language relatively easily? E.g. if strings are immutable in the language, then any writing to a string variable compiles into: calculate the string length + tag length, make a sys call to allocate that amount and throw an exception if the call fails, then write the bytes into that chunk of memory.
@mjg59 Then you've got some other poor quality bounds checking. Overriding a string length tag isn't worse than overwriting anything else, is it? AFAIK that's essentially random, chaotically determined by the language, the compiler, and the program.
Add comment