[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Ruby/.NET bridge R3

Benjamin Schroeder

9/13/2003 11:51:00 PM

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

and you can download the latest bridge from

http://www.saltypickle.com/.../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?foru...

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


1 Answer

gabriele renzi

9/14/2003 4:14:00 PM

0

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

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

>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!