Lua is a lightweight, compact, and fast programming language
designed as
an embeddable scripting language. This cross-platform language has a
simple syntax with powerful data description constructs. Lua aims for
simplicity, small size, performance and portability. It has automatic
memory management and incremental garbage collection, making it ideal
for configuration, scripting, and rapid prototyping.
In the popularity takes, Lua lags behind say Python,
Perl, or Ruby for scripting purposes. And Lua is not designed to
develop standalone software. But where Lua excels is as a secondary
language. Witness Lua cropping up in kernels, tools, and
games. For the latter, LÖVE is worthy of a mention. It is a sweet
framework you can use to make 2D games in Lua.
Lua 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 more than 20 years.
The focus of this article is to select the best free books
which help developers master Lua.
1. Lua for Beginners
|
|
Lua for Beginners is an unofficial guide designed to
offer a good introduction to the world of Lua. It covers the basics of
Lua, taking the reader a step at a time through the language. It comes
with exercises to test learning.
The guide is incomplete in parts.
Chapters cover:
- Introduction
- A first look at Lua - printing results
- Variables - variable names, changing a variable,
types of variable, and deleting variables
- Conditions - shows how decisions are made in Lua.
Covers the basic If test, how to set conditions, and combining multiple
if tests
- Loops
- Lists - an introduction covering making date
lists
- More lists, tables and loops - two dimensional
tables, tables of named items
- Functions - built in functions, building your own
functions, optional variables and defaults, variable number of
parameters, and named parameters
- Scope - includes "local" functions
- Playful practice projects - the fairground coin
trick, Wimbledon, and downloading movies
- Classes - explains classes with 3 examples
- Pointers
- Classes and Callbacks
- Class inheritance
- Coroutines
- Closures (and zombic variables)
- Debugging and error handling
- Metatables
|
2. Programming in Lua
|
|
Programming in Lua is the official book about the
language, giving a solid base for any programmer who wants to use
Lua.
Chapters of the book:
- The Language: Types and values, expressions,
statements, functions, more about functions, iterators and the generic
for, compilation, execution and errors, coroutines, and complete
examples
- Tables and Objects: Data structures, Data files and
persistence, metatables and metamethods, the environment, packages,
object-oriented programming, and weak tables
- The Standard Libraries: The mathematical library, the
table library, the string library, the I/O library, the operating
system library, and the debug library
- The C API: An overview of the C API, extending your
application, calling C from Lua, techniques for writing C functions,
user-defined types in C, and managing resources
|
3. Lua 5.3 Reference Manual
|
|
Website |
www.lua.org/manual/5.3 |
Author |
Roberto Ierusalimschy, Luiz Henrique de
Figueiredo, Waldemar Celes |
Format |
HTML |
Pages |
- |
This reference book describes version 5.3 of the Lua
programming language and the Application Program Interface that allows
interaction between Lua programs and their .host C-programs. The book
provides a thorough treatment of the latest version of Lua.
The book explores:
- Introduction
- Basic concepts - describes the basic concepts of the
language: Values and types, environments and the global environment,
error handling, metatables and metamethods, garbage collection, and
coroutines
- The Language - describes the lexis, the syntax, and
the semantics of Lua: Lexical conventions, variables, statements,
expressions, and visibility Rules
- The Application Program Interface - describes the C
API for Lua: The stack, stack size, valid and acceptable indices, C
closures, registry, error handling in C, handling yields in C,
functions and types, and the debug interface
- The Auxiliary Library - provides several convenient
functions to interface C with Lua
- Standard Libraries - provide useful functions that
are implemented directly through the C API: Basic functions, coroutine
manipulation, modules, string manipulation, UTF-8 support, table
manipulation, mathematical functions, input and output facilities,
operating system facilities, and the debug library
- Lua Standalone
The book is released freely under the Lua license.
|
Last Updated Sunday, August 09 2015 @ 07:19 AM EDT |