https://www.lua.org/pil/3.6.html
In particular, to initialize a table to be used as a record:
a = {x=0, y=0}
which is equivalent to: a = {}; a.x=0; a.y=0
and: a.x = nil -- removes field "x"
But I think Guido's right about 0-based indexing:http://python-history.blogspot.com/2013/10/why-python-uses-0...
is very similar to
var a ={x:0,y:0} //javascript object definition
Lua is great but that 1-based indexing is very unfortunate - works fine in itself but clashes badly with the norm.
Lua, on the other hand, is a tiny language. It is remarkably well-designed, with a very simple type system, a very simple syntax, but nevertheless, Lua is extremely flexible.
I have spent a few years with Lue, and I have come to admire it, for it feels as flexible as Ruby, but at the same time more consistent than Python, and faster and simpler than either of those. And, needless to say, none of the inconsistencies of JavaScript.
Lua's stated goal is embeddability. The whole language including the parser and the standard library fit in a few hundred Kb. The bytecode only has a handful of very simple instructions. The source code is exceedingly well-structured and easy to understand.
I think Lua could be a very simple drop-in replacement for JavaScript, doing exactly the same thing that JS does today, but using a much nicer programming language. And it already comes with an object system, modules, and a string manipulation library.
I like Lua.
I can think of several languages I'd like to use on the web, but never really considered Lua.
I'm curious. Why Lua?