![]() |
Ruby & Perl
Has anyone considered some way to make Perl modules callable from Ruby?
Although I'm growing ot like Ruby quite a bit, the vast quantity of Perl Modules is a long way from being matched in Ruby. Being able to call them from Ruby would be awesome. David |
Re: Ruby & Perl
In article <200308231616.18616.dcorbin@machturtle.com>,
David Corbin <dcorbin@machturtle.com> wrote: >Has anyone considered some way to make Perl modules callable from Ruby? >Although I'm growing ot like Ruby quite a bit, the vast quantity of Perl >Modules is a long way from being matched in Ruby. Being able to call them >from Ruby would be awesome. > >David > Until we have Ruby on Parrot (Cardinal) I don't know that there will be any satisfactory ways of acheiving what you're trying to do. What about using SOAP, XML-RPC or maybe even YAML as a liason between your Ruby objects and your Perl objects? Phil |
Re: Ruby & Perl
On Sunday 24 August 2003 03:21, Phil Tomson wrote:
> In article <200308231616.18616.dcorbin@machturtle.com>, > > David Corbin <dcorbin@machturtle.com> wrote: > >Has anyone considered some way to make Perl modules callable from Ruby? > >Although I'm growing ot like Ruby quite a bit, the vast quantity of Perl > >Modules is a long way from being matched in Ruby. Being able to call them > >from Ruby would be awesome. > > > >David > > Until we have Ruby on Parrot (Cardinal) I don't know that there will be > any satisfactory ways of acheiving what you're trying to do. > > What about using SOAP, XML-RPC or maybe even YAML as a liason between your > Ruby objects and your Perl objects? > > Phil I'm sure that something like that is doable, but I was thinking that something might be done by embedding the perl engine in ruby. Then, you'd have a method for registering perl modules, that would return an ruby object with wrapper methods for perl functions. I'm a little rusty on how Perl "objects" are created, but I figure one can certainly do this: when I call wrapped Perl method, the return object is analyzed - if it's blessed, a new class is created. Then, if its a hash or list, for every "nested object", the same logic is applied. There very well could be fundamental flaws with this approach, but my instinct says that we could open up a large class of functionality in this manner, and make it's use almost transparent to the end-user (i.e., it still looks like the programmer is using Ruby objects). David |
Re: Ruby & Perl
David Corbin <dcorbin@machturtle.com> writes:
> I'm sure that something like that is doable, but I was thinking that > something might be done by embedding the perl engine in ruby. Perl's Inline::Ruby may help you if you're happy to do things the other way around. -- print "Just another ",0 ? "Ruby" : "Perl", " double agent\n" |
Re: Ruby & Perl
On Sunday 24 August 2003 08:42, Simon Cozens wrote:
> David Corbin <dcorbin@machturtle.com> writes: > > I'm sure that something like that is doable, but I was thinking that > > something might be done by embedding the perl engine in ruby. > > Perl's Inline::Ruby may help you if you're happy to do things the > other way around. Cool, but it seems to me the real payback would be the reverse. |
Re: Ruby & Perl
il Sun, 24 Aug 2003 05:16:22 +0900, David Corbin
<dcorbin@machturtle.com> ha scritto:: >Has anyone considered some way to make Perl modules callable from Ruby? >Although I'm growing ot like Ruby quite a bit, the vast quantity of Perl >Modules is a long way from being matched in Ruby. Being able to call them >from Ruby would be awesome. > I can bet I read a message long time ago about PerlInside in ruby-talk. I think that was the post, look at this thread or call the author http://blade.nagaokaut.ac.jp/cgi-bin...uby-talk/58626 |
Re: Ruby & Perl
On Sunday, August 24, 2003, 6:16:22 AM, David wrote:
> Has anyone considered some way to make Perl modules callable from Ruby? > Although I'm growing ot like Ruby quite a bit, the vast quantity of Perl > Modules is a long way from being matched in Ruby. Being able to call them > from Ruby would be awesome. Hi David, I have nothing to add to the technical discussion underway, but thought it would be nice to know if there are any particular Perl libraries you are after. It may spark someone's creative juices. We have a wiki page somewhere to track these. Cheers, Gavin |
Re: Ruby & Perl
On Mon, Aug 25, 2003 at 09:37:13AM +0900, David Corbin wrote:
> MIME::Tools (for constructing MIME messages), I knew that before I openes this message... > but I'm sure there will be others :) ...so I wouldn't be so sure about this part ;-) Seriously, I think MIME::Tools is indeed the module that is missed the most by Perl-to-Ruby converts, and also one of the best MIME implementations, too. I wonder is it possible to provide both Perl and Ruby bindings from one codebase without doing a fork of it? -- Dmitry Borodaenko |
MIME::Tools (was Re: Ruby & Perl)
On Monday, August 25, 2003, 7:02:58 PM, Dmitry wrote:
> Seriously, I think MIME::Tools is indeed the module that is missed the > most by Perl-to-Ruby converts, and also one of the best MIME > implementations, too. I wonder is it possible to provide both Perl and > Ruby bindings from one codebase without doing a fork of it? Could you give a quick description of it, and explain what's so good about the Perl version? Gavin |
Re: Ruby & Perl
On Sun, Aug 24, 2003 at 09:52:01PM +0900, David Corbin wrote:
> > Perl's Inline::Ruby may help you if you're happy to do things the > > other way around. > Cool, but it seems to me the real payback would be the reverse. It seems that it may not be too difficult to make the reverse happen. Inline::Ruby actually works both ways around, in that you can pass a Perl subroutine reference to any Ruby method, and it will be automagically turned into a Proc object which Ruby can then call. Unlike most of the other Inline modules for Perl, Inline::Ruby can also work standalone, and has an interface for rb_eval(), rb_call_function(), rb_call_class_method(), rb_call_instance_method() etc.. I don't know enough Ruby yet to know how this could be used, but it seems that, as a worst case, someone could wrap this up to use the Shell approach that Mark Wilson posted, and hide the nastiness from users. Tony |
| All times are GMT. The time now is 10:18 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.