1 .\" $NetBSD: luac.1,v 1.1.1.2 2012/03/15 00:08:21 alnsn Exp $
3 .\" $Id: luac.1,v 1.1.1.2 2012/03/15 00:08:21 alnsn Exp $
4 .TH LUAC 1 "$Date: 2012/03/15 00:08:21 $"
17 It translates programs written in the Lua programming language
18 into binary files that can be later loaded and executed.
20 The main advantages of precompiling chunks are:
22 protecting source code from accidental user changes,
24 off-line syntax checking.
26 Pre-compiling does not imply faster execution
27 because in Lua chunks are always compiled into bytecodes before being executed.
29 simply allows those bytecodes to be saved in a file for later execution.
31 Pre-compiled chunks are not necessarily smaller than the corresponding source.
32 The main goal in pre-compiling is faster loading.
34 The binary files created by
36 are portable only among architectures with the same word size and byte order.
39 produces a single output file containing the bytecodes
40 for all source files given.
42 the output file is named
44 but you can change this with the
50 text files containing Lua source and
51 binary files containing precompiled chunks.
52 This is useful to combine several precompiled chunks,
53 even from different (but compatible) platforms,
54 into a single precompiled chunk.
58 to indicate the standard input as a source file
61 to signal the end of options
63 all remaining arguments will be treated as files even if they start with
66 The internal format of the binary files produced by
68 is likely to change when a new version of Lua is released.
70 save the source files of all Lua programs that you precompile.
73 Options must be separate.
76 produce a listing of the compiled bytecode for Lua's virtual machine.
77 Listing bytecodes is useful to learn about Lua's virtual machine.
78 If no files are given, then
82 and lists its contents.
87 instead of the default
92 but not on platforms that open standard output in text mode.)
93 The output file may be a source file because
94 all files are loaded before the output file is written.
95 Be careful not to overwrite precious files.
98 load files but do not generate any output file.
99 Used mainly for syntax checking and for testing precompiled chunks:
100 corrupted files will probably generate errors when loaded.
101 Lua always performs a thorough integrity test on precompiled chunks.
102 Bytecode that passes this test is completely safe,
103 in the sense that it will not break the interpreter.
105 there is no guarantee that such code does anything sensible.
106 (None can be given, because the halting problem is unsolvable.)
107 If no files are given, then
111 and tests its contents.
112 No messages are displayed if the file passes the integrity test.
115 strip debug information before writing the output file.
116 This saves some space in very large chunks,
117 but if errors occur when running a stripped chunk,
118 then the error messages may not contain the full information they usually do.
120 line numbers and names of local variables are lost.
123 show version information.
133 Error messages should be self explanatory.