« Why Ruby? (for .NET folks) | Main | When I was a boy I used a pencil and paper »

March 16, 2006

Third Drop of RubyCLR

This is the biggest release of RubyCLR yet. You can download it here. Here’s a brief summary of RubyCLR as of this drop:

  • Reference .NET assemblies by assembly name or by filename
  • Create and manipulate .NET reference and value types
  • Automatically marshal .NET reference and value types to / from Ruby
  • Dynamic generation of interop code using CIL instructions
  • Create and manipulate generic .NET reference types
  • Discover and consume .NET interfaces on a .NET object
  • Implement .NET event handlers using Ruby blocks
  • Map .NET member names to Ruby names (e.g. WordCount becomes word_count)
  • Mix in Ruby Enumerable support for .NET IEnumerable types
  • Dynamically access .NET XML documentation from irb (requires text/format – to make it work uncomment require in rubyclr.rb)

There are several sample applications to show you what’s possible:

  • GoogleCalc lets you access Google’s calculator from a rich client application
  • RssReader is a Windows Forms 2.0 RSS reader
  • Math is a Windows Presentation Foundation (aka Avalon) application that renders math equations using a domain specific language

The source code has been massively reorganized from the last drop. If you’re using Komodo you’ll find Komodo project files in this drop to make it easier to navigate the non C++ source code.

I’m going to be pretty busy for the next three weeks doing work to pay the bills around here, so work is going to slow down quite a bit on the bridge. I hope this release is of sufficient quality to sustain y’all for the next month or so. Let me know by email (jlam at this domain) if you have any reproducible showstopper bugs and I’ll see what I can do to get a patch out the door.

Enjoy!

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834fc885d53ef00e5501623fe8833

Listed below are links to weblogs that reference Third Drop of RubyCLR:

Comments

Thank you! :-)

This looks very interesting. I haven't followed the development up to this point so forgive me if this is an ignorant question... does RubyCLR only work in VS '05?

Sweet! I am real excited to dig into this.

Jason - it only works with .NET 2.0 - there are no dependencies on Visual Studio itself.

John,

Did you see this:

http://www.plas.fit.qut.edu.au/rubynet/

Yes I have - I've chatted with both John Gough and Wayne Kelly at OOPSLA. There are some really hairy technical challenges that they have to overcome so that's likely why you haven't seen anything out of them quite yet. But they're smart guys- I'm looking forward to seeing what comes out of their group.

Are you familiar with the Ruby/.Net bridge from http://www.saltypickle.com/rubydotnet ?

I've used it some in the past for stubs and generators for component/integration testing with good success (not without issues though).

I'll be checking out your RubyCLR soon...

regards.

Ah, a bit of history.

The saltypickle bridge was OK, but not particularly interesting due to their socket implementation which resulted in awful performance. Thomas Sondergaard's rubydotnet bridge was *far* superior, and was a major source of inspiration for the first version of my bridge (which was never publicly released).

RubyCLR is much, much faster than either of these bridges (Thomas used Reflection to invoke, and RubyCLR uses dynamically generated CIL shims). There are also a lot of additional features in RubyCLR which makes it far more natural to use (such as mapping method names like GetCount to get_count).

I'm impressed with your work, good job!
Just one note, I ran the testsuite, and got one failure:
test_say_hello(RubyMethodTests) [./tests_rbdynamicmethod.rb:73]: expected but was .

That is, in my locale, decimal point is different than in your tests. Not a big deal though.

Still waiting for a proper project page to follow though =)

Thanks for the bug report. I'm happy to see that the CLR is localizing strings correctly. Now I just have to figure out how to localize that string in Ruby :)

Hi

Is there someway possible to interact with Tao's opengl or CsGL in RubyCLR, I have tried to import the libs but it doesn't work. Is it because they are built for .net 1.x?
I tested another bridge, which is for .net 1.x but it didn't work to import the libs there either.
What I need is to use OpenGL with .net forms (in ruby using rubyclr, for my examwork)

I didn't know anything about CsGL before your post. I downloaded it and did a quick import of the wrapper lib and that worked. But since I don't know anything about CsGL I'll have to take a look at the samples to see if I can get it up and running.

Cool examwork project :)

Feel free to contact me direct via jlam at this domain about your project. This could make for yet another cool demo for the next release of the bridge.

I took a closer look at one of the samples (MesaBounce.cs) and it appears that you have to derive a new class from CsGL.Basecode.Model and override some virtual methods (like Draw). Unfortunately, RubyCLR does not support deriving new Ruby classes from CLR base classes. Is there some other way of implementing the OpenGL code so that you don't have to derive from a library base class?

hi,
I am not able to download RubyCLR.

Broken link...

Thanks for the bugreport. Fucking spammers:(

yeah link ain't work;/

This release is great

Thanks for very interesting article and release. Greetings

Thanks for very interesting article and release. Greetings

I'm impressed with your work, good job! Just one note, I ran the testsuite, and got one failure: testsayhello(RubyMethodTests) [./tests_rbdynamicmethod.rb:73]: expected but was .

That is, in my locale, decimal point is different than in your tests. Not a big deal though.

Still waiting for a proper project page to follow though =)

It requires at a minimum .NET 2.0

Thanks for help,thats the answer of all my questions

Thanks for help,thats the answer of all my questions

Thanks for help,thats the answer of all my questions

Thanks for help,thats the answer of all my questions

Thanks for help,thats the answer of all my questions

Thanks for help,thats the answer of all my questions

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from John Lam. Make your own badge here.

May 2009

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Blog powered by TypePad