LUAC5.4(1)
π LUAC5.4(1) β the luac girlies' era π
okay bestie, sit down, hydrate, and let me tell you about luac β aka the Lua compiler, aka the girl who turns your cute little scripts into bytecode before anyone even runs them. this is the manual page, but make it a group chat. π
β¨ NAME β¨
luac β the Lua compiler, periodt.
πΈ SYNOPSIS πΈ
luac [ options ] [ filenames ]
π¦ DESCRIPTION π¦
so luac is the Lua compiler. it takes programs written in the Lua programming language and translates them into binary files stuffed with precompiled chunks that you can load and execute later. it's giving "meal prep but for bytecode". π
the main advantages of precompiling chunks are, in order:
- faster loading β¨
- protecting source code from accidental user changes π
- off-line syntax checking β
but likeβ¦ do not come for me thinking precompiling means faster execution. no bestie. in Lua, chunks are always compiled into bytecodes before being executed anyway. luac literally just lets those bytecodes be saved in a file for later execution. that's it, that's the whole thing. π
also, precompiled chunks are not necessarily smaller than the corresponding source. the main goal in precompiling is faster loading. okurrr.
on the command line you can mix text files containing Lua source and binary files containing precompiled chunks β yes, together, in one big pile, it's fine π«Ά. luac produces a single output file containing the combined bytecodes for all files given. executing the combined file is equivalent to executing the given files. by default, the output file is named luac.out, but you can change that with the -o option.
π¨ MAJOR WARNING BESTIE π¨ precompiled chunks are not portable across different architectures. and on top of that, the internal format of precompiled chunks is likely to change when a new version of Lua is released. so please please please save the source files of all Lua programs that you precompile. i am begging. π
π OPTIONS π
-lβ produce a listing of the compiled bytecode for Lua's virtual machine. listing bytecodes is useful to learn about Lua's virtual machine (iykyk). if no files are given, thenluacloadsluac.outand lists its contents. use-l -lfor a full listing. β¨-o fileβ output to file, instead of the defaultluac.out. (you can use'-'for standard output, but not on platforms that open standard output in text mode.) the output file may be one of the given files, because all files are loaded before the output file is written. be careful not to overwrite precious files. π₯Ί-pβ load files but do not generate any output file. used mainly for syntax checking and for testing precompiled chunks: corrupted files will probably generate errors when loaded. if no files are given, thenluacloadsluac.outand tests its contents. no messages are displayed if the file loads without errors β silence is the vibe. π€«-sβ strip debug information before writing the output file. this saves some space in very large chunks, but if errors occur when running a stripped chunk, then the error messages may not contain the full information they usually do. in particular, line numbers and names of local variables are lost. π-vβ show version information. π--β stop handling options.-β stop handling options and process standard input.
π SEE ALSO π
lua(1)- the documentation at lua.org.
π₯ DIAGNOSTICS π₯
error messages should be self explanatory. no cryptic nonsense here, bestie β you got this. π
π AUTHORS π
R. Ierusalimschy, L. H. de Figueiredo, W. Celes β the icons who made it all happen. π«Ά
and that's the whole page, no cap. this was LUAC5.4(1) from the General Commands Manual, and the source/date footer said $Date: 2011/11/16 13:53:40 $ β yes, 2011, she's vintage, she's iconic, she ate. π
β¨ bye bestie, go compile something cute. ππ¦
π¦ where this page comes from
- debian bookworm: lua5.4 5.4.4-3+deb12u1 Β· MIT
- debian trixie: lua5.4 5.4.7-1+b2 Β· MIT
- opensuse-leap 16.0: lua54 5.4.7-160000.2.2 Β· MIT
- opensuse-leap 16.0: lua54 5.4.7-160000.2.2 Β· MIT
- opensuse-leap 16.0: lua54 5.4.7-160000.2.2 Β· MIT
- opensuse-leap 16.0: lua54 5.4.7-160000.2.2 Β· MIT
- ubuntu jammy: lua5.4 5.4.4-1 Β· MIT
- ubuntu noble: lua5.4 5.4.6-3build2 Β· MIT
- ubuntu questing: lua5.4 5.4.8-1
- ubuntu resolute: lua5.4 5.4.8-1build1 Β· MIT
- ubuntu stonking: lua5.4 5.4.9-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms