lua-users home
lua-l archive

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


----- Original Message -----
From: Tim Mensch
Date: 1/20/2009 12:57 PM
One that I've been using that isn't on that list is part of LuaPlus: The "LuaPlus Call Dispatcher" is a single header (no Boost or other external libraries) that uses templates to bind C++ functions to Lua. It also has support for binding Lua functions to C++, though I haven't used that yet. Not sure if it's appropriate to add LuaPlus to the wiki, though, since it obviously does a lot more than just C++ binding.
I should make sure the standalone download version of this is up to date. I know the LuaPlus one at svn://svn.luaplus.org/LuaPlus/work51/Src/LuaPlus/LuaPlusCD.h is.
We use LuaPlusCD.h right now in the Playground casual game library, wrapped with a couple of macros to make it even easier:
If you have any contributions, feel free to email them to me.
And is also a big reason we don't use the entire LuaPlus distribution--it added another 150k to our footprint.
The reason for the extra 100k-ish (that's all it was for me) was due to the viral effect of linking against an .obj. All functions in an .obj link in, and any other .obj files those functions touch get linked in, too.

The code "LuaState* state = LuaState::Create()" was supposed to create a Lua state without linking in any of the standard Lua runtime libraries. However, it existed in the same .obj as the function that would initialize the standard libraries. When LuaState::Create() was called, all the standard libraries came with it.

This problem was alleviated by moving the function definition for initializing the standard libraries into a separate .obj.

The minimal overhead for using LuaPlus now, then, is under 4k.

Josh