by tayistay · 3y ago · 0 comments
Even very good static analysis tools have a hard time doing this. In a language like C++ this would effectively mean that very few index operations can be done naively and compile times are significantly increased. Performance is likely reduced as well over the trivial alternative of using a safe array.
https://github.com/google/wuffs#what-does-compile-time-check...
and using a range check manually before an index will normally optimize the internal bounds check away