scoder / lupa

Lua in Python
http://pypi.python.org/pypi/lupa
Other
1.02k stars 136 forks source link

[Feature Request] Expose Guts for better fine control. #254

Open volundmush opened 11 months ago

volundmush commented 11 months ago

Although Lupa is very intuitive to use and its integration with Python is astoundingly thorough, not very much of Lua's guts are exposed to Python. There's no direct access to lua_yield or lua_sethook for instance. (as I understand it, lua_sethook applies to each lua_State*, so it would need to be able to target both the LuaRuntime and each lua_newthread pointer. Unless I am misunderstanding.) I am not certain how one is supposed to properly sandbox an environment's globals, restrict execution, force Lua to terminate for running too long, etc.

After checking out LuaBridge's ability to create frozen namespaces and fill it with functions and property getter-setters, and using the raw C API to put restraints on Lua, I find these things lacking in Lupa.

Unless I am somehow not seeing the forest for the trees; I don't know the right way to inject a pile of Python API objects into a Lua Coroutine's globals or to limit access to certain libraries using Lupa.