ljx

FORK: LuaJIT with native 5.2 and 5.3 support
git clone https://git.neptards.moe/neptards/ljx.git
Log | Files | Refs | README

faq.html (7685B)


      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
      2 <html>
      3 <head>
      4 <title>Frequently Asked Questions (FAQ)</title>
      5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      6 <meta name="Author" content="Mike Pall">
      7 <meta name="Copyright" content="Copyright (C) 2005-2016, Mike Pall">
      8 <meta name="Language" content="en">
      9 <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
     10 <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
     11 <style type="text/css">
     12 dd { margin-left: 1.5em; }
     13 </style>
     14 </head>
     15 <body>
     16 <div id="site">
     17 <a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
     18 </div>
     19 <div id="head">
     20 <h1>Frequently Asked Questions (FAQ)</h1>
     21 </div>
     22 <div id="nav">
     23 <ul><li>
     24 <a href="luajit.html">LuaJIT</a>
     25 <ul><li>
     26 <a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
     27 </li><li>
     28 <a href="install.html">Installation</a>
     29 </li><li>
     30 <a href="running.html">Running</a>
     31 </li></ul>
     32 </li><li>
     33 <a href="extensions.html">Extensions</a>
     34 <ul><li>
     35 <a href="ext_ffi.html">FFI Library</a>
     36 <ul><li>
     37 <a href="ext_ffi_tutorial.html">FFI Tutorial</a>
     38 </li><li>
     39 <a href="ext_ffi_api.html">ffi.* API</a>
     40 </li><li>
     41 <a href="ext_ffi_semantics.html">FFI Semantics</a>
     42 </li></ul>
     43 </li><li>
     44 <a href="ext_jit.html">jit.* Library</a>
     45 </li><li>
     46 <a href="ext_c_api.html">Lua/C API</a>
     47 </li><li>
     48 <a href="ext_profiler.html">Profiler</a>
     49 </li></ul>
     50 </li><li>
     51 <a href="status.html">Status</a>
     52 <ul><li>
     53 <a href="changes.html">Changes</a>
     54 </li></ul>
     55 </li><li>
     56 <a class="current" href="faq.html">FAQ</a>
     57 </li><li>
     58 <a href="http://luajit.org/performance.html">Performance <span class="ext">&raquo;</span></a>
     59 </li><li>
     60 <a href="http://wiki.luajit.org/">Wiki <span class="ext">&raquo;</span></a>
     61 </li><li>
     62 <a href="http://luajit.org/list.html">Mailing List <span class="ext">&raquo;</span></a>
     63 </li></ul>
     64 </div>
     65 <div id="main">
     66 <dl>
     67 <dt>Q: Where can I learn more about LuaJIT and Lua?</dt>
     68 <dd>
     69 <ul style="padding: 0;">
     70 <li>The <a href="http://luajit.org/list.html"><span class="ext">&raquo;</span>&nbsp;LuaJIT mailing list</a> focuses on topics
     71 related to LuaJIT.</li>
     72 <li>The <a href="http://wiki.luajit.org/"><span class="ext">&raquo;</span>&nbsp;LuaJIT wiki</a> gathers community
     73 resources about LuaJIT.</li>
     74 <li>News about Lua itself can be found at the
     75 <a href="http://www.lua.org/lua-l.html"><span class="ext">&raquo;</span>&nbsp;Lua mailing list</a>.
     76 The mailing list archives are worth checking out for older postings
     77 about LuaJIT.</li>
     78 <li>The <a href="http://lua.org"><span class="ext">&raquo;</span>&nbsp;main Lua.org site</a> has complete
     79 <a href="http://www.lua.org/docs.html"><span class="ext">&raquo;</span>&nbsp;documentation</a> of the language
     80 and links to books and papers about Lua.</li>
     81 <li>The community-managed <a href="http://lua-users.org/wiki/"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a>
     82 has information about diverse topics.</li>
     83 </ul>
     84 </dl>
     85 
     86 <dl>
     87 <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>
     88 <dd>
     89 I'm planning to write more documentation about the internals of LuaJIT.
     90 In the meantime, please use the following Google Scholar searches
     91 to find relevant papers:<br>
     92 Search for: <a href="http://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br>
     93 Search for: <a href="http://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br>
     94 Search for: <a href="http://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br>
     95 Search for: <a href="http://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br>
     96 Search for: <a href="http://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br>
     97 Here is a list of the <a href="http://article.gmane.org/gmane.comp.lang.lua.general/58908"><span class="ext">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br>
     98 And, you know, reading the source is of course the only way to enlightenment. :-)
     99 </dd>
    100 </dl>
    101 
    102 <dl>
    103 <dt>Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?<br>
    104 Q: My vararg functions fail after switching to LuaJIT!</dt>
    105 <dd>LuaJIT is compatible to the Lua 5.1 language standard. It doesn't
    106 support the implicit <tt>arg</tt> parameter for old-style vararg
    107 functions from Lua 5.0.<br>Please convert your code to the
    108 <a href="http://www.lua.org/manual/5.1/manual.html#2.5.9"><span class="ext">&raquo;</span>&nbsp;Lua 5.1
    109 vararg syntax</a>.</dd>
    110 </dl>
    111 
    112 <dl>
    113 <dt>Q: Why do I get this error: "bad FPU precision"?<br>
    114 <dt>Q: I get weird behavior after initializing Direct3D.<br>
    115 <dt>Q: Some FPU operations crash after I load a Delphi DLL.<br>
    116 </dt>
    117 <dd>
    118 
    119 DirectX/Direct3D (up to version 9) sets the x87 FPU to single-precision
    120 mode by default. This violates the Windows ABI and interferes with the
    121 operation of many programs &mdash; LuaJIT is affected, too. Please make
    122 sure you always use the <tt>D3DCREATE_FPU_PRESERVE</tt> flag when
    123 initializing Direct3D.<br>
    124 
    125 Direct3D version 10 or higher do not show this behavior anymore.
    126 Consider testing your application with older versions, too.<br>
    127 
    128 Similarly, the Borland/Delphi runtime modifies the FPU control word and
    129 enables FP exceptions. Of course this violates the Windows ABI, too.
    130 Please check the Delphi docs for the Set8087CW method.
    131 
    132 </dl>
    133 
    134 <dl>
    135 <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>
    136 <dd>The interrupt signal handler sets a Lua debug hook. But this is
    137 currently ignored by compiled code (this will eventually be fixed). If
    138 your program is running in a tight loop and never falls back to the
    139 interpreter, the debug hook never runs and can't throw the
    140 "interrupted!" error.<br> In the meantime you have to press Ctrl-C
    141 twice to get stop your program. That's similar to when it's stuck
    142 running inside a C function under the Lua interpreter.</dd>
    143 </dl>
    144 
    145 <dl>
    146 <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt>
    147 <dd>Because it's a completely redesigned VM and has very little code
    148 in common with Lua anymore. Also, if the patch introduces changes to
    149 the Lua semantics, these would need to be reflected everywhere in the
    150 VM, from the interpreter up to all stages of the compiler.<br> Please
    151 use only standard Lua language constructs. For many common needs you
    152 can use source transformations or use wrapper or proxy functions.
    153 The compiler will happily optimize away such indirections.</dd>
    154 </dl>
    155 
    156 <dl>
    157 <dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?</dt>
    158 <dd>Because it's a compiler &mdash; it needs to generate native
    159 machine code. This means the code generator must be ported to each
    160 architecture. And the fast interpreter is written in assembler and
    161 must be ported, too. This is quite an undertaking.<br>
    162 The <a href="install.html">install documentation</a> shows the supported
    163 architectures. Other architectures will follow based on sufficient user
    164 demand and/or sponsoring.</dd>
    165 </dl>
    166 
    167 <dl>
    168 <dt>Q: When will feature X be added? When will the next version be released?</dt>
    169 <dd>When it's ready.<br>
    170 C'mon, it's open source &mdash; I'm doing it on my own time and you're
    171 getting it for free. You can either contribute a patch or sponsor
    172 the development of certain features, if they are important to you.
    173 </dd>
    174 </dl>
    175 <br class="flush">
    176 </div>
    177 <div id="foot">
    178 <hr class="hide">
    179 Copyright &copy; 2005-2016 Mike Pall
    180 <span class="noprint">
    181 &middot;
    182 <a href="contact.html">Contact</a>
    183 </span>
    184 </div>
    185 </body>
    186 </html>