The A-Z of Programming Languages: Lua

Professor Roberto Ierusalimschy offers an in-depth examination of what he believes to be the most successful programming language not born in a developed country.

Have you ever seen the language used in a way that was not originally intended? If so, what was it, and did it work?

For me, one of the most unexpected uses of Lua is "inline::Lua", a "Perl extension for embedding Lua scripts into Perl code". I always thought that it was a weird thing to use Lua for scripting a scripting language. It does work, but I do not know how useful it really is.

In a broader sense, the whole use of Lua in games was unexpected for us. We did not create Lua for games, and we had never thought about this possibility before. Of course, with hindsight it looks an obvious application area, and we are very happy to be part of this community. And it seems to be working ;)

You've mentioned the usage of Lua in games already and it's used for scripting in some very famous games such as World of Warcraft (WoW). Have you played WoW or written scripts in it?

No :) I have never played that kind of games (RPG). Actually, until recently I had no knowledge at all about WoW add ons (what they call their scripts). In the last Lua Workshop, Jim Whitehead gave a nice talk about WoW add ons; it was only then that I learned the little I currently know about them.

Do you think that the use of Lua in computer games has allowed people to discover the language who may not have done so otherwise?

Sure. I guess more people have learned about Lua through games than through any other channel.

Do you think that computer games have a part to play in promoting programming languages?

Certainly games are an important way to introduce people to programming. Many kids start using computers to play games, so it seems natural to use this same stimulus for more advanced uses of computers and for programming. However, we should always consider other routes to stimulate people to learn programming. Not everybody is interested in games. In particular, girls are much less motivated by games (or at least by most games) than boys.

Over 40 percent of Adobe Lightroom is believed to be written in Lua. How do you feel about this?

Proud :)

Why do you think that Lua has been such a popular toolkit for programs like Adobe lightroom and various computer games?

There is an important difference between Adobe Lightroom and games in general. For most games, I think the main reason for choosing Lua is its emphasis on scripting. Lightroom has made a different use of Lua, as a large part of the program is written in Lua. For Adobe, a strong reason for choosing Lua was its simplicity. In all cases, however, the easiness of interfacing with C/C++ is quite important, too.

In the Wikipedia article on Lua, it notes: “…Lua’s creators also state that Lisp and Scheme with their single, ubiquitous data structure mechanism were a major influence on their decision to develop the table as the primary data structure of Lua.” Is this true, and why was the list such a powerful influence?

Scheme has been a major source of inspiration for us. This is a language I would love to have created. And it is amazing what we can do using only lists. However, lists do not seem so appropriate for a language where the main paradigm is imperative, such as Lua. Associative arrays have proved to be quite a flexible mechanism.

Join the newsletter!

Error: Please check your email address.

Tags a-z of programming languageslua

More about Adobe SystemsMicrosoftMITRIO TINTOWikipedia

Show Comments