Pros/cons of embedded scripting environments?

旧城冷巷雨未停 提交于 2019-12-12 12:27:02

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2609794/pros-cons-of-embedded-scripting-environments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!