Introduction

Why Lua?

Lua is a lightweight, embeddable scripting language designed for extending applications. It powers game scripting (Roblox, World of Warcraft, LOVE2D), embedded systems, and configuration for tools like Neovim, Redis, and Nginx.

  • Simple and elegant — Lua has a tiny core with just 8 basic types and one data structure (the table).
  • Fast — LuaJIT is one of the fastest dynamic language runtimes ever built.
  • Embeddable — Lua was designed from day one to be embedded in C/C++ applications.
  • Tables are everything — arrays, dictionaries, objects, modules, and namespaces are all tables.

What You Will Learn

  • Variables and types — dynamic typing with local declarations
  • Strings — concatenation with .., the string library
  • Control flowif/elseif/else, while, repeat/until, numeric and generic for
  • Functions — first-class functions, closures, variadic arguments
  • Tables — arrays (1-indexed), dictionaries, metatables for OOP
  • Modules — organizing code with table-based modules
  • Coroutines — cooperative multitasking via iterator patterns

Resources

Next →