Slashdot Mirror


User: cognominally

cognominally's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. Who needs Perl 6 when all languages do regexps? on Perl 6, Early, With Rakudo Star · · Score: 1

    Interesting that someone is talking about regular expressions and mentionning

    > the absence of comparably useful alternatives, something that's no longer the case.

    Other languages have indeed borrowed and extended the regular expression engine without questioning the initial design that is contemporary of the first Unix, with commands like sed. At some point, one has to sit down and redesign a feature set to clean it up and integrate it to the whole. That's the very point of Perl 6 and the grammar syntax is only a part. It may be debatable that the Perl 6 design is great or not. But the regular expression engine is now a full grammar engine. It is used to bootstrap the Perl language so it is the part that has been the most exercised.I don't ever hear someone that has used it saying that the design is unsound.

    "But Perl has often been tagged as a language in which it's easy to write programs that are difficult to read, and it's no secret that regular expression syntax that has been the chief culprit. Funny that other languages have been borrowing Perl's regular expressions as fast as they can..." says Larry Wall in http://dev.perl.org/perl6/doc/design/apo/A05.html

    The problem with all general purpose languages except Perl 6 is that regular expression is a side language or a library. The perl 5 interpreter has to resort to hand-lexing and yacc to parse Perl programs. And you had to use libraries if you wanted to do serious parsing, like Parse::Yapp, Parse::RecDescent or more recently Regex::Grammars.

    Now, contrary to Perl 5, the parser engine is correctly integrated in the language and is used to parse Perl 6 programs which is a good clue to think it can handle very complex grammars.

    Perl 6 is doing just what Perl had done in its time. Concentrating in a coherent whole what was scattered in many places. The price to pay is abandoning retrocompatibility and changing your habits for better ones.
    I agree that the engine is slow, but that is an (early) implementation problem, not a design one.