Lua script

Lua is commonly described as a "multi-paradigmarrow-up-right" language, providing a small set of general features that can be extended to fit different problem types. Lua does not contain explicit support for inheritancearrow-up-right, but allows it to be implemented with metatablesarrow-up-right. Similarly, Lua allows programmers to implement namespacesarrow-up-right, classesarrow-up-right, and other related features using its single table implementation; first-class functionsarrow-up-right allow the employment of many techniques from functional programmingarrow-up-right; and full lexical scopingarrow-up-right allows fine-grained information hidingarrow-up-right to enforce the principle of least privilegearrow-up-right.

In general, Lua strives to provide simple, flexible meta-featuresarrow-up-right that can be extended as needed, rather than supply a feature-set specific to one programming paradigm. As a result, the base language is lightarrow-up-right—the full reference interpreterarrow-up-right is only about 247 kBarrow-up-right compiled[3]arrow-up-right—and easily adaptable to a broad range of applications.

Lua is a dynamically typedarrow-up-right language intended for use as an extensionarrow-up-right or scripting languagearrow-up-right and is compact enough to fit on a variety of host platforms. It supports only a small number of atomic data structures such as booleanarrow-up-right values, numbers (double-precision floating pointarrow-up-right and 64-bit integersarrow-up-right by default), and stringsarrow-up-right. Typical data structures such as arraysarrow-up-right, setsarrow-up-right, listsarrow-up-right, and recordsarrow-up-right can be represented using Lua's single native data structure, the table, which is essentially a heterogeneous associative arrayarrow-up-right.

Lua implements a small set of advanced features such as first-class functionsarrow-up-right, garbage collectionarrow-up-right, closuresarrow-up-right, proper tail callsarrow-up-right, coercionarrow-up-right (automatic conversion between string and number values at run time), coroutinesarrow-up-right (cooperative multitasking) and dynamic module loadingarrow-up-right.

Last updated