lua-users home
lua-l archive

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


On Wed, Jun 18, 2014 at 8:12 AM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Wed, Jun 18, 2014 at 9:50 AM, Coda Highland <chighland@gmail.com> 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.

I actually agree with you. I said *when* I do such a direct binding. I
do prefer to expose something more idiomatic on top of it, and I
generally don't bother with strict similarity in the C-side binding if
it's not something that people will already know (but in this case I
also don't expose the C-side binding to the user AT ALL instead of
exposing it as a "core" library.)

> 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.

It's less a matter of wanting people to be able to use the C docs as
it is wanting people to be able to port C code without needing a lot
of rewrite.

/s/ Adam