diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-05-16 10:58:21 (GMT) |
---|---|---|
committer | Paul Tagliamonte <paultag@fluxbox.org> | 2012-04-07 02:08:41 (GMT) |
commit | 0fa62fe1598c5b04925c0b7b98d0d00d28d10d88 (patch) | |
tree | ccc2dd040a03b294b17abaa4da55ca00ed9b82a7 /libs/lua/doc/luac.1 | |
parent | 7b6dc2ad72a4c4ecd20eddbfb6f1b4c3bd2a7024 (diff) | |
download | fluxbox_paul-0fa62fe1598c5b04925c0b7b98d0d00d28d10d88.zip fluxbox_paul-0fa62fe1598c5b04925c0b7b98d0d00d28d10d88.tar.bz2 |
Add lua as an internal library in libs/lua
Diffstat (limited to 'libs/lua/doc/luac.1')
-rw-r--r-- | libs/lua/doc/luac.1 | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/libs/lua/doc/luac.1 b/libs/lua/doc/luac.1 new file mode 100644 index 0000000..d814678 --- /dev/null +++ b/libs/lua/doc/luac.1 | |||
@@ -0,0 +1,136 @@ | |||
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 $" | ||
3 | .SH NAME | ||
4 | luac \- Lua compiler | ||
5 | .SH SYNOPSIS | ||
6 | .B luac | ||
7 | [ | ||
8 | .I options | ||
9 | ] [ | ||
10 | .I filenames | ||
11 | ] | ||
12 | .SH DESCRIPTION | ||
13 | .B luac | ||
14 | is the Lua compiler. | ||
15 | It translates programs written in the Lua programming language | ||
16 | into binary files that can be later loaded and executed. | ||
17 | .LP | ||
18 | The main advantages of precompiling chunks are: | ||
19 | faster loading, | ||
20 | protecting source code from accidental user changes, | ||
21 | and | ||
22 | off-line syntax checking. | ||
23 | .LP | ||
24 | Pre-compiling does not imply faster execution | ||
25 | because in Lua chunks are always compiled into bytecodes before being executed. | ||
26 | .B luac | ||
27 | simply allows those bytecodes to be saved in a file for later execution. | ||
28 | .LP | ||
29 | Pre-compiled chunks are not necessarily smaller than the corresponding source. | ||
30 | The main goal in pre-compiling is faster loading. | ||
31 | .LP | ||
32 | The binary files created by | ||
33 | .B luac | ||
34 | are portable only among architectures with the same word size and byte order. | ||
35 | .LP | ||
36 | .B luac | ||
37 | produces a single output file containing the bytecodes | ||
38 | for all source files given. | ||
39 | By default, | ||
40 | the output file is named | ||
41 | .BR luac.out , | ||
42 | but you can change this with the | ||
43 | .B \-o | ||
44 | option. | ||
45 | .LP | ||
46 | In the command line, | ||
47 | you can mix | ||
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. | ||
53 | .LP | ||
54 | You can use | ||
55 | .B "'\-'" | ||
56 | to indicate the standard input as a source file | ||
57 | and | ||
58 | .B "'\--'" | ||
59 | to signal the end of options | ||
60 | (that is, | ||
61 | all remaining arguments will be treated as files even if they start with | ||
62 | .BR "'\-'" ). | ||
63 | .LP | ||
64 | The internal format of the binary files produced by | ||
65 | .B luac | ||
66 | is likely to change when a new version of Lua is released. | ||
67 | So, | ||
68 | save the source files of all Lua programs that you precompile. | ||
69 | .LP | ||
70 | .SH OPTIONS | ||
71 | Options must be separate. | ||
72 | .TP | ||
73 | .B \-l | ||
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 | ||
77 | .B luac | ||
78 | loads | ||
79 | .B luac.out | ||
80 | and lists its contents. | ||
81 | .TP | ||
82 | .BI \-o " file" | ||
83 | output to | ||
84 | .IR file , | ||
85 | instead of the default | ||
86 | .BR luac.out . | ||
87 | (You can use | ||
88 | .B "'\-'" | ||
89 | for standard output, | ||
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. | ||
94 | .TP | ||
95 | .B \-p | ||
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. | ||
102 | However, | ||
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 | ||
106 | .B luac | ||
107 | loads | ||
108 | .B luac.out | ||
109 | and tests its contents. | ||
110 | No messages are displayed if the file passes the integrity test. | ||
111 | .TP | ||
112 | .B \-s | ||
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. | ||
117 | For instance, | ||
118 | line numbers and names of local variables are lost. | ||
119 | .TP | ||
120 | .B \-v | ||
121 | show version information. | ||
122 | .SH FILES | ||
123 | .TP 15 | ||
124 | .B luac.out | ||
125 | default output file | ||
126 | .SH "SEE ALSO" | ||
127 | .BR lua (1) | ||
128 | .br | ||
129 | http://www.lua.org/ | ||
130 | .SH DIAGNOSTICS | ||
131 | Error messages should be self explanatory. | ||
132 | .SH AUTHORS | ||
133 | L. H. de Figueiredo, | ||
134 | R. Ierusalimschy and | ||
135 | W. Celes | ||
136 | .\" EOF | ||