lua-users home
lua-l archive

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


On Sat, 2011-01-22 at 21:49 +0100, Florian Weimer wrote:
> * Michal Kottman:
> 
> > I have a question I wanted to ask for a long time - are there any plans
> > to support C++? Using a database of classes/methods/arguments, I could
> > replace the whole 25Mb generated Qt bindings with a single library that
> > generates bindings on-the-fly. This is just a dream, but I hope there is
> > a faint chance of it becoming true :)
> 
> Wouldn't the humongous size of C++ header files causes problems with
> application startup time?

The idea was to prepare the headers beforehand and convert it into some
easily digestable format, like some form of a key-value database. We
already do the parsing while generating the bindings, and it's
relatively fast (i.e. not more than a second of processing on my 2.4GHz
processor).

Let's say that a user wanted to create qtgui.QPushButton. An __index
metamethod would be triggered and the definitions would be read from the
database and constructed so that LuaJIT FFI could parse it. The
resulting type would be saved back in qtgui.QPushButton and used to
construct new objects.

This way, we would not have to distribute the whole generator, only a
single 'live-binding' module and a pre-processed database of types.

I'm sure this idea could work on smaller libraries, but now it seems to
me that Qt is too complicated for this (it has it's own nuances, like
the signal-slot mechanism, parent-child memory management etc.)