lua-users home
lua-l archive

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




On 27 September 2010 20:32, Michal Kottman <k0mpjut0r@gmail.com> wrote:
On Mon, 2010-09-27 at 20:11 +0100, Rob Kendrick wrote:
> Again, I'd suggest that a class with hundreds of member functions
> might
> require... reworking.  Additionally, such verbatim bindings often
> result
> in disappointing experiences when used from inside Lua, which is why I
> always implement a wafer-thin binding, and then make everything look
> lovely from Lua.

We've bound almost the entire Qt framework for Lua using our automated
binding generator - lqt ( http://github.com/mkottman/lqt ).

Qt is a huge framework, with many classes and methods to be bound. It
would be nearly impossible to do it by hand. The advantage of using a
binding generator allows us to update the binding pretty easily for new
versions of the original library (like transition from Qt 4.5 -> 4.6 ->
4.7).

Yes, I like to create most of my bindings by hand, and make them work
the "Lua way", but there are simply times when you simply need to use a
binding generator...




There are positives and negatives to using any Lua binding library and I have to admit that I have not used LuaPlus, mainly because it requires an old modified Lua core. 
Automatic binding frameworks via parsing C++ files seems very attractive and I have even had a look at using cpp2xml before; yet having experience with swig it can sometimes need manually editing to get the binding correct which to me defeats the whole point of using an automatic binding. :(

The problem with some bindings, as I see it, are they can be slow and require the kitchen sink; this is the reason why I created a binding and made it available. It may not do everything you want as it was intended for my use and what I wanted from it. 

Nowadays if I am using Lua which interacts with C++ the first thing I do is include my Library even if I am not touching C++ member functions are C++ class types. The idea that it is simple to do something using the C API with five lines is not as attractive to _me_ as being able to do it in less lines which are tested, not having to directly error check runtimes calls myself and generating compile time errors
.
Liam