4 ms·
The versions of Pascal that are practical aren't any safer than C. With a properly designed programming environment, you don't need many bounds checks to begin
by pcwalton 8y ago
The versions of Pascal that are practical aren't any safer than C.
With a properly designed programming environment, you don't need many bounds checks to begin with. Almost every embedded system can easily afford the cost of the few you can't eliminate.
- pjmlp 8y agoOn the contrary. While they aren't Rust level safe, they eliminate like 80% of the common C safety errors. Thanks to explicit conversions, proper enums, reference parameters, actual string and vector types, memory allocation based on types instead of arbitrary numbers, type safe linkage thanks modules. So while use after free or double frees would are still an issue, many other classes of typical C errors would be gone.
- pcwalton 8y agoConversions and such aren't where the memory-safety-related vulnerabilities in C++ come from nowadays. They come from memory management problems, which Pascal doesn't help with.
- pjmlp 8y agoMoving goal posts here? I thought we were speaking about C. Yes Rust is great and all, sometimes getting people half-way is better than not at all.
- andrewflnr 8y agoHe probably meant to type C/C++ or something but typo'd it. The set of vulnerabilities is exactly the same. If Pascal still lets you do heap corruption, it's only a matter of time before RCEs become common. So yeah, I'm convinced on that point.