"Lua is a small scripting language. How small? Lua uses
a custom pattern-matching feature, rather than POSIX regular
expressions, because a complete regular expression implementation
is substantially larger than all the standard Lua libraries put
together; the much simpler string matching provided by Lua, while
not quite as powerful, is a fraction of the size.
"Lua variables are not strongly typed; you can check the type of
a value, but there is nothing preventing a variable's type from
changing over time. Both of these choices are good fits for a
scripting language. Lua's type system is reasonably simple, but
quite flexible. Arrays and associative arrays are combined into a
single type, called tables. Strings, numbers (floating point only),
booleans, and the special nil type are basic types. Perhaps more
interestingly, functions are also a basic type. You can assign
functions to variables as easily as any other type; there is no
special syntax. Additional support exists for custom userdata
objects, which can be defined by developers to handle types beyond
those of the basic system.
"One of the biggest surprises for programmers coming from other
languages is that, in Lua, only false and nil are considered false;
any object of a non-boolean type is always considered true in
tests. While this behavior can surprise people who are used to C
idioms, such as using 1 and 0 for true and false, it is easy to
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.