Re:Lua, a Misunderstood Language
by CountSessine on Friday January 15, 2021 @07:04PM
(#25798350)
That makes a lot sense. History is a path-dependent function, I guess. Interesting that it was a data description language - in that context, 1-based indexing really would be called for, although maybe flexible indexing like Pascal’s would be even better.
Lua uses 1-based indexing because it started as a data description language, and data tends to use 1-based indexing.
It evolved to where the primary use case is at odds with this origin. I work with Lua every day and consider the indexing convention to be a genuine flaw. But it's useful to know where that came from, because it wasn't a mistake.