lua-users home
lua-l archive

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


On Mon, Mar 12, 2012 at 3:08 PM, Janis Britals <jbritals@xs4all.nl> wrote:
> I'm using very thin interface layers wrapping C++ method calls in their
> 'extern "C"' equivalents. It is a good enough solution in itself, though
> less elegant.

The idea of a straight-to-C++ binding is attractive, but mangling is
very compiler-specific. And that's probably the least of the possible
pitfalls (which is why a standard mangling scheme wouldn't be as
useful as people think).  Making new objects requires not only their
constructors but the whole machinery of 'new' itself.   I've done this
kind of thing (although not in this context) and things get pretty
hairy.  It's a pity in a way that the cool cross-platform kits are
C++, because C++ does not play nice with the rest of the world.

steve d.