Other meanings of LuaRocks
Software
LuaRocks is the standard package manager for the Lua programming language, providing a command-line interface to install, manage, and distribute Lua modules as self-contained packages called "rocks". It simplifies dependency resolution and versioning, making it an essential tool for Lua developers. LuaRocks is written in Lua itself and is available on all major platforms, including Windows, macOS, and Linux.
LuaRocks automates the process of downloading, building, and installing Lua modules, handling dependencies and version constraints. It uses a repository of rockspec files, which describe module metadata, dependencies, and build instructions. The command luarocks install fetches a rock from a server (default is luarocks.org) and compiles it locally if needed. LuaRocks supports both source and binary rocks, and it can install modules into user-specific trees, avoiding system-wide conflicts. Its design mirrors tools like CPAN for Perl and pip for Python, but tailored to Lua's lightweight philosophy.
LuaRocks was created by Hisham Muhammad in 2007 as a response to the lack of a standardized module distribution system for Lua. It was first announced at the Lua Workshop in 2007 and quickly gained adoption within the community. The project is hosted on GitHub and has seen contributions from numerous developers. Over the years, LuaRocks has evolved to support Lua 5.1 through 5.4, as well as LuaJIT, and has introduced features like namespaces and custom repositories. Its development is closely tied to the Lua ecosystem, with many popular libraries such as LuaSocket and LÖVE using it for distribution.
LuaRocks is widely used in game development, embedded systems, and web applications. It is integrated into the build processes of projects like OpenResty and Tarantool, which rely on Lua modules. The LuaRocks repository hosts thousands of modules, ranging from database drivers to GUI toolkits. Developers can create their own rocks by writing a rockspec and uploading it to the central server. LuaRocks also supports offline installation via local rocks, and it can generate standalone executables using tools like luarocks-build-marionet. Its command-line interface is simple, yet powerful, with commands for search, show, and remove.
LuaRocks includes a built-in command to create a new rock, luarocks newrock, which scaffolds a rockspec. It also supports "rockspec formats" that allow for conditional dependencies based on platform or Lua version. A lesser-known feature is the ability to use LuaRocks as a library, via its API, to programmatically manage modules. Additionally, LuaRocks can be used with LuaJIT, and it has a special mode for cross-compilation. The project has a mascot, a stylized rock, and its official website provides a web-based search interface. LuaRocks also has a plugin system for custom build backends, such as CMake or Make.
LuaRocks is a free and open-source project, released under the MIT license.
Help improve the encyclopedia. Reports go straight to the site manager.