[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The current state of interfacing Lua with C++ code
- From: Miles Bader <miles@...>
- Date: Thu, 10 Dec 2009 12:37:22 +0900
"Martin C. Martin" <martin@martincmartin.com> writes:
> What libraries would someone recommend for binding Lua to parts of a
> large, existing C++ code base? It needs to work in both Windows and
> Linux. I'm looking at LuaPlus (I know, it's a lot more than just a C++
> binding), but perhaps that's not the place to start?
I use swig, which is very flexible, works with multiple languages, has
fairly easy/mechanical interface definitions[*], and generates Lua
interfaces which usually capture most of the nuances of the C++
interface (e.g., overloading, inheritance).
[*] It looks at C++ declarations directly, so theoretically you can just
feed it your existing .h files and have it generate the appropriate
interfaces; in practice, you often want to give it slightly massaged
versions, but it's pretty easy to do this.
The downside is that the code it generates can be a bit bloated. So
it's maybe not what you want for a small embedded app with simple
interfaces.
-Miles
--
Cat, n. A soft, indestructible automaton provided by nature to be kicked when
things go wrong in the domestic circle.