3
22
Fork
You've already forked lrc
0
A compiler for the Lua Programming Language
  • Lua 87%
  • C 13%
2026年07月12日 14:16:29 +02:00
cmd docs: fix duplicate --verbose entry in command line options table 2026年06月01日 16:34:07 +02:00
docs docs(writing-{a-language-extension,a-toolchain,an-otype}): new page 2026年06月01日 16:51:16 +02:00
loader feat: implement msvc toolchain for v1.2 2026年06月01日 22:33:16 +02:00
lrocket Release v1.2.1 2026年06月05日 12:19:56 +02:00
rockspecs Release v1.2.1-2 2026年07月12日 14:16:29 +02:00
tests refactor: rename all internal camelCase names to snailcase 2026年05月31日 21:26:35 +02:00
tools chore: update tools/new_version to be used with revisions 2026年07月12日 14:16:16 +02:00
.gitignore chore(.gitignore): ignore files generated via --keep 2026年01月09日 19:46:57 +01:00
CHANGELOG.md Release v1.2.1-2 2026年07月12日 14:16:29 +02:00
LICENSE Add license 2024年03月30日 23:24:14 +01:00
LRA_FORMAT.md docs(LRA_FORMAT): document that lra_format is currently not under semver 2025年06月02日 21:51:05 +02:00
lrc-scm-0.rockspec chore(deps): bump compat53 to 0.15 2026年07月12日 12:53:16 +02:00
README.md docs: update readme 2026年06月02日 21:24:45 +02:00

lrocket Logo

The LRocket Project

A compiler for the Lua Programming Language.


The LRocket Compiler (lrc) bundles and compiles Lua programs into several formats.

Starting from a single Lua file (entrypoint), it automatically resolves any required Lua modules, file resources and native modules recursively, based on require() and io.open() statements.

Some advanced features of lrc include cross-compilation arbitrary resource embedding and compiler extensions.

Usage

> lrc main.lua
# outputs ./main (exectuable, or main.exe on Windows)

lrc supports many options and there is integration for the luarocks module manager and build system.

For a full list of options see https://lrocket.codeberg.page/lrc.html.

Installation

The compiler is available on luarocks!

> luarocks install lrc

From Source (e.g. for Development)

> git clone https://codeberg.org/lrocket/lrc
> cd lrc
# compile C bits
> luarocks make --no-install
# run directly via:
> lua cmd/lrc.lua

Features

  • Dependency Tracing and Bundling
    • Packs lua programs/modules into a single bundle
    • Links C modules into the target binary or
    • Copies shared libraries (.so/.dll) into target directory
  • Static and Dynamic Linking support
  • Embedding of Arbitrary Resource-Files
  • Cross-Compilation
  • Integration with LuaRocks
  • Platform Support
  • Output Formats
    • Lua Bundle (single .lua-file)
    • Native Executable (e.g. ELF64 or .exe)
    • Native Lua Module (.dll/.so)
  • Lua Versions
    • Supports 5.4, 5.3, 5.2, 5.1 and LuaJIT
    • Automatically finds lua in system paths (and via pkg-config if installed)
    • Allows multiple lua versions to be installed with flag to select a version
  • Language Support for C and Teal modules
  • Debugging: Compiled executables support lua debuggers (e.g. Local Lua Debugger)
  • Optional Embedding of Bytecode
  • Optimization Profiles (space / speed)
  • Bash/ZSH Completion
  • Log Levels
  • Many Command-Line Options
  • lrc supports custom Compiler Extensions

Hacking

The functionality of lrc can be expanded with custom Compiler Extensions! Read more here: Hacking the LRocket Compiler.

License

LRocket is licensed under the MIT License.

The Lua Programming Language logo was created by Alexandre Nakonechnyj.

LRocket was inspired by and is loosely based on luastatic.

During late development we also found luapak, which does an awesome job at bundling and shares some concepts with lrc! Both however have some unique features:

The main differences being that luapak supports compression of lua source code while lrocket does not rely on luarocks and has broader platform support for some features like static-linking.

Known Issues

See Troubleshooting or in case of doubt, feel free to open an issue!

Have a fix ready? Cool! Just file an issue for the problem you're fixing if nobody has done so yet and reference it when submitting your Pull-Request.

Changelog

See changelog.md.


Created by Sewbacca and Lesosoftware in 2023 - 2026