[Ironruby-core] Initializing external Ruby libraries

Wayne Kelly w.kelly at qut.edu.au
Wed Feb 13 20:59:03 EST 2008

> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org
> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of
> Michael Letterle
> Sent: Thursday, 14 February 2008 11:03 AM
> To: ironruby-core at rubyforge.org
> Subject: Re: [Ironruby-core] Initializing external Ruby libraries
> What do you see would be the advantage of something like this
> as opposed to the current method of loading .NET assemblies?
> I mean you could use something like OpenSSL.NET
> (http://openssl-net.sourceforge.net/) today to implement ssl
> in IronRuby for example

It's not just about getting access to some implementation of OpenSSL, it about providing a set of Ruby classes and methods that exactly match those exposed by existing Ruby extension libraries used by CRuby. By explicitly calling define_class, define_method etc, you have better control over how your C# code is presented to the Ruby world. You can, for example, specify a Ruby base class that may not exist as a static .NET class. I'm not sure if this is actually an issue in practice. But then if there's no need to call define_class and define_method explicitly for external libraries, then why do it for the built-in classes? Why not simply load an RubyExternalLibrary.dll? Is it for performance, for preciseness of interface or both?

Cheers, Wayne.

More information about the Ironruby-core mailing list