tags:

views:

3859

answers:

13

We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine.

What is now the best choice for an embedded scripting language on Windows .NET?

+16  A: 

IronPython. Here's an overview of how to embed it.

Ben Hoffstein
A: 

JScript.NET is a good one. Fiddler uses it.

Mark Cidade
+7  A: 

The PowerShell engine was designed to be easily embedded in an application to make it scriptable. In fact, the PowerShell CLI is just a text based interface to the engine.

Edit: See http://blogs.msdn.com/powershell/archive/2007/08/29/making-applications-scriptable-via-powershell.aspx

Rodrick Chapman
+1  A: 

IronRuby as mentioned above. An interesting project to me as a C# programmer is C# Eval support in Mono. But it's not available yet (will be part of Mono 2.2).

Borek
+9  A: 

Boo language.

jop
+1  A: 

I havnt tried this yet but it looks pretty cool:

http://www.codeplex.com/scriptdotnet

mattlant
A: 

I've just created a plugin for a client, allowing them to write C# code in modules that act like VBA does for Office.

+2  A: 

My scripting language of choice would be Lua these days. It's small, fast, clean, fully documented, well supported, has a great community , it's used by many big companies in the industry (Adobe, Blizzard, EA Games), definetely worth a try.

To use it with .NET languages the LuaInterface project will provide all you need.

Remo.D
Lua is also used for scripting in Garry's Mod, which is a great game :)
Charlie Somerville
+1  A: 

Why not try C#? Mono has a great new project especially for dynamically evaluating C# :

http://tirania.org/blog/archive/2008/Sep-10.html

DAC
+2  A: 

Another vote for IronPython. Embedding it is simple, interoperation with .Net classes is straightforward, and, well, it's Python.

Robert Rossney
+2  A: 

I've used CSScript with amazing results. It really cut down on having to do bindings and other low level stuff in my scriptable apps.

hectorsosajr
+15  A: 
Grant Peters
Do you know if this will work in Mono too, or is it only available on .NET?
Matthew Scharley
i don't know, never used Mono
Grant Peters
FYI, and for anyone else that's curious, yes, this does compile and run on Mono just fine. Only need the System reference for the compilation parts.
Matthew Scharley
Haha, onomatopoeias. :]
ANeves
+1 nice example
Justin
A: 

I've used Lua before; in a Delphi app but it can be embedded in lots of things. It's used in Adobe's Photoshop Lightroom.

Tony