Slashdot Mirror


What is Perl 6?

chromatic writes "Perl.com has a new article entitled What is Perl 6?. It analyzes the changes to the language in light of the good and bad points of Perl 5 and provides new information about the current state of the project: Perl 6 exists, you can write code in it today, and it's more consistent and easier to use than Perl 5."

11 of 343 comments (clear)

  1. unfortunately by caffeinemessiah · · Score: 5, Funny

    You can never be told what Perl is.
    You just have to see it for yourself.

    sorry, i just had to.

    --
    An old-timer with old-timey ideas.
  2. What is perl? by Anonymous Coward · · Score: 5, Funny

    Baby don't hurt me,
    Don't hurt me
    No more

  3. Re:What is Perl 6? by Perey · · Score: 5, Interesting

    That's the thing, though. PHP is the big name (from management's perspective), at least in the P category of LAMP, right now. Not that Perl's gone away by any stretch of the imagination, but the existing Perl shops are happy to keep on doing what they're doing, while the PHP advocates crow about how many new jobs are being done in their language.

    So is Perl 6 going to bring about a Perl revival, or is it (as I suspect) going to fall flat when faced with Perl 5's quietly entrenched support and PHP's proclaimed grip on new uptakers? TFA mentions the reasons for cutting backwards compatibility (or at least reducing its priority) far too often for me to be optimistic there.

    I think Perl 6 will catch on, eventually... but it's going to be more of an alternative language, not an upgrade, to Perl 5 for a long time yet.

  4. No language that I like better by BadAnalogyGuy · · Score: 5, Interesting

    I never really understood Data Structures until I learned Perl. I was consistently and thoroughly confused in my DS class. The language used there was C++. There was simply too much baggage in the language that obfuscated the very points we were being taught. If you can't get past the template syntax, how in the world are you going to be able to understand the data structure concepts?

    Then I met Perl (5.003). What a difference it made! The data structures were built in, and on top of that, it was EASY to nest structures to build complex data types. It was like having a semester of Data Structures immediately made clear.

    Then I found myself back with C++ again. First I wrote my own List classes. However I soon realized that STL made available exactly the types of data structures that Perl has. Maps, Lists, Vectors. And since I understood what I was doing in Perl, it was so much easier to catch on with C++.

    Perl taught me C++. Who would have thought?

    1. Re:No language that I like better by patio11 · · Score: 5, Funny
      Perl taught me C++

      Somewhere, a maintenance programmer just slit his wrists.

  5. New Perl excitement by ChrisDolan · · Score: 5, Insightful

    What makes Perl strong, in my opinion, is the community's interest in maintaining a large and well-tested library of useful code in CPAN. Without CPAN, it's not clear that Perl would be as alive and healthy as it is today.

    What Perl 6 offers is a rejuvenation of the language. Perl 5 still works great (better than ever due to new efforts to stamp out even the most obscure bugs) but this new revision is attracting some *really* smart people who are bringing interesting new ideas to the language. Audrey Tang and Luke Palmer come to mind right away.

    My greatest hope, however, is not that a revitalized Perl will squash the other dynamic languages (Python, Ruby, PHP, ECMAScript, etc) but will instead bring them into a state of interoperability. I really, really want Parrot to succeed so well that the other languages decide to target it as a backend so I can trivially call Python or C libraries from Perl and vice versa.

    1. Re:New Perl excitement by killjoe · · Score: 5, Insightful

      Parrot is multi dispach and supports multiple inheritance. It also does not have a patent sword hanging over it like mono does.

      --
      evil is as evil does
  6. Q. What is Perl 6? by dazlari · · Score: 5, Funny

    A.Two Kiwi oysters going at it.

  7. Hiring here. by Tei · · Score: 5, Funny

    Hello.

    We need 5 years experience Perl 6 programmers for 3D game. Reference: P6DNF.

    --

    -Woof woof woof!

  8. Re:10 Years Overdue by chromatic · · Score: 5, Informative
    Over 10 years later, perl 6 is still in beta mode.

    Did you read the same article I wrote or is your post from the mysterious future? Larry announced Perl 6 in the summer of 2000.

  9. Re:My short experience with perl... by BadAnalogyGuy · · Score: 5, Informative
    This is one area where the Perl docs (as detailed as they may be) fail new users.

    Intuitively, a new user would look at the TOC and see perldata "Perl Data Types" and think that the complete definition of the 3 main Perl data types would be described. So rsidd looks for instructions on creating multidimensional arrays, sees "List value constructors" and gets this:

    LISTs do automatic interpolation of sublists. ... arrays and hashes lose their identity in a LIST... To make a list reference that does NOT interpolate, see the perlref manpage.


    So they head over to perlref (an extra level of indirection) and notice in Item 2:

    A reference to an anonymous array can be created using square brackets:

            $arrayref = [1, 2, ['a', 'b', 'c']];

    Here we've created a reference to an anonymous array of three elements whose final element is itself a reference to another anonymous array of three elements. (The multidimensional syntax described later can be used to access this. For example, after the above, $arrayref->[2][1] would have the value ``b''.)


    But this isn't really easy to understand. Why does he need an arrayref when he wants an array?

    @array = [1, 2, ['a', 'b', 'c']];

    That isn't the same as what he wants. In fact, it's not what you'd expect from DWIM. It's a single entry array, not a multidimensional array. It's not even a list of lists (unless you perform a little magic on it).

    So finally after struggling with this and ending up with some ugly monstrosity like the following:

    @array = @{[1,2,\@{['a','b','c']}]};

    Now his code works, but it isn't very easy to understand, and the maintainers of this code are going to tell everyone how evil and illegible Perl is because the programmer here couldn't figure out how to make a multidimensional array.

    The only FAQ entry with the term "multidimensional" in it refers to some DBM-specific topic that doesn't seem to have any relation to the problem at hand. While "list of lists" may be the preferred term in the Perl community, it would be nice to have a FAQ entry like "How do I create a multidimensional array?"

    As you've mentioned, perllol has the exact syntax of how to do this. Unfortunately for our poor programmer, the link to that is buried in the See Also section alongside perldsc (which is large and contains quite a bit of irrelevant information like 'use strict' information, while at the same time not providing very detailed information about the data structures themselves). The very first 'perldoc perllol' page displayed gives the answer immediately:

    An array of an array is just a regular old array @AoA that you can get
    at with two subscripts, like $AoA[3][2]. Here's a declaration of the
    array:

            # assign to our array, an array of array references
            @AoA = (
                          [ "fred", "barney" ],
                          [ "george", "jane", "elroy" ],
                          [ "homer", "marge", "bart" ],
            );

            print $AoA[2][2];


    Why is it so hard to get to this simple explanation? Why should a neophyte have to go through two documents to finally get to perllol? The FAQ should describe the technique using "multidimensional" as a keyword.

    I love Perl, and I love the depth and breadth of the Perl docs, but they are difficult to navigate for Perl neophytes.