Anyway, your language without buffer overflows would not use pointer arithmetic, so would create a zlib a lot slower than the one we now, even if you optimise your high level language to the max.
Really? I don't see any reasonable way for a compiler to implement arrays internally without pointer arithmetic, be it C or any high-level language.
As for mandatory array boundary checks, they can really be optimized away whenever they are not needed. Most trivial example: in case the complier has verified that the loop counter is within the boundaries of the array, no check on access is necessary. Provided the optimizer is good, there won't be any significant difference between the optimized code with mandatory checks and the code where all necessary checks are added manually.
It can even be possible to allow real pointers and pointer arithmetic, have certain source-level compatibility with C, and still have the code which has all necessary checks and is not prone to buffer overflows. E.g. check out Cyclone, which was discussed on Slashdot some time ago.
Comparing with C qsort is strange, qsort will never work fast due to being unable to inline the comparison function. Hand-written qsort of floats should work much faster.
Lone Star: A million? That's unfair.
Pizza the Hutt: Unfair to the pay-or, but not to the pay-ee. But you're gonna pay it, or else!
As for mandatory array boundary checks, they can really be optimized away whenever they are not needed. Most trivial example: in case the complier has verified that the loop counter is within the boundaries of the array, no check on access is necessary. Provided the optimizer is good, there won't be any significant difference between the optimized code with mandatory checks and the code where all necessary checks are added manually.
It can even be possible to allow real pointers and pointer arithmetic, have certain source-level compatibility with C, and still have the code which has all necessary checks and is not prone to buffer overflows. E.g. check out Cyclone, which was discussed on Slashdot some time ago.
Comparing with C qsort is strange, qsort will never work fast due to being unable to inline the comparison function. Hand-written qsort of floats should work much faster.