Lua is great for high-level control of a program written in C/C++. When setting that up, I’ve often appreciated that I could removed features like file I/O from the Lua standard library and the rest keeps on trucking.
Lua is terrible for writing programs by itself. People keep trying to make it happen. But, for anything non-trivial, it’s a fool’s errand.
As for how light it is, I don't disagree with you that it's frustrating, but as someone who only started using it at the beginning of last year for making a mod, I've realized that in a lot of ways, it feels like it's JavaScript if it were designed properly from the start. Both use a single map data structure for everything, including having arrays be "maps with incrementing integer keys", but Lua anticipated that iteration for arrays should work differently made the loop syntax give you a way to specify which way you want. Neither has a particularly large set of APIs that are available out of the box, but Lua defined a module system from day one (I assume, I guess I don't know for sure) and even provides a way to use it as for defining objects; JavaScript has a prototypical inheritance system that's probably more complex than it ever needed to be, and it took decades for a standard way of importing things to be defined. Lua also doesn't have the famous warts of implicit type coercion for operators (including the more familiar looking of the two equality checks); I'd take arrays starting at 1 over that any day.
I don't love working in Lua, but given how unfathomable it is to me that so many people genuinely seem to enjoy JavaScript, Lua seems more than sufficient in terms of the language features at least.
Some of them had this cool modern idea of overlays, where we would manually manage loading additional code segments into the same process memory slot.
Numerical loops in Lua are inclusive:
for i=1,#t do t[i]=0 end
On the example above the i starts at 1 and goes up to (and including) the length of t.With 0-based indexes, and that numerical loop format, it would be minus-one everywhere:
for i=1,#t-1 do ...The funny thing is, you could say the end index is zero-indexed and exclusive and that would result in the same behavior as one-indexed and inclusive. It wouldn't make sense to make it zero-indexed and inclusive, because the inclusivity only exists in the first place to account for the one-indexing. That would be an incomplete and nonsensical conversion.
Jokes aside, I did start to do a conversion like this manually some years ago, but it wouldn't really be Lua at that point. I just got bored because I knew it wouldn't really have value to anybody.