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

6 of 234 comments (clear)

  1. Perl's had it's day - It's become like COBOL by ajm · · Score: 3, Interesting

    For instance there is now OO COBOL but the only people that use it are COBOL programmers who are stuck, perhaps because of their company's dictates, perhaps by choice, with COBOL. In the same way perl may be heading towards irrelevance wrt "mainstream" language. I've written commercial perl in the past, it was a pain then and it's still a pain now. The thing is that now there are alternative languages in the same space (python, ruby etc., php for web side) that do the "perl thing" better than perl.

    Perl was great, it introduced many people to programming, just like COBOL did. But now it's time to move on. To move on to languages that learnt from perl, that improved on it, that don't have to drag around a syntax and culture that values neat tricks and trying to guess what the programmer really meant over providing the needed building blocks and letting you build code that does what you say, not what it thinks it heard you say. Or even, dare I say it, to move on to languages outside the perl family for some programming and choose the right tool for the job for a change.

    I'd prefer to think of this as provocative rather than a flame, there is a difference you know.

    1. Re:Perl's had it's day - It's become like COBOL by kisrael · · Score: 3, Interesting

      As a developer who has done a reasonable amount of Perl and Java, the choice of when to use one or the other is becoming more and more interesting.

      Sometimes, it's just a matter of environment: the places I host my websites have Perl available, (sometimes Java, but it's more of a pain) so that tends to be my first choice.

      There's a lot to be said for the convenience of Perl. Edit code, save, and run has benefits greater than you'd expect by just seeing that edit, save, compile, run is one extra step. (And pushing that one step further, the sheer # of files is one of the things that's a huge drawback to EJBs...)

      And of course there's what the language makes simpler. I know there are Java classes that give it full Perl regexes and the like, but somehow they seem evil to me. I don't like to go crazy with the Perl syntax shortcuts, but being able to so easily open up files and the like, and not have to jump through hoops to read a line at a time...there's a lot to be said for that.

      On the other hand, OO in Perl is pretty disgusting to anyone who grew up with objects in C++ and Java. It even makes PHP's object syntax look normal.

      So, in the end, I don't know. It certainly seems easier to sell my Java skills in today's ugly jobmarket, and it certainly seems easier to update my personal websites in Perl. For now, I guess I'll be keeping up my skills in both.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  2. recursive regular expressions by Saint+Nobody · · Score: 3, Interesting

    this guy has been doing some interesting work on the regex engine. he's added functionality so that you can have recursive regular expressions without the clumsy postponed subexpression ("(??{...})") mechanism. on the one hand, it's far less readable that way, but on the other hand, you don't have to predeclare a variable for every production rule in your grammar.

    and the current system is even more convoluted since the postponed subexpressions are evaluated in the environment in which they are checked, not where they were declared. this means that all variables referenced when you built the regex have to be in scope when you use it. that's a restriction i'd like to do away with, although i'd rather see it done by making postponed subexpressions support closures.

    as i recall there's also an rfc for perl 6 on the perl site to make a stack-based regex engine rather than stat-machine-based, so that it could support CFGs, but i don't think it specified how it would work syntactically.

    --
    #define F(x) int main(){printf(#x,10,#x);}
    F(#define F(x) int main(){printf(#x,10,#x);}%cF(%s))
  3. 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.

  4. Re:Just what Perl needs by GoRK · · Score: 3, Interesting

    Hmm PHP. Talk about a language that breaks things between versions! #include behavior was changed between two revision numbers!

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