Ruby & Perl

Discussion in 'Ruby' started by David Corbin, Aug 23, 2003.

  1. David Corbin

    David Corbin Guest

    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
    David Corbin, Aug 23, 2003
    #1
    1. Advertising

  2. David Corbin

    Phil Tomson Guest

    In article <>,
    David Corbin <> 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
    Phil Tomson, Aug 24, 2003
    #2
    1. Advertising

  3. David Corbin

    David Corbin Guest

    On Sunday 24 August 2003 03:21, Phil Tomson wrote:
    > In article <>,
    >
    > David Corbin <> 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
    David Corbin, Aug 24, 2003
    #3
  4. David Corbin

    Simon Cozens Guest

    David Corbin <> 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"
    Simon Cozens, Aug 24, 2003
    #4
  5. David Corbin

    David Corbin Guest

    On Sunday 24 August 2003 08:42, Simon Cozens wrote:
    > David Corbin <> 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.
    David Corbin, Aug 24, 2003
    #5
  6. il Sun, 24 Aug 2003 05:16:22 +0900, David Corbin
    <> 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/scat.rb/ruby/ruby-talk/58626
    gabriele renzi, Aug 24, 2003
    #6
  7. 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
    Gavin Sinclair, Aug 24, 2003
    #7
  8. 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
    Dmitry Borodaenko, Aug 25, 2003
    #8
  9. 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
    Gavin Sinclair, Aug 25, 2003
    #9
  10. David Corbin

    Tony Bowden Guest

    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
    Tony Bowden, Aug 25, 2003
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,773
  2. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    288
    PerlFAQ Server
    Jan 23, 2011
  3. PerlFAQ Server
    Replies:
    0
    Views:
    658
    PerlFAQ Server
    Feb 3, 2011
  4. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Feb 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    280
    PerlFAQ Server
    Feb 27, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    664
    PerlFAQ Server
    Apr 4, 2011
Loading...

Share This Page