Antti-Juhani Kaijanaho: Safety is paramount
Most programming languages designed before 1980's were safe. All well-formed programs had well-defined meaning. The main exceptions were very low-level languages where run-time tests for indexes and such things were just too expensive. From this low-level tradition came C.
Then for some very strange reason C became popular for general-purpose programming. It has been in to avoid safety as much as possible ever since then.
For most programming tasks, safety is much more important than speed. It seems it's only now that people are realizing it. If we hadn't made the C mistake, we wouldn't need to be paying for it with all those buffer overflows.
Cyclone looks like a useful C replacement for most projects. Never tried it for real, though.
2004-05-12T23:54+0300 - /en/programming
Trackback url: http://antti-juhani.kaijanaho.info/blog/en/programming/safety.trackback (trackback on rikki / trackback is broken)
Re: Safety is paramount
No, older languages were not safe. Dereferencing null pointers, or previously freed pointers was always a possibility, and while out-of-bounds array accesses might be immediately caught, the resulting termination of the program by a trap could be disasterous.
It is true that C makes it easier to randomly corrupt memory and have no idea what happened.
- Joe Buck, la, 15 touko 2004 03:27
Re: Safety is paramount
I see you want to debate my comment. Pascal and PL/I both predated C, and both allowed the programmer to corrupt the heap (by using a pointer after the object to which it points is deleted).
- Joe Buck, ke, 19 touko 2004 01:34
Re: Safety is paramount
Your comment would apply if I had claimed "all" :)
However, it probably is not true that most languages designed in the 1970s were safe. Rather, the state of the art of language design already included everything required to make a language safe, and there are indeed several examples of safe languages designed in the 1970s.
Pascal is, BTW, unsafe also for many other reasons, not just because of dangling pointers (variant records come to mind).
- Antti-Juhani Kaijanaho, ke, 19 touko 2004 18:22
Your Comment