lua-users home
lua-l archive

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


Indeed; this is one of the several reasons I think
it would be good for even the standard Lua libraries
to be written using tolua (or a similar tool), and
for this practice to be encouraged for everyone.

Before people jump on this bandwagon, I have a question.  I've never used
tolua or SWIG or othersuch.  What kind of run-time overhead (processor time,
memory space, etc.) is involved with using such tools?

I haven't the foggiest, to be honest. Whether it's a problem for you depends on whether you need the standard libraries in your tiny environments. SWIG (the tool I'm most familiar with) certainly imposes overhead, but first, I think it could be reduced with a little extra care, and secondly, I don't think it's that great. The fundamental limit is that you keep the original C functions verbatim, and have a second wrapper function, thus imposing an extra function call and return per C function wrapped. In my current environment (resource-consciously-written C running on a modern UNIX server) this is not an issue. I'd be interested to know the results for those who are, and agree this may well be a reason not to wrap the standard libraries this way if the overhead were unacceptable.
--
http://sc3d.org/rrt/