Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make a nasty C++ program scriptable with Python and/or Lua?
    primarykey
    data
    text
    <p>I'm confronted with the task of making a C++ app scriptable by users. The app has been in development for several years with no one wasting a thought on this before. It contains all sorts of niceties like multithreading, template wizardry and multiple inheritance. As the scripting language, Python is preferred, but Lua might be accepted if it is significantly easier to implement.</p> <h3>Question 1</h3> <p>From what I have learned so far, there are broadly speaking two ways to integrate Python/Lua with C++ : "extending" and "embedding".</p> <p>In this case, it looks like I need both. The scripting language need access to objects, methods and data from the app but needs to be called by the app once the user has written the script - without restarting anything.</p> <p>How is this usually done in the real world?</p> <h3>Question 2</h3> <p>There seems to be a bewildering array of of manual solutions and binding generators out there, all of them less than perfect. </p> <ul> <li>swig, pyste, Py++, ctypes, Boost.Python sip, PyCXX, pybindgen, robin, (Cython/Pyrex, Weave)</li> <li>CppLua, Diluculum, Luabind, Luabridge, LuaCpp, Luna/LunaWrapper, MLuaBind, MultiScript, OOLua, SLB, Sweet Lua, lux (this list from the lua wiki)</li> <li>CPB, tolua, tolua++, toLuaxx, luna and again swig</li> </ul> <p>Most commments on these found on the web are a little out of date. For example, swig is said to be difficult in non-trivial cases and to generate incomprehensible code. OTOH, it has recently gone to v2.0.</p> <p>Some of the above use pygccxml to let gcc analyze the C++ code and then genarate the binding. I find this idea appealing, as gcc probably understands the code better than i do :-). Does this work well?</p> <p>Testing them all might easily cost me half of the time allocated for the whole project.</p> <p>So, which ones do you recommend?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload