Litt's Lua Laboratory
The 10% you need -- for 90% of your work
IntroductionIn my opinion, Lua as a
language rather than an environment or framework, is second to none.
Its syntax is so simple there's almost never a surprise and it's
memorable enough that you don't need to keep referring back to the
manual, even if you use it only once a month.
What I Like About Lua
Here are some of the things I like about Lua:
- All complex data formations are built with tables. A Lua table is simply a high performance set of key/value pairs.
- Callback functions are trivially easy in Lua, without the confusing syntax required in other languages.
- Closures are trivially easy in Lua, and enable all sorts of powerful programming techniques.
- Lua runs very fast. If the normal Lua interpreter isn't fast
enough for you (and I think it's faster than Perl), then you can run
LuaJIT 2.0 for triple the speed.
- You can easily run Lua programs or functions from your C program.
- You can easily run C functions from your Lua programs.
- You can do OOP in Lua but you have a lot more paradigm choices.
- Lua's string.gsub() function does almost all of what Perl's regex does.
What I Don't Like About Lua
I don't like the following things about Lua:
That being said, if you need the preceding, where there's a will
there's a way. For GUI support you have some third party addons. One
interesting RAD idea is that there's an addon called pLua that
interfaces Lua with Lazarus, a Delphi-like free software RAD program.
- No built in GUI support.
- No built in Rapid Application Development (RAD) support.
- No built in web app support.
- Database support requires the LuaSQL addon.
Web support can be provided either by Kepler, which is a full featured
straightforward web framework, or if you like MVC, you can use an addon
None of these addons are as easy to install and work with as something
native, but they get you out of any dead ends you might encounter.
Lua's a spectacular language.
| Code Corner | Email
Steve Litt ]
(C) 2011 by Steve Litt --