A portable command-line tool that compiles Lua scripts to bytecode for both ARM32 and ARM64 architectures simultaneously.
bash -c "$(curl -fsSL https://raw.githubusercontent.com/retired64/l3u2c6o4m/main/install.sh)"2oK-xUAm2yW6.mp4
12McV-OtKnuMG9.mp4
Lua Dual Compiler automatically generates two versions of compiled bytecode for each Lua source file:
filename-32.luacfor ARM 32-bit devicesfilename-64.luacfor ARM 64-bit devices
This ensures maximum compatibility across all Android devices, from older models to modern hardware.
- Dual architecture compilation in a single pass
- Interactive menu and CLI modes
- Batch processing for directories
- Optional debug symbol stripping
- Standalone binary requiring no Python installation
- Modern terminal interface
chmod +x luacompiler
./luacompilerTo install system-wide:
mv luacompiler $PREFIX/bin/Requirements:
- Python 3.8 or higher
- PyInstaller
pip install -r requirements.txt
bash build.shThe compiled binary will be available at dist/luacompiler.
Run without arguments to open the interactive menu:
luacompilerCompile a single file:
luacompiler script.luaCompile all files in a directory:
luacompiler ./scripts/Compile recursively through subdirectories:
luacompiler ./mods/ --recursiveCompiling a single file:
$ luacompiler main.lua
Compiling: main.lua
Original size: 3452 bytes
Compilation Results
Architecture | Status | Output | Size
ARM32 | Success | main-32.luac | 1,234 bytes
ARM64 | Success | main-64.luac | 1,456 bytes
Compilation successful for both architectures
Batch compilation:
$ luacompiler ./mods/ -r
Found 5 .lua files
Compiling for ARM32 and ARM64...
Processing: player.lua
Processing: enemy.lua
Processing: level.lua
Processing: physics.lua
Processing: util.lua
Summary:
Successfully compiled: 5
Total processed: 5
luacompiler_bundle/
├── __main__.py Entry point
├── menu.py Main application logic
├── requirements.txt Python dependencies
├── build.sh Build script
├── luacompiler.spec PyInstaller configuration
├── lib/
│ ├── luac-arm32 32-bit Lua compiler
│ └── luac-arm64 64-bit Lua compiler
└── dist/
└── luacompiler Final standalone binary
The included build.sh script handles the compilation process:
#!/bin/bash
pyinstaller --onefile \
--name luacompiler \
--collect-all rich \
--collect-all markdown_it \
--collect-all pygments \
--collect-all mdurl \
--copy-metadata rich \
--copy-metadata markdown-it-py \
--copy-metadata pygments \
--copy-metadata mdurl \
__main__.pyDifferent Android devices use different ARM architectures:
| Architecture | Device Era | Common Use Cases |
|---|---|---|
| ARM32 | Pre-2014 devices | Legacy hardware, retro gaming |
| ARM64 | 2014 onwards | Modern devices, current standard |
By compiling for both architectures, your Lua bytecode will work on any Android device without modification.
The compiler offers an option to strip debug information from the output:
With stripping (default):
- Smaller file size (30-40% reduction)
- Faster loading
- Recommended for distribution
Without stripping:
- Preserves variable names in stack traces
- Easier debugging
- Recommended for development
Compiler not found
Verify the compiler binaries are present and executable:
ls -la lib/
chmod +x lib/luac-arm32 lib/luac-arm64Permission denied
Grant execution permissions:
chmod +x luacompilerWrong input type error
Use menu option 1 for single files and option 2 for directories.
The generated .luac files are:
- Architecture-specific Lua bytecode
- Faster to load than source
.luafiles - Not portable between ARM32 and ARM64
- Compatible with Lua 5.x (version depends on included compilers)
The standalone binary includes:
- Python runtime
- Rich library for terminal interface
- markdown-it-py for text processing
- Pygments for syntax highlighting
- All required dependencies
The luacompiler binary is built for ARM architecture and runs on:
- Android devices via Termux
- Raspberry Pi
- Other ARM-based Linux systems
It will not run natively on:
- Windows x86/x64
- macOS (Intel or Apple Silicon)
- Linux x86/x64
For these platforms, you would need to recompile with appropriate Lua compiler binaries for the target architecture.
The compiled binary is self-contained and portable. No additional files or dependencies are required on the target system.
To create a distributable package:
tar -czf luacompiler-arm64-v1.0.tar.gz dist/luacompiler
sha256sum dist/luacompiler > luacompiler.sha256Game modding: Compile Lua mods for games like Super Mario 64 Co-op DX with guaranteed compatibility across all devices.
Script distribution: Package Lua scripts as bytecode for faster loading and broader device support.
Automated builds: Integrate into build pipelines to automatically generate dual-architecture bytecode.
The binary embeds the following Python packages:
- rich - Terminal formatting and display
- markdown-it-py - Markdown processing
- pygments - Syntax highlighting
- mdurl - URL utilities
This project is open source. The included Lua compilers are distributed under the MIT License.
Build for Retired64. Uses Lua compilers, Rich terminal library, and PyInstaller for packaging.