Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl to Ruby translator?

by Abigail-II (Bishop)
on Oct 10, 2003 at 17:01 UTC ( [id://298319]=note: print w/replies, xml ) Need Help??


in reply to Perl to Ruby translator?

If Ruby is so excellent and so wonderful to program in, how come you're looking for a Perl to Ruby translator? Surely by now Ruby should have its own masterpieces? Ruby has been available since 1995, which is longer than many of the Perl masterpieces.

So, why doesn't Ruby have its own quality templating system?

In Ruby, we have a language out there now that is very Perlish but supports the notion of 'Programming as a craft' much better than Perl5 does.
What are you saying here? That Ruby is very close to Perl that it even can be called "Perlish", or is it very different due to this "notion of 'Programming as a craft'", whatever that maybe?

I can't help it, but each time if I see someone advocating Ruby, it's like I heard some Python user. Everything is relative to Perl. But if Perl is the measure, Perl is good enough for me.

Are there some features that carry Ruby on their own? (Other than "everything is an object", I don't really care whether "1" is an object. I don't need it. I've programmed for two decades with numbers, and I've never felt restricted that number weren't objects. (And if I really wanted to modify my numbers, I'd use FORTRAN)).

Abigail

Replies are listed 'Best First'.
Re: Re: Perl to Ruby translator?
by tilly (Archbishop) on Oct 11, 2003 at 05:08 UTC
    Ruby has 2 big features that are worthy of note.

    The first one is irrelevant to most of us, and that is that Ruby smoothly supports multiple different character encodings, including ones for Japanese text which aren't directly-supported other scripting languages (like Perl). This is notable because it is why Ruby was invented.

    Other than that, Ruby is a highly derivative language which is mainly notable for a remarkable consistency in its layout and design. Before I tried Ruby I wouldn't have believed that this was an important feature. After trying it, I was amazed at how many things which in Perl look magical because of how the language has hidden things from you (eg overload and tie) in Ruby are so natural that it was only in retrospect that I realized that the language was cleanly enough structured that no extra hooks had to be added to let the user play with those.

    My capsule summary is this. On a few small projects that I did in Ruby, I found that I did the same thing in about half the code that I did in Perl. However my code ran slower, and I had to rewrite things that in Perl I would have gotten from CPAN. Furthermore, I am unlikely to get a job programming Ruby, but I can with Perl.

    Furthermore I recommend learning Ruby's class library to people at a certain level of expertise in virtually any language as an example of what good design. This only holds in a certain range. If you don't have enough background then you can't see why the design works, and won't get much out of it. If you have too much, then you have hopefully seen the basic ideas already in Smalltalk, Lisp, Perl, etc.

    I can't readily quantify what level is right for that experience to be valuable. But I was certainly in the right range 2 years ago.

Re^2: Perl to Ruby translator?
by Aristotle (Chancellor) on Oct 10, 2003 at 17:31 UTC
    "Everything is an object" is only a tiny part of Ruby's strength: object oriented programming is Clean And Easy. In Perl, it's always messy. There are some other nice things (no special global variables f.ex), but those are really details; some people might also consider "less linenoise" an argument (I'm indifferent). On all other accounts, Perl and Ruby are pretty much on equal footing.

    Makeshifts last the longest.

Re: Re: Perl to Ruby translator?
by Anonymous Monk on Oct 11, 2003 at 03:19 UTC
    I can't help it, but each time if I see someone advocating Ruby, it's like I heard some Python user. Everything is relative to Perl. But if Perl is the measure, Perl is good enough for me.
    Seems Perl is the measure for Perl6 too, just a better Perl by some peoples measure. So, if others find Ruby to be a better Perl by their own measure, it stands to reason they'll use Perl when describing it.

    I think Ruby's biggest weakness is that's its RAA (cpan equivelant) isn't as well developed and as standardized as CPAN. I think CPAN remains Perl's big killer-app. Ruby does have mature templating systems, but as you know, everyone who invents a templating system does it differently. It doesn't seem so odd that a particular templating model "X" might not exist in Ruby and someone would rather see a port of model "X" than use one of the "Y" or "Z" models already implemented in Ruby.

Re: Re: Perl to Ruby translator?
by diotalevi (Canon) on Oct 10, 2003 at 17:38 UTC

    Or %^H. I've seen you redefine numbers before.

    (Drat. I forgot to include the caret in the variable name and that just spoils the whole thing. Well there it is now.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://298319]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-24 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found