Lua is a fast language engine with small footprint that you can embed
easily into your application. Lua has a simple and well documented API
that allows strong integration with code written in other languages.
It is easy to extend Lua with libraries written in other languages. It
is also easy to extend programs written in other languages with Lua.
Lua has been used to extend programs written not only in C and C++, but also in Java, C#, Smalltalk, Fortran, Ada, Erlang, and even in
other scripting languages, such as Perl and Ruby.
有一个项目(pylux)在Python中嵌入Lua。虽然它看起来相当不活跃,但它可能是一个很好的项目来看看。在
从您的评论来看,您似乎对执行不可信代码的安全方法感兴趣。在
正如您在评论中建议的那样,重新定义python内置函数是一种保护代码安全的可怕方法。在
你想要的是沙盒,有针对python的解决方案,但我不推荐它们。使用Jython或IronPython会更好,因为JVM和.netclr在设计时考虑了沙箱。在
我个人认为,在大多数情况下,如果您需要执行不可信的代码,那么您对您的用户的信任太多或不够。在
@卓尔
来自Lua的网站:
@乔·辛普森
看看疯狂的Python,它可能有你想要的。我知道这是个老问题,但其他人可能也在寻找这个答案。这是一个值得好好回答的好问题。在
相关问题 更多 >
编程相关推荐