lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Indeed, for more details look at the luaffi known issues [0]:

Specifically these two points at least diverge from Lua 5.1 semantics
and can't be worked around:

- Comparing a ctype pointer to nil doesn't work the same as luajit.
This is unfixable with the current metamethod semantics. Instead use
ffi.C.NULL
- Not all metamethods work with lua 5.1 (eg char* + number). This is
due to the way metamethods are looked up with mixed types in Lua 5.1.
If you need this upgrade to Lua 5.2 or use boxed numbers (uint64_t and
uintptr_t).

—Pierre-Yves

0. https://github.com/jmckaskill/luaffi#known-issues

On Fri, Mar 9, 2018 at 10:35 AM, Soni "They/Them" L. <fakedme@gmail.com> wrote:
>
>
> On 2018-03-09 06:23 AM, Pierre Chapuis wrote:
>>
>> On Thu, Mar 8, 2018, at 22:13, Soni They/Them L. wrote:
>>
>>> You can implement bitops in pure Lua.
>>>
>>> I challenge you to implement FFI in pure Lua.
>>
>> It is a library to interact with the outside world.
>> You can say the same of LuaPosix, LuaSocket, LuaFilesystem...
>>
>
> Hmm...
>
> I mean those were explicitly designed as independent Lua modules, I guess.
>
> The FFI was designed to integrate with the language.
>
>
> --
> Disclaimer: these emails may be made public at any given time, with or
> without reason. If you don't agree with this, DO NOT REPLY.
>
>