< Previous | Contents | Next >
About the Lua Language
Lua is a powerful, efficient, lightweight, embedded scripting language built into Resolve and Fusion it is used for Scripting and hosting Python scripting as well as Fuse image processing plugins.
It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode with a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.
— Lua supports an almost conventional set of statements, similar to those in C. This set includes assignments, control structures, function calls, and variable declarations.
— Control structures if, else, while, and repeat have the usual meaning and familiar syntax
— The for statement has two forms: one numeric and one generic. The numeric for loop repeats a block of code while a control variable runs through an arithmetic progression. Also do and break loops.
— Expressions: numbers and literal strings. Variables. Function definitions. Function calls. Table constructors. Both function calls and vararg expressions can result in multiple values.
— Arithmetic operators: the binary + (addition), - (subtraction), * (multiplication), / (division), % (modulo), and ^ (exponentiation); and unary - (negation). If the operands are numbers, or strings that can be converted to numbers, then all operations have the usual meaning.
— The relational operators are, == (equal), ~= (not equal), < (less than), > (greater than), <= (less than or equal), >= (greater than or equal). These operators always result in false or true.
— Math operators like Sin, Cos, Absolute, Log, Power, and more.
— I/O and OS level file open close read write support and control.
Fuses use Lua for the Fuse language and further language documentation can be found on the Lua site and the LuaJit site.