4 ms·
Running untrusted code to allow modding of games. Suddenly the fact that you have a standard library or a complex language with a large amount of features is no
by imtringued 8y ago
Running untrusted code to allow modding of games. Suddenly the fact that you have a standard library or a complex language with a large amount of features is no longer a benefit and instead is actually a liability often to the point that you disable the standard library in lua entirely and only selectively load parts of it and write your own modding API to allow modification of the game.
There are entire games built around modding via lua such as gary's mod which similar to a web browser has to download random code from a server. Then there are mods like computercraft/opencomputers for minecraft in which direct file access to the host doesn't make any sense at all because every computer has it's own filesystem.
I just looked up Python's sandboxing capabilities and I can't find anything. All I see is answers like [0] that suggest that it's not trivial.
What about other implementations like pypy that claim to have a sandbox? [1] I can see lots of warnings like "This is not actively maintained."
The lack of mature sandboxing for python makes it impossible to use for the usecases I've described above.
[0] https://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python https://stackoverflow.com/questions/3068139/how-can-i-sandbo...
[1] http://doc.pypy.org/en/latest/sandbox.html http://doc.pypy.org/en/latest/sandbox.html