[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C/C++ bindings: automated or by hand?
- From: Miles Bader <miles.bader@...>
- Date: Mon, 10 Sep 2007 10:58:02 +0900
"Daniel Collins" <email@example.com> writes:
> + 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
> 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
97% of everything is grunge