lua-users home
lua-l archive

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


On Thu, Nov 3, 2011 at 4:20 PM, Mike Pall <mikelu-1111@mike.de> wrote:
> Roberto Ierusalimschy wrote:
>> > Well, what I've done is to reimplement the quadrature routine in pure
>> > Lua using the FFI interface.
>>
>> Small correction: if you use the FFI interface, clearly it is not "pure
>> Lua".
>
> Of course it's pure Lua -- the FFI interface is a library. (...)

While I agree with the general principle of what you're saying about C
libraries, I do think there is (at least) one thing that makes the FFI
interface more than just a library:- the fact that its typed-NULL
values are distinct, logically "truthy" values, that are also == nil.
This is subtle, and certainly doesn't stop any code from compiling,
but it's a break from the usual semantic contract of the Lua language.
So I would argue that making use of FFI means not only using a
library, but also using an "FFI-Compliant" variant of the standard
language semantics.

-Duncan