Slashdot Mirror


Exegesis 3 Released (Perl 6 Examples)

chromatic writes "On the heels of Larry's most recent revelation, the mad scientist of Perl (Damian Conway) has followed up with Exegesis 3. His article gives working Perl 6 code examples of Larry's design decisions." Lots of good stuff in here.

85 comments

  1. !#/bin/perl6 by linux4life · · Score: 0

    with @all this new $syntax, won't we have to rewrite() our perl jokes? ;)

  2. "working" examples by Sneakums · · Score: 3, Funny
    His article gives working Perl 6 code examples...

    How can these be working examples when Perl 6 does not even exist yet?

    1. Re:"working" examples by Anonymous Coward · · Score: 0

      what miserable cretin moderated that down as 'offtopic'?

    2. Re:"working" examples by Anonymous Coward · · Score: 0

      ok, I'm the cretin here. I had not noticed that the link was a troll. I think I'll crawl back into my den and sulk.

    3. Re:"working" examples by chromatic · · Score: 2, Informative

      Several CPAN modules have been written to allow Perl 6 syntax in Perl 5. More will certainly follow.

  3. man by Anonymous Coward · · Score: 2, Insightful

    I really used to like perl i thought it was great...

    But now that i have been using C++ alot and really learned the in's and out's of the language, perl code really looks kinda nasty.

    Yick. I never thought i'd become one of those perl is messy and crusty and ugly types, but looking at that code, blech.

    So now they're gonna start using non-ascii characters in the code? Oh that's a joy, like i really wanna have to look up how to make greek characters in text editors.

    They blew it, perl 5 was acceptable and pretty useable. Perl 6 just looks silly.

    If i have to resort to using a scripting language for something in the future i definatly will avoid perl, especially perl 6.

    Perl really is a hacked together mess.

    Cool hack, but not cool to actually use for something important.

    1. Re:man by Anonymous Coward · · Score: 0
      "Hello, Kettle? This is Pot. You're black."

      C -> C++ is not the best comparison you could have made.

    2. Re:man by dbremner · · Score: 1
      So now they're gonna start using non-ascii characters in the code? Oh that's a joy, like i really wanna have to look up how to make greek characters in text editors.

      More and more, Perl seems to resemble APL.
      The emphasis on one-liners, TMTOWTDI, VHL monadic or dyadic operators, and reputation as a write-only language.
      Larry Wall seems to have the goal of evolving Perl into a natural language or something equally complex.
      Non-ASCII characters seem like a mistake to me as well, Unicode support is far from universal and it introduces unnecessary complications, especially for parsing Perl programs.
      At the very least, there should be some alternate form of ASCII representation, possibly similar to Morgan Stanley's A+.
      Most modern APL style languages use ASCII characters for precisely this reason.
      If using a tool is too complex, people will look elsewhere.

      --

      Life is a psychology experiment gone awry.
    3. Re:man by metis · · Score: 2

      Perl is a language that stood out because of the way it came to be. It differs from others by the careful balancing of ideosyncrecy and shameless emulation. The guiding principles were always practicality ( making simple things easy) and linguistic metaphors ( $_ means 'it', @ is to $ as plural to singular, : is like the adverbial 'ly' in english, etc.).

      The fact that Perl succeded so well is proof that these design principles were right, despite the legions of naysayers.

      Now Larry Wall leads Perl into the unknown by trying a bolder iteration of the same principles. He may well fail, either because the world of computing has changed or because these principles have reached their ceiling. But he is doing the right thing. Innovation doesn't come from trying to keep everyone happy.

      To all those naysayers, Perl 5 is there, stay with it and be happy.

      --
      -- look, cheese ahoy!
  4. Heresy! by Anonymous Coward · · Score: 0

    This is _heresy_ ....

    it's starting to look *readable*

  5. Doh by Anonymous Coward · · Score: 0

    Oh that's a joy, like i really wanna have to look up how to make greek characters in text editors.

    Use an editor which has Unicode support. This is the year 2001 if you haven't noticed.

    1. Re:Doh by Anonymous Coward · · Score: 0
      Why should I have to learn to use a new editor just because some idiot thinks that normal ascii set isn't good enough for his script language?

      ASCII is a real standard. Unicode may be the same in the future but it sure as hell isn't it yet.

  6. Still prefer scalars, I do. by imrdkl · · Score: 2, Interesting
    The flattening star *@array seems to give basically the same behavior as an real array parameter dereference in perl5, gobbling every other parameter to the end. OTOH, making an array parameter require a actual array is an improvement, I guess, because at least there is now a way to pass scalar after array without having it be gobbled up by the array.

    For me tho, I guess I'll stick with array reference arguments, anyways. Probably still cheaper and faster. I wonder also if what Damian says is true:

    In other words, a @ parameter in Perl 6 is like a \@ context specifier in Perl 5. .

    I suspect that passing an actual array is still "by value". Seems like alot of work to avoid confusion that is not really very confusing.

    1. Re:Still prefer scalars, I do. by This+Is+Ridiculous · · Score: 1
      I suspect that passing an actual array is still "by value".


      Nope, it's by constant reference (and appending an 'is rw' to the end of the variable name makes it non-constant reference).

      --
      Hey, you try to find an open nick these days!
  7. yuck by khuber · · Score: 0, Redundant

    I can't believe how horrible Perl 6 looks.

    -Kevin

  8. horse? by davereed · · Score: 2, Funny

    perhaps o'reilly will change the perl animal to a horse now that it's not so ugly?

    --
    The proper answer to "Why do I need to know this?" is always, "Because."
    1. Re:horse? by AtrN · · Score: 1

      Mephisto's five-arsed monkey might be more appropriate.

  9. Re:Grandma Spooky by Anonymous Coward · · Score: 0

    I believe you. Someday you will meet her again.

  10. Some thoughts by reynaert · · Score: 4, Insightful

    Some of this new stuff seems to be seriously blurring the difference between language and library.

    Of course it's cool to write something like @costs, but why must be an operator? It seems to me it would work just as well as an ordinary procedure.

    I'm wondering if they are thinking about constructs to define new syntax at runtime. In Scheme for example most of the syntactic forms are defined in the library using define-syntax .

    1. Re:Some thoughts by scrytch · · Score: 5, Insightful

      Some of this new stuff seems to be seriously blurring the difference between language and library

      Bingo. Perl has very malleable syntax, which is perhaps not as flexible as, say, SML, but still has had a philosophy of letting you rewrite good chunks of perl in perl. Perl6 is just adding to the potential confusion, letting you write code as twisted and evil as you want to. Besides, if you tend to write mathematical apps commonly ... well, you might not write them in perl, but you probably do at least " on an easy key (I had to copy and paste it myself). " does not need to be an operator. It just can be.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    2. Re:Some thoughts by scrytch · · Score: 3, Insightful

      Bah, piece of crap turned my sigma characters into something else entirely. My guess is unicode input box, non-unicode form processing... I think the mainframe world is chuckling at us now, they dealt with EBCDIC dialect conversion issues on a daily basis decades ago...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    3. Re:Some thoughts by archen · · Score: 2, Interesting

      Yeah, I'm pretty leary of any operator that can't be made by a key on my keyboard (or at least with a shift+key).

      Well I'm also sort of leary about any Perl article that goes into talking about "Schwartzian Transformers". Say what?!

      I think Perl 6 is starting to make me paranoid.

    4. Re:Some thoughts by smcdow · · Score: 2, Interesting

      Well I'm also sort of leary about any Perl article that goes into talking about "Schwartzian Transformers". Say what?!

      Aw, c'mon. Schwartzian Transforms have been around for as long as Perl 5 has been.

      my @output =
      map { $_->[0] }
      sort { $a->[1] cmp $b->[1] }
      map { [$_, expensive_func($_)] }
      @input;

      A sort between two maps. Doesn't get much simpler than that.

      --
      In the course of every project, it will become necessary to shoot the scientists and begin production.
    5. Re:Some thoughts by fm6 · · Score: 2
      but why must be an operator?
      It can, therefore it must. That's the way Perl is designed. I seem to recall a leading Perl hacker looking at Python and saying something like, "OK, it's got some good features and it's well-designed -- but there's only one way to do most things!" To Perl people, lovely new language idioms are a positive thing in and of themselves.

      Which is why I finally had to back away from Perl. Perhaps there are programmers who can deal with this kind of complexity and non-linear logic. I'm not one of them.

      Well, I'm a special case -- I'm a lousy programmer who mostly makes his living documenting other people's code. But judging from the code I've read, a lot of other Perl programmers don't think that way either. They treat Perl as kind of a super-BASIC, and their code is full of hand-coded loops and other stuff the fancy Perl idioms are supposed to replace.

    6. Re:Some thoughts by archen · · Score: 1

      I'll wait for "Schwartzian Transformers for dummies" before I get into Perl tutorials that use them, thank you very much =P

  11. i hold my breath and... by d_i_r_t_y · · Score: 2, Interesting
    ...await what LW and the gang make of what i really care about -- built-in language support for OOP. i can live with spelling '->' as '.' and using an underscore for concatenation, but what i really want to know is -- will perl6 allow me to write 50K lines of OO perl that doesn't depend on my client coders being able to read my source to be sure they don't trample over my member objects? all i'm really dying for with perl is some clean feel-good OO syntax and real encapsulation:

    public class MyPerlClass
    {
    my public $member_obj1 = new CGI ();
    my private %hash = ( 'some' => 'values' );
    my private int foo = 1;

    public sub new ( const int $int )
    {
    this.foo += $int;
    return this;
    }

    public sub get_foo ()
    {
    return this.foo;
    }

    public sub set_foo ( const int $new_foo )
    {
    this.foo = $new_foo;
    }

    private sub _recalculate_stuff ()
    {
    # some important stuff here...
    }
    }


    perl-lover and then some, but give me syntax sugary OO dear larry!!!
    d_i_r_t_y

    1. Re:i hold my breath and... by smcdow · · Score: 2, Informative

      OO perl that doesn't depend on my client coders being able to read my source to be sure they don't trample over my member objects?

      Use closures. Run perldoc perltoot , and then read the section Closures as Objects

      --
      In the course of every project, it will become necessary to shoot the scientists and begin production.
    2. Re:i hold my breath and... by Anonymous Coward · · Score: 0

      No thanks. Would rather use a real production language...

      Later, boys...

    3. Re:i hold my breath and... by d_i_r_t_y · · Score: 1

      Use closures. Run perldoc perltoot , and then read the section Closures as Objects.

      i have and i do, though closures are somewhat slower and larger than blessed hashes. it would be nice to be able to effectively local'ise the accessibility/visibility of member objects to inside a class using a perl keyword, rather than changing an class' implementation, ie, using keywords like 'private', 'public', and maybe even 'protected'. likewise, it'd be nice to overload the 'my' and 'our' operators to mean the equivalent of my == object declaration, our == class (ie: 'static') declaration. i have to say i really like the look of:

      class Me {

      # class data
      our public $Class_Total;
      our private $Class_Increment;

      # object data
      my public $total; # this.{'total'}
      my private $increment; # this.{'increment'}
      }

      dirty

    4. Re:i hold my breath and... by Magius_AR · · Score: 1
      const int $new_foo
      Perl better not introduce variable types and casting, or I'll be ticked.
  12. wow, perl meets apl by scrytch · · Score: 4, Interesting

    I do love the hell out of perl, but I sure hope I can "use English 'operators';" for things like the hyper-operators. 'course, maybe 'use English' is deprecated ... can't wait for 'use Chinese', imagine what perl would look like then...

    I would much rather see "@diffs = @set1 ^- @set2" expressed as a list comprehension, say @diffs = (each $x - $y suchthat $x in @set1, $y in @set2); (assuming I have said "english operators" on, otherwise I would imagine at least the 'suchthat' operator would be some punctuation char). It's a bit contrived for something as simple as subtracting every member of a couple lists, but list comprehension is beautiful stuff when combined with lazy evaluation in languages like Haskell.

    Oh, and Perl6 is going to have an 'in' operator, right?

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
    1. Re:wow, perl meets apl by Anonymous Coward · · Score: 0

      I would much rather see "@diffs = @set1 ^- @set2" expressed as a list comprehension, say @diffs = (each $x - $y suchthat $x in @set1, $y in @set2); (assuming I have said "english operators" on, otherwise I would imagine at least the 'suchthat' operator would be some punctuation char)

      You'll get used to it.

    2. Re:wow, perl meets apl by Dr.+Awktagon · · Score: 3, Insightful

      I'd like to see something like this:

      @diffs = map { $1 - $2 } @list1, @list2
      That makes sense to me at first glance..or maybe better something like this:
      @diffs = map { $_[0] - $_[1] } @list1, @list2
      which would be like taking one element from each list and passing them to the "subroutine" in the block. Anything would make more sense than ^- !
    3. Re:wow, perl meets apl by apsmith · · Score: 2

      Huh? Was this an attempt at humor? I thought the '^' character for "vector" operations was a wonderful idea for perl... Even FORTRAN has had this sort of capability since FORTRAN-90 came out... If you don't want to use the '^' then fine, use some complicated map or looping construct. But I'd pick the '^' any day over those other suggestions!

      --

      Energy: time to change the picture.

    4. Re:wow, perl meets apl by brer_rabbit · · Score: 1

      that sounds similar to vector operations. I don't know where Larry is going with his new syntax, but what really seems like it could extend the language are vector operations. Anyone familiar with Matlab (or similar) knows the power of vector operations.

      @a = @b / @c;

      now there you've got potential to extend the language.

  13. My head... by Saint+Aardvark · · Score: 1
    I got about half of that. No, less than half. I love Perl, but I'm not at all sophisticated in my understanding of it. I mainly use it for mangling text (I have a serious fixation on this, and I love Perl for the built-in text mangling) and for quick scripting. I start to frown when figuring out the difference between list and scalar contexts; when you start to talk about operator overloading, or references to slices of arrays of references to hashes, my eyes glaze over.

    I want to understand this, I really do, but I just don't. Sorry, Larry and Damien, I tried...

    1. Re:My head... by Anonymous Coward · · Score: 0

      Don't worry. Most normal people who have better things to do with their lives are subject to the same "glaze over". That is why Perl is being abandoned for cleaner tools such as Ruby and Python.

  14. Makes me glad I moved to Ruby by Anonymous Coward · · Score: 0

    Man, am I glad I switched to Ruby a few months back. The transistion to Perl6 looks pretty nasty!

    Go Ruby! (the O'Reilly book "Ruby in a Nutshell" is due out next month).

  15. Re:Perl 7 by Anonymous Coward · · Score: 0

    No, it'll look like this.
    (Ruby)

  16. Admittedly the syntax is getting out there by Ars-Fartsica · · Score: 3
    Hopefully you won't be marked as a troll, because I think in a way you are correct. Larry is recreating the language to be even more palatable to perl gurus but I think more hostile to newbies.

    On the other hand, if you can obscure complex operations into short syntactic sequences, you can keep the programmer from shooting himself in the foot. Look at Java - its syntax is probably as plain and up-front as you can get, but the need to spell most things out explicitly means most programmers spell them out incorrectly. Therein lies the magic of some syntactic freakshows like regular expressions - imagine programmers defining their own NDFAs? I understand this is not a great example as other languages support perl-like regexes, but maybe you get my drift.

    I think the conlcusion is that perl will be like Haskell and Lisp in a way (not a functional language per se) in that programming in perl will simply require a different approach and strategy. You'll have to think in perl in order to properly program in perl. It simply won't be for translating C into an interpreted environment or sh into a portable syntax, it'll be its own paradigm.

  17. I wish Ruby would have come out in 1995 by Ars-Fartsica · · Score: 2
    It might have stood a chance. At this point I really don't see much motivation for moving to Ruby. It doesn bring much to the table that Perl and Python don't already.

    You may see some new Ruby programmers afte the Perl 6 fallout - I think there is going to be a severe backlash when Larry unleashses a language so vastly different from the pervious version that it really requires even experienced Perl programmers to go back to square one.

    1. Re:I wish Ruby would have come out in 1995 by Anonymous Coward · · Score: 0

      It's Perl, Jim, and quite like we know it.

      Exegis 2 and 3 clearly state that except differences in the sigil, change in deref (-> becomes .) and concatenation (. becomes _) operator you can use the perl5 syntax just as one is used too...
      the problem?

  18. Unfortunately you will probably get your wish by Ars-Fartsica · · Score: 3, Interesting

    I believe there is extensive remodelling called for by the current Perl6 gameplan, although I think this will further distance Perl 6 from Perl 5 programmers, and most likely some of them will simply move on to other languages which don't seem like such moving targets (although with Python claiming a signficant rewrite in the future, there may not be much of a safe harbor outside of yuck Java).

    1. Re:Unfortunately you will probably get your wish by Anonymous Coward · · Score: 0

      SMALLTALK! Seriously. If you can get over the fact that most smalltalk programmers are complete fucktards (but hey, at least its not as bad as java in that regard) who think Squeak is reasonable, its an excellent language.

    2. Re:Unfortunately you will probably get your wish by smallpaul · · Score: 2

      Python is not going to undergo a rewrite. That was the plan two years ago but Guido has since moved away from that idea.

  19. MOD THIS UP! by levl289 · · Score: 1

    I too used to fight tooth and nail against co-workers to prove that Perl really wasn't that bad. Having been forced to code in other languages at that job though, Perl is starting to look as bad as everyone was saying.

    pity.

    --

    Q: What do you think about American Culture?
    A: I think it's a good idea.
    (adapted from Gandhi)

  20. Perl6 multiway comparison requires telepathy by dha · · Score: 3, Insightful
    On the one hand, Exegesis 3 tells us that in Perl 6,
    100 < -s $filepath <= 1e6
    is essentially equivalent to:
    (100 < -s $filepath) && (-s $filepath <= 1e6)
    except that the `-s $filepath' only gets evaluated once. We're supposed to be Wow! Neat! about that.

    On the other hand, we are also told:

    Did you notice that cunning $a == $b != NaN test in operator:EQ? This lovely Perl 6 idiom solves the problem of numerical comparisons between non-numeric strings.
    which may be cunning, except of course with wow neat multiway comparisons it is equivalent to ($a == $b) && ($b != NaN), which doesn't do the advertised job.

    Finally, lest we might suspect operators like < and <= are treated differently from == and != for purposes of this `feature', we are told:

    binary <, >, lt, gt, ==, !=, etc. become chainable

    Predict the ultimate (though probably not imminent) demise of multiway comparisons in Perl 6.

    1. Re:Perl6 multiway comparison requires telepathy by Eimi+Metamorphoumai · · Score: 2

      Actually, that does do the job. If $a == $b, then they either both represent the same number, or they are both NaN, and if they are both NaN, then $b is NaN.

      --

      Visit me on #weirdness on the Galaxynet.

    2. Re:Perl6 multiway comparison requires telepathy by dha · · Score: 1
      Ah, you're right. I was somehow lala imagining it was the application of `==' to one or two strings that would yield NaN, but actually `==' just propagates numeric context, so strings get numerified first, and non-numeric strings numerify as NaN in Perl 6.

      Hadn't noticed that `if ($a < $b < $c) { .. }' is actually illegal in Perl 5. Would've expected it to follow C, where you can be sick with like `int cp = (c!=0); if (a < b <= cp) { .. }' to say `a less than b implies (in the sense of modus ponens) that c is not zero'.

      But, Perl didn't do that, so you can't say twisted stuff like that, so there's no loss to adding multiway comparisons to Perl 6. Wow, Perl is actually cleaner than something!

    3. Re:Perl6 multiway comparison requires telepathy by John+Siracusa · · Score: 1
      On the other hand, we are also told:
      Did you notice that cunning $a == $b != NaN test in operator:EQ? This lovely Perl 6 idiom solves the problem of numerical comparisons between non-numeric strings.
      which may be cunning, except of course with wow neat multiway comparisons it is equivalent to ($a == $b) && ($b != NaN), which doesn't do the advertised job.

      Actually, it does, as Damian pointed out to me when I asked about it earlier today.

  21. from the baroque to the bizarre by mj6798 · · Score: 2
    I started using Perl4 years ago. It was a very useful tool when there wasn't much else available on UNIX. It also seemed like its design was trying to poke some fun at the oddball collection of tools like awk, shell, and sed, that UNIX users were using. Perl4 was already pretty baroque. Perl4 was not really a full-featured modern programming language but a scripting tool.

    Perl5 tried to fix a lot of Perl4's limitations and turn it into a modern programming language, but the end result is rather iffy. It's a language with a bizarre object system grafted on top of the module system and lots of syntactic and semantic pitfalls for the unwary. Still, Perl5 has great libraries and a fast implementation, and I knew most of the weird features from Perl4. So I still use it, particularly when it has a library that does something I need.

    With Perl6, the fun seems completely gone, and the endeavor just seems bizarre. Does a language really need a -//=- operator (I'm not making this up) for default-assignment-that-only-interprets-undef-as-u ndefined, as opposed to the existing ||= operator, default-assignment-that-treats-undef-0-and-the-emp ty-string-as-undefined?

    My enthusiasm for Perl5 was already dampened, although I have probably written thousands of Perl5 scripts and CGI scripts over the years. But I think with Perl6, I'm going to jump ship. Perl isn't the only game in town anymore, and several other scripting languages now also have good libraries and are widely used.

  22. Perl?! by Anonymous Coward · · Score: 0

    The only thing I still Perl for is as a heavy duty scripting language. From what I can see Perl 6 may not correct the deficiencies of Perl 5. Perl 6 was also supposed to take away Perl's version of DLL hell. This library compatibility problem of Perl is the number one reason I switched to Java.

    For the "real" applications, I discovered the readability of Java (and to a lesser extent C++) far outweigh the performance Perl *USED* to have over Java. Since the majority of my development consists of web-based apps, Resin and Apache running on Linux have no noticable speed disadvantage to modperl. And the readability and maintainability of the code is where the real benefits exist. Now the Perl fanatics will say something like "it's still 1% slower than modperl..", but the bottom line is maintainability and readability is worth the one or two percent differential.

    My experience with Perl is that the larger the project the more spagetti code you get. I still use Perl to do quick admin type of scripts and utilities because most shells don't always have the power that I need.

    Perl has its place but the readability of Perl is a definite minus. I remember the hours/days our Perl junkies used to spend trying to fix a problem that existed in a line or two of a Perl script. The writability was a plus, but several months later when business requirements changed,
    trying to update the script so that it worked correctly was nothing short of a miracle.

  23. yeesh, too much! by Dr.+Awktagon · · Score: 2

    I hated Perl4 because it was inconsistent and didn't make sense. Perl5 was MUCH better because there was a certain consistency and a lot of clever things were put in (example, using {} to create anonymous hashes is clever because {} reminds you of hashes, the => is a stringifying comma substitute which makes hash defs look good, but can also be used for other things, etc).

    Now Perl6 almost goes too far! Some of that stuff is handy but excessive. Let's see..

    // .. okay that's cool. I've wished for something like that many times. I hope it finds its way into Perl5. I also hope it comes in a unary version as a shortcut for defined() so I can write fun stuff like:

    while(//<>) { .. }
    or
    print "$_ is defined" if //

    ^ .. uhh.. handy, but ugly and makes me think of pascal. There must be a better syntax. What's wrong with some kind of multi-argument "map" operator? And is this:

    @a ^=~ s/foo/bar/;
    somehow better than this:
    s/foo/bar/ foreach @a
    ??

    _ underscore .. okay now this is too much. Just because dot is "industry standard" for dereferencing doesn't mean perl has to have it, the "->" syntax is clear to me. And now I'd have to put spaces around _? Yuck. Of course with the cool new scalar interpolator $(..) for strings I probably wouldn't use it as much, but still, that's too major a change I think.

    The unary underscore to convert to strings is silly. The article even says that _@thingy is the same as "@thingy". Well, duh, then let's use the second one, anybody off the street could tell it had something to do with strings, but what does the first one do? In my mind, underscore means "placeholder", not "string". Get rid of this syntax please, put it back the way it was!

    To add insult to injury, the article says that dot is optional/uneeded in many places except function calls. So they'd take it away and then make it mostly optional?? Why??

    : for marking adverbs and parameter lists is useful, though it means we have to put up with the new $x ?? $y :: $z operator. And that means we need a space around the "::" which runs all my obfuscated whitespace-free scripts. :-)

    := to bind things is cool. The sooner Perl can get rid of typeglobs and that crap the better. I bet someone understands typeglobs completely, but I sure don't.

    That whole thing with the Sigma summation operator was just ugly voodoo, especially the bit that specifies the precedence. Bleh, what's the point??? He defines the Sigma with a certain precedence, but then doesn't even make use of it in the script example. If you need special precedence, use parantheses!

    What is a "higher-order function"? Apparantly it's an anonymous subroutine with placeholder variables...the syntax doesn't really make sense, why "$^"? That makes me think of the hyper-operators. Probably a "&" should be thrown in there someplace. How about beginning those variables with "$&"?

    I think relying TOO much on punctuation is a bad idea. For one thing it becomes harder and harder to scan a script quickly looking for things. And if you start overloading symbols with all kinds of context-dependent meanings, it becomes impossible to remember what it means. For instance, using "+" to convert strings to numbers sorta makes sense, because plus has something to do with numbers. But it has nothing to do with converting strings to numbers, so people will probably forget what it means. I'd much prefer a "num" bareword.

    Oh well, some cool things, and some things that make me wonder why bother? I think I'll stick with Perl 5 for a while (but I'll take the // operator in Perl 5).

  24. It's Really Not Bad by chromatic · · Score: 2
    I think filehandle properties will let you do the definedness trick, though while() {} trick in Perl 5 is currently magical that way.

    Changing the meaning of the dot operator is pretty big, though. It'll take a while to get used to method calls without -> and concatenation with _.

    Using a leading underscore as a stringification operator could be advantageous... especially when dealing with an expression that returns a list, like a hash or list slice, or a method call. There are lots of things that aren't easily interpolated into a string. Give that one a chance.

    (And, yes, I understand typeglobs. :)

    Higher order functions are functions that can be treated as values... passed to and from other functions. They're terribly handy.

    I also wouldn't worry about excessive punctuation. If someone else doesn't already have plans to provide English.pm for Perl 6, I'll do it. It'll probably end up being handled the same way Ruby does it. Internally, everything's an object, and you can access regexp captures through methods or regexp properties, but there are also optional magic punctuation variables available for Perl afficiandoes or shortcut gurus.

    The really big changes are the dot and the underscore. Most beginner and intermediate Perl hackers aren't going to notice many of the other changes.

  25. Scary by Julian+Morrison · · Score: 1

    This new language frightens me. I say that as a perl coder who plays with the old version for a living and makes it do some funky tricks already. Perl 6 is skating worryingly close to the edge at which line noise parses and runs.

  26. Not by value... by Aighearach · · Score: 1

    There is no such thing as passing by value in Perl 5, and I doubt there will be in Perl 6. In Perl 5, @_ gets refs to the arguments. The common practice of saying:

    sub foo {
    my ( $this, $that ) = @_;
    ...
    }

    &nbsp
    isn't only to give better names than $_[0] and $_[1] to the arguments; it's also to get values instead of references.

  27. reduction with ^ by Sharkeys-Day · · Score: 1

    Would $a ^+= @b do what I want?

    i.e. $a is the sum of all elements of @b?