Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby & Perl

Reply
Thread Tools

Ruby & Perl

 
 
David Corbin
Guest
Posts: n/a
 
      08-23-2003
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

 
Reply With Quote
 
 
 
 
Phil Tomson
Guest
Posts: n/a
 
      08-24-2003
In article <(E-Mail Removed)>,
David Corbin <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
David Corbin
Guest
Posts: n/a
 
      08-24-2003
On Sunday 24 August 2003 03:21, Phil Tomson wrote:
> In article <(E-Mail Removed)>,
>
> David Corbin <(E-Mail Removed)> 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

 
Reply With Quote
 
Simon Cozens
Guest
Posts: n/a
 
      08-24-2003
David Corbin <(E-Mail Removed)> 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"
 
Reply With Quote
 
David Corbin
Guest
Posts: n/a
 
      08-24-2003
On Sunday 24 August 2003 08:42, Simon Cozens wrote:
> David Corbin <(E-Mail Removed)> 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.

 
Reply With Quote
 
gabriele renzi
Guest
Posts: n/a
 
      08-24-2003
il Sun, 24 Aug 2003 05:16:22 +0900, David Corbin
<(E-Mail Removed)> 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


 
Reply With Quote
 
Gavin Sinclair
Guest
Posts: n/a
 
      08-24-2003
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



 
Reply With Quote
 
Dmitry Borodaenko
Guest
Posts: n/a
 
      08-25-2003
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

 
Reply With Quote
 
Gavin Sinclair
Guest
Posts: n/a
 
      08-25-2003
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



 
Reply With Quote
 
Tony Bowden
Guest
Posts: n/a
 
      08-25-2003
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments