# ANN: RubyCLR first drop

**URL:** <https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423>\
**Category:** Ruby\
**Created:** [January 13, 2006, 10:58pm UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423 "2006-01-13T22:58:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 13, 2006, 10:58pm UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/1 "2006-01-13T22:58:00Z")

</div>

I posted the first drop of my RubyCLR bridge here:  
[http://www.iunknown.com/articles/2006/01/12/first-drop-of-rubyclr](http://www.iunknown.com/articles/2006/01/12/first-drop-of-rubyclr)

There’s more information about it on the blog entry. This is a very  
early  
build, but the unit tests that I have all pass. If you have the .NET  
Frameworks 2.0 installed on your computer you could give it a test  
drive.

If folks could provide any feedback at this point it would be greatly  
appreciated. If someone wants a simple challenge extending the bits, you  
could add static field support which is currently missing from this  
drop,  
unlike what I claimed on my blog entry 🙂

Thanks  
-John

> **[John Lam's Blog](https://www.iunknown.com/)**
>
> Since 1997

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 14, 2006, 12:05am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/2 "2006-01-14T00:05:32Z")

</div>

John L. wrote:

> I posted the first drop of my RubyCLR bridge here:  
> [http://www.iunknown.com/articles/2006/01/12/first-drop-of-rubyclr](http://www.iunknown.com/articles/2006/01/12/first-drop-of-rubyclr)

What’s the overall idea of the bridge: to allow Ruby to be called from,  
say, C# code, or to write Ruby code and compile it into a .net assembly?

I thought it would be the latter, but when you mention it does not yet  
support generics, etc. I got confused (I wouldn’t use generics if I’m  
writing Ruby code).

Jeff

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 14, 2006, 12:34am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/3 "2006-01-14T00:34:45Z")

</div>

> What’s the overall idea of the bridge: to allow Ruby to be called from,  
> say, C# code, or to write Ruby code and compile it into a .net assembly?

The bridge allows you to manipulate C# objects from Ruby, which is  
different  
form the scenarios that you present. It also supports callbacks - that  
is  
you can write event handlers for CLR events in Ruby. So it is a two-way  
bridge in this sense. It’s currently a non-goal for the bridge to  
support  
creating CLR objects using Ruby, although I can imagine how that could  
be  
done.

I thought it would be the latter, but when you mention it does not yet

> support generics, etc. I got confused (I wouldn’t use generics if I’m  
> writing Ruby code).

If you want to consume CLR objects, you need to support generics. The  
WinFX  
libraries use generics heavily.

-John

> **[John Lam's Blog](https://www.iunknown.com)**
>
> Since 1997

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 14, 2006, 6:58am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/4 "2006-01-14T06:58:29Z")

</div>

John L. wrote:

> The bridge allows you to manipulate C# objects from Ruby, which is

Ah! Makes sense now. Kind of like how the COM Callable Wrappers let  
COM objects talk to .Net components, one could consider the bridge to be  
a kind of “Ruby Callable Wrapper”, I guess?

Sounds exciting. I will definitely take a look at it when I get the  
chance.

Jeff

> **[Hey Daddio!](http://www.softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 16, 2006, 1:03am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/5 "2006-01-16T01:03:27Z")

</div>

On Mon, 16 Jan 2006 00:42:11 +0100, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On 1/13/06, John L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> How crazy would I have to be to try making a Windows Forms GUI app using  
> this?
> 
> Looks like fun, either way.

Actually, I already managed to call .NET ArrayLists via Win32OLE. It  
doesn’t get (much) crazier.

Why would you want to use WinForms anyway? It’s such a horrible terrible  
clumsy GUI toolkit anyway.

David V.

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 16, 2006, 12:45am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/6 "2006-01-16T00:45:21Z")

</div>

On 1/13/06, John L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> unlike what I claimed on my blog entry 🙂

How crazy would I have to be to try making a Windows Forms GUI app using  
this?

Looks like fun, either way.

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 16, 2006, 1:09am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/7 "2006-01-16T01:09:29Z")

</div>

On 1/15/06, David V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Actually, I already managed to call .NET ArrayLists via Win32OLE. It  
> doesn’t get (much) crazier.
> 
> Why would you want to use WinForms anyway? It’s such a horrible terrible  
> clumsy GUI toolkit anyway.

I’m looking for the ability to write GUI apps in Ruby, without any of  
the deployment difficulties associated with ‘non-standard’ toolkits.  
I probably just need to get better at packaging working subsets of the  
full Ruby install on Windows, though. I was starting to think that  
.NET was an easier prerequisite than “Ruby, GTK+, and these particular  
environment variables.”  
Your post reminded me how bad parts of WinForms are, though. Heh.

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 16, 2006, 1:21am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/8 "2006-01-16T01:21:32Z")

</div>

On Mon, 16 Jan 2006 01:06:43 +0100, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > Looks like fun, either way.  
> > > the deployment difficulties associated with ‘non-standard’ toolkits.  
> > > I probably just need to get better at packaging working subsets of the  
> > > full Ruby install on Windows, though. I was starting to think that  
> > > .NET was an easier prerequisite than “Ruby, GTK+, and these particular  
> > > environment variables.”  
> > > Your post reminded me how bad parts of WinForms are, though. Heh.

Well, someone did point my attention at a binary ruby-gtk, so if that  
has  
GTK bundled along, things might get less insane in first-time  
deployment.

David V.

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [January 16, 2006, 4:00am UTC](https://www.ruby-forum.com/t/ann-rubyclr-first-drop/52423/9 "2006-01-16T04:00:53Z")

</div>

> How crazy would I have to be to try making a Windows Forms GUI app using  
> this?
> 
> Looks like fun, either way.

Using the earlier non-released build of my bridge, I created a lap  
around  
WinFX app:  
[http://www.iunknown.com/articles/2005/11/29/matthews-birthday-present](http://www.iunknown.com/articles/2005/11/29/matthews-birthday-present).  
There  
was Avalon and Indigo stuff there (it was a flash card app that used  
Indigo  
to pull images out of flickr and used Avalon to render a 3D flash card  
that  
would rotate about its z-axis).

The Indigo stuff wasn’t all that well baked as Ruby since I didn’t  
support  
generics in that version of my bridge. I still don’t in this version,  
but  
it’s a super high priority item to get working.

I think the real fun will be to use Ruby to gen Avalon UI’s on the fly.

-John

> **[John Lam's Blog](https://www.iunknown.com)**
>
> Since 1997
