Using IronRuby as a Scripting Engine in Your Application

Originally published: 06/2011 by J Wynia

So, one of the products I’m building needs several points of extensibility that can be dropped in. For a certain type of extension, we’re using MEF. I’ve been using MEF on my current client project for a while and have worked out many of its quirks. But, MEF still puts the author of extended logic in Visual Studio.

On the other side, we’ve got a templating/snippet system that stores chunks of “views” for rendering pages, emails, etc. that provide a mechanism so that the entire look and feel of the application is stored in chunks in a database. They’re editable via a web app by people other than web developers. I’ve built similar for several projects and it works out really nicely.

I want something closer to that templating solution for simple business logic and rules. There’s still a definite place in my architecture for MEF plugins. C# does heavy lifting well. However, I have long been intrigued by IronRuby as an embedded scripting engine. So, this morning, I did a quick prototype to determine how much effort it was going to be to use it in the way I want.

Turns out, it’s pretty damned easy. When I mentioned that I was doing this prototype, someone asked if I was going to blog it. It’s often easier to just record a quick explanation/walkthrough, so that’s what I did. The video is below.

IronRuby Scripting in .NET from J Wynia on Vimeo.


blog comments powered by Disqus
Or, browse the archives.
© 2003- 2015 J Wynia. Very Few Rights Reserved. This article is licensed under the terms of the Creative Commons Attribution License. Quoted content or content included from others is not subject to that license and defaults to normal copyright.