SoftBound

bearophile bearophileHUGS at lycos.com
Thu Oct 1 12:50:53 PDT 2009


Walter Bright:

> I don't think there's much point to this in D. You rarely need to deal 
> with pointers directly. Arrays are already checked.

In D pointers are quite less common than in C, but half of the point of using D is to be able to use pointers too, when you want to implement your own data structures, otherwise it may be better to just use Java in the first place. So in my opinion adding optional safeties to D pointers can be useful.

The good things of the design of SoftBound is that it looks simple to implement (and probably LDC may just use/adapt the already existing implementation), it's logically sound, it doesn't change the behaviour of the C/D program and works with most or all programs, it's safe, it doesn't need changes to the source code of programs to be used, and the performance&memory overhead it introduces is usually acceptable in nonrelease mode (there are two different usage modes). I have seen more than ten similar systems for C, this one looks like being simple and effective enough.

Bye,
bearophile



More information about the Digitalmars-d mailing list