[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: request for interest/participants: another lua C++ binding
- From: Oliver Schoenborn <oliver.schoenborn@...>
- Date: Sat, 08 Apr 2006 10:09:52 -0400
Hi Tyranni,
Tyranni wrote:
Oliver,
* luabind: most powerful, but requires boost, and syntax a little
unnatural (IMO)
What is your specific issue with using boost?
My only problem with it is that many projects can afford to depend on it
due to size or other constraints.
Also, I use luabind not just as a binding system, but also to abstract dealing with the Lua stack.
The luabind::object class and luabind::object_cast functions are extremely useful for this:
double d = luabind::object_cast<double>( luabind::globals(L)['my']['nested']['table']['entry'] );
// yes that looks sorta ugly but in practice you don't write it like that
Seems to me this casting could be handled automatically by the compiler.
As to the table example, is the above necessary? I would much prefer
being able to write
double d = luabind::globals(L, "my.nested.table.entry");
Seems rather simpler. Perhaps I don't know luabind enough, but in
general (from the docs) I find it forces you to be much more verbose and
explicit than necessary about what you want to achieve.
* swig and tolua++: don't allow for variable argument lists (AFAICT)
or for logging callbacks and gets/sets
SWIG supports C varargs. I don't think it supports Lua varargs since the Lua-SWIG module is
targeted to Lua 5.0. You can add it and send them patches.
Varargs don't preserve type and UDT.
In terms of adding logging functionality, there is complete flexibility in SWIG through the use of
typemaps. They are a bit of a pain to use (you normally don't have to), but you can.
I'd rather avoid having to use them, especially to support logging.
One problem with SWIG is that it is one-way... you can only access C++ objects and functions from
Lua. You cannot (easily) get those objects back in C++. [Something like this could be possible
with some adapating tools that combine SWIG and luabind.]
IIRC (though I might be thinking of tolua++ rather than SWIG), swig
allows you to "export" globals to lua interpreter, which address *some*
of the above, but you're right, it's doesn't help with getting things
from the lua interpreter.
I'm not trying to squash your call to arms; I'm just trying to give you more info.
I greatly appreciate your input, thanks for taking the time. Cheers,
Oliver
-Evan
Oliver Schoenborn wrote:
Hello, I'm somewhat unhappy with the existing bindings to C++. The major
ones
* lua++: clean and simple, but requires custom lua
* cpplua: some good ideas, but some less good, and doesn't seem to
be maintained
* luabind: most powerful, but requires boost, and syntax a little
unnatural (IMO)
* swig and tolua++: don't allow for variable argument lists (AFAICT)
or for logging callbacks and gets/sets
[...]