From: ptkwt@... (Phil Tomson) Date: 2004-01-30T14:09:58+09:00 Subject: Re: Ruby and Perl Integration In article <010c01c3e6e4$dac1c5d0$6601a8c0@jwldesktop>, John W. Long wrote: >----Lothar Scholz wrote:---- >> JWL> and then use the perl code in a rubyish way. >> >> And this is a logical mistake. Even if Perl is near Ruby in a few ways >> (i think this is not so much). A rubyish way can never be generated >automatically >> from Perl. The only way is to automatically generate function wrappers. > >My ignorance shows here. I'm not a perl coder. I don't know how easy it >would be to integrate the two. But even if there was just a simple: > >Perl::eval %{ > use MyModule; > ... > my $m = MyModule->new; > $m->func; >} > >Where eval would return some sort of object wraping the result of func it >seems like you could write small ruby libraries that would leverage the >support of much larger perl libraries. Even if it were ugly, ugliness can be >hidden withing small Ruby classes. > >I've seen several Ruby projects that are merely ports of Perl Libraries. It >seems like this process might be made easier if you could write a Ruby >wrapper for an existing Perl library and then gradually rewrite the code in >Ruby as you have the time. Perl integration with Ruby would also make it >easier for people to port their existing Perl applications to Ruby. Perhaps, but I suspect that if it worked well enough that no one would find the time to rewrite the code in Ruby. It could actually be counterproductive. People would just figure that well we can just grab the Perl module Foo::Bar and use it with the Perl_eval thingy and nobody would bother to actually translate Foo::Bar to Ruby and 'rubyfy' it. ....Not saying that you shouldn't try to make a bridge between the two languages just saying that this could be a consequence. Phil