Question

[The only similar question I can find was answered long ago and contains a reference to mostly IronPython. I want to consider other options as well]

We have a complex data analysis application written in C#. The application should provide users with a sophisticated means of customizing their data analysis tasks. Currently, we use a mixture of configuration files and Excel tables to specify this, but it gets unwieldy, so we're looking for a scripting language to embed.

What's the best simple scripting language for C#/.NET embedding? Is it possible to somehow embed VBA similarly to Excel/Word? Or is perhaps JavaScript/Lua are used?

Needless to say, it should be easy to expose some API and objects from the main application into the embedded scripts.

Was it helpful?

Solution

I know the other question references IronPython, but I still feel like it should be here because I think it's one of the best options.

Another great option would be IronRuby. The main difference I see would be if your developers/users had any experience with either Python or Ruby that could be transferable.

Really, in the end your best option is going to be a language that is most easily adapted to by the users. Unless they accept it and are able to be more productive than they were with the old method it isn't worth the effort.

OTHER TIPS

Boo perhaps?

Lua is great! Lua play really nice with .NET. I wrote a blog post about how to get started embedding Lua and C#, might be worth to check out:

http://blog.apterainc.com/software/embedding-lua-and-c/

I would look into the XAML only Windows Workflow. You can rehost the designer, and provide custom activities that can be dragged out and used to manipulate the data in any way they like. VERY visual. I'm currently using this in one of my applications, and the users seem to love it. While there is a small learning curve to it, it is much less than a typical scripting language, and people seem to be able to grasp it fairly quickly, especially those with experience using flow charts and Visio.

I know you asked for a scripting technology, but the underlying need is code control for non-programmers. We're using ILOG Rules for .Net to meet that need.

Umm, how about C#? There's no reason why you cannot let the user write C#, then safely load it into another AppDomain with all the correct restrictions and safeguards.

What about JScript.NET or PowerShell

I think using C# via CodeDom is very powerful solution

Boo and IronPython have been mentioned, but don't forget IronScheme, F#, or any of the other languages that have been ported to the CIL virtual machine and have runtime compiliation/interpretation.

IronRuby is looking better everyday.

There are many, many, many scripting languages. Which is best for you depends on what you're trying to do.

You should analyze the tasks your users need to do, the notation they are already familiar with, and pick an existing scripting language that matches them. You should not pick a popular scripting language then force your application and users to fit into it.

I also would put in a vote for using C# to write your extensions. Unless you have a compelling reason such as an existing user base already familiar with python, ruby, or boo, bringing in another language just adds complexity and training cost.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top