First impressions with Lua


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.

One thought on “First impressions with Lua

  1. Don’t forget the simplicity of Lua syntax! Compare it to Ruby, Python, C++ or Java, and you may find that Lua has surprising flexibility for its limited syntax.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s