|
May 2004
Regular Expressions: Lua Shines
by Cameron Laird and Kathryn Soraiz
Take a look a Lua.
We write that every few years (most recently in May of 2002) because the Lua programming language is underappreciated, and because it continues to advance despite the comparatively small number of people working on and with it.
This spring, though, is a particularly good time to jump to Lua (the Portuguese word for "moon"), because Version 5.0 and The Lua Book are both better than we expected them to be.
Simple and extensible
Let's begin with a bit of background. Lua is a high-level or "scripting" procedural language, roughly comparable to Tcl, Python, Ruby, and similar languages. Lua source code has a familiar appearance; the canonical factorial definition with which the book begins looks almost like:
-- This is a comment.
function factorial(n)
if n == 0 then
return 1
else
return n * fact(n - 1)
end
end
Lua is around a decade old; Version 1.1 was the first public release in July of 1994. It's used mostly outside the United
States, with the core implementation team based in Brazil. Although Lua is far down the list of computing languages in wide use in the United States, at least a couple of development communities strong in the United States have recognized the language's virtues; a poll at GameDev.net, for example, yielded Lua as the most popular language for game scripting.
|