[SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Sonia Hamilton
I'm thinking of learning Ruby - is there an easy way of running Perl and
Python code/libraries from Ruby? I've googled and browsed manuals in
Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.

Reason I ask is that I want to learn Ruby for Ruby on Rails, but there's
so much good stuff in the existing Perl and Python libraries/cpan.

(Yes I know about Python/Django, but Rails seems to have better
doco/manuals at the moment).  

-- 
Sonia Hamilton. GPG key A8B77238.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Taryn East
* Sonia Hamilton [EMAIL PROTECTED] spake thus:
 I'm thinking of learning Ruby - is there an easy way of running Perl and
 Python code/libraries from Ruby? I've googled and browsed manuals in
 Dymocks Library ^H^H^H Bookshop, can't seem to find an answe

I haven't read in depth but Ruby/Python:
http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html

seems to be a way to embed python into ruby


Cheers,
Taryn


-- 
Let there be lights!
http://fiatlux.webcentre.co.nz/
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Taryn East
* Sonia Hamilton [EMAIL PROTECTED] spake thus:
 I'm thinking of learning Ruby - is there an easy way of running Perl and
 Python code/libraries from Ruby? I've googled and browsed manuals in
 Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.

on a quick google, this is the closest thing I could find for perl:
http://www.yoshidam.net/perl_en.txt

again - I've never used it and haven't read through it - but I guess
it's a start for you :)

 Reason I ask is that I want to learn Ruby for Ruby on Rails, but there's
 so much good stuff in the existing Perl and Python libraries/cpan.

true - though if you're using Rails I'd recommend you check if a library
already exists in Rails first (a given, really).

 (Yes I know about Python/Django, but Rails seems to have better
 doco/manuals at the moment).  

Absolutely - and it's a dream to work with for web-app development.
Besides-which, if you're using Rails, you at least know that most fo the
Ruby community is behind Rails. Compare with the current joke that
there are more web-development frameworks than keywords in Python ;)

Cheers,
Taryn

-- 
Let there be lights!
http://fiatlux.webcentre.co.nz/
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Adam Kennedy

Taryn East wrote:

Absolutely - and it's a dream to work with for web-app development.
Besides-which, if you're using Rails, you at least know that most fo the
Ruby community is behind Rails. Compare with the current joke that
there are more web-development frameworks than keywords in Python ;)


Heh, and to add to that, while there's a ridiculously large number of 
Perl web development frameworks, it isn't a joke. It's just considered 
normal because CPAN has ridiculously large number of just about _every_ 
type of module :)


Adam K
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Daniel Bush

Hi Sonia,

On 17/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:

I'm thinking of learning Ruby ...

Yay! Another rubyist!
One thing I can say, if you like oop, you will probably like ruby.


- is there an easy way of running Perl and
Python code/libraries from Ruby? I've googled and browsed manuals in
Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.


This cropped up on the ruby talk list with regards perl in late
September - http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/217173.
Looking at the thread I'm not sure if there was a consensus -
certainly no magical wrapping utility was mentioned when I last
checked.

You can run perl from C.  And you can run/use C from ruby so if you're
desperate you can bolt something together that way, maybe after a
couple of beers.

Some of the more common things in perl are replicated, sort of, in
ruby.  There is a CGI module and also dbi/dbd for instance, but the
latter is nothing like as complete as perl.  You might want to check
out rubyforge.org, as well as the Pragmatic Programmer's Guide book
which takes you through some of the more common modules which come
with ruby.


Reason I ask is that I want to learn Ruby for Ruby on Rails, but there's
so much good stuff in the existing Perl and Python libraries/cpan.



Definitely recommend you try rails out, and get used to its brand of
MVC - you may not need whatever it is because rails comes with a lot
of stuff but it takes time to exploit all of it  (including some of
its conventions).  I usually install ruby from source (esp. on debian
systems), and then set up rake and gems from source as well.  Then use
the gem utility to install rails and database stuff.  Ruby gems will
also handle multiple versions of rails.


(Yes I know about Python/Django, but Rails seems to have better
doco/manuals at the moment).

--
Sonia Hamilton. GPG key A8B77238.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html



Daniel
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Adam Kennedy

Daniel Bush wrote:

Hi Sonia,

On 17/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:

I'm thinking of learning Ruby ...

Yay! Another rubyist!
One thing I can say, if you like oop, you will probably like ruby.


- is there an easy way of running Perl and
Python code/libraries from Ruby? I've googled and browsed manuals in
Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.


This cropped up on the ruby talk list with regards perl in late
September - 
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/217173.

Looking at the thread I'm not sure if there was a consensus -
certainly no magical wrapping utility was mentioned when I last
checked.


The only thing I can suggest at the moment is something that goes the 
other direction, one of the Inline:: modules (there was a bit of a fad 
relating to makeing Perl inline-embed anything a while back).


http://search.cpan.org/~neilw/Inline-Ruby-0.02/lib/Inline/Ruby.pod

The Inline::Ruby module would _seem_ to let you embed ruby code directly 
in your Perl.


That _might_ be enough to get you going, but I doubt it, since I suspect 
what you really want is something like


I want to call CPAN modules natively from Ruby

That you don't get, although as was mentioned quite a number of the 
better and more venerable CPAN modules are gradually being cloned over 
to gems.


To get something fairly robust I think you will need to wait for the 
Parrot/Perl6 stack, which _will_ allow native cross-language calls 
between Perl5/Perl6/Python/Ruby et al.


But until that is more usable, there's no good answers I'm aware of.

Adam K
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can ruby run perl/python libraries?

2006-11-16 Thread Penedo

On 17/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:


I'm thinking of learning Ruby - is there an easy way of running Perl and
Python code/libraries from Ruby? I've googled and browsed manuals in
Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.

Reason I ask is that I want to learn Ruby for Ruby on Rails, but there's
so much good stuff in the existing Perl and Python libraries/cpan.



Deviating from the stream of suggestions and pointers sent by others - I'd
like to suggest you to reconsider that strategy - if you want to learn a new
language then you better immerse yourself in its tools and way of
thinking. It suspect that by looking for Ruby to wrap Perl/Python you are
setting yourself a trap where you'll end up using Ruby/Rails as a thin shell
in front of the real code. That's how you end up with people writing Shell
Scripts the way they write C programs (e.g. not realizing they can treat the
source code as data, as I've just seen on another linux mailing list) or,
as happened to me when I tried to lean C++ after years of programming C -
using C++ and ostreams/istreams and overloaded operators as glorified C
instead of actually taking advantage of the new way of thinking the language
encourages.

I don't know Ruby and hardly know Python but I think the above is applicable
for any new language and computing environment you want to get really
comfortable with.

Cheers,

--P
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html