1 .\" $Id: luac.man,v 1.28 2006/01/06 16:03:34 lhf Exp $
2 .TH LUAC 1 "$Date: 2006/01/06 16:03:34 $"
15 It translates programs written in the Lua programming language
16 into binary files that can be later loaded and executed.
18 The main advantages of precompiling chunks are:
20 protecting source code from accidental user changes,
22 off-line syntax checking.
24 Pre-compiling does not imply faster execution
25 because in Lua chunks are always compiled into bytecodes before being executed.
27 simply allows those bytecodes to be saved in a file for later execution.
29 Pre-compiled chunks are not necessarily smaller than the corresponding source.
30 The main goal in pre-compiling is faster loading.
32 The binary files created by
34 are portable only among architectures with the same word size and byte order.
37 produces a single output file containing the bytecodes
38 for all source files given.
40 the output file is named
42 but you can change this with the
48 text files containing Lua source and
49 binary files containing precompiled chunks.
50 This is useful to combine several precompiled chunks,
51 even from different (but compatible) platforms,
52 into a single precompiled chunk.
56 to indicate the standard input as a source file
59 to signal the end of options
61 all remaining arguments will be treated as files even if they start with
64 The internal format of the binary files produced by
66 is likely to change when a new version of Lua is released.
68 save the source files of all Lua programs that you precompile.
71 Options must be separate.
74 produce a listing of the compiled bytecode for Lua's virtual machine.
75 Listing bytecodes is useful to learn about Lua's virtual machine.
76 If no files are given, then
80 and lists its contents.
85 instead of the default
90 but not on platforms that open standard output in text mode.)
91 The output file may be a source file because
92 all files are loaded before the output file is written.
93 Be careful not to overwrite precious files.
96 load files but do not generate any output file.
97 Used mainly for syntax checking and for testing precompiled chunks:
98 corrupted files will probably generate errors when loaded.
99 Lua always performs a thorough integrity test on precompiled chunks.
100 Bytecode that passes this test is completely safe,
101 in the sense that it will not break the interpreter.
103 there is no guarantee that such code does anything sensible.
104 (None can be given, because the halting problem is unsolvable.)
105 If no files are given, then
109 and tests its contents.
110 No messages are displayed if the file passes the integrity test.
113 strip debug information before writing the output file.
114 This saves some space in very large chunks,
115 but if errors occur when running a stripped chunk,
116 then the error messages may not contain the full information they usually do.
118 line numbers and names of local variables are lost.
121 show version information.
131 Error messages should be self explanatory.