# Ruby .NET, RubyCLR, and Assemblies

**URL:** <https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82014>\
**Category:** Ruby\
**Created:** [January 16, 2007, 9:52pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82014 "2007-01-16T21:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 16, 2007, 9:52pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82014/1 "2007-01-16T21:52:32Z")

</div>

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. 😉

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 16, 2007, 11:07pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82014/2 "2007-01-16T23:07:56Z")

</div>

On 1/16/07, Gavin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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/](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. 😉

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

Justin
