Skip to main content
The 2024 Developer Survey results are live! See the results

Lua is a powerful, fast, lightweight, embeddable scripting language. It is dynamically typed, runs by interpreting bytecode, and has automatic garbage collection. Its speed is one of the main reasons it is widely used by the machine learning community. It is often referred to as an "extensible extension language".

This tag is used for questions about the Lua programming language.

From Lua's About page:

What is Lua?

Lua is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

The official implementation of Lua is written in clean ANSI C, but a list of several other implementations can be found on the Lua Users Wiki page on Lua Implementations.

The latest official version of Lua is 5.4.1. The previous minor version (5.3.6) is available in the version history on the official site. Lua version numbers are defined as follows: major.minor.bugfix. Minor version increases will often no longer be backwards compatible with prior minor versions.

Lua is certified Open Source software distributed under the terms of the MIT license. As such, Lua is free to use, even for commercial products.

Please note that the official name of this programming language is Lua (a Portuguese word for Earth's moon). It is not an acronym -- it is not spelled LUA.

Learning Lua

Resources

  • Lua.org - The official Lua site.
  • LuaJIT - A fast tracing Just-In-Time compiler for Lua 5.1.
  • LuaRocks - the package manager for Lua modules.
  • ZeroBrane Studio - An IDE and debugger supporting a variety of Lua systems.
  • Lua Development Tools - An Eclipse-based IDE and debugger.
  • LuaDist - Lua modules management system with Virtual Environment capabilities.

Some projects using Lua

  • Torch - A scientific computing framework based on Lua[JIT] with strong CPU and CUDA backends.
  • lua-alchemy - Port of the Lua programming language for ActionScript using Alchemy.
  • Nutria - PHP Standard Library Written in Lua Programming Language
  • Sputnik - A content management system designed for extensibility.

Community

Other places for discussing Lua, beyond the question & answer format of Stack Overflow:

Books

Code Language (used for syntax highlighting): lang-lua