Lua

A tiny language designed to be embedded.

Lua is taught here in 3 lessons, running from Lua syntax and types through to Embedding Lua in a host program. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackProgramming Languages
Lessons3
LevelBeginner
Reading timeabout 39 minutes
PrerequisitesHelpful, but not required: Scala

Lessons

  1. Lua syntax and typesLocals versus globals, the eight value types, 1-based tables, and the operators that surprise newcomers.
  2. Tables, metatables and object orientationHow __index and __newindex turn plain tables into classes, proxies and read-only views.
  3. Embedding Lua in a host programThe C API stack, passing values in both directions, registering host functions, and sandboxing untrusted scripts.

More in Programming Languages

C C++ C# Scala Dart VBA

FAQ

How long does the Lua course take?
It has 3 lessons, about 39 minutes of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Lua?
Not strictly. It helps to have read Scala first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Lua?
Continue with Dart (3 lessons), the next course in Programming Languages.

Last refreshed 2026-09-18.