1 .\" $NetBSD: luac.1,v 1.2 2014/07/19 18:38:33 lneto Exp $
3 .\" $Id: luac.1,v 1.2 2014/07/19 18:38:33 lneto Exp $
4 .TH LUAC 1 "$Date: 2014/07/19 18:38:33 $"
17 It translates programs written in the Lua programming language
18 into binary files containing precompiled chunks
19 that can be later loaded and executed.
21 The main advantages of precompiling chunks are:
23 protecting source code from accidental user changes,
25 off-line syntax checking.
26 Precompiling 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.
30 Precompiled chunks are not necessarily smaller than the corresponding source.
31 The main goal in precompiling is faster loading.
35 text files containing Lua source and
36 binary files containing precompiled chunks.
38 produces a single output file containing the combined bytecodes
40 Executing the combined file is equivalent to executing the given files.
42 the output file is named
44 but you can change this with the
48 Precompiled chunks are
50 portable across different architectures.
52 the internal format of precompiled chunks
53 is likely to change when a new version of Lua is released.
54 Make sure you save the source files of all Lua programs that you precompile.
59 produce a listing of the compiled bytecode for Lua's virtual machine.
60 Listing bytecodes is useful to learn about Lua's virtual machine.
61 If no files are given, then
65 and lists its contents.
73 instead of the default
78 but not on platforms that open standard output in text mode.)
79 The output file may be one of the given files because
80 all files are loaded before the output file is written.
81 Be careful not to overwrite precious files.
84 load files but do not generate any output file.
85 Used mainly for syntax checking and for testing precompiled chunks:
86 corrupted files will probably generate errors when loaded.
87 If no files are given, then
91 and tests its contents.
92 No messages are displayed if the file loads without errors.
95 strip debug information before writing the output file.
96 This saves some space in very large chunks,
97 but if errors occur when running a stripped chunk,
98 then the error messages may not contain the full information they usually do.
100 line numbers and names of local variables are lost.
103 show version information.
106 stop handling options.
109 stop handling options and process standard input.
113 The documentation at lua.org.
115 Error messages should be self explanatory.