Gavin Kistner
1/18/2007 8:49:00 PM
Shea Martin wrote:
> Lua was the first one that jumped into my head, even though I know very
> little about the language, other than the fact that games often embed it.
I use Lua almost daily in my work, and have written moderate-sized
libraries with it.
Things that are great about Lua, in my opinion:
* It's really small, and really fast.
* It's easy to embed, and designed that way.
* It has strong, dynamic typed variables, and first-class functions,
and automatic (now incremental) garbage collection.
* The language itself is REALLY simple and elegant; you can learn it
in a few days, and nearly master it in a week.
* It is an entirely procedural, not object-oriented language...and yet
a tiny, simple bit of syntax sugar and a few powerful metaevents can
make it look like OOP for simple tasks, and it's easy to write your own
fully-OOP framework.
* It's crazy portable to a lot of platforms.
* You can compile code to bytecode and load bytecode in directly.
* A recent addition called token filters (that I don't fully
understand) allow you to easily extend the language to support near
arbitrary syntax additions that you want.
Things that make Lua not nearly as cool as Ruby, in my opinion:
* The core library of functionality is extremely limited. (No IO. No
time or date objects. No XML. Limited pattern matching.)
* Verbose syntax. ("function" instead of "def" makes lambdas
inconvenient. "then" with every "if" statement. Not only no ++, but no
+= either.) The amount of typing just to accomplish a simple task makes
me feel like I'm working with a low-level language like C, not a high
level scripting language.
Lua is so clean and elegant at the core that I have to love it. I
enjoyed writing my own OOP wrapper that mimics Ruby's hierarchy (though
I decided not to add modules or 'super' calls, it's absolutely
possible). But programming in it generally feels like I'm working to
figure out how to make Lua do what I want, whereas Ruby enables me to
do it.