4 ms·
I worked (a long time ago) on Burroughs mainframes which did bounds checking of arrays (and in fact even type checking), because the whole machine was build aro
by sseth 8y ago
I worked (a long time ago) on Burroughs mainframes which did bounds checking of arrays (and in fact even type checking), because the whole machine was build around ALGOL.
I am not sure whether the experience from these machines was negative. It may be that when you move beyond one-dimensional arrays, bounds checking becomes more complicated.
Perhaps performance suffers too. Languages which do bounds checking often have intelligent compilers which can skip the bounds check in a variety of conditions. So even if the hardware is faster, it may be doing unnecessary checks. See for example : https://www.ardanlabs.com/blog/2018/04/bounds-check-elimination-in-go.html https://www.ardanlabs.com/blog/2018/04/bounds-check-eliminat...
- qznc 8y agoI also believe that bounds checking in hardware is not worth it. Memory accesses dominate the runtime such that a few extra instructions for bounds checking is negligible.