I know that this may not fit your needs, but there are some nice libraries that helps to expose C++ classes to lua. For example: http://www.rasterbar.com/products/luabind/docs.html#properties Guilherme.