[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: luaffi vs luajit ffi
- From: Cosmin Apreutesei <cosmin.apreutesei@...>
- Date: Tue, 22 May 2012 19:03:01 +0300
I'm using luajit ffi for a month now. I found that it's not just a
library as it extends the language in some key semantics:
(1) values of different types can be compared (Lua can't do that);
this makes things easier most of the time, and a tricky sometimes
(2) type(cdata) == "cdata" -- so now we have the 9th Lua type -- ok
you can overload type(), but maybe ffi.type() similar to io.type()
would have been better, dunno.
I don't think you can make luaffi a drop-in replacement for lj ffi
without patching Lua to address (1) am I right?
 for a null pointer a, `a == nil` is true but `not a` is false and
`a = a or default` is not the same for a null pointer a and for a nil