Questions tagged [luajit]

LuaJIT is a Just-In-Time Compiler for the Lua programming language. LuaJIT offers more performance, at the expense of portability. On the supported OS's (all popular operating systems based on x86 or x64 CPUs (Windows, Mac OSX, Linux, ...), ARM based embedded devices (Android, iOS) and PPC/e500v2 CPUs) it offers an API- and ABI-compatible drop-in replacement for the standard Lua interpreter.

Overview

LuaJIT is a high-performance, Just-In-Time(JIT) implementation by Mike Pall for the Lua programming language. It has been successfully used as a scripting middleware in games, 3D modelers, numerical simulations, trading platforms and many other specialty applications. It combines high flexibility with high performance and an unmatched low memory footprint: less than 125K for the virtual machine(VM) plus less than 85K for the JIT compiler (on x86).

LuaJIT has been in continuous development since 2005. It's widely considered to be one of the fastest dynamic language implementations. It has outperformed other dynamic languages on many cross-language benchmarks since its first release — often by a substantial margin. In 2009 other dynamic language VMs started to catch up with the performance of LuaJIT 1.x. Well, I couldn't let that slide. ;-)

2009 also marks the first release of the long-awaited LuaJIT 2.0. The whole VM has been rewritten from the ground up and relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler. An innovative trace compiler is integrated with advanced, SSA-based optimizations and a highly tuned code generation backend. This allows a substantial reduction of the overhead associated with dynamic language features.

It's destined to break into the performance range traditionally reserved for offline, static language compilers.

Compatibility

LuaJIT implements the full set of language features defined by Lua 5.1. The virtual machine is API- and ABI-compatible to the standard Lua interpreter and can be deployed as a drop-in replacement.

LuaJIT offers more performance, at the expense of portability. It currently runs on all popular operating systems based on x86 or x64 CPUs (Linux, Windows, OSX etc.) or embedded systems based on ARM (Android, iOS) or PPC/e500v2 CPUs. Other platforms will be supported in the future, based on user demand and sponsoring.

430 questions
0
votes
0 answers

luaposix msgget function doesn't create the queue

I'm playing with luaposix module (using luajit) trying to learn how to fork process and demonize it. Here is the code that create a new process and try to set up a msg queue for communication with the child. I use the function msgget(key) to create…
msalese
  • 596
  • 1
  • 6
  • 18
0
votes
1 answer

Creating a struct of callbacks in LuaJIT FFI

So first I load in a DLL I need local ffi = require("ffi") local theDLL = ffi.load("thisDLL") in the ffi cdef I have this struct ffi.cdef [[ typedef struct { /* * begin_proj callback */ bool (__cdecl…
theman
  • 345
  • 1
  • 14
0
votes
2 answers

PostgreSQL and pllua

I'm trying to build the pllua module but I'm having some trouble. I think that the problem is on the wrong PostgreSQL version but I'm not sure, I'd be grateful if someone could help me. Postgres location: /opt/PostgreSQL/9.3/bin (is the…
msalese
  • 596
  • 1
  • 6
  • 18
0
votes
1 answer

Lua (LuaJit) cURL curl_easy_getinfo does not work as expected

I am trying to get the info CURLINFO_RESPONSE_CODE and CURLINFO_CONTENT_TYPE with curl_easy_getinfo, but both tries seem to fail. Like in a LuaJit/scanf example, I'm allocating ffi.new("int[1]") to get one element as a pointer and use it as…
kungfooman
  • 4,473
  • 1
  • 44
  • 33
0
votes
1 answer

Lua (LuaJit) cURL curl_easy_perform is always returning CURLE_URL_MALFORMAT (3)

I'm trying to use libcurl.dll with LuaJit, but curl_easy_perform always returns CURLE_URL_MALFORMAT (3) This is my actual code (code fixed): url = [[http://static02.mediaite.com/geekosystem/uploads/2013/12/doge.jpg]] ffi.cdef [[ int…
kungfooman
  • 4,473
  • 1
  • 44
  • 33
0
votes
1 answer

Passing pointer to int in LUA FFI

I have a C function as follows ffi.cdef[[ typedef struct { int index; char name[10]; } entry_key_t; extern entry_t *lookup_entry(entry_key_t *key, int *err); ]] I am having trouble passing the "int *" and I have tried the following…
0
votes
1 answer

Suricata luajit compilation error

I'm currently trying to compile suricata (http://suricata-ids.org/) with luajit support on my arch linux distribution with these commands: ./configure --enable-luajit --with-libpcap-includes=/usr/local/pfring/include…
E-Kami
  • 2,529
  • 5
  • 30
  • 50
0
votes
1 answer

luajit mode with C API

I'm starting at LUAJIT. LUAJIT has a function to set mode LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); Is there any way to get actual mode ? Thanks
fgarbin
  • 1
  • 1
  • 2
0
votes
1 answer

msvcbuild - how to compile luajit

i'va just downloaded luajit and trying to compile it. i'm doing everything as it says here to compile it i should execute msvcbuild from VS .NET Command Promt. so i installed VS 2010 and started VS 2010 Command Promt and when i try to execute…
SuperYegorius
  • 754
  • 6
  • 24
0
votes
1 answer

openRTMFP cumulus how to compile and install

i've just downloaded cumulus, POCO, OpenSSL and LuaJIT and visual studio. now i'm trying to compile it as it said in instruction here however i've never used visual studio and i've never programed on visual c. so i'm stuck at the very begining. in…
SuperYegorius
  • 754
  • 6
  • 24
0
votes
2 answers

How to implement lua_lock/lua_unlock in luajit?

I am reading this lua thread tutorial and my lua code may be accessed by other threads at anytime and all I wan to do is to protect the luaState from corrupting. I just searched luajit's source but found there is no lua_lock/lua_unlock in place. So…
Mickey Shine
  • 12,187
  • 25
  • 96
  • 148
0
votes
2 answers

Error when compiling with luajit and lua-iup libs [visual c++ 2012]

I wrote an app with luajit and lua-iup, and link my app with static libs. But I got the following error: ------ Build started: Project: ConsoleApplication1, Configuration: Release Win32 ------ Creating library C:\Users\root\Documents\Visual…
Mickey Shine
  • 12,187
  • 25
  • 96
  • 148
0
votes
1 answer

LuaJIT Vector Library

I am using LuaJIT with OpenGL ES 2.0 as a way to rapidly create some 3D interactive scenes. I have been busy reinventing the wheel, making my own vector library. My question is, does anyone else have experience with this sort of thing? Are there…
chowey
  • 9,138
  • 6
  • 54
  • 84
0
votes
1 answer

Argv functions vs. LuaJIT FFI's vararg

Is there a more effecient way to handle argv functions than this? ffi.cdef [[ void fooArgv(int argc, const char ** argv, const size_t * argvlen); ]] local foo = function(...) local nargs = select("#", ...) local argv = { } local argvlen =…
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
0
votes
1 answer

Combine wxLua with LuaJIT on Mac OS X

How do you build wxLua on Mac OS X (10.6.8) so that it uses LuaJIT2 instead of the standard Lua interpreter? I have tried: ./configure --with-lua-prefix=/Users/finnw/LuaJIT-2.0.0-beta9 where /Users/finnw/LuaJIT-2.0.0-beta9 is the directory in which…
finnw
  • 47,861
  • 24
  • 143
  • 221
1 2 3
28
29