This is a project to compile LLVM IR to Roblox Luau.
$ rbxllc <input.ll> -o <output.lua>
-o <output.lua>
: Output file-v
or--version
: Print version information-s
: generate code that is buffer-overflow strict. This will make the generated code slower, larger, and less readable but can fix programs that depend on buffer overflow behavior.-nb
: use Luau 5.4 operaters instead of thebit32
library.-cbuf
: generated code will declare functions from the Luaubuffer
library to be resolved. Reccomended for non-luau ecosystems.-cbit
: generated code will declare functions from the Luaubit32
library to be resolved. Reccomended for non-luau ecosystems.
- LLVM 14 (no higher)
pip install llvmlite
- python3 You can install prebuilt binaries from the releases page.
- Compile test.c to test.ll using clang:
$ clang -S -emit-llvm test/test.c -o test/test.ll
- Compile test.ll to test.lua using rbxllc:
$ rbxllc test/test.ll -o test/test.lua
- Run test.lua using luau:
$ luau test.lua
Hello, World!