Awesome Lua
Inspired by the lists awesome, awesome-awesomeness, and awesome-nodejs.
Packages
- Implementations and Interpreters
- Package Managers
- Debugging and Profiling
- IDEs and Plugins
- Utility Belts
- Game Engines
- Game Development
- Logging
- Web Platforms
- OpenResty
- Command-line Utilities
- Concurrency and Multithreading
- Templating
- Documentation
- Object-oriented Programming
- Filesystem and OS
- Time and Date
- Image Manipulation
- Digital Signal Processing
- Math and Scientific Computing
- Parsing
- Humanize
- Compression
- Network
- Data Stores
- Testing
- Foreign Function Interfaces
- Analysis Tools and ASTs
- Experimental, etc
- Scriptable by Lua
- Miscellaneous
Implementations and Interpreters
- Lua - Lua's original ANSI C interpreter.
- LuaJIT - High-performance Just-In-Time compiler for Lua.
- LLVM-Lua - Compiles Lua to LLVM.
- lua.vm.js - Lua VM on the web; a direct port of the C interpreter via LLVM, emscripten, and asm.js.
- Moonshine - A Lua VM implemented in JavaScript. Slower than lua.vm.js, but with better docs, examples, and JS interfacing.
- UniLua - A pure C# implementation of Lua 5.2, focused on compatibility with the Unity game engine.
Note: From LuaJIT to Lua to lua.vm.js to Moonshine, a basic benchmark sees performance drop by roughly a factor of 6 with each hop.
Package Managers
- LuaRocks - Allows you to install Lua modules as packages called "rocks", which contain version and dependency information. Much like npm or pip.
- MoonRocks - Public Lua rock repository, website, and uploading tool. Default server used by LuaRocks.
Debugging and Profiling
- ProFi - Simple profiler that works with LuaJIT and produces a report file.
- luatrace - Toolset for tracing/analyzing/profiling script execution and generating detailed reports.
- StackTracePlus - Drop-in upgrade to Lua's stack traces which adds local context and improves readability.
- MobDebug - Powerful remote debugger with breakpoints and stack inspection. Used by ZeroBraneStudio.
- lovebird - Browser-based debug console. Originally made for LÖVE, but works in any project with LuaSocket support.
IDEs and Plugins
- Lua Development Tools - Eclipse plugin which provides code completion, debugging, and more. Built on Metalua.
- Lua for IDEA - IntelliJ IDEA plugin which, among other things, provides code completion, smart highlighting, and experimental debugging.
- ZeroBraneStudio - Lightweight, customizable, cross-platform Lua-dedicated IDE with code completion and analysis, written in Lua. Has broad debugging support for numerous Lua engines.
Utility Belts
- Lua Fun - High-performance functional programming library designed for LuaJIT.
- Moses - Functional programming utility belt, inspired by Underscore.js.
- Penlight - Broad, heavyweight utility library, inspired by Python's standard libs. Provides the batteries that Lua doesn't.
- lua-stdlib - Middle-weight standard library extension; adds some useful data structures, utility functions, and basic functional stuff.
- Microlight - A little library of useful Lua functions; the 'extra light' version of Penlight.
Game Engines
- LÖVE 2D - Desktop game development platform. Cross-platform, feature-complete, well-adopted.
- Corona SDK - Development platform for iOS and Android. Proprietary, but used by numerous top games and apps, totaling over 150 million downloads.
- MOAI - Open source, cross-platform, mobile game development framework. Minimalist C++ engine powered by Lua scripting.
Game Development
- Corona
- Coronium.io - Simple cloud platform supporting analytics, data objects, user management, and more.
- LÖVE
- lurker - Shortens the iteration cycle by auto-swapping changed Lua files in a running LÖVE project.
- MOAI
- moaifiddle - Edit and share short scripts for the MOAI game engine and run them in the browser using WebGL.
- Jumper - Fast, lightweight, and easy-to-use pathfinding library for grid-based games.
- lume - Utility belt library geared toward game development.
- NoobHub - Network multiplayer for Corona, LÖVE, and more, following a simple pub-sub model.
- Collision detection
- bump.lua - Minimal rectangle-based collision detection which handles tunnelling and basic collision resolution.
- HardonCollider - Detect collisions between arbitrarily positioned and rotated shapes of any type.
- Tweening
Logging
- log-lua - Asynchronous logging library with pluggable writers for filesystem, network, ZeroMQ, and more.
Web Platforms
- OpenResty - A fast and scalable web application platform created by extending Nginx with Lua. Today's de-facto Lua web platform, used heavily by Cloudflare, Taobao, Tencent, and others.
- turbo - Event-driven, non-blocking, LuaJIT-based framework inspired by Tornado.
OpenResty
- Core platform
- ngx_lua - The core piece of OpenResty. Embeds Lua in Nginx and exposes, among other things, the cosocket API for non-blocking sockets (compatible with LuaSocket's API).
- OpenResty GitHub Organization - Home of the repositories for ngx_lua, ngx_openresty, and many related modules.
- Third-party modules
- lua-resty-http - Lua HTTP client driver, built on the cosocket API.
- Frameworks & tools
Search this page for 'OpenResty' to find related packages under other categories (data stores in particular).
Command-line Utilities
- ansicolors - Simple function for printing to the console in color.
- cliargs - A simple command-line argument parsing module.
- lua-term - Terminal operations and manipulations.
Concurrency and Multithreading
- Coroutine-based multitasking:
- Lumen - Simple concurrent task scheduling.
- ConcurrentLua - Implements an Erlang-style message-passing concurrency model.
- Multithreading:
- llthreads - A simple wrapper for low-level pthreads & WIN32 threads.
- lanes - Library implementing a message passing model with one OS thread per Lua thread.
- luaproc - Message-passing model which allows multiple threads per OS thread and easily generalizes across a network. See also the paper where it originated.
For more on the differences (particularly between lanes
and luaproc
), see this comparison of options; somewhat dated, but covers how each one works and the significant differences.
Templating
- lustache - Mustache template implementation.
- etlua - Embedded Lua templates, ERB-style.
- lua-resty-template - Lua-oriented template engine for OpenResty, somewhat Jinja-like.
Documentation
Object-oriented Programming
- 30log - Minimalist OOP library with basic classes, inheritance, and mixins in 30 lines.
- middleclass - Simple but robust OOP library with inheritance, methods, metamethods, class variables and mixins.
Filesystem and OS
- LuaFileSystem - Extends and complements Lua's built-in set of filesystem functions.
- luaposix - Bindings for POSIX APIs, including curses.
Time and Date
- LuaDate - Date and time module with parsing, formatting, addition/subtraction, localization, and ISO 8601 support.
- cron.lua - Time-related functions for Lua, inspired by JavaScript's setTimeout and setInterval.
Image Manipulation
- magick - Lua bindings to ImageMagick for LuaJIT using FFI.
Digital Signal Processing
- LuaFFT - An easy to use Fast Fourier Transformation package in pure Lua.
- Worp - Sound/music/DSP engine written for LuaJIT.
Math and Scientific Computing
- SciLua - Numerical/scientific computing framework built on LuaJIT, with an interface to R.
- Torch7 - Scientific computing framework with wide support for machine learning algorithms, used by Facebook, Google, and more.
- lhf's Lua Tools - Assorted libraries and tools, many math-related.
Parsing
- JSON
- XML
- LPeg - A pattern-matching library for Lua, based on Parsing Expression Grammars.
- lunamark - Converts Markdown to other textual formats including HTML and LaTeX. Uses LPeg for fast parsing.
Humanize
- i18n.lua - Internationalization library with locales, formatting, and pluralization.
- inspect.lua - Human-readable representation of Lua tables.
- serpent - Serializer and pretty printer.
- Ser - Dead simple serializer with good performance.
Compression
- lua-zlib - Simple streaming interface to zlib for gzip/gunzip.
- lua-zip - Lua binding to libzip. Reads and writes zip files.
Network
- LuaSocket - Networking extension which provides a socket API for TCP and UDP, and implements HTTP, FTP, and SMTP.
Data Stores
- redis-lua - Pure Lua client library for Redis.
- pgmoon - Lua PostgreSQL driver for OpenResty and others.
- lua-resty-mysql - Lua MySQL driver for OpenResty.
- lua-resty-redis - Lua Redis client driver for OpenResty.
- lua-resty-cassandra - Lua Cassandra client driver for OpenResty and others.
Testing
- busted - BDD-style unit testing framework with great docs and Moonscript support.
- telescope - Flexible and highly customizable testing library.
- luassert - Assertion library extending Lua's built-in assertions.
Foreign Function Interfaces
- LuaJIT FFI - LuaJIT's mechanism for calling external C functions and using C data structures from pure Lua code.
- luaffi - Standalone FFI library, compatible with the LuaJIT FFI interface.
Analysis Tools and ASTs
- luacov - Simple coverage analyzer, used by busted and telescope for checking test coverage.
- luacheck - Simple static analyzer which detects accidental globals and undefined or shadowed locals.
- Metalua - Pure Lua parser and compiler, used for generating ASTs. A number of other tools make use of the Metalua parser in this way.
- LuaInspect - Lua's most powerful code analysis and linting tool, built on Metalua. Used by ZeroBraneStudio, among others.
- LuaMinify - Minifier which also brings its own static analysis tools, lexer, and parser.
Experimental, etc
- punchdrunk.js - Moonshine + LÖVE API reimplementation = run LÖVE games in the browser.
- luvit - Node.js's underlying architecture (libUV) with Lua on top instead of JavaScript.
Scriptable by Lua
- luakit - Fast, small, webkit based browser framework extensible by Lua.
- mjolnir - OS X desktop environment manager, scripted with Lua. Under development, formerly known as hydra.
- kpie - A scripting utility to juggle windows.
- lumail - A console-based mail client, with extensive scripting capabilities.
- AwesomeWM - A highly configurable and extensible window manager for X, scripted and configured by Lua.
- Textadept - Extremely lightweight, customizable, cross-platform editor, written (mostly) in (and scripted by) Lua.
Miscellaneous
- MoonScript - Moonscript is a dynamic scripting language that compiles to Lua. It reduces verbosity and provides a rich set of features like comprehensions and classes. Its author calls it 'CoffeeScript for Lua'.
- sitegen - A static site generator which uses MoonScript and supports HTML and Markdown, page grouping, and plugins.
Resources
References
- Reference Manual - The official definition of the Lua language.
- lua-users wiki - A large community-maintained collection of Lua information and resources, supplementing the official website.
- Lua Unofficial FAQ - Answers all sorts of Lua-related questions, including many of the form 'How to _?'.
- lua-l - The official Lua mailing list, and one of the focal points of the Lua community.
Style Guides
- Lua-users style guide - A general, high-level style guide; unopinionated, easily agreed on.
- Olivine style guide - A more opinionated and specific, and therefore more rigorous, guide.
Tutorials
- Lua Crash Course - Short crash course readover, or reference for when you forget the basics.
- Learn Lua in 15 Minutes - A well-commented example file which covers the basics.
- Learning Lua from JS - An overview of the similarities and differences between Lua and JS; a great start for JavaScript folks looking to pick up Lua.
- lua-users tutorial - In-depth collection of tutorials aimed at newcomers.
- Lua Missions - A series of 'Missions' to work through which are designed to teach aspects of Lua along the way.
- Creating an Image Server - Walks through setting up and using OpenResty to build a simple image processing server; a great starting point for playing with OpenResty.
Articles
- Embedding Lua in C - An introductory walkthrough of embedding Lua in a C program. A bit dated, but still a great walkthrough.
- Lua: Good, bad, and ugly parts - A thorough summary of the good, different, bad, and ugly aspects of Lua, including many subtle quirks, by the author of ZeroBraneStudio.
- Lua states, libraries, coroutines and memory - Diagrams and explains some more advanced concepts of the Lua VM, particularly when interfacing with C.
Talks & Slides
- Roberto's Talks - History of talks given by Lua's chief architect, with slides for each.
- Lua Workshop Talks - High-quality talks are given at each ~annual Lua Workshop, and a history of them is online, slides included.
Books
- Programming in Lua - The authoritative intro to all aspects of Lua programming, written by Lua's chief architect. Three editions released; first edition available online.
- Programming Gems - A collection of articles covering existing wisdom and practices on programming well in Lua, in a broad variety of use cases.
- Lua Programming - A shorter overview of the language, up to date for Lua 5.2, and available online.
Contribute
Contributions welcome and wanted! Read the contribution guidelines first.
License
To the extent possible under law, Lewis Ellis has waived all copyright and related or neighboring rights to this work.