lua-users home
lua-l archive

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


On Tue, Feb 22, 2011 at 22:53, Jeff Smith <spammealot1@live.co.uk> wrote:

> Well Swig is really just the usual way of Interfacing between C and Lua. The
> benefit is that Swig writes the binding code for you
> and saves you the tedious work of hand coding the API Interface. It easy
> to see the attraction of not having to learn the C API in detail and also
> eliminating possible bugs I might introduce.

*The* usual way? Not really.

The proper way to write Lua bindings is to use Lua C API. Or, at least
— if you have to bind a large legacy library — the *specialized*
generator, not a multi-language one, like SWIG. Otherwise you lose
some vital expressive means.

> I havent used Swig very much, I did have a brief look also at laubind and
> toLua,  Swig looks more suited for my purpose as it has no other
> dependencies such as Boost, Windows etc, It simply produces a C or C++
> wrapper file that you include in your link. This is good if you are trying
> to use it in a non Windows embedded App.

Ahem. Last time I looked Luabind was not dependent on Windows in any
way. (Though it, ineed,  depends on Boost and is rather
template-heavy.)

Alexander.