Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I have plenty of experience with both Ruby and Python, and I'm looking to embed either one of these on a C# application I'm developing. I don't really care which, but I'd like to know which one currently has better support and is overall less buggy, and is the easiest to implement and deploy.

I also took a good look at Boo, which I'm also messing around with. C# Is too complicated and verbose, so I'm leaving that as the last option.

As for what I'm doing, I need to extend some classes in a friendly and dynamic way, without the need to recompile. They will also need to have access to a data structure created on the C# side of the code.

So, any recommendations on which should I use?

share|improve this question

closed as not constructive by Joel Etherton, Walter, ChrisF Aug 9 '11 at 14:59

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

What is definition of better? – MattyD Aug 8 '11 at 3:10
"but I'd like to know which one currently has better support and is overall less buggy, and is the easiest to implement and deploy." – elite5472 Aug 8 '11 at 3:12
They both have interpreters, and they both can access .NET types. Pick whichever one you like. There's no "better". – Aaronaught Aug 8 '11 at 4:28
@Aaronaught: He clearly states 'overall less buggy'. I don't use any of them, so I don't know if there are clear enough differences, but I had to make tech decisions of this kind in the past and often enough there was a answer possible like "Don't use X, it's just too buggy yet". – thorsten müller Aug 8 '11 at 4:49
IronPython has been the most active, if that is any measure. – sylvanaar Aug 8 '11 at 7:05

2 Answers 2

up vote 4 down vote accepted

Either one is perfectly fine for embedding in a .NET application. Unless you have a specific reason for picking Ruby or Python, give your users the ability to use both; it's the same hosting code:

var runtime = ScriptRuntime.CreateFromConfiguration();
var extension = Path.GetExtension(scriptFileName);
var engine = runtime.GetEngineByFileExtension(extension);

Both can access your application's data structures, subclass .NET types, and implement .NET interfaces using language-specific semantics.

share|improve this answer
Interesting suggestion. Perhaps the best will be to test how both fare in our application until the answer becomes clear. I will check this out. Thanks. – elite5472 Aug 8 '11 at 14:45
Okay, I messed around a bit with this and got both Python and Ruby running successfully. Your answer was really useful; now if I find one to be better than the other, I can effortlessly change the language without having to change anything on the C# side. Thanks! – elite5472 Aug 8 '11 at 17:05
Great! Feel free to email the mailing lists if you have any issues or other questions, see and – Jimmy Schementi Aug 8 '11 at 19:20

There are a few quirks in IronPython we've encountered - a number of pretty standard modules (the ones we found had to do with IO, but others have to do with NumPy) are written in C (rather than Python), which IronPython cannot handle. While this is supposed to be fixed "real soon now", it isn't done in time for the app we're releasing this fall. If these aren't a problem, then IronPython should work well.

share|improve this answer
I see. The scripting we'll be doing will mostly be basic event handling, so I don't think we'll need any of the python libraries. I got IronPython running without much effort; pretty straightforward stuff. – elite5472 Aug 8 '11 at 14:44
Unfortunately we're really not looking to improve the situation with Python C extensions. There is a project "IronClad" which implements the python C API, but not much work is being done on it anymore. Though there is work porting NumPy to .NET w/IronPython support, it's not a general solution to the CPython extension compat issue. – Jimmy Schementi Aug 8 '11 at 19:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.