Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have plenty of experience with both Ruby and Python, and I\'m looking to embed

ID: 642847 • Letter: I

Question

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?

Explanation / Answer

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);
engine.ExecuteFile(scriptFileName);
Both can access your application's data structures, subclass .NET types, and implement .NET interfaces using language-specific semantics.