[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How close to C do you make your binding?
- From: Javier Guerra Giraldez <javier@...>
- Date: Wed, 18 Jun 2014 10:12:49 -0500
On Wed, Jun 18, 2014 at 9:50 AM, Coda Highland <firstname.lastname@example.org> wrote:
> My goal, when I do such a direct binding, is to make it to where
> there's almost no documentation necessary -- that is, you can use the
> original C docs directly with only minor changes (mostly syntactical).
i prefer almost the opposite. try to do things as much idiomatic Lua
as i can imagine. if the C api is well known, then a two-layer
approach might be valuable, but not having an idiomatic Lua api is a
big turn off.
in fact, a "use the C docs" remark makes it even worse. it means i'll
have to understand first the C library and then try to guess the
wrapper itself, which is effectively undocumented. at that point it's
sometimes easier to whip a quick LuaJIT-FFI wrapper with just the
functionality i need.