Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Pascal object code with runtime range checks could be slower than C object code without any such checks. Pascal strings typically were either statically bounded or included bounds information, while C strings typically did not.

Unfortunately C's lack of bounds checking made it very easy to create buffer overflows, which turned out to be a huge problem.

Ada doubled down on memory safety, which turned out to be a very good idea, especially if it can be combined with concurrency safety, formal checking (as with SPARK), etc.

Fortunately clang/llvm seem to be making some progress on memory safety; hopefully features like -fbounds-safety [1] will eventually bring C (and maybe C++) solidly into the 1980s.

[1] https://clang.llvm.org/docs/BoundsSafetyAdoptionGuide.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: