THE READING ROOM / BOOK GUIDE
Programming In Lua
Roberto Ierusalimschy, one of Lua's designers, wrote this guide for programmers who want to learn the language from someone involved in shaping it.
About the book
Programming in Lua is a language guide by Roberto Ierusalimschy, a member of the team that designed Lua. It treats Lua as a practical tool: a small language with tables, functions, and a C API that lets host programs expose their own features to scripts.
The text starts with the mechanics of running a Lua program and moves through the language's core ideas. Tables serve as the single data structure, doing duty as arrays, records, and objects. Functions are first-class values. Metatables let programmers customize behavior. The later material turns to the C interface, showing how a host application and a Lua script exchange values and call each other.
This is a teaching book, not a reference manual. It explains design choices as it introduces features, so readers learn why Lua works the way it does. The author's position inside the language's development informs the explanations in ways secondary tutorials often cannot.
How to read it
Read the early chapters in order. The treatment of tables and functions builds a foundation that later material on metatables and the C API assumes. Jumping to the embedding chapters without the language basics will make the examples harder to follow.
The book mixes explanation with short code samples. Type out the examples instead of reading them passively; Lua's interactive interpreter makes this easy. The C API sections demand more patience and some familiarity with C, so budget extra time there. The prose is plain and direct, which keeps the pace brisk.
Who it suits
Programmers who need to embed a scripting language in a C or C++ application will find the most value here, because the C API chapters address that task directly. Developers who have used Lua casually and want to understand metatables, closures, and the language's design will also benefit. Readers coming from larger languages should expect a compact, unusual model and a book that explains it patiently.
Reading considerations
The edition describes Lua as it stood at the time of writing, and the language has continued to evolve. Check which Lua version a project targets before relying on specific syntax or library details. The book teaches the language and its C interface; it does not cover third-party libraries or application design, so readers should look elsewhere for those.
Follow the HN conversation
34 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.
Search HN comments about this book ↗
Explore videos on the same subject ↗
Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.
