Lua

Best Free Books to Learn about Lua

Lua is a lightweight, small, compact, and fast programming language designed as an embeddable scripting language. This cross-platform interpreted language has a simple syntax with powerful data description constructs. It has automatic memory management and incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping. Lua tries to help you solve problems with only hundreds of lines, or even less. To achieve this aim, Lua relies on extensibility.

In the popularity stakes, Lua lags behind say Python, Perl, or Ruby for scripting purposes. As a barometer of its popularity, Lua is currently ranked in 33rd place on the TIOBE Index.

Lua is not designed to develop standalone software. But Lua excels as a secondary language. Witness Lua cropping up in kernels, tools, and games. Lua was designed, from the beginning, to be integrated with software written in C and other conventional languages. But it’s also used as a standalone language.

This language is free software distributed under the terms of the MIT license. Lua’s developers consist of a team at PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. The language has been in development for 26 years.

This article recommends free books to help you master programming in Lua. As the range of good free books is fairly limited, I close the article with a few carefully selected tutorials that are genuinely useful.


1. Lua 5.3 Reference Manual by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes

Lua 5.3 Reference ManualLua 5.3 Reference Manual offers the official definition of the Lua language. This expertly written book describes the syntax and the semantics of Lua, the standard libraries, and the C Application Program Interface (API). The section on the API covers the stack, stack size, valid and acceptable indices, C closures, registry, error handling in C, handling yields in C, and more.

The book ends with the complete syntax of Lua in extended Backus Normal Form (BNF 1).

Read the book at https://www.lua.org/manual/.

The book is published under the terms of the Lua license.


2. Programming in Lua (first edition) by Roberto Ierusalimschy

ProgrammingLuaProgramming in Lua is a detailed and authoritative introduction to all aspects of Lua programming written by Lua’s chief architect.

The free online version of this book focuses on Lua 5.0. While this is not the latest release of Lua, the book remains very relevant. You’ll just have to refresh the latest changes in the syntax of the language.

Read the online version of the book at https://www.lua.org/pil/contents.html.

We recommend purchasing a paperback version of the fourth edition of the book, which updates the book to Lua 5.3.


3. Lua for Beginners by ignatz

Lua for BeginnersLua for Beginners is an unofficial guide designed to offer a good introduction to the world of Lua. It’s targeted at beginners to the language.

Spanning 83 pages, this book covers the basics of Lua, taking the reader a step at a time through the language. Along the way you’ll learn about variables, conditions, loops, lists, functions, classes, pointers, classes and callbacks, class inheritance, coroutines, closures, debugging, and metatables.

The book is supplied with exercises to test learning.

Download a PDF copy of the book.


4. Lua Programming Gems edited by L. H. de Figueiredo, W. Celes, R. Ierusalimschy

Lua Programming GemsLua Programming Gems is a collection of articles that express some of the existing wisdom and practice on how to program well in Lua.

Please note some parts of the book are not freely available, and some of the links are broken. But there are some free chapters with accompanying code. You’ll learn how to write better Lua programs.

Read the articles and code at https://www.lua.org/gems/.


Other useful guides for learning how to program in Lua include:

And for a listing of Lua projects, visit the Project Catalog at LuaForge.


1 BNF is a metasyntactic notation procedure used to specify the syntax of computer programming languages, command/instruction sets, document formatting and communication protocols.


All books in this series:

Free Programming Books
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
CGeneral-purpose, procedural, portable, high-level language
PythonGeneral-purpose, structured, powerful language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
JavaScriptInterpreted, prototype-based, scripting language
PHPPHP has been at the helm of the web for many years
HTMLHyperText Markup Language
SQLAccess and manipulate data held in a relational database management system
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
AssemblyAs close to writing machine code without writing in pure hexadecimal
SwiftPowerful and intuitive general-purpose programming language
GroovyPowerful, optionally typed and dynamic language
GoCompiled, statically typed programming language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
RDe facto standard among statisticians and data analysts
COBOLCommon Business-Oriented Language
ScalaModern, object-functional, multi-paradigm, Java-based language
FortranThe first high-level language, using the first compiler
ScratchVisual programming language designed for 8-16 year-old children
LuaDesigned as an embeddable scripting language
LogoDialect of Lisp that features interactivity, modularity, extensibility
RustIdeal for systems, embedded, and other performance critical code
LispUnique features - excellent to study programming constructs
AdaALGOL-like programming language, extended from Pascal and other languages
HaskellStandardized, general-purpose, polymorphically, statically typed language
SchemeA general-purpose, functional language descended from Lisp and Algol
PrologA general purpose, declarative, logic programming language
ForthImperative stack-based programming language
ClojureDialect of the Lisp programming language
JuliaHigh-level, high-performance language for technical computing
AwkVersatile language designed for pattern scanning and processing language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
BASICBeginner’s All-purpose Symbolic Instruction Code
ErlangGeneral-purpose, concurrent, declarative, functional language
VimLPowerful scripting language of the Vim editor
OCamlThe main implementation of the Caml language
ECMAScriptBest known as the language embedded in web browsers
BashShell and command language; popular both as a shell and a scripting language
LaTeXProfessional document preparation system and document markup language
TeXMarkup and programming language - create professional quality typeset text
ArduinoInexpensive, flexible, open source microcontroller platform
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ElixirRelatively new functional language running on the Erlang virtual machine
F#Uses functional, imperative, and object-oriented programming methods
TclDynamic language based on concepts of Lisp, C, and Unix shells
FactorDynamic stack-based programming language
EiffelObject-oriented language designed by Bertrand Meyer
AgdaDependently typed functional language based on intuitionistic Type Theory
IconWide variety of features for processing and presenting symbolic data
XMLRules for defining semantic tags describing structure ad meaning
ValaObject-oriented language, syntactically similar to C#
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
DGeneral-purpose systems programming language with a C-like syntax
Share this article

Share your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.