Comment by rswail

15 days ago

Except that the ISA has a perfectly good ALU there that can detect zero really easily, so no one was going to waste silicon on an instruction that required comparison to yet another value (which essentially would be an additional subtraction or OR or equivalent) added to the loop.

The fat pointers are much more efficient in that you don't need to scan memory to get the length or find the end to append or take slices etc.

Especially for vectors that don't have any value that can be used as a sentinel.