# Ruby .NET, RubyCLR, and Assemblies

**URL:** <https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017>\
**Category:** Ruby\
**Created:** [January 16, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017 "2007-01-16T22:09:35Z")\
**Posts on this page:** 4\
**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, 10:09pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017/1 "2007-01-16T22:09:35Z")

</div>

(Resending again as plain-text (hopefully) to ensure it makes it through  
the google groups gateway.)

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?

2. If it’s not correct, could you elaborate on how one might achieve the  
functionality I describe above?

3. 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:15pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017/2 "2007-01-16T23:15:57Z")

</div>

Gavin K. 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  
> performance and memory.

The short answer is no. RubyClr uses .NET’s DynamicMethod.

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

I don’t know that RubyClr is necessarily ready to be depended on. Don’t  
get me wrong, it does some things well, but last I looked it still had  
object-identity issues and that’s a major problem for writing anything  
reliable.

It’s fun for short-lived scripts with low object counts though.

---

<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 29, 2007, 10:50pm UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017/3 "2007-01-29T22:50:51Z")

</div>

Can you provide some examples of object-identity issues? Or perhaps  
an URL ?

I am interested in using RubyCLR in production code.

thanks,

devdev

---

<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 30, 2007, 12:09am UTC](https://www.ruby-forum.com/t/ruby-net-rubyclr-and-assemblies/82017/4 "2007-01-30T00:09:09Z")

</div>

> On Jan 16, 5:10 pm, “Sam S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I don’t know thatRubyClris necessarily ready to be depended on. Don’t  
> > get me wrong, it does some things well, but last I looked it still had  
> > object-identity issues and that’s a major problem for writing anything  
> > reliable.

On 1/29/07, devdev [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can you provide some examples of object-identity issues? Or perhaps  
> an URL ?
> 
> I am interested in using RubyCLR in production code.

[http://www.iunknown.com/articles/2006/10/05/interfaces-that-dont-break-object-identity](http://www.iunknown.com/articles/2006/10/05/interfaces-that-dont-break-object-identity)  
[http://www.iunknown.com/articles/tag/rubyclr](http://www.iunknown.com/articles/tag/rubyclr)
