Page 1 of 1

LuaJIT FFI

Posted: Tue Feb 15, 2011 4:30 pm
by Vadi
"The FFI library allows calling external C functions and using C data structures from pure Lua code." [http://luajit.org/ext_ffi.html]

I built a LuaJIT2 version of Mudlet before, but the perfomance improvements (on my poor benchmarks) weren't awesome so I didn't push the idea too much. The FFI however changes things, and besides, possibly, making binding Qt stuff in Mudlet easier, will help experienced coders play around with even more powerful structures and exotic algorithms for curing systems :roll:

I'll see about finding the stuff and publishing my changes this weekend if nobody else gets to it sooner.

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 4:37 pm
by tsuujin
Huh. I wonder if I could figure out a way to call custom qt interfaces (windows!) not shipped with mudlet...

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 6:08 pm
by Vadi
Yeah, that'll be nice to do. Threading will need to be solved though (but you could import a threading lib in Mudlet).

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 6:27 pm
by tsuujin
I'm wondering, though, how much other than playing directly with QT the JIT library will do for us. I've never had a problem getting my system to do what I want in Lua, and I'm trying to think of where I'd actually add in C structs.

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 6:28 pm
by Vadi
I haven't either, but there were people who liked bitwise operations for their curing stuffs... (which will be available because a bit library comes with LuaJIT anyway, but ...). Who knows. Maybe someone will want to implement efficient Markov chains and automate their character! (what am I talking about? but only time can tell.)

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 6:40 pm
by tsuujin
hmm, I didn't see that the LuaJIT comes with a bitwise library. That's absolutely awesome. I might actually go back and rewrite some of my stuff to use bitwise comparison!

Re: LuaJIT FFI

Posted: Tue Feb 15, 2011 9:06 pm
by Vadi