问题
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