[ANN] Ruby/.NET bridge R3

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

This is really great! I’m glad to that you are doing this. If someone out
there has the time and interest, it would be nice to see this working with
Mono as well as .NET (I wish I had the time). I’m just throwing out the
idea…

Cut

Benjamin Schroeder wrote:

···

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

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

it seem I posted a question about rubydotnet at the same time you were
sending this message :slight_smile:

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!

one thing I’d love to see is a reflection api for the .net classes.
It seem to me that the .net framework allows reflection at some
degree, and having a DotNetType.dotNetMethods would be lovely…

BTW, a wonderful work!

···

il Sun, 14 Sep 2003 08:51:15 +0900, Benjamin Schroeder benschroeder@acm.org ha scritto::

Thanks!

Regarding Mono, someone asked a similar question about the Squeak
version of the bridge. I think (not knowing much about Mono) that it
might not be too hard, at least for the sockets version. (The bridge
can run in two modes - an in-process connection through Managed C++ is
the default, and there is also a mode that uses TCP sockets.)

I’d be happy to try to port it, or to help another interested person
try to do so. If anyone is interested, please drop me a line.

Ben Schroeder

···

On Saturday, September 13, 2003, at 11:09 PM, Curt Hibbs wrote:

This is really great! I’m glad to that you are doing this. If someone
out
there has the time and interest, it would be nice to see this working
with
Mono as well as .NET (I wish I had the time). I’m just throwing out the
idea…

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

it seem I posted a question about rubydotnet at the same time you were
sending this message :slight_smile:

Yes, good timing! :wink:

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!

one thing I’d love to see is a reflection api for the .net classes.
It seem to me that the .net framework allows reflection at some
degree, and having a DotNetType.dotNetMethods would be lovely…

Sure, I like that idea. I think that the bridge that Tim Sutherland
was working on had something similar, as does the WIN32OLE package for
using COM objects. It would be nice to add the things around it, like
:respond_to? and :kind_of?, as well.

BTW, a wonderful work!

Thanks!

Ben Schroeder

···

On Sunday, September 14, 2003, at 12:24 PM, gabriele renzi wrote:

il Sun, 14 Sep 2003 08:51:15 +0900, Benjamin Schroeder > benschroeder@acm.org ha scritto::