Lua: Difference between revisions
No edit summary |
No edit summary |
||
| Line 41: | Line 41: | ||
These existing standard library functions were modified: | These existing standard library functions were modified: | ||
* <code>getfenv()<code> - <code>__environment</code> | * <code>getfenv()</code> - <code>__environment</code> | ||
These standard library functions were added by Blizzard: | These standard library functions were added by Blizzard: | ||
Revision as of 04:14, 29 April 2026
"During the slow month of December, programmer Sam Lantinga finished making our user interface customizable via a lightweight programming language called Lua. Despite the fact Sam had explained it to the artists a number of times, the concept of a user-controlled interface didn’t make sense, but the designers and programmers assured us it would be great. Most of us couldn’t understand what was so wrong with the default interface that we now wanted to turn control of it over to the general public. Why let users control the interface? How much better could they make it? Wasn’t it clean enough?"
— John Staats, The WoW Diary
Lua (/ˈluːə/ LOO-ə; from Portuguese: lua [ˈlu(w)ɐ] meaning moon) is a lightweight, high-level, multi-paradigm programming language designed mainly for embedded use in applications.[ Lua is cross-platform software, since the interpreter of compiled bytecode is written in ANSI C,and Lua has a relatively simple C application programming interface (API) to embed it into applications.
Lua originated in 1993 as a language for extending software applications to meet the increasing demand for customization at the time. It provided the basic facilities of most procedural programming languages, but more complicated or domain-specific features were not included; rather, it included mechanisms for extending the language, allowing programmers to implement such features. As Lua was intended to be a general embeddable extension language, the designers of Lua focused on improving its speed, portability, extensibility and ease-of-use in development.
WoW Lua
By the release of 3.3.5a, Blizzard had made various helpful modifications to its version of Lua.
Taint
In WoW Lua, each variable contains a taint value, a string that identifies the AddOn from where the variable originated.
Standard library
WoW Lua modifies the standard library by removing functions that expose the host filesystem, modifying existing functions, or adding new ones.
These functions were removed from the standard library:
dofile(),loadfile()- Removed to prevent Lua from touching the host filesystem.
load()- Reason for removal unclear
print()- Removed to prevent Lua from touching stdout. This is replaced by a function that prints output to the ingame chat.
These existing standard library functions were modified:
getfenv()-__environment
These standard library functions were added by Blizzard:
table.removemulti()
table.wipe()