Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Eric Wilhelm (6389)

Eric Wilhelm
  (email not shown publicly)
http://scratchcomputing.com/

Journal of Eric Wilhelm (6389)

Sunday April 23, 2006
02:42 AM

Perl6 -- Hip,Hip,Hooray!

[ #29416 ]

I must admit that I have barely given Perl6 a corner of my thought in the last several years. I'll make the excuse that I was really busy for the first few years and haven't been busy enough for this last (read: all time is spent looking for work.) But, I'm repenting -- I'm reading the bible...

And I've found myself honestly cheering while I read the design docs! I mean, // is extremely cool by itself, but then you have pairs, smart matching, ranges, etc.

# perl5
my $ans = $this + (defined($foo) ? $foo : 0);
# perl6
my $ans = $this + $foo // 0;

Ok, that example could be more convincing. Don't take my word for it, read it for yourself.

So why is this so awesome? I get a lot of flack for my dislike of ruby (which, mind you, I rank above lisp and python (in that order -- subject to change, but both are still ahead of PHP)) and I have a hard time articulating exactly what it is that bothers me about them. I'm not playing ignorant language bigot here, so please put away your wagging fingers. The thing is:

... To other language designers, this may seem like a silly thing to agonize over.
-- Larry Wall in Apocalypse 3

See? That is exactly what I mean. When I use other languages, I don't get the impression that anyone agonized over how well things read and how the syntax fits the problem nearly as much as I do with Perl. I guess you could say it speaks to me. Sure perl5 has some warts and oddities, but 95% of the time it mostly gets out of your way and lets you say what you mean rather than requiring you do things that make the computer happy. So, things like "6".to_f and python's "pass" really annoy me. Complete absence of syntax is annoying, so even though lisp gets more points than python for run-time and reflection, the inability to make a statement is a big drawback in my book.

So, three cheers for perl6! As for why you should cheer too, Larry articulates that way better than I could ever hope to in the design documents. Ruby is not perl6, not by a long shot.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Increasingly, science is discovering that humans are really really good at making the correct decisions about small niggly things by thinking about them a lot, but really really bad about making large sweeping global decisions by thinking about them a lot.

    So the ideal scenario is obsessing over the details, and going with your gut on the big decisions.

    And Perl for the most part seems to keep getting this right.

    And pugs (and Audrey) has done WONDERS for that in Perl 6, because now we don't have to just talk
    • Increasingly, science is discovering that humans are really really good at making the correct decisions about small niggly things by thinking about them a lot, but really really bad about making large sweeping global decisions by thinking about them a lot. So the ideal scenario is obsessing over the details, and going with your gut on the big decisions.

      I'm not sure the latter follows, but it is certainly used by most PHB's use to justify global decisions. Just because big global decisions are hard doesn

      • > the cost *appears* much lower

        It does seem that most decisions to spend money are only made under duress or lust. Invisible money is so much easier to spend. Thus, if you propose to save someone invisible money by spending an identifiable sum at a specific time, you will almost always fail to convince them.

        What we have is good enough right? OK, I guess we don't need perl6, VectorSection, subversion for the CPAN, or much else of anything new. In the same vein, we could just live in trees and eat bugs
        • What we have is good enough right? OK, I guess we don't need perl6, VectorSection, subversion for the CPAN, or much else of anything new. In the same vein, we could just live in trees and eat bugs. Shrug.

          FWIW, I'm all for moving forward. I was merely zeroing in on a specific misconception I've personally seen a lot of. Sometimes I get rather pedantic and divert whole arguments ...

  • You don't need perl6 to be able to enjoy //. // will be in perl5.10, and there have been patches to enable // in perl5.x ever since 5.8.1 or so.

    People have enjoyed // for years - they can't be bothered to wait more than half a dozen years.

    As for cheering for perl6, don't expect any cheers from me. I'm not so thrilled about a language that forces me to change my coding style of 20+ years - neither C, nor Java or Python take my precious whitespace away - but perl6 will. But time is in my favour: I doubt w