diff options
Diffstat (limited to 'doc/faq.html')
-rw-r--r-- | doc/faq.html | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/doc/faq.html b/doc/faq.html index acc47bae..484d2f20 100644 --- a/doc/faq.html +++ b/doc/faq.html | |||
@@ -80,16 +80,14 @@ has information about diverse topics.</li> | |||
80 | <dl id="tech"> | 80 | <dl id="tech"> |
81 | <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt> | 81 | <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt> |
82 | <dd> | 82 | <dd> |
83 | I'm planning to write more documentation about the internals of LuaJIT. | 83 | Please use the following Google Scholar searches to find relevant papers:<br> |
84 | In the meantime, please use the following Google Scholar searches | ||
85 | to find relevant papers:<br> | ||
86 | Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">»</span> Trace Compiler</a><br> | 84 | Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">»</span> Trace Compiler</a><br> |
87 | Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">»</span> JIT Compiler</a><br> | 85 | Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">»</span> JIT Compiler</a><br> |
88 | Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">»</span> Dynamic Language Optimizations</a><br> | 86 | Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">»</span> Dynamic Language Optimizations</a><br> |
89 | Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">»</span> SSA Form</a><br> | 87 | Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">»</span> SSA Form</a><br> |
90 | Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">»</span> Linear Scan Register Allocation</a><br> | 88 | Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">»</span> Linear Scan Register Allocation</a><br> |
91 | Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">»</span> innovative features in LuaJIT</a>.<br> | 89 | Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">»</span> innovative features in LuaJIT</a>.<br> |
92 | And, you know, reading the source is of course the only way to enlightenment. :-) | 90 | And, you know, reading the source is of course the only way to enlightenment. |
93 | </dd> | 91 | </dd> |
94 | </dl> | 92 | </dl> |
95 | 93 | ||
@@ -128,12 +126,11 @@ Please check the Delphi docs for the Set8087CW method. | |||
128 | <dl id="ctrlc"> | 126 | <dl id="ctrlc"> |
129 | <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt> | 127 | <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt> |
130 | <dd>The interrupt signal handler sets a Lua debug hook. But this is | 128 | <dd>The interrupt signal handler sets a Lua debug hook. But this is |
131 | currently ignored by compiled code (this will eventually be fixed). If | 129 | ignored by compiled code. If your program is running in a tight loop |
132 | your program is running in a tight loop and never falls back to the | 130 | and never falls back to the interpreter, the debug hook never runs and |
133 | interpreter, the debug hook never runs and can't throw the | 131 | can't throw the "interrupted!" error.<br> |
134 | "interrupted!" error.<br> In the meantime you have to press Ctrl-C | 132 | You have to press Ctrl-C twice to get stop your program. That's similar |
135 | twice to get stop your program. That's similar to when it's stuck | 133 | to when it's stuck running inside a C function under the Lua interpreter.</dd> |
136 | running inside a C function under the Lua interpreter.</dd> | ||
137 | </dl> | 134 | </dl> |
138 | 135 | ||
139 | <dl id="sandbox"> | 136 | <dl id="sandbox"> |
@@ -147,28 +144,18 @@ it's very hard to get this right even for the Lua core libraries. Of course, | |||
147 | you'll need to inspect any extension library, too. And there are libraries | 144 | you'll need to inspect any extension library, too. And there are libraries |
148 | that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br> | 145 | that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br> |
149 | 146 | ||
150 | Relatedly, <b>loading untrusted bytecode is not safe!</b> It's trivial | 147 | More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">»</span> Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">»</span> Wikipedia</a>.<br><br> |
151 | to crash the Lua or LuaJIT VM with maliciously crafted bytecode. This is | ||
152 | well known and there's no bytecode verification on purpose, so please | ||
153 | don't report a bug about it. Check the <tt>mode</tt> parameter for the | ||
154 | <tt>load*()</tt> functions to disable loading of bytecode.<br> | ||
155 | 148 | ||
156 | In general, the only promising approach is to sandbox Lua code at the | 149 | Relatedly, <b>loading untrusted bytecode is not safe!</b><br> |
157 | process level and not the VM level.<br> | ||
158 | 150 | ||
159 | More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">»</span> Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">»</span> Wikipedia</a>. | 151 | It's trivial to crash the Lua or LuaJIT VM with maliciously crafted bytecode. |
160 | </dd> | 152 | This is well known and there's no bytecode verification on purpose, so please |
161 | </dl> | 153 | don't report a bug about it. Check the <tt>mode</tt> parameter for the |
154 | <tt>load*()</tt> functions to disable loading of bytecode.<br><br> | ||
162 | 155 | ||
163 | <dl id="patches"> | 156 | <b>In general, the only promising approach is to sandbox Lua code at the |
164 | <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt> | 157 | process level and not the VM level.</b> |
165 | <dd>Because it's a completely redesigned VM and has very little code | 158 | </dd> |
166 | in common with Lua anymore. Also, if the patch introduces changes to | ||
167 | the Lua semantics, these would need to be reflected everywhere in the | ||
168 | VM, from the interpreter up to all stages of the compiler.<br> Please | ||
169 | use only standard Lua language constructs. For many common needs you | ||
170 | can use source transformations or use wrapper or proxy functions. | ||
171 | The compiler will happily optimize away such indirections.</dd> | ||
172 | </dl> | 159 | </dl> |
173 | 160 | ||
174 | <dl id="arch"> | 161 | <dl id="arch"> |
@@ -178,17 +165,11 @@ machine code. This means the code generator must be ported to each | |||
178 | architecture. And the fast interpreter is written in assembler and | 165 | architecture. And the fast interpreter is written in assembler and |
179 | must be ported, too. This is quite an undertaking.<br> | 166 | must be ported, too. This is quite an undertaking.<br> |
180 | The <a href="install.html">install documentation</a> shows the supported | 167 | The <a href="install.html">install documentation</a> shows the supported |
181 | architectures. Other architectures will follow based on sufficient user | 168 | architectures.<br> |
182 | demand and/or sponsoring.</dd> | 169 | Other architectures may follow based on sufficient user demand and |
183 | </dl> | 170 | market-relevance of the architecture. Sponsoring is required to develop |
184 | 171 | the port itself, to integrate it and to continuously maintain it in the | |
185 | <dl id="when"> | 172 | actively developed branches.</dd> |
186 | <dt>Q: When will feature X be added? When will the next version be released?</dt> | ||
187 | <dd>When it's ready.<br> | ||
188 | C'mon, it's open source — I'm doing it on my own time and you're | ||
189 | getting it for free. You can either contribute a patch or sponsor | ||
190 | the development of certain features, if they are important to you. | ||
191 | </dd> | ||
192 | </dl> | 173 | </dl> |
193 | <br class="flush"> | 174 | <br class="flush"> |
194 | </div> | 175 | </div> |