Hi everyone,
I’d like to announce Release 3 of our Ruby/.NET bridge, which lets you
use Ruby and .NET objects together in your programs. (Releases 1 and 2
were available on the RAA and RubyForge, but this is the first one
we’re announcing widely.)
I’d also like to introduce myself, since this is my first time posting
to ruby-talk. My name is Ben Schroeder, and I’ve used Ruby on side
projects for a while now. I enjoy working with dynamic languages like
Ruby and Smalltalk - the exploratory feel is great.
We work a lot with .NET where I work, and a couple of us (myself and
John Pierce) were interested in being able to write Ruby scripts and
programs using the .NET APIs, and in particular the windowing and
database objects available there. We have been working on a bridge
between the two, and although there are still many things to improve,
we have already been able to write a number of scripts and utilities
with it. One of the things that I particularly enjoy is being able to
interactively explore how the .NET objects work.
Here is an example of the kind of code you can write with our bridge:
require 'dotnet'
list = ArrayList.new
list.add 'Hello'
list.add 'World'
puts list.count # -> prints <<2>>
reversed = list.collect do |each|
each.reverse
end
puts reversed.inspect # -> prints <<["olleH", "dlroW"]>>
You can also handle .NET events and (in the latest release) implement
.NET interfaces.
We have more examples and information on our web site at
http://www.saltypickle.com/RubyDotNet
and you can download the latest bridge from
http://www.saltypickle.com/RubyDotNet/Downloads
Release 3 brings a number of improvements, such as compatibility with
Ruby 1.8, the ability to implement .NET interfaces in Ruby, and a way
to access the bridge that makes .NET classes look like top-level Ruby
ones. (The top-level feature is only available in 1.8 - it uses the
new :const_missing method.)
There are of course some similar projects out there. We have learned a
lot from discussing things on the rubydotnet-developer list at
http://sourceforge.net/mailarchive/forum.php?forum_id=34312
In particular, the :const_missing idea is based on one of Thomas
Sondergaard’s, and a new way to access Ruby objects from .NET code is
based on something Tim Sutherland’s bridge did.
John and I would love to hear any feedback or questions you have -
either on this list or by private mail. I hope you enjoy using the
bridge!
Regards,
Ben Schroeder