3

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.

Community
  • 1
  • 1
pomeroy
  • 1,377
  • 1
  • 12
  • 21
  • I listed a few embedded scripting environments, but I didn't mean to limit your responses to those listed. – pomeroy Apr 09 '10 at 18:13
  • 3
    What is it you are trying to script? Is this part of the UI? Part of your build process? Scripting server components triggered by your UI? – Jaxidian Apr 09 '10 at 18:19

2 Answers2

2

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.

John Weldon
  • 39,849
  • 11
  • 94
  • 127
  • You mean there isn't a Native implementation of Lua or Javascript in .Net? How sure are you on that? It's a scripting language not a device driver. – Earlz Apr 09 '10 at 18:23
  • Good point @Earlz. I was thinking of the obvious or default implementation I suppose. – John Weldon Apr 09 '10 at 18:24
  • Is IronPython ready for expert end-users, if it were deployed within an app? – pomeroy Apr 12 '10 at 18:31
1

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.

FFox
  • 1,550
  • 2
  • 17
  • 26