[Ironruby-core] The future of Ruby.NET

M. David Peterson m.david at xmlhacker.com
Wed Feb 6 04:15:18 EST 2008


On Tue, 05 Feb 2008 13:43:14 -0700, Curt Hagenlocher  
<curt at hagenlocher.org> wrote:

> On Feb 5, 2008 12:31 PM, Greg Akins <angrygreg at gmail.com> wrote:
>>
>> Meaning, that like Ruby.Net can we write .Net classes in Ruby rather
>> than writing them as strings that are passed to the RubyEngine?
>
> There's a kind of mismatch between the capabilities of statically
> defined types (as in the CLR) and the dynamic classes that Ruby
> offers.  What should happen to the corresponding CLR class if, for
> instance, someone were to dynamically add methods to the Ruby class?
> CLR classes don't support that kind of operation.

I'm not sure this can really be applied to the notion of statically  
compiling Ruby code into a language agnostic .NET assembly.  People who  
want static compilation of Ruby code don't look at it from the stand point  
of "I want the best of both the dynamic and static worlds" and instead "I  
want to write this library in Ruby because it's easier." or "I would like  
to use this Ruby library inside of my C# code." or "etc.".  There's an  
obvious tradeoff: If you compile the code statically you lose the benefits  
that come along for the dynamic ride.  But that's a tradeoff I believe  
some folks are willing to make.  It doesn't always make sense to go this  
direction, and in some cases it may not even work as one might expect.   
But again, that's the tradeoff you have to be willing to make and it seems  
to me there are enough people who are willing to make it and therefore  
interested in the capability.

> The best option in this regard is probably to allow a dynamic (Ruby or
> other DLR) class to be delegated to by a statically-defined wrapper.
> Conceptually, such a wrapper could be automatically generated from the
> Ruby class definition, but once defined it would be unalterable.

I think this is taking things a little too far.  If you want the  
advantages of a dynamic language, use a dynamic language coupled with it's  
dynamic language runtime counterpart.  If you're simply interested in  
using Ruby code as if it were a statically compiled language then  
statically compile the code and then, as you point out,

> once defined it would be unalterable.

-- 
/M:D

M. David Peterson
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: m.david at 3rdandUrban.com | m.david at amp.fm
Mobile: (206) 418-9027
http://3rdandUrban.com | http://amp.fm |  
http://www.oreillynet.com/pub/au/2354


More information about the Ironruby-core mailing list