lua-users home
lua-l archive

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


"Daniel Collins" <dcplus@bigpond.com> writes:
> Automated:
> 	+ Fast.
> 	+ In theory, should be less error prone.
> 	+ Very fast updating of the binding code when the underlying
> native code API changes.
> 	-- Leaves me dependent on the capabilities of the binding tool.
> This can manifest as a hunt for a different tool, or in warping the
> native code API to accommodate the needs/limitations of the binding
> tool.
>
> That last point is to me the biggest drawback of automated code binding.
> I don't like having to modify the native code API just to suit the
> binding tool, especially since the C++ code is also used by other C++
> projects. I also don't like being dependent on the tool's functionality
> for features I know I could do by hand.

I've been using "swig" generated bindings for a lua interface to my
program.  While it has its problems (mostly bloat), it hasn't required
_any_ changes in my underlying C++ api, and making the interface
definition files is really easy (basically you just copy the class defs
from the existing C++ header files into your interface def file and
trim/annotate them there to tweak the result).

I've thought that maybe sometime in the future I'd make my own
hand-rolled interface to trim some of the bloat, but that goal seems
increasingly distant...

-Miles
-- 
97% of everything is grunge