lua-users home
lua-l archive

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


I'm writing a binding that allows Lua to be used for describing 3d scenes intended for rendering with a high-end 3d renderer like Pixar's PhotoRealistic RenderMan or DNASoft's 3Delight. The target audience for this is foremost the visual effects industry.

This requires me to support some more exotic things.
1. Lua source files that may be compressed (gzip, bzip2, etc.) and may contain binary chunks of data (essentially rendering the source file partly non human-readable).

2. It also requires functions with variable-length argument lists (arguments being of arbitrary type, detected at runtime).

I have all this working already well 'by hand'.

However, with my codebase growing and me spending a lot of time maintaining code that is doing these things (vs code that does things interesting to the functionality provided by the binding itself), I was wondering if people here have experience with SWIG and how it handles 1. & 2. I also will have to do a Python binding for this next which seems another strong point to use something like SWIG.


I couldn't find anything about variable-length argument list functions in the SWIG Lua docs. I'm also unsure about how much control I have over loading code (to do decompressing and turning binary chunks into user data pointers on-the-fly, as I currently do) before handing it over to the actual interpreter.

And just in general, what are people's experiences when going from a 'hand-written' binding to a binding generation framework like SWIG?


Cheers,

Moritz