lua-users home
lua-l archive

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



Hi all.

This is probably a wildly discussed topic, but I haven't found a good compilation of the resources as new ones pops up all over the place, and others die..

Problem: Given a C++ API I want to export classes, methods, namespaces, enums to lua. Being able to implement virtual methods in lua, calling them from C++/lua transparently...


This is a the list I know about, correct me if Im wrong, perhaps someone can update a list on the lua site?

- LuaBridge 
  * Templetized way of exporting C++ classes
  * Require manual labour of explicitly listing all classes, methods enums that should be exported.
  *one way only, exporting C++ to lua (no virtual callbacks to lua?)
  * Handles namespaces?

- LuaBind
  * Templetized way of exporting C++ classes
  * Require manual labour of explicitly listing all classes, methods enums that should be exported.
  * Full support of virtual methods
  * Seems to handle namespaces?

- tolua
  * dead

- tolua++
  * Parse either modified header files OR cleaned .h (.tolua/.pkg) files
  * Require manual creation of suitable .pkg files
  * Do not support virtual methods in lua
  * Handle namespaces


- luaQT (right now specialized for QT, but...)
  * Parse .h files of the target API
  * Require you to filter out unwanted classes, but after that its automatic
  * Does not handle namespaces


More?

What I really like about the luaQT approach is it has a big gain exporting numerous API:s where you want to avoid the manual labour of specifying each and every class/method, this is a tedious work and has to be redone each time you update your dependencies, unless you want to wrap everything into a scripting layer which you then export...


Right now yet another way would be to use cpp2xml (like luaQT) and generate cleaned up .pkg files and run those through tolua++. However this would not give me support for virtual methods, this would be added to tolua++...


Looking for quite some feedback because I know this is a hot issue!


Cheers, Anders