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."

78 of 343 comments (clear)

  1. What is Perl 6? by eldavojohn · · Score: 2, Insightful
    What is Perl 6?
    Probably a pretty good sign I should get off my ass and spend some time learning the language if I don't want to become obsolete to my employer.

    Yeah, I know I'm late to get on this but ... well ... my personal needs and job have never forced me to use it.
    --
    My work here is dung.
    1. 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.

    2. Re:What is Perl 6? by slashdotnickname · · Score: 2, Interesting

      Probably a pretty good sign I should get off my ass and spend some time learning the language if I don't want to become obsolete to my employer.

      I'm sure if your employer starts needing perl solutions, they'll buy you a book. It's not that hard to pick up if you come from a programming background. I once got tasked to modify a perl script, and was able to learn enough perl to get the job done within an afternoon. Been a fan of it ever since!

    3. Re:What is Perl 6? by Scarblac · · Score: 3, Insightful

      But if you need to do a longer project, pick up Programming Perl and read it (from front to end). Without that book, Perl can just be extremely weird, after reading the book it at least makes sense in its own world, no matter how unconnected that world seems to be to the rest of the universe :-)

      --
      I believe posters are recognized by their sig. So I made one.
    4. Re:What is Perl 6? by Colonel+Panic · · Score: 2, Insightful

      Probably a pretty good sign I should get off my ass and spend some time learning the language if I don't want to become obsolete to my employer.

      I suspect your manager (if s/he is a typical manager) hasn't even heard of Perl 6.

      Perl 6 is still vapor at this point. It's probably still a year or two away (and may be perpetually, unfortuneately). Yes, there are cool ideas there and you might want to be familiar with some of the highlevel concepts. But if you really want to study some new languages that will help your employment prospects you'd probably be better off learning Ruby at this point (that Rails stuff is really taking off). If you want to learn something on the leading edge you might even want to consider learning Io No books for Io as yet, but it seems to be be generating buzz among the early adopters (the sort of folks who were using Ruby five years ago).

    5. Re:What is Perl 6? by beef3k · · Score: 2, Funny

      Last I heard it was a long forgotten dialect of Klingon.

    6. Re:What is Perl 6? by CRCulver · · Score: 2, Informative

      If you want to learn something on the leading edge you might even want to consider learning Io No books for Io as yet, but it seems to be be generating buzz among the early adopters (the sort of folks who were using Ruby five years ago).

      I've heard of Io before, but I find it hard to take a language seriously if it has its own UI toolkit. That for me implies a lack of abstraction, a philosophy of micromanagement, and--since there's already plenty of existing UI toolkits for which its a cinch to write bindings--a sentiment of Not Invented Here. Let the language be designed so that it steps out of the user's way on many fronts and encourages him to code with whatever already-available libraries might be available.

      FWIW, if the OP wants to learn another language beside Perl 5 just in case he were tasked to maintain some outside project, I'd recommend Python. O'Reilly's Learning Python and Programming Python are dynamite books.

  2. 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.
    1. Re:unfortunately by value_added · · Score: 4, Funny

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


      Is this what you saw?

    2. Re:unfortunately by Julian+Morrison · · Score: 2, Funny

      That's almost right, except that it doesn't quite capture the depth of wierdness. Lets label that beastie a "knuffle". The picture shows one regular sized knuffle, and a casual glance shows perl 6 looking rather like that. In truth though it's more like a fractal aggregation of nano-knuffles which can be morphed into more or less anything else. In fact, apart from the initial morphing commands that initiate the change (lets, say, the antlers), it needn't look anything like a knuffle at all. So perhaps you see a python with antlers, or a cup of coffee with antlers. In fact the antlers can be hidden in hardlink magic, so /usr/bin/perl starts out looking like your regular perl 5 camel.

      I don't actually disapprove of perl 6. If I were a lot cleverer, I might even be able to understand it. But it's a fearsome and alien creature, and I wouldn't use it to do paying work.

  3. What is perl? by Anonymous Coward · · Score: 5, Funny

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

  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.

    2. Re:No language that I like better by HermanAB · · Score: 2, Insightful

      Perl seems to be every Unix hacker's favourite, most hated, language. It fills the huge void between Bash and C.

      --
      Oh well, what the hell...
    3. Re:No language that I like better by Lisandro · · Score: 4, Informative

      Can you recommend a resource for OOP with Perl?

      Right now i found all i needed in the Perl.org site - this OO tutorial for Perl is pretty complete. There's also this one, which is oriented to begginers.

          In fact, i always keep a browser window open to Perl.org when i'm coding Perl - the tutorials are very nice, but the function reference has been priceless to me.

    4. Re:No language that I like better by AuMatar · · Score: 3, Interesting

      Ignore the analogies, OOP has nothing to do with obkects at its core. OOP is basicly encapsulation and interfaces. You design your program so that its broken into parts. Each part handles one bit of functionality- networking, or database communication or the like. Each part is self contained, no 2 parts should know how the other part is coded- they only communicate with each other through a set of functions. These functions are called an interface. The functionality of each part is said to be encapsulated, because the actual design of the code is not known to the outside world.

      In C, you do this with functions in a .h file and call it a library or a module. Sometimes you use a struct to pass around data. A great example is the stdio library- you have a bunch of library functions to do IO. You don't know how those are implemented. ANd since you can have open IO on more than 1 file at a time, you need a bit of data to hold the state of an IO. Thats why you pass back and forth FILE* parameters.

      In C++, you put the data and the functions together in one package and call it a class. Think of a class as a C struct with a bunch of function pointers in it. So instead of calling myfunction(mystruct) you call myclass.myfunction(). Its conceptually the same (in fact, the machine code is almost identical).

      By now you should be thinking "damn, that sounds like what I do in C already". It is. Good C programmers did OOP before OOP was a buzzword. languages like C and Java just add some syntactic sugar like inheretance (one of the most abused language features ever, especially in Java) and autoatic constructiors and destructors into the mix.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    5. Re:No language that I like better by Anonymous Coward · · Score: 2, Interesting

      That's one of the problems with inheritance. It's entirely possible to override an innocent looking method, and in doing so break the contract of an apparently unrelated method in a different class. It's extremely difficult to debug when it does occur, and the probability of it occuring increases with the complexity of the system. It becomes a real problem when lots of programmers work on the same project, especially if some of them don't understand the whole codebase, aren't very experienced, or are just plain idiots.

      It is possible to work around this by using disciplined inheritance or, better still, by not using implementation inheritance at all, and going for interface inheritance instead. You still get polymorphism, and you still get code reuse (you just need to design the system differently), but you don't get the hidden problems, and the resulting system will be far more robust.

      By the way, COM actually uses a similar system. It's based purely on the idea of interfaces. Each COM object can implement one or more interfaces, but can not inherit behaviour from another COM object. Internally, you can use implementation inheritance as much as you like, but from the outside there is no inheritance. You can implement the behaviour of one object in another by encapsulating that object and forwarding method calls, which is externally the same as implementation inheritance, but is more flexible (since you can "inherit" from any object that implements a specified interface without problems), and way more robust.

      Hmm... That course I did on component-based software engineering back at university made much more of an impact on me than I thought.

    6. Re:No language that I like better by BlueYoshi · · Score: 2, Interesting

      I was thinkink like you till I was hired in a company that use real OO technique.

      And I learn the beauty of OO and the very nice way to solve problems by using Factory, Prototype, Facade, Visitor Patterns. I can tell you that before I was writing Object but not thinking 'object' and that is very different.

      I agree its possible to code in Assembly using OO technique but it is really not natural and can be really tricky to do .

      --
      "Use cases are fairy tales..." I. S. 2005
    7. Re:No language that I like better by Metasquares · · Score: 2, Informative

      Poor OOP support is an understatement. Classes are really just blessed hashes in Perl 5. You can't do encapsulation (without special modules, anyway) and even inheritance looks like it was just tacked on. (@isa?)

      I'm very glad that Perl 6 will have better thought out OOP support. It would have made a recent 7,500 line project I worked on much smaller, easier, and more stable.

      You're correct, though; it's a very useful language outside of the poor OOP.

    8. Re:No language that I like better by Anonymous+Brave+Guy · · Score: 4, Funny

      Another is swallowing a bullet, while a third fell on his sword. There's more than one way to do yourself in!

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    9. Re:No language that I like better by dubl-u · · Score: 2, Informative

      Ignore the analogies, OOP has nothing to do with obkects at its core. OOP is basicly encapsulation and interfaces.

      A reasonable theory, but you're missing half of the power of object-oriented languages. Read Evans' fantastic book Domain-Driven Design for the other half. You will discover than a lot of people, even many of those writing "Intro to Java" books, made the transition to OO languages without ever learning OO design.

  5. What is Perl 6? by Rob_Ogilvie · · Score: 3, Funny

    I can't define it, but I know it when I see it.

    --
    Rob
  6. 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
  7. One thing perl is still good for. by tuxmaster · · Score: 2, Insightful

    One thing that perl is good for that I hope it continues to be good for in the future in command line scripting.

    --
    ~tuxmaster
  8. Perl 6 is evolving the language into awesome! by Inoshiro · · Score: 2, Interesting

    My compilers professor has nothing but bad things to say about a language whose syntax is inelegant and tricky. After all, if a language is inelegant, it will be hard to read and understand, as well as hard to create a proper grammar for, or parse.

    "(Perl 5 overloaded curly braces in six different ways. If you can list four, you're doing well.)" ! Java has something like 22 levels of precedence. Most people will use the bare minimum of that, lest they tread upon a dragon's tail.

    And, one of my favourite points: "Why is the method call operator two characters (one shifted), not a single dot? "

    Perl 6 means a simpler, better parser, while keeping all the language strengths. This means it won't be such a bitch to deal with mod_perl's weird gleeps once it's Perl 6. This means smaller process overhead. This means quicker development of web applications that are cool (although I must admit, Ruby on Rails is also pretty neat looking).

    The new regex syntax alone is reason to switch!

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Perl 6 is evolving the language into awesome! by Engineer+Chris · · Score: 2, Interesting
      And, one of my favourite points: "Why is the method call operator two characters (one shifted), not a single dot? "
      Because concatenation was already a single dot before method calls were introduced (in perl5).
      --
      Read the sig, read the sig, ziggy ziggy ziggy zig!
    2. Re:Perl 6 is evolving the language into awesome! by Viol8 · · Score: 2, Insightful

      "Because concatenation was already a single dot"

      And wasn't that well thought out. Who needs "+" for concat like most
      other scripting languages when you can use a "." instead. Doh.

    3. Re:Perl 6 is evolving the language into awesome! by Anonymous Coward · · Score: 3, Interesting

      I like the use of "." for concatenation

      "+" as an operator sugguests that the order of the items being operated on has no effect on the answer...

      eg. 2 + 3 == 3 + 2

      but
      "two" + "three" != "three" + "two"

    4. Re:Perl 6 is evolving the language into awesome! by Viol8 · · Score: 3, Insightful

      "sugguests that the order of the items being operated on has no effect on the answer..."

      And a dot suggests a decimal point. Plus or double bar are used as concat
      almost everywhere else. Using a dot was not very logical. But I guess that
      follows the general philosphy of perl syntax anyway.

    5. Re:Perl 6 is evolving the language into awesome! by TheLink · · Score: 3, Informative

      Because in Perl
      "1"."2" eq "12"
        and
      1 + 2 == 3

      If a loosely typed language is using + for concatenation, it's poorly designed (you'd end up typing more to specify what you want done).

      You need to know that the concatenation of two variables is not the same as adding them together.

      Slightly relieved that Perl 6 switched from using underscore to tilde for concat - underscore is overloaded with so many other tasks already. Unfortunately ~ still requires shift to be pressed on my keyboards, but I guess they are running out of symbols, and at least I think ~ won't require you to keep putting spaces around it to disambiguate it from other meanings.

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

    A.Two Kiwi oysters going at it.

  10. Who cares what Perl 6 is.. by ForeverFaithless · · Score: 2, Informative

    ..now that we got Ruby.

    --
    Mark Kretschmann - Amarok Developer, KDE Member
  11. WHOOPITUPTITUDE! by reidman · · Score: 4, Funny

    From TFA:

    Not everyone who starts learning Perl for whipituptitude needs manipulexity right away, if ever, but having a tool that supports both is amazingly useful.

    Whipituptitude?!

    That is awesome. Made up words a--

    Whats this? Manipulexity?

    How much awesome can you cram into a single sentence?
    1. Re:WHOOPITUPTITUDE! by ceeam · · Score: 2, Funny

      Give them a break, they are Perl programmers after all. ;)

    2. Re:WHOOPITUPTITUDE! by maxwell+demon · · Score: 2, Funny

      Well, that's the inventixibility of Perl programmers. :-)

      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:WHOOPITUPTITUDE! by whterbt · · Score: 2, Funny

      I don't see what the problem is. They're perfectly cromulent words.

      --
      Too late to be known as Bush the First, he's sure to be known as Bush the Worst.
  12. My short experience with perl... by rsidd · · Score: 3, Insightful

    Three years ago, I could program in C, but had never used a scripting language (except bash, for very basic stuff). I needed to do some non-trivial manipulation of text files and figured that this was a good time to learn. Since others in the group were using perl, I tried perl.

    I knew what I wanted to do, but needed to learn the language. I struggled with the awful syntax for three days. The breaking point came when I wanted a list of lists and realised that Perl "flattens" nested lists. How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]? In Python, it's trivial (that's how you'd write it), but in perl, nobody I talked to could give me an answer. It flattens it, unasked, to [1,2,3,4,5,6,7,8] and, try as I might, I can't see the point. (It turns out it's possible to have nested lists, but it's yet another example of perl's horrendous syntax).

    Finally, I decided to give python a try. I spent an hour reading the python tutorial, and in another three hours, I had reimplemented everything I'd done in the last three days in perl, and an hour after that I'd finished the job. Python syntax was, and still is, the cleanest I've ever seen. It's an amazing language. And it changed the way I think about programming: it gave me an appreciation of functional methods (I now use ocaml a lot) and also changed the way I write C (vastly for the better).

    That was it. No more perl for me.

    1. Re:My short experience with perl... by cliveholloway · · Score: 2, Informative
      use Data::Dumper 'Dumper';
      my $LoL = [[1,2],[3,4],5,[6,7,8]];
      print Dumper $LoL;
      Errr??
      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    2. Re:My short experience with perl... by cliveholloway · · Score: 4, Informative

      Oh please.

      "Especially when every perl doc I see around tells me to use curved parentheses for lists, and @ prefixes for variables that refer to them..."

      How hard did you look, really? If you go to Google and type in perl list of lists, the FIRST link takes you here.

      And within 1/2 a page, you see this:

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

      print $LoL[2][2];
      bart

      Damn anti-Perl trolls :-)

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    3. Re:My short experience with perl... by forty7 · · Score: 3, Informative

      Yes, that's really intuitive, thanks. Especially when every perl doc I see around tells me to use curved parentheses for lists, and @ prefixes for variables that refer to them, and I have no clue what data structure you've used above.

      You're right; you do need curved parens for real lists. It may be helpful to think of the @ mark as referring to multiple values, rather than to a list specifically. It's also used for list and hash slices, like this: @list[1,3,5] and @names{'tom', 'dick', 'harry'} (Both of those expressions really just evaluate to lists, but, particularly with the hash slice, that's not necessarily obvious).

      The other responders, in their haste to point out how much perlier-than-thou they are, have glossed over the fact that 'my $list = [[1,2],[3,4],5,[6,7,8]];', as you've pointed out, doesn't exactly produce a list of lists. It produces a data structure that's close enough to a list of lists that they can call it that without being entirely wrong.

      (Warning: Perl content. I love Perl, so it'll probably sound like I'm rambling. My apologies.)

      You can't directly create a list of lists in Perl. Not possible, because they'll get flattened. But what you can do is create a list of *references* to lists. There are two ways to do this:
      my @list1 = (1, 2, 3);
      my @list2 = (4, 5, 6);
      my @combined = (\@list1, \@list2);

      Or:
      my @combined = ([1, 2, 3], [4, 5, 6]);

      This second syntax is called the anonymous list syntax.

      The upshot is that lists are surrounded by (), as you already know, but that by replacing them with [], you get a reference to a list with no other name. The same can be done for hashes with {}, which means that all Perl data structures can be arbitrarily nested.

      So, your Python example, in Perl, would create a reference to a list of references to lists. Its elements would be accessed like this:
      my $list = [[1,2],[3,4],5,[6,7,8]];
      print $list->[0][1] # prints 2

      The -> is used for dereferencing, but Perl is clever enough to figure out that the value of '$list->[0]' is also a reference, and doesn't require you to write the -> between [0] and [1].

      You could also write your example like this:
      my @list = ([1,2],[3,4],5,[6,7,8]); # note the ()

      print $list[0][1] # *also* prints 2!

      It turns out Perl is *still* clever enough to figure out that $list[0] is a reference, and will automatically dereference it for you. No -> required.

      I hope this helps clear things up a bit!

    4. 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.
    5. Re:My short experience with perl... by forty7 · · Score: 3, Informative

      Dang it, copy-and-paste missed a couple of sentences at the end. Here they are, in context:

      It turns out Perl is *still* clever enough to figure out that $list[0] is a reference, and will automatically dereference it for you. No -> required. The beauty of this automatic dereferencing is that it allows Perl to DWIM (Do What I Mean): Perl is perfectly content to let you pretend that a 'list of *references* to lists' is actually just a 'list of lists'. The downside of the automatic dereferencing is that it turns the easy-to-miss difference between '((1,2),(3,4))' and '([1,2],[3,4])' into Just Another Bit Of Fiddly Syntax To Remember.

    6. Re:My short experience with perl... by Russellkhan · · Score: 3, Funny

      That's the first time I've ever seen or heard anyone say that Lisp didn't have enough parentheses!

      --
      Information doesn't want to be anthropomorphized anymore.
    7. Re:My short experience with perl... by rsidd · · Score: 3, Insightful
      You put it very well. It's possible that if I had seen this doc to begin with, I'd have stayed with perl. But perhaps I would merely have switched later. This was just the last straw -- I'd already spent three days trying to figure out perl syntax (and meanwhile, one colleague was strongly urging me to try python -- everyone else used perl). And I'd already read ESR's article on his first exposure to Python, so I had a favourable impression of it.

      Having used python for about 3 years now, I'm yet to find something that I can't easily do in it, that I can in other languages. Except for speed/numbercrunching issues. And then I use ocaml (for new code) or C (for existing code). Even if I liked perl syntax and hated python's whitespace-significance (I don't and I don't), I imagine I'd have migrated to ruby by now.

      Actually, the really cool feature of Python, one that I use all the time now, is "list comprehensions" -- an idea stolen from Haskell, and as far as I know, no other language has it. You can't do anything with it that you couldn't with map() and filter() but it's a much more elegant way of writing things -- just the way mathematicians would with sets.

    8. Re:My short experience with perl... by Scarblac · · Score: 2, Interesting

      The mind-bending thing of Haskell's list comprehension is mostly that they're evaluated lazily, and can be of infinite length. A famous examples is of course the implementation of the Fibonacci function in Haskell as an infinite list:

      fibo = 1 : 1 : zipWith (+) fibo (tail fibo)

      Python's list comprehensions are rather neat, but they lack those features, so they don't come near Haskell's level of mindbendingness. They're mostly a cool shorthand for writing down lists that would have been ugly with map() and filter(). I wish the dict comprehension PEP had made it...

      (I'm a Python fan, but nowadays I program Perl for a living and play with the book Practical Common Lisp in my spare time... give Lisp a try!)

      --
      I believe posters are recognized by their sig. So I made one.
    9. Re:My short experience with perl... by Eivind · · Score: 2, Insightful
      This is true. And to a perlhead it even makes sense. But it still makes the language a *lot* harder to come to grips with.

      In python, an array consists of "[ what,ever,here ]" and that extends inituitively, *without* needing to read any manual-page to the case where "what" in itself is a array (or anything else).

      It's not inituitive that (1,2,3,4) is the same as ((1,2),(3,4)). That's not reasonable at all. Yes there's an explanation for it. Yes the explanation makes sense, from a certain point of view. The thing is, you first have to *aquire* /precisely/ that point of view. It's not something you'd expect.

    10. Re:My short experience with perl... by I+Like+Pudding · · Score: 2, Interesting

      Well then how about
      print map {"(@$_)"} @$a; #---> (1 2)(3 4)(5)(6 7 8)
      instead?

      TIMTOWTDI, bitch!

      Seriously, though, nested data structures and the deferencing syntax is the single worst part of perl. I'm not surprised it made you break out into hives. Your main problem, though, is that you keep thinking a list is an array. It isn't. Parens build lists, and arrays are primarily built from lists. Also: learn to use google. I ran into this same problem when I was first starting out and took a few hours to nail down some docs and get familiar with it. The syntax is ugly and annoying, but not overly difficult (assuming you already understand references).

    11. Re:My short experience with perl... by PommeFritz · · Score: 2, Informative

      Python's list comprehensions are generators. Look it up what this means. The infinite Fibonacci sequence can be written in Python as a generator function:

      def fib():
              e=0
              f=1
              while True:
                      yield f
                      e,f = f,f+e

      You can print it like this:

      for f in fib(): print f

      but that wouldn't bee too convenient, other than to see Python's long-number feature :)

      More interesting is combining it with another generator function, one that only returns the first N numbers of the given generator:

      def firstn(g, n):
              gen=g()
              for i in range(n):
                      yield gen.next()

      print list(firstn(fib, 10))

      The explicit conversion to a list is because otherwise you would see that the object you're trying to print is not the list itself, but the generator that will build the list for you one element at a time.

  13. Perl 6 is by Ulrich+Hobelmann · · Score: 2, Interesting

    yet another Virtual Machine nobody needs, that's supposed to be well at executing lots of different languages, but probably won't really.

    It's a new language built by rewriting an ugly, old hack, that only fans of the old version will probably ever use. Everybody who didn't like Perl already moved on.

    1. Re:Perl 6 is by TheP0et · · Score: 3, Interesting

      Not just another virtual machine nobody needs. Perl6 is also a consequent implentation of language development paradigms. Java started some of it with its so called "platform independent" VM. Microsoft jumped on that train with DotNet and its intermediate language for the CRL. Perl6 bundles those ideas together, gets rid of hierarchy constraints inherited from the old OO drafts, and adds complete costumizability to syntax and grammar while trying to keep the number of built-in functions as small as possible.

      No other language does make it so easy by now to adapt the language itself to the needs of the special environment. You could for example write a module that forces strict inheritance to all of your objects, or implicitly puts all variables and values into a protected memory range, or dump your current program state onto a disk, everything within the blink of an eye.

      Other implementations of introspection, like Java's Reflection API, provide the needed self-awareness of the code and the means for dynamic object handling up to some point, but that point reached, things tend to get rather ugly. Perl5 provided some "dirty hacks" for a part of that, but couldn't cover everything without breaking compatibility and, most of all, performance.

      Still Perl6 won't be the sole answer to every question - as allways TMTOWTDI. But it's certainly interesting enough to keep an eye on it.

  14. Re:starting from the bottom by free+space · · Score: 2, Insightful

    With all respect to the importance of strategic management, it is only one way to achieve success. Many of the great organizations of today didn't have a vision when they started and made it up as they went along.

    Linux began as just for fun, Bill Gates' vision when starting Microsoft was "join the bandwagon as fast as you can before you miss the oppurtunity", and Perl itself started as a replacement for awk.

    IMO, you can go either way- top down or bottom up- as long as you're competent enough to see oppurtunity and smart enough to know good decisions from bad.

  15. 10 Years Overdue by dorpus · · Score: 4, Insightful

    People in the mid-1990s spoke of "overnight obsolescence", that Perl 6 would replace everything in a few weeks, and that you had better learn a new programming language every month. Over 10 years later, perl 6 is still in beta mode.

    1. 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.

    2. Re:10 Years Overdue by Sentry21 · · Score: 2, Interesting

      His post makes reference to how Perl 5 was released in 1994, and people were expecting Perl 6 to obsolete everything 'overnight'. 'Perl 5 is great, welcome to 1994, but Perl 6 is going to be out soon, and in order to stay up to date in this fast-paced world of technology, you'll need to learn Perl 6 before you're done learning Perl 5' sort of thing.

      The 10 years the OP is referring to is the 10 (now 11, nearing 12) years since the release of Perl 5, without any major updates to the language (other than a sane versioning scheme).

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

    Hello.

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

    --

    -Woof woof woof!

  17. PDL by LordMyren · · Score: 4, Interesting

    The article talks about some of the defining features for perl. Well, one of the defining features in my perl experience has been Perl Data Language, pdl. PDL _is_ whipitupitude. Its a wonderful wonderful matrix library. And it comes with the best perl shell I know.

    I had to break down a equation into a sequence of linear equations. So I hacked up some PDL in like 2 hours to do that. Couldn't have been easier, even though I'd never used PDL or its perldl perl shell; I just started typing in the interactive shell until it worked as expected and until I knew what I was doing. Then I needed the results in interger, so I rounded everything down, built a permuter and sorted the permuted results for each individual segment. That took three hours, but only because I kept botching the matrix multiplication. Even with huge datasets, generating hundreds of thousands of linear equations, each spanning dozens of datapoints, permuting the linear equations, sorting them and selecting the optimal, PDL would run it all my slow arse 800mhz crusoe laptop in seconds. Matlab couldnt touch it.

    Thats the other really truly thing about PDL; the performance. If someone else would chime in and do it better justice, but my crude understanding is that it generates some kind of extremely optimized machine code on first use and runs whatever equations you've thrown at it like silk from that point on.

    Little late and a little off topic, but PDL really is just a masterpiece of perl hackability. The PDL perl shell is truly spectacular; get some symbolic integrators and differential equation solving packages in there and I wouldn't need to break open Mathematica or Matlab ever again. Ok, long way away, pdl is really just about matricies, but it is really really sweet, and its shell is good for anyone who just wants to try something out really quickly in fully interactive perl.

    That being said, I really cant wait to see where the perl6 VM is going.

    G'night!
    Myren

  18. Perl 6 ~= LISP by paulthomas · · Score: 2, Interesting

    The article mentions blocks being closures and the fact that Perl 6 -- much like the new regex system -- is itself really a programmable grammar. It sounds like we now have real macros.

    The question is: is Perl becoming a LISP implementation?

  19. PUGS by putko · · Score: 3, Informative

    Here http://www.pugscode.org/ is something on the PUGS project, which is making an implementation of Perl 6 in Haskell, conformant to the spec.

    Apparently they are having a lot of fun.

    --
    http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
  20. Perl is between awk and C by Pausanias · · Score: 2, Insightful

    I do scientific computing (astronomy). I never met the task that was too cumbersome to write in C, while at the same time too complex to write in awk.

    I keep waiting for a task where it would make sense for me to learn perl... it's never come along.

  21. Err? by LordMyren · · Score: 2, Insightful

    Normally you wait until a language is actually released before learning it. Traditionally, you let a couple early adopters build something with it first too. Most smart organizations wait to make sure the langauge actually is somewhat stable before buying into the list of benefits. They wait for books to be released.

    Perl6 is not really here yet. Read the last page. Author doesnt come out and state it directly, but the current best implementation runs on Haskell.

    I dunno, somehow I dont think the take-away was supposed to be "learn this or get fired, parrot is the one vm to rulezor them all!!11," I think it was more "perl6 is still coming and has some really cool new features, as well as being built around a much more solid core." There's mainstream technologies worth reading up on if you feel the heat to stay up to date for your job. Then there's things like Perl6/Parrot; cool technologies to read up on if you're actually fucking interested in computer languages or vm's. Forgive me, I realize you simply werent aware of the status of perl6, but perhaps you should see how many band members are actually on the bandwagon before hoping aboard yourself.

    Myren

  22. Meditations on Perl 6 by starX · · Score: 4, Funny

    If the release of Perl 5 was any indication, Perl 6 is the single magic bullet that will kill all of my (Perl) code.

    Perl 6 may be more akin to a divine programming language, which makes the implimentation of complex data structures simple and sublime. Then again, it could all be a nasty trick to lead us away from the true path of enlightenment.

    Perl 6 is not .NET.

    Perl 6 is not controlled by any major corporation; I haven't decided whether this is advantageous or not yet.

    If I were to have a child, would it be written in Perl 6?

    Can Perl 6 be used to unlock the secret mysteries of the Bible code to reveal the end times?

    Is Perl 6 really being developed by the descendants of Jesus Christ? Is the Pope trying to cover it up? Does the Pope know what Perl is? If so, is using Perl 5 a sin? How about Perl 6?

    I bought a preview book on Perl 6 a few years ago. Is it still useful? Can I have my money back?

    If Ruby was an upgrade to Perl, and Perl 6 is a an upgrade to Perl and Ruby, will Ruby need to changes their name in such a way as to play off of Ruby Tuesdays?

    If I enter the Perl 6, can I change my mind later?

    If Perl 6 is brillian, but no one uses it, is it still brilliant? What if it's awful and everyone uses it?

    So very tired....

  23. Re:Hear me True Gods of Interoperability by chromatic · · Score: 2, Informative

    That's what Parrot's NCI layer does. It's a foreign function interface to shared libraries. It's much nicer than Perl 5's XS.

  24. About 3 years too late by Colonel+Panic · · Score: 3, Interesting

    Ok, Perl6 does indeed look cool. Lots of interesting things there. Sure, you can apparently write Perl6 code today and run it on PUGS (a Haskell implementation of Perl 6; that's gotta be speedy, eh?). But as is mentioned in the article, Perl6 was announced at OSCON 2000; that's 5.5 years ago. It's now become the posterchild for vaporware in the open source world, hence this article to keep the faithful hopeful (and to keep'em from sneaking off to Ruby, Python or even Io). Really, it just looks like the purpose of the article is to say "yes, we're still here working on Perl 6. We're working hard, we really are. Please, don't lose hope. This is hard work. It'll be here one day and it'll be great", while a lot of Perl folks who yearned for something better have already moved on to Ruby or Python.

    I really hope that Perl 6 arrives one day. I'm pretty deep into using Ruby these days having left Perl 5 behind long ago (the part of the article about what's wrong with Perl 5 was really superfluous; maybe it was intended to convince the remainingn Perl folks who are happy with 5 to check out 6), but I'll give Perl 6 a look when it arrives. The grammar support alone looks pretty awesome; it'd be great to have a viable lex/yacc alternative. In the meantime I want to learn some languages that have a bit more immediate promise like Io. It seems that maybe the plans for Perl 6 were just too ambitious. Yes, it's great to start with a clean slate and try to revolutionize, but often it's evolution that wins out.

    1. Re:About 3 years too late by IpalindromeI · · Score: 2, Insightful

      PUGS (a Haskell implementation of Perl 6; that's gotta be speedy, eh?)

      I keep seeing statements like this, but I don't understand them. A Haskell implementation of a Perl interpreter is no different than a C implementation, which is what Perl 5 uses. The interpreter has to be written in something. Why not choose a high level language that will allow high productivity?

      My guess is that you, and the others who make these remarks, don't know anything about Haskell and think it is Yet Another Scripting Language. Haskell is a statically-typed language, and can be compiled to machine code. In terms of speed, it's quite competitive when written correctly.

      --

      --
      Promoting critical thinking since 1994.
  25. Is this the last revision? by VGPowerlord · · Score: 2, Insightful
    QFE: "Perl 5 isn't perfect, though, and some of its flaws are more apparent the closer Perl 6 comes to completion." Bolded for emphasis.

    In other words, the spec still isn't nailed down. I may have only been been loosely following Perl 6's progress, but having seen the concatention operator change from . to ~ to _ during Perl 6's development, I'll wait until the final spec comes out, thanks.

    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  26. Some much better... by AVee · · Score: 2, Interesting

    ...it's more consistent and easier to use than Perl 5

    Some thing are just so easy there's no pride in it. Now make something more wich is harder to read then Perl 5 and you've achieved something. It may be better, but is it good?

  27. No , Perl taught you data structures. by Viol8 · · Score: 2, Insightful

    I hope you're sitting down since this might come as a shock but ... theres
    more to C++ than the STL! Yes , I know , its amazing isn't it that a language
    thats only been around 20 years and is based on C which has been around for
    over 30 is more complex than this , but, well son , its true. Until you
    understand not just all the cool trendy OO and generic side but also understand
    pointer arithmetic, indirection , word boundary alignment issues and 101 other
    low level topics inherited from C then you DO NOT "know" C++ at all.

  28. Re:The funny thing is... by LarsWestergren · · Score: 3, Funny

    ... that they all spell that "whipituptitude" differently. Look for yourself:

            * In TFA1: whipituptitude
            * In TFA2 referenced from TFA1: whipuptitude


    With Perl, there is always more than one way to spell it.

    --

    Being bitter is drinking poison and hoping someone else will die

  29. Perl6's direction by I+Like+Pudding · · Score: 2, Interesting

    From the examples I've seen, I'm worried. Perl5 already has too much syntax for my liking (see the subthread on nested refs. yuck), and Perl6 seems to be going much, much furthur in that direction. Will it be powerful? You bet! The problem is that Larry thinks power is the sort of subtle change of inflection that can alter your meaning from "Greetings!" to "Greetings, shithead!", but only when the moon is in the third house. I'll hold off my judgement until it ships; I certainly owe Larry that much for how much use I get out of 5. In the meantime, though, I will be using Ruby as much as I can and wondering how anything else can be more fun to write in.

  30. Obligatory Muppets Quote by cheezemonkhai · · Score: 2, Funny

    The question is "What is Perl 6"?

    The Question is "Who Cares"

  31. Amber for Parrot by ribuck · · Score: 2, Informative
    For instance I very much like the look of Amber as a scripting language with maintainability in mind

    Thanks for your interest in Amber. I'm the author of Amber for Parrot which, although in the early stages of development, will hopefully become sufficiently complete to be really useful, sometime this year.

    Although Perl 6 is a nice cleanup and enhancement, the Parrot Virtual Machine is going to be far more important to the computing world than Perl 6. Parrot will do for scripting languages what the JVM and .NET are doing for compiled languages.

    Parrot is not yet functionally complete, but it's genuinely usable. It has been a delight to to target Parrot, because most things just work - and when they don't, the Parrot developers have gone out of their way to help.

    Parrot development has been pretty rapid recently - although you can't always tell from the documentation which often lags behind.

  32. Re:Neat, yes, but It's not pleasant to read... by plurgid · · Score: 2, Insightful

    > isn't something you should expect to build a whole program ...

    oh, horse crap on that.

    Over 6 years ago, I built a GUI front end to a workflow system (read: database + some business logic) using perl/Tk. An entire department runs the app on it's unix workstations from an NFS mount, and they've been doing it day-in and day-out for that entire 6 year period. All kinds of people have mangled that thing to hell and back, using it in the most inapropriate of ways, yet it's never been broken.

    Perl is what it is, man. It got it's name in the 90's as a web programming language, and I guess it got typecast. Heh ... I guess that'd be "weak typecasting" in this case ...

    Saying perl is dead because PHP r0x0rz so hard is like saying hammers are dead because of nail guns. Pounding nails ain't the only thing a hammer can do.

  33. Perl 6 = COBOL 9x by scottsk · · Score: 3, Interesting

    Perl 6 reminds me of the super-revamped, object-oriented COBOL that came out in the 90s -- by the time this perfect language was created (and it was a decent upgrade, although the OO stuff was so verbose it wasn't funny), COBOL 85 had such a huge installed base that COBOL 9x was irrelevant. The amount of code written to the COBOL 85 standard was immense, and most new development had moved on to other languages. Maybe Perl 6 can escape the Fortran 9x and COBOL 9x trap of being really great languages about a decade too late. The biggest hurdle Perl 6 is going to face is its own installed base. It will have to be 100% compatible with Perl 5 to get people with a code base of Perl 5 code to even think about using it. Plus, it needs to have a compelling story to tell. I was excited about Perl 6 five or six years ago.

  34. Re:Too many changes all at once by Lost+Found · · Score: 3, Insightful

    Whenever I hear people saying things like this I think that they really lack visibility or understanding into the language's design process. Granted, the coming-to-life of Perl 6 hasn't been the quickest miracle we've seen, but I'm a hundred thousand percent positive that its being done in the best possible manner.

    Think about it. Larry Wall accepted numerous RFCs from programmers of all walks, discussing Perl's problems / desires for new features / suggestions for new implementations / ideas how to change the syntax. He commented on each one, indicating whether (1) he agreed with the problem, (2) whether he agreed with the solution, (3) what, if anything, he thought should be done about it.

    In the mean time, a radically new language glue system is introduced - Parrot. Perl had such wild success with XS - granted, Parrot isn't just about making language A talk to language B, but it's certainly an example of natural evolution.

    As for Pugs, it's been fantastic. It's allowed lots of people to write real and working Perl 6 code (including lots of tests) to evaluate all aspects of the Perl 6 design before it goes into production.

    Now, I'm not addressing you directly with this last part; rather, a greater community of Slashdot trolls. If you don't feel like Perl is for you, or if you feel like Perl is no longer for you, fine. Find your way to Ruby, Python, Java or whatever floats your boat.

    But please, it's getting really goddamned irritating to have to sift through the comments of a handful of armchair morons that sit at home, interfacing with something called "comments.pl", eating doritos and talking about how the greater Perl community should just drop everything and go to language X, or repeating a tired meme about how the language is making no progress at all (when all they need to do to see the massive progress is read Audrey Tang's blog or visit pugscode.org). And then, there are some mods that feel it appropriate to mark clueless jabs as "insightful".

    I am thankful of one thing - Perl's momentum. While everyone else is barking about how (name my scripting language) is great this week for doing web pages or some nonsense, there is still a huge community of devoted, bleeding edge language researchers and smart people, chisel in hand, forming Perl 6 from the rocks.

    And while the naysayers are switching languages once a week as they make incremental advantages over eachother -- while they're totally clueless that so many of the 'advancements' in their own languages over the years have been 'borrowed' from or 'inspired' by perl, the aforementioned language scientists are preparing to do once again what Larry Wall did, intentionally or not, when he released Perl on the world - bring about a revolution.

  35. Just one question by Dasher42 · · Score: 2, Interesting

    Will Perl 6 finally end the sheer madness of allowing a function to use loop control statements like next and last to meddle with the loops in their calling functions?

    Some of us have predecessor's code to use and maintain that do the darnedest things, you know. A bit of protection from the madness of others, that's all I'm asking for.

  36. Actually, I found an example of what you mention by 5n3ak3rp1mp · · Score: 2, Informative

    I believe that this is what you are slandering on about, and this is one possible workaround.

    I asked around in #ruby-lang about this, and this is not only the #1 bug in Ruby, it will be fixed in 2.0.

    If you had a more concrete broken-lexical-scoping example, please feel free to provide.

    In the meantime, if this is the biggest Ruby bug, I'm planning on sticking around for sure ;) The readability alone is a huge win over other languages (IMHO).

  37. Re:Too many changes all at once by Junks+Jerzey · · Score: 2, Insightful

    Did I say everyone should drop Perl 6? To the contrary, I said I was looking forward to it.

    I think you're in denial of what's gone wrong with the P6 process, regardless of how great a language it may be five years from now. You don't develop a language by soliciting opinions and letting things pile up for years without prototyping anything. You certainly don't throw out everything on every level all at once and start up an independent project to develop a virtual machine for an undefined language. Mr. Tang has done things the right way. He wrote a very simple, very straightforward prototype and has been iterating it ever since. Were it not for him--arguably a random hacker--there STILL wouldn't be any kind of P6 prototype.

    The P6 process should have started with a simple, high-level testbed for Perl ideas.