Description #
Lua is a lightweight, high-performance scripting language designed for embedded use in applications. With a small footprint and clean syntax, it’s widely used in video games, IoT devices, and scripting engines.
History #
Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes at the Pontifical Catholic University of Rio de Janeiro. It was developed as a simple yet powerful embeddable scripting language to bypass software import restrictions in Brazil.
Hello World Code #
print("Hello, World!")
How to Run #
Option 1: Online
Option 2: Local
- Install Lua:
sudo apt install lua5.3 # or use Homebrew for macOS
Run in terminal:
lua
> print("Hello, World!")
Key Concepts #
- Lightweight and embeddable
- Dynamic typing
- Interpreted language
- First-class functions
- Table-based data structures
- Coroutines for concurrency
- Minimal standard library
- Simple C API for embedding
- Garbage-collected memory management
- Multi-platform compatibility
Try It Online #
Fun Facts #
- Lua is used in games like World of Warcraft and Angry Birds.
- The name Lua means “moon” in Portuguese.
- Lua is written entirely in ANSI C, making it extremely portable.