Slashdot Mirror


Apocalypse 5 Released

Simon Cozens writes "The Apocalypses are Larry Wall's explanation of the design of Perl 6. In Apocalypse 5, Larry turns to redesigning regular expressions. He set out to intentionally 'break' a lot of the regular expression culture we're all used to, and these are the results - and they're mindblowing."

10 of 234 comments (clear)

  1. Regex by inflex · · Score: 4, Insightful

    Why do we always have to keep changing regex [and many othe things]. Isn't enough that we have to learn one format for almost every language. Sure, there are perhaps easier ways to express certain logic situations, but over all, do we /need/ another regex format?

    1. Re:Regex by jaffray · · Score: 5, Informative

      Yes, we do need another regexp format. Larry spends several pages explaining why, if you'd read the article.

      Furthermore, 80% of your existing Perl5 regexps will work unchanged in Perl6. *, +, *?, +?, (), ?, all unchanged. Most of the backslash-letter character classes, unchanged. Dot and ^ and $ are the same for most purposes, trivial to port when they aren't. 80% of the remaining cases can be ported by changing [] to <[]> and escaping spaces or replacing them with \s or \h (which they often should have been anyway).

      I'd rather spend half an hour every fifteen years to learn something new than put up with the inferior old scheme for another decade or more. Unreadability of regexps is one of the biggest complaints people have about Perl, and this addresses those concerns head-on.

      (Incidentally, people made all these same complaints the last time Perl changed regexps, when Perl5 came out. And now virtually every other popular language has recognized that the Perl5 design is better than its predecessors, and has adopted a Perl-compatible regular expression syntax or library. Larry's got a pretty good track record here.)

      (BTW, the preceding incomplete post was a slip of the mouse. Mods, please kill it.)

  2. Breaking expressions by somethingwicked · · Score: 4, Funny

    He set out to intentionally 'break' a lot of the regular expression culture we're all used to

    I hope he can break "Don't go there" and "Talk to the hand" There are many others, but this would be a good start

    --

    ---"What did I say that sounded like 'Tell me about your day?'"---

  3. Apocalyptic numbering by distributed.karma · · Score: 4, Funny

    So, when Perl 6.final is released, will the release notes be called "Apocalypse.Now"?

    --

    --
    If you moderate this, then your children will be next.

  4. New regexes by Dacmot · · Score: 5, Insightful

    The new perl 6 regexes are crazy. They seem "weird" and awkward compared to the perl 5 ones... but then again I thought the same when I started learning perl (at version 5.6).

    A lot of this makes a lot of sense however, especially the default /x to allow for easier reading of code and allow for comments inside the regexes. Some of the new features make the regexes a bit longer to type, but in general they are significantly smaller. There's also a much better and more consistent use of different types of brackets. Not having to look at the end of the regex to understand the whole thing is going to be great. I hate having to skip the regex to look a the flags first.

    Brilliant I think. I can't wait for it to come out. I hope they make a perl5->6 translator though :o) I also wonder what the speed of the interpreter is going to be like compared to perl5. Hopefully faster :o)

    Good job Larry, Damian et al.

  5. Great by duffbeer703 · · Score: 5, Insightful

    So now Perl regexs are going to be completely different from every other language and more complex than ever... wonderful.

    I certainly hope that someone is going to be maintaining Perl 5. I certainly cannot see the Perl community moveing en masse to Perl 6, or whatever they decide to call it.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
  6. One thing that I'd like to hear about with this... by AltGrendel · · Score: 5, Funny

    ...is if Cmdr Taco is going to upgrade slashcode to Perl 6 and what he thinks of all this re-write of Perl.

    --
    The simple truth is that interstellar distances will not fit into the human imagination

    - Douglas Adams

  7. Re:Perl's had it's day - It's become like COBOL by ekidder · · Score: 5, Informative

    We use perl pretty much exclusively for my work (telecommunications company). It's not that we have inertia (in fact, the company standard is Java - ack), it's that we LIKE perl. It has the right combination of features that makes just about everyone in the group happy.

  8. Perl parsing Perl by dannyspanner · · Score: 4, Interesting

    I've read comments by Larry to the effect that Perl is great at writing lexers but not parsers. If you look at some of the later examples (around page 11) it's clear that he's trying to make Perl regexes powerful/clear enough to parse Perl. They remind me of yacc/bison, which makes sense.

  9. Perl gives you by nullard · · Score: 4, Interesting
    Perl IS awkward and crazy. I've never understood the attraction to it. The few times I've had to dabble it in, it's just been frustrating, limiting, and ugly as hell. Bleh. I wish someone could explain it to me.

    It's not that perl is akward. It's a language that lets you code in a number of different styles. It gives you the freedom to code your own way. This does reduce readability, but it greatly increases speed of coding. If others need to read your code, just set up style guidelines.

    I use perl for just about all scripting I do on my system. Just a moment ago, I had to read an html file over http, but there were no line breaks. I just needed to get one piece of information, so I did this:
    GET url|perl -ne 's/</\n</g ;print;'|less
    Sure it's unreadable, but it did the job. If I'd been writing CGI, I would've been more verbose since terse perl code can be difficult for even the author to understand by reading it.

    perl gives you lots and lots of freedom. This is not a bad thing, but it is dangerous. Other languages force you to work in one way.

    Think of a bike. A bike w/ trainig wheels makes it hard to fall over, but your agility is reduced. perl has no training wheels by default. You can write really nasty code that works but is unreadable. Perl is anything but limiting.

    If you want more structure to protect you from yourself, try running perl the -w option and put "use strict" in your scripts. If you want pretty built-in identifiers, try "use English"

    I've been coding for so long that the restrictions built into many other languages just get in my way most of the time. I like the way perl never gets in my way.
    --


    t'nera semordnilap