And no, I’m not even going to talk about LÖVE today!
Lau’s great. Just plain great. For those of you not in the know, it’s best described as a scripting language. Lightweight, easy and fun to use, and with a huge amount of possibilities. It’s often used as a scripting language to extend the user’s programming language of choice (but it’s also been put into scripting languages). I myself got introduced to it through LÖVE (last time I’ll mention that this post), and am currently diving a bit deeper into the language itself.
Doing so has taught me a lot of fun small things I wouldn’t have known otherwise. Some pretty essential things as well. My blog isn’t the place to get into specifics, but swapping variable values is hella easy, functions with variable parameter counts are a piece of cake, they can return multiple variables, too! Tables are definitely one of the better data structures out there, the syntax is really nice, and you don’t have to worry about variable types.
Now, Lua is not without its quirks. you may have spotted some points just now that seem a bit strange compared to your average language. In Lua, you never explicitly state the type of a variable. This generally makes things a lot easier, but I can see how some people would like some more control over this. (Using tonumber() or tostring() is usually all you need though.) And then there’s tables. Lua doesn’t have arrays, lists, or any of that. Well, it does, but it’s all grouped under one single object type: tables. Personally I think they’re great. Mix and match different kinds of indices within the same table, use it to pass parameters, do all kinds of other sweet things. Lua indexing starts at 1 by default though. I personally don’t have that big a problem with it, but it definitely took a bit of time to get used to. (You can work around and have ’em start at 0 instead, but that’s not recommended, what with most libraries assuming you start at 1 and all.)
Despite its quirks, Lua is very lovable. Fun and easy to use, and released under the MIT license, allowing you to use it for any purpose whatsoever. Always nice, having such a liberal license in the software you use. It runs on a wide variety of platforms, so there really is very little reason to not give it a shot.
If you’re looking for a new language to learn, check it out!