[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: toLua++ question
- From: Christian Tellefsen <christian.tellefsen@...>
- Date: Tue, 21 Dec 2010 14:22:35 +0100
I looked at some Lua wrappers a while back.
After a bit of evaluation, I decided to add our own wrappers and added
push_xxx, to_xxx and check_xxx functions that know about our classes /
vectors / enumerations and so on, in the same style as the normal Lua C
interface.
Advantages:
- Everything looks like 'normal' Lua bindings. No need to learn two
different style interfaces for doing bindings.
- Low complexity.
- Shallow call stacks, easy to debug.
- Quick compilation, works well with edit & continue, since pretty much
any bindings change is local to one .cpp file.
- Easy to do bindings that are not simply wrapping methods and
properties, like setting properties on a table reading and writing data
in a database.
- Small.
- Fast.
Disadvantages:
- More verbose code.
- Harder to learn for C++ coders who don't know the Lua stack, and are
more used to working with classes and templates.
I'm sure some other wrappers also have some of the advantages above, I
haven't looked at everything in depth, and it was some time ago. I'm
pretty happy with how it turned out, though.
Cheers,
Christian Tellefsen