News for hackers. Stuff that matters.
Re:Lua, a Misunderstood Language by samatman on Friday January 15, 2021 @06:16PM (#25797897)
I was with you up to the last paragraph.

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.

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.