Iterating collections without first-class references
In my previous round of benchmarking
I noted that Datalove's system library iterates collections in an awkward way.
It keeps a loop induction variable of type index,
increments it each time around the loop, and indexes into the collection to get the element.
Each index imposes a bounds check.
Datalove is missing a basic language feature: the for loop.
Adding one sounds simple,
but without first-class references we can't make iterators a general-purpose library feature.
Instead we have to build them into the language and runtime,
teaching the compiler directly about every type that can be iterated.