Pros/cons of embedded scripting environments?

610 Views Asked by At

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.

2

There are 2 best solutions below

3
On BEST ANSWER

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.

0
On

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.