Programming Books

Best Free Books to Learn about Lua

Last Updated on May 22, 2022

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:


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
AdaALGOL-like programming language, extended from Pascal and other languages
AgdaDependently typed functional language based on intuitionistic Type Theory
ArduinoInexpensive, flexible, open source microcontroller platform
AssemblyAs close to writing machine code without writing in pure hexadecimal
AwkVersatile language designed for pattern scanning and processing language
BashShell and command language; popular both as a shell and a scripting language
BASICBeginner’s All-purpose Symbolic Instruction Code
CGeneral-purpose, procedural, portable, high-level language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
ClojureDialect of the Lisp programming language
ClojureScriptCompiler for Clojure that targets JavaScript
COBOLCommon Business-Oriented Language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
CoqDependently typed language similar to Agda, Idris, F* and others
CrystalGeneral-purpose, concurrent, multi-paradigm, object-oriented language
CSSCSS (Cascading Style Sheets) specifies a web page’s appearance
DGeneral-purpose systems programming language with a C-like syntax
DartClient-optimized language for fast apps on multiple platforms
DylanMulti-paradigm language supporting functional and object-oriented coding
ECMAScriptBest known as the language embedded in web browsers
EiffelObject-oriented language designed by Bertrand Meyer
ElixirRelatively new functional language running on the Erlang virtual machine
ErlangGeneral-purpose, concurrent, declarative, functional language
F#Uses functional, imperative, and object-oriented programming methods
FactorDynamic stack-based programming language
ForthImperative stack-based programming language
FortranThe first high-level language, using the first compiler
GoCompiled, statically typed programming language
GroovyPowerful, optionally typed and dynamic language
HaskellStandardized, general-purpose, polymorphically, statically typed language
HTMLHyperText Markup Language
IconWide variety of features for processing and presenting symbolic data
JArray programming language based primarily on APL
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
JavaScriptInterpreted, prototype-based, scripting language
JuliaHigh-level, high-performance language for technical computing
KotlinMore modern version of Java
LabVIEWDesigned to enable domain experts to build power systems quickly
LaTeXProfessional document preparation system and document markup language
LispUnique features - excellent to study programming constructs
LogoDialect of Lisp that features interactivity, modularity, extensibility
LuaDesigned as an embeddable scripting language
MarkdownPlain text formatting syntax designed to be easy-to-read and easy-to-write
Objective-CObject-oriented language that adds Smalltalk-style messaging to C
OCamlThe main implementation of the Caml language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
PHPPHP has been at the helm of the web for many years
PostScriptInterpreted, stack-based and Turing complete language
PrologA general purpose, declarative, logic programming language
PureScriptSmall strongly, statically typed language compiling to JavaScript
PythonGeneral-purpose, structured, powerful language
QMLHierarchical declarative language for user interface layout - JSON-like syntax
RDe facto standard among statisticians and data analysts
RacketGeneral-purpose, object-oriented, multi-paradigm, functional language
RakuMember of the Perl family of programming languages
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
RustIdeal for systems, embedded, and other performance critical code
ScalaModern, object-functional, multi-paradigm, Java-based language
SchemeA general-purpose, functional language descended from Lisp and Algol
ScratchVisual programming language designed for 8-16 year-old children
SQLAccess and manipulate data held in a relational database management system
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
SwiftPowerful and intuitive general-purpose programming language
TclDynamic language based on concepts of Lisp, C, and Unix shells
TeXMarkup and programming language - create professional quality typeset text
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ValaObject-oriented language, syntactically similar to C#
VHDLHardware description language used in electronic design automation
VimLPowerful scripting language of the Vim editor
XMLRules for defining semantic tags describing structure ad meaning
Subscribe
Notify of
guest

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

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
K Postero
K Postero
3 years ago

In recommendation 3. Lua for Beginners by ignatz, he wants the beginner to work in Codea. My grandson has access to Roblox Studio on his desktop computer, but not Codea. Will Roblox Studio be suitable for this learning process? If not, where does he download Codea for his desktop computer?

Colin J
Colin J
3 years ago

I suggest your grandson uses a search engine and type in Codea, it’ll come up top in the list. If your grandson can’t do this for himself, I suggest he doesn’t try to learn programming.

michael
michael
6 months ago

Wow! This is an amazing list of free books to learn about Lua! I’m a beginner in Lua, and I’ve been looking for some good resources to learn more. This list is perfect!

I especially like the way the books are organized. They are all well-written and easy to follow. I’m also impressed with the breadth of topics covered.I’m definitely going to check out some of these books. Thanks for sharing this list!