Slashdot Mirror


Damian Conway Publishes Exegesis 5

prostoalex writes "Come gather round Mongers, whatever you code, And admit that your forehead's about to explode, 'Cos Perl patterns induce complete brain overload, If there's source code you should be maintainin', Then you better start learnin' Perl 6 patterns soon, For the regexes, they are a-changin'. This remix of Bob Dylan serves as an epigraph to Exegesis 5."

11 of 125 comments (clear)

  1. Re:back to school by IpalindromeI · · Score: 4, Informative

    You'll still be able to use Perl5 regexes by indicating a special flag to the regex engine. So you don't have completely jump right in from the start. But from reading Apocalypse 5, Perl6 regexes look to be much much cooler. So you'll probably want to learn them anyway.

    --

    --
    Promoting critical thinking since 1994.
  2. Re:back to school by jomagam · · Score: 2, Informative

    Damian was illustrating advanced concepts in this article. Things are not going to get more complicated if you are a mid level perl programmer and never cared about zero-width positive look-behind assertions. Other good news is that perl6 is not expected to be production ready for at least 4 years; you have plenty of time to become a perl wizard.

  3. Re:skimmed the article by twoshortplanks · · Score: 5, Informative
    1. A regular expression is, and always will be, a way of creating a rule engine/fine-state machine. It's a type three grammer. There are simple maths proofs that can demonstrate this
    2. A finate state machine cannot match XML. XML requires you to have the ability to match the right number of opening and closing brackets (and to do that you need to be able to store the number you've seen somewhere.) This requires a push down automina - a stack machine - a type two grammer.
    3. Perl's "Regular Expressions" have been beond a true regular expression for quite a while now (see backreferences)
    4. Perl 6's rule system - let's dump the term regular expression now - is a further step in this complicated matching.
    5. Matching type two grammers - like Parse::RecDescent can - is a good thing.
    --
    -- Sorry, I can't think of anything funny to say here.
  4. Perl 6 will be largely backward compatible by barries · · Score: 5, Informative

    People--especially FUDchunkers--are missing the most important points:

    Almost all of the most useful Perl5 code of today will be runnable by Perl6 tomorrow: the compiler will fall back to perl5 and the VM is language neutral (even moreso that .NET it would seem).

    In addition to running most perl5 modules as-is, Perl6 matching rules will have a perl5 backwards compatability mode built in so you can continue using the Perl5 regular expressions you know and love from Perl, Java, and everywhere else that's adopted them as needed in Perl6 code.

    Yes, Perl6 is a rewrite and introduces a lot of deep CS concepts and ew syntax, but some care is being taken to assure that most Perl5 code will be runnable as is, while people learn about the power of some of the advanced tools Perl6 will provide.

    Please Don't Panic (or incite others to): the apocolypses and exegises are technical documents, they are not meant to be smooth, easy reading or to reassure today's perlers that their hard won skills will be useful. They're meant to describe what's new and different and usually why. Don't be scared by the new and different, just as with existing Perl, you should be able to adopt the powerful new concepts and syntax as you need to without having to swallow it whole or unlearn everything you already know.

    Perl6 will be stunningly more powerful, expressive, and provide (optionally) the safety features required for average coders to implement large systems while letting experts use extremely powerful tools like closures, continuations, intricate pattern matching that have mostly been accessible in academic languages to this point. And it will still allow convenient scripts to be generated if that's what you need to do.

    Remember folks, other languages can make shitty code smell nice, but it's still shitty code and you wouldn't want to eat^Wmaintain it.

    - Barrie

  5. Re:What does this mean for CPAN modules? by Masem · · Score: 3, Informative
    Elsewhere on this thread, someone posted the relative question from the Perl6 FAQ. Basically, Perl 6 creates a virtual bytecode engine, and the front end interpreter includes one that converts Perl6 to this engine, and another that convert Perl5 to this engine. From a programming POV, the distinction between a Perl6 and Perl5 program will be the inclusion at the first line of code of a keyword in Perl6 that's not in Perl5; if the interpreter sees that keyword first, it will treat the source as Perl6, otherwise Perl5.

    Since most existing CPAN modules lack this keyword they will all run with the Perl5 interpreter. There may be some oddities with modules that use native code or other odd features, so obviously there will be a testing phase.

    Additionally, at least for OOP-type modules, everything you can do with objects in Perl5 can be done to objects in Perl6 (albeit with minor differences in the syntax), so and Perl5 module should work cleanly in a Perl6 codeblock. Obviously, since Perl6 objects have a bit more power, you can't necessarily take those back to Perl5.

    Of course, there will probably be some mechanism to update CPAN modules from Perl5 to Perl6, leaving the Perl5 version in place, but exactly how this is do be done, it's way too early to tell.

    --
    "Pinky, you've left the lens cap of your mind on again." - P&TB
    "I can see my house from here!" - ST:
  6. CPAN will be just fine, thank you by admiralh · · Score: 2, Informative

    Someone asked this very question at Damien's Pel 6 talk YAPC. According to Damien the "use CGI" (or whichever package) construct will tell the Perl 6 interpreter that the package being "use"'d is Perl 5 code. So the CPAN modules will still work.

    --
    Hopelessly pedantic since 1963.
  7. Re:Question about :any modifier by aytekin · · Score: 2, Informative

    Because star can mean 0 to infinity. You are confusing "*" with "+". Plus would have meant 1 to infinity.

    @matches = $str =~ m:any/ah*/; # returns "ahhh", "ahh", "ah", "a"

    @matches = $str =~ m:any/ah+/; # returns "ahhh", "ahh", "ah"

  8. Re:What does this mean for CPAN modules? by gorilla · · Score: 3, Informative
    From a programming POV, the distinction between a Perl6 and Perl5 program will be the inclusion at the first line of code of a keyword in Perl6 that's not in Perl5; if the interpreter sees that keyword first, it will treat the source as Perl6, otherwise Perl5.

    This will be for modules, not programs. A Perl 5 module begins with 'package Acme::Foo;'. A Perl 6 module will begin with 'module Acme::Foo'. This is explained in Exegesis 4.

  9. Re:Ugh by jdavidb · · Score: 5, Informative

    You might want to have a look at this article which highlights some of the ways in which Perl 6 is not changing.

  10. Re:skimmed the article by Anonymous Coward · · Score: 1, Informative

    By the way, it's "Perl," not "PERL.". The language is "Perl," the interpreter (the actual program itself) is "perl." Perl is not really an acronym (that was made up after the fact), so "PERL" is not correct.

  11. Re:Awful lot of fuss around regex by Elian · · Score: 2, Informative

    Things are being taken in order. Each Apocalypse corresponds to a chapter in Programming Perl 3e. We'll get to objects, never fear. They're just not next.