Ruby .NET, RubyCLR, and Assemblies

My company is working on a piece of software right now that is using
.NET. One of the features is a scripting console similar to IRB: the
user may type in one-off commands and see the effect in the application.

I want the scripting language to be Ruby. Right now, it’s IronPython.
I’ve been told that the reason is that with using Ruby under this
scenario, a new Assembly is created for each command that the user
enters. This is a Bad Thing, as it’s been described to me, for
performance and memory. IronPython doesn’t suffer this problem. (I was
also told that there is some nasty way to get around the problem that
involves tying objects together and marshalling data back and forth. Or
something. Hopefully I got the description right; I’m a Ruby scripter,
not a .NET programmer.)

  1.   Does this sound correct to people who know Ruby/.NET or
    

RubyCLR?

  1.   If it's not correct, could you elaborate on how one might
    

achieve the functionality I describe above?

  1.   If it is correct, how can it be fixed? If Python managed a
    

solution, I assume Ruby could as well.

I’d really like our software to use Ruby, and I could probably convince
the engineers to use it if we could overcome this hurdle. More Ruby
everywhere is better for the world. :wink:

On 1/16/07, Gavin K. [email protected] wrote:

I want the scripting language to be Ruby. Right now, it’s IronPython.
I’ve been told that the reason is that with using Ruby under this
scenario, a new Assembly is created for each command that the user
enters. This is a Bad Thing, as it’s been described to me, for

This is not a behavior defined by RubyCLR (the only of the three I’m
familiar with). RubyCLR does a very nice job of allowing .NET and
Ruby object to interoperate. If you want to look at some code that
uses RubyCLR, check out my “codebuilder” gem
(http://rubyforge.org/projects/codedombuilder/). All the tests but one
or two work with the latest version of RubyCLR, so its a good demo of
interoperation.

  1.   Does this sound correct to people who know Ruby/.NET or
    

RubyCLR?

Like I said above, no. Unless something specific in your application
requires it, RubyCLR itself doesn’t do this to you.

  1.   If it's not correct, could you elaborate on how one might
    

achieve the functionality I describe above?

My experience in RubyCLR is from the opposite direction of your app -
I have used it quite a bit to script .NET components, but I have not
done a lot of automation the other way. However, I can tell you that
once RubyCLR gets a reference to a .NET object, you can call any of
it’s methods and properties in a fairly intuitive way.

I’d really like our software to use Ruby, and I could probably convince
the engineers to use it if we could overcome this hurdle. More Ruby
everywhere is better for the world. :wink:

If you have more specific questions I’d be glad to help. I love
RubyCLR, .NET and Ruby too :slight_smile:

Justin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs