Both Lua and Python can provide the features you mention, so choosing one of them will depend on other criteria.
Lua is a lighter weight solution, it will have a much smaller disk footprint and likely a smaller memory overhead than Python too. For some uses it may be faster. Python has a much richer standard library, more mature third party libraries and a more expressive language.
Both have been embedded into major applications. Python can be found in Blender, OpenOffice and Civilization 4. Lua can be found in World of Warcraft and Adobe Lightroom. I'd recommend looking at a few tutorials for each and the facilities available to embed them in your application and just choose the one that fits your brain best.
Typically, Lua is the better choice for embedding into another project. Python is better as a standalone platform because the library support is so much broader. See Lua Versus Python for more details.
Personally, I use both very frequently depending on the job at hand. I always use Lua for embedding into C/C++ applications or scripting functionality that is imported from C/C++ shared libraries (i.e. a DLL). Python is always my first choice for standalone tasks that do not require low-level C/C++ code.
I'd put my two cents in for python. I don't know a lot of the details, but the computer graphics suite blender does a wonderful job of implementing python scripting.
As far as I can tell in blender 2.5 the interpreter is run from inside the executable,
import sys
sys.executable
shows /blender/blender.exe and there is good debugging support, it even has a full interactive interpreter inside.
I really like Lua for embedding, but just as another alternative, JavaScript is easily embeddable in C, C++ (SpiderMonkey and V8) and Java (Rhino) programs.
发布评论
评论(7)
Lua 和 Python 都可以提供您提到的功能,因此选择其中之一将取决于其他标准。
Lua 是一种更轻量级的解决方案,与 Python 相比,它的磁盘占用空间要小得多,而且内存开销也可能更小。对于某些用途,它可能会更快。 Python拥有更丰富的标准库、更成熟的第三方库和更具表现力的语言。
两者都已嵌入到主要应用程序中。 Python 可以在 Blender、OpenOffice 和 Civilization 4 中找到。Lua 可以在魔兽世界和 Adobe Lightroom 中找到。我建议您查看每个教程的一些教程以及将它们嵌入到您的应用程序中的可用工具,然后选择最适合您大脑的一个。
Both Lua and Python can provide the features you mention, so choosing one of them will depend on other criteria.
Lua is a lighter weight solution, it will have a much smaller disk footprint and likely a smaller memory overhead than Python too. For some uses it may be faster. Python has a much richer standard library, more mature third party libraries and a more expressive language.
Both have been embedded into major applications. Python can be found in Blender, OpenOffice and Civilization 4. Lua can be found in World of Warcraft and Adobe Lightroom. I'd recommend looking at a few tutorials for each and the facilities available to embed them in your application and just choose the one that fits your brain best.
Lua 是为此而设计的:
Lua is designed for this:
通常,Lua 是嵌入到另一个项目中的更好选择。 Python 作为独立平台更好,因为库支持更广泛。有关更多详细信息,请参阅 Lua 与 Python。
就我个人而言,我根据手头的工作经常使用这两种方法。我总是使用 Lua 嵌入 C/C++ 应用程序或从 C/C++ 共享库(即 DLL)导入的脚本功能。对于不需要低级 C/C++ 代码的独立任务,Python 始终是我的首选。
Typically, Lua is the better choice for embedding into another project. Python is better as a standalone platform because the library support is so much broader. See Lua Versus Python for more details.
Personally, I use both very frequently depending on the job at hand. I always use Lua for embedding into C/C++ applications or scripting functionality that is imported from C/C++ shared libraries (i.e. a DLL). Python is always my first choice for standalone tasks that do not require low-level C/C++ code.
我愿意花两分钱买蟒蛇。我不知道很多细节,但是计算机图形套件搅拌机在实现 python 脚本方面做得非常出色。
据我所知,在 Blender 2.5 中,解释器是从可执行文件内部运行的,
显示 /blender/blender.exe
并且有良好的调试支持,它甚至内部有一个完整的交互式解释器。
欲了解更多信息,请查看:http://www.blender.org/
I'd put my two cents in for python. I don't know a lot of the details, but the computer graphics suite blender does a wonderful job of implementing python scripting.
As far as I can tell in blender 2.5 the interpreter is run from inside the executable,
shows /blender/blender.exe
and there is good debugging support, it even has a full interactive interpreter inside.
For more info check out: http://www.blender.org/
我真的很喜欢 Lua 的嵌入功能,但作为另一种选择,JavaScript 可以轻松嵌入到 C、C++(SpiderMonkey 和 V8)和 Java(Rhino)程序中。
I really like Lua for embedding, but just as another alternative, JavaScript is easily embeddable in C, C++ (SpiderMonkey and V8) and Java (Rhino) programs.
除了 Tcl、Lua 和 Javascript(都已经提到过)之外,Guile是另一种专门为此设计的语言。
In addition to Tcl, Lua, and Javascript (all already mentioned), Guile is another language designed explicitly for this.
我会将 Tcl 添加到其中。它被设计为可以轻松嵌入到其他程序中。
I'll add Tcl to the mix. It's designed to be easily embedded into other programs.