...you could have a loop construct that instead looks like:
forin (a, i, 0, n) as ctl
{
print(ctl[i])
}
The latter would check if 0 is large enough, and n-1 is small enough,
and then execute the actual loop iterations without (further) bounds checking - because we know 1..n-2 have to be in-bounds
if 0 and n-1 were (for sufficiently large n).
Granted, not all loops could be done this way: function calls and mmap would complicate matters, but I believe many loops
could be safe and fast this way.
Also, of course, C arrays usually do not have a length associated with them. This example is more for C-like languages.