swig is a script interface auto generate tool
here is the tutorial for lua
http://www.swig.org/Doc1.3/Lua.html#Lua_nn2