Advertisement

differences between various lua binding projects

Started by February 07, 2004 12:21 PM
1 comment, last by nekoflux 20 years, 9 months ago
sounds like there are a lot of options here...can somebody plz explain the differences between tolua and luabind? they sound like similar projects with very similar goals. Is anyone familiar with the pros/cons of both projects that would care to elaborate? thanks!! neko
nekoflux
toLua is a code generator. Working from a cleaned header file it produces code which can interface with Lua.

+ simple to understand process / technique
- tolua 5 is currently in alpha
- requires an extra build step (running toLua to make the interfacing code)
- cleaned headers may require external code (which may lead to synchronization)

Luabind use template techniques to build interfaces to lua at compile time. The documentation for luabind is not pitched at people new to luabind, but it is good documentation, as much as you''ll curse it for the first few days.

+ has more advanced memory management techniques (support for smart pointers and handles)
+ always parses the C++ classes correctly, because it uses the compiler.
+ Support. Luabind''s authors are really helpful, so are the mailing lists - I haven''t looked into support for tolua.
+ Luabind may at some time in the future become a part of boost, which to my way of thinking guarantees ongoing support.
- the examples that come with luabind aren''t particularly helpful for someone trying to learn about scripting and luabind at the same time.
- occasionally the templates are so complicated the VC7.1 will freeze for a while, something to do with intellisense maybe?
- slow build times. This is a big problem (30 seconds per compilation unit on my pIII 1GHz), you will need to use the pimpl idiom to minimise the impact of the luabind headers on the rest of your code.

My personal taste is for luabind, I haven''t actually used toLua, the alpha didn''t come out until after I''d been using luabind for a while. Regardless, code generators worry me - if I forget to do a step it would be hard to debug. IMHO Lua code to interface with C++ using luabind looks neater than the same code using toLua.
Advertisement
thanks andrew, I really appreciate youn taking the time to respond and give a detailed diff list...Its replies like these that really save people a lot of time.



kind regards,

neko
nekoflux

This topic is closed to new replies.

Advertisement