Lua Flashcards
(26 cards)
Lua was created on
1993
Creator of Lua
Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes
Reason Why Lua was made
Due to Brazil’s strict trade barriers (1977–1992)—known as the “market reserve”
policy
two domain-specific languages for its engineering applications at Petrobras that laid the ground work for the creation Lua
● DEL – A data-entry language
● SOL – A configurable report generator for lithology profiles
The name Lua came from
The Portuguese word for “moon”
Latest Version of Lua
Version 5.4.7 (June 2024)
Version that added Constants
Version 5.4 (June 2020)
Application Areas of Lua
Game Development
Embedded Systems & IoT
Web Development
Artificial Intelligence (AI) & Machine Learning
System Administration & Scripting
Characteristics of Lua
Fast
Portable
Embeddable
Powerful (but Simple)
Small
Free
Lua Programming Paradigm
Multi - paradigm - procedural, functional and object oriented programing
Lua Type System
Dynamically Type and Weakly Typed
Lua is weakly typed Because
of its automatic type conversion
Memory Management in Lua
It has an automatic garbage collection
Translator Program for Lua
Lua Translator
Bytecode compiler - luac
JIT compilation - LuaJIT
How to make constant in Lua
local PI <const> = 3.14159.</const>
Make a variable y with a value 7
y = 7
Make a local Variable y with value 7
local y = 7
Used to differentiate the value from having some data or no data.
nil
Represents arbitrary C data.
userdata
Lua’s only Data Structure Available
Table
Array in Lua
array = {10, 20, 30, 40, 50}
print(array[1])
Record in Lua
record = {name = “John”, age = 30 }
print(record.name)
List in Lua
list = {“banana”, “apple”, “cherry”}
Sets in Lua
set = {}
set[“apple”] = true
set[“banana”] = true