嵌入式脚本环境的优点/缺点?
有多种可用于 .NET 应用程序的脚本环境(例如这篇文章)。
我的问题是,使用它们各自的优点/缺点是什么?
示例包括(但不限于)
- PowerShell
- IronPython
- Lua
- JavaScript
我正在尝试决定在科学应用程序中使用哪种脚本编写工具,以允许专家用户与复杂的模型进行交互,以便他们可以创建新的算法。
There are several scripting environments available for .NET applications (e.g.this post).
My question is, what are the pros/cons of using each of them?
Examples include (but not limited to)
- PowerShell
- IronPython
- Lua
- JavaScript
I am trying to decide which scripting tool to use in scientific applications to allow expert users to interact with complicated models such that they can create new algorithms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有嵌入 Powershell 的经验,但我假设它很像 IronPython,因为它最终与 CLR 紧密相连。
所以:
PowerShell / IronPython
我会将这两者放在一起,并说最大的优点是通过 CLR 进行直接通信的能力。
这些的负面影响可能是内存使用和可能的运行时性能。尽管无论如何它都会在 CLR 中运行,但应该不会有太大区别。
Lua / Javascript
相似之处在于两者最终都会使用某种 P/Invoke API 嵌入。 (或 COM Interop)
Pro:速度快,内存使用量少。
缺点:P/Invoke、非托管代码等。
Lua 和 Javascript 之间:
Lua 可能比 Javascript 更快并且更少占用内存,但是 Javascript 的语言中融入了更熟悉的 OOP 和 FP 习惯用法。
I don't have experience embedding Powershell, but I'm going to assume it's a lot like IronPython in that it's ultimately deeply connected to the CLR.
So:
PowerShell / IronPython
I would group these two together and say the big positive is direct ability to communicate via the CLR.
The negatives for these may be memory use and possibly runtime performance. Although since it will be running in the CLR already anyway, it shouldn't be much of a difference.
Lua / Javascript
Similar in that both would be embedded using some sort of P/Invoke API ultimately. (Or COM Interop)
Pro: Fast, less memory usage.
Con: P/Invoke, unmanaged code, etc.
Between Lua and Javascript:
Lua may be even faster and less of a memory hog than Javascript, but Javascript has more familiar OOP and FP idioms baked into the language.
我认为你可以把 javascript 从你的列表中删除。它不支持复数,也不支持运算符重载...因此,如果 a、b、c 很复数,则似乎无法实现 c=a+b。
I think you can get javascript off your list. It does not support complex numbers nor operator overloading ... so there seems to be no way to implement c=a+b if a,b,c are complex.