lua-users home
lua-l archive

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


Sam Roberts <vieuxtech@gmail.com> writes:
>>> I have the impression swig works better when binding C++ to an object
>>> oriented language,
>>
>> I think that's a mistaken impression.  Swig does a _very_ good job
>> binding Lua and C++.  It almost always does "the right thing", so one
>> doesn't have to worry about it most of the time.
>
> Uh, Miles, you said you think I've a mistaken impression...

Hmm, I thought your implication was that Lua wasn't an object-oriented
language and thus using swig to bind C++ to Lua didn't work so well.

So you were really saying using swig to bind C to Lua doesn't work so
well?

In that case, I dunno; clearly swig doesn't have as big an advantage as
with C++ interfaces, and its various problems are relatively bigger, but
still... for a biggish interface, it seems much easier to copy a bunch
of header-file contents and tweak them than write a bunch of hand-rolled
interface thunks -- even if the latter is _straightforward_, still, it's
work...

As usual, YMMV, depending on the details of the interface.

For _small_ interfaces, I'd just hand-roll it, as of course that gives
you the most control, and avoids dependencies.

-mile

-- 
Sabbath, n. A weekly festival having its origin in the fact that God made the
world in six days and was arrested on the seventh.