Jump to content
Posted 12 August 2012 - 05:17 AM
Posted 12 August 2012 - 06:15 AM
we actually write all our Lua bindings by hand (i.e., explicit int do_something(lua_State *L) functions).
It is just a few lines of code for each function you bind, so it doesn't take much time and I find that being deliberate about what you export to Lua and how leads to better Lua APIs -- smaller, simpler and more Lua-style than C-style. It also means we can refactor the C code without affecting the Lua API.
I used to do automatic Lua bindings in the past (with template matching), but I like this approach a lot better.
We export most C objects as lightuserdata, to minimize the load on the garbage collector. This means that our C++ classes become more like "modules" in Lua -- tables grouping functions. So, you can't actually call unit:set_position(...) in our Lua API, you have to call Unit.set_position(unit,...)
Does this mean that you have no control over when updates to your dependencies occur, or which version you're compiling against? If so, that's a huge red flag and is really unprofessional -- e.g. a QA department couldn't even begin to validate your game if you can't control what code is being included in a build. You need to have full control over your dependencies. I'd sort this out before rejecting libraries based on this fault.
And most importantly, I want something that won't be broken each times there's an update (I use Linux/Debian Testing, so updates could happen quite frequently)
Posted 12 August 2012 - 06:51 AM
Edited by dAgeCKo, 12 August 2012 - 06:53 AM.
Posted 12 August 2012 - 08:35 AM
But I am now fed up with it for these reasons: each time there's a new version of luabind I have many problems with my development: compilation issues, linking issues and running issues (segmentation fault, not running...). For example the last time I could plainly use my program (which uses luabind) was on april. All the next releases I had broken things (out of my concern).
Trouble with tools shouldn't be an important reason to choose or dismiss a scripting language. If what you are trying to do doesn't work, it can be assumed that what you are trying to do is wrong, not that tools are defective: a humble approach would be more productive. Why don't you explain your difficulties in detail in order to get help? Recommending alternative tools that you'll also make mistakes with isn't going to be very useful.
What I am looking for should not necessary binds the lua language. I am also opened to python. However my last attempt to use python was a disaster, mainly because of the bjam thing which I didn't succeed to make it work (if you know how to manage this, feel free to propose python).
Omae Wa Mou Shindeiru
Posted 12 August 2012 - 09:11 AM
Posted 13 August 2012 - 03:48 AM
I am now looking for a good scripting language to use within C++ which will replace the current one (luabind).
Posted 13 August 2012 - 04:59 PM
Edited by krippy2k8, 13 August 2012 - 04:59 PM.