I am not a big fan of arcane languages, when possible I like to stick to mainstream languages. Sometimes though our work does drive us to some strange languages. Like Visual TCL, a toolkit for the SCO Unix operating system, I used in the final year of my BE degree. I have mostly steered away from other popular languages such as Python and Perl. I then started learning Lua quite skeptically, mostly because my work required me to. I have been fairly surprised by Lua. I don’t want this post to be long, so I’ll quickly list those bits and pieces that are rarely found in mainstream languages:
- Arrays as tables of key/value pairs, or associative arrays
- Multiple return values from functions
- A generic for loop, which in combination with multiple return values from functions, leads to some pretty strange possibilities
- Named arguments to functions using tables
- Closures and the ability to redefine any function, allowing for convenient sandboxing
If you are a Lua veteran, comment about what you think is good about Lua.