LUAC5.3(1)

πŸ“¦
version 5.3.6 Β· 2 versions
, in debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– LUAC5.3 πŸ’–

okay bestie, welcome to the luac manual page β€” that's the Lua compiler, and yes it's a whole general commands manual situation, section 1, we're doing this πŸŽ€


✨ NAME ✨

luac β€” the Lua compiler, periodt πŸ’…


✨ SYNOPSIS ✨

luac [ options ] [ filenames ]

🌸 DESCRIPTION 🌸

So luac is the Lua compiler, right? It takes programs you wrote in the Lua programming language and translates them into binary files containing precompiled chunks that you can load and execute later. iconic behavior honestly πŸ¦‹

The main advantages of precompiling chunks are:

  • faster loading ⚑
  • protecting source code from accidental user changes πŸ”’
  • off-line syntax checking βœ…
ngl, precompiling does not imply faster execution β€” because in Lua, chunks are always compiled into bytecodes before being executed anyway. luac simply lets those bytecodes get saved in a file for later execution. no cap.

Also? Precompiled chunks are not necessarily smaller than the corresponding source. The main goal in precompiling is faster loading. that's it, that's the vibe.

On the command line you can mix text files containing Lua source and binary files containing precompiled chunks β€” literally mix them, it's fine 🫢 luac produces a single output file containing the combined bytecodes for all the files you gave it. Executing the combined file is equivalent to executing the given files. By default, the output file is named luac.out, but you can change this with the -o option.

🚨 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. Make sure you save the source files of all Lua programs that you precompile. like. please. save them. πŸ™ˆ

πŸ’… 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 πŸ‘‘ If no files are given, then luac loads luac.out and lists its contents. Use -l -l for a full listing. (yes, twice. double the listing, double the slay ✨)
  • -o file β€” output to file, instead of the default luac.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, then luac loads luac.out and tests its contents. No messages are displayed if the file loads without errors. silent queen 🀫
  • -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. she tells you what's wrong, we love a communicative icon πŸ’–


πŸ‘‘ AUTHORS πŸ‘‘

R. Ierusalimschy, L. H. de Figueiredo, W. Celes


and that's the whole page bestie, no crumbs left πŸ“ this lil masterpiece is tagged $Date: 2011/11/16 13:53:40 $ and it lives under the manual name LUAC5.3(1) β€” go forth and precompile responsibly πŸ’œ