From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Tue, 14 Jan 2014 02:25:20 +0100 Subject: cgit-lua: to jit or not to jit Message-ID: Hi folks, Over at the cgit project [1], we're in the process of adding Lua support. Things are going swimmingly, and I've just merged to the master tree some commits adding full lua support [2] to our filter API [3] and an example script [4]. At the moment we've got some moderately messy logic in our makefile [6] that autodetects if LuaJIT is installed, and if it isn't, falls back to mainline Lua. What I'm wondering is -- what is the purpose of keeping around support for mainline Lua? Why shouldn't we just go with LuaJIT and be done with it? I'm unable to find any advantages mainline Lua has over LuaJIT, which is why I'm emailing these lists. What features am I forgetting about that would make some people prefer mainline Lua over LuaJIT? An additional motivation for wanting to go to LuaJIT is the FFI library that comes with it [5]. It seems like this would make packaging and swapping scripts a lot easier. For example, in the gravatar script [4], I depend on luacrypto, which some users might not want to install or have easily available. With FFI, I could instead just wrap OpenSSL (which cgit already depends on). But perhaps there are some obvious downsides to this approach that I also am missing. My experience with embedding Lua inside cgit so far has been very nice. What a clean simple API. I look forward to hearing your responses and any feedback and suggestions you might have. Thank you, Jason Donenfeld [1] http://git.zx2c4.com/cgit/about/ [2] http://git.zx2c4.com/cgit/tree/filter.c#n176 [3] http://git.zx2c4.com/cgit/tree/cgitrc.5.txt#n569 [4] http://git.zx2c4.com/cgit/tree/filters/email-gravatar.lua [5] http://luajit.org/ext_ffi.html [6] http://git.zx2c4.com/cgit/tree/cgit.mk#n30