Impressively, you can even tell typed racket that your lists have certain lengths, and it can skip bounds checks! https://docs.racket-lang.org/ts-guide/optimization.html#(part._.Lists)
miniblog.
Related Posts
Some excellent safety improvements in C++26: hardening the standard library against out-of-bounds bugs, and a safer semantics for uninitialised local variables:
Benchmarking the cost of array bounds checks in Rust code: https://blog.readyset.io/bounds-checks/
The author even patches rustc to make sure *all* bounds checks are gone, in order to compare the performance!
Rust 1.34.0 had a security vulnerability that allowed reading/writing memory out of bounds!
