Ruby & Perl

D

David Corbin

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
 
P

Phil Tomson

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
 
D

David Corbin

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
 
S

Simon Cozens

David Corbin said:
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.
 
G

gabriele renzi

il Sun, 24 Aug 2003 05:16:22 +0900, David Corbin
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/scat.rb/ruby/ruby-talk/58626
 
G

Gavin Sinclair

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
 
D

Dmitry Borodaenko

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?
 
G

Gavin Sinclair

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
 
T

Tony Bowden

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top