Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by Matts (1087) on 2002.04.23 9:53 (#7379) Journal
    Yes, I knew it was coming, ultimately Larry's plan is merely to encode regexps as XML! This will make things so much easier in porting from Perl 5 to Perl 6. No longer will you need uglinesses like:

    /^
      (\d+)        # id
      (T?)         # TP
      _
      (\d+)        # SeqNo
      X
    /xg


    And instead we can have beautiful XML regexps like:

    /
      <start-of-string/>
      <capture>
        <one-or-more>
          <number/>    <!-- id -->
        </one-or-more>
      </capture>
      <capture>
        <optional>
          <string>T</string>  <!-- TP -->
        </optional>
      </capture>
      <string>_</string>
      <capture>
        <one-or-more>
          <number/>        <!-- Seq No. -->
        </one-or-more>
      </capture>
      <string>X</string>
    /xml

    (and yes, I'm just kidding)

  • by hossman (2110) on 2002.04.23 12:31 (#7391)
    Is anyone else concerned that just as the rest of the programming languages in the world are getting arround to including regex support in the core language (or core libraries), and doing so by adopting the exact same syntax as "perl regular expressions", perl regular expression syntax is changing?

    I mean, it's the nature of things to change, but we're not going to win over converts from other languages if they have to learn all new regex syntax to use perl 6.

    • In other words, Perl's regexps drive the other languages' implementations.

      Note that the new syntax is also there to allow more powerful, BNF-like, constructs.

      • In other words, Perl's regexps drive the other languages' implementations.

        Yes, but if all those millions of young'ns out there that only know java, and are just now learning the wonders of regexps read about "Perl regular expressions" in their javadocs, and then try to use perl6 and discover that the syntax has completely changed, they aren't going to be eager to figure it out.

        Note that the new syntax is also there to allow more powerful, BNF-like, constructs.

        Don't get me wrong, I'd love if if Perl ma

        • In other words, Perl's regexps drive the other languages' implementations.

          Yes, but if all those millions of young'ns out there that only know java, and are just now learning the wonders of regexps read about "Perl regular expressions" in their javadocs, and then try to use perl6 and discover that the syntax has completely changed, they aren't going to be eager to figure it out.

          They'll cope. :)

          The current regex syntax is past the point where adding new syntax is conceptually feasable.

          Also, if you rea

    • by erikharrison (2764) on 2002.04.24 9:51 (#7458)

      Adding constructs to the current regex syntax has been difficult - not impossible, but the (?x . . .) syntax is incredibly strained. As such the syntax needs a change, and I would argue that since Perl is so widely known for being innovative in it's regexes that we should be willing to take the plunge to change it, should it be necessary.

      One of the things Larry has pointed out over the perl6-language list is that Perl isn't realy good at writing parsers. We can write lexers and tokenizers pretty well, but true parsers are non trivial. This is a strange weakness for a text processing language.

      The angles getting new uses enhances Perl regexes wihtout breaking to much. Newbies Perl 5 regexes will port with only some backslashes to keep tags kosher, most of the time. If we are worried about the newbies, it should be pointed out that at the basic level regexes do what they always did. /start(.*)stop/; print $1; still does what we expect. Few languages offer 'Perl compatible Regexes', but plenty offer 'Perl like regexes'. We're gonna have to teach the Java Junkies they can't && their character classes anyway, so why not teach them about angles?

      All in all I find that interlanguage communication shouldn't be a reason to disapprove of Larry's changes. The only case where I'd be worried is Python, and that is because Guido himself asked p5p about whether or not certain syntax would be used so that Python could extend Perl's regex abilities a little. Since they are the only ones that asked, they're the only ones I'm worried about. As I said before, if everyone agrees that Perl is king of regexes, then we shouldn't let that fame prevent us from enhancing our regex syntax and ability.

  • Why is this new language being called Perl at all? Exactly what is the relationship between Perl 5 and Perl 6, other than their creator?

    I haven't read all the docs by Wall and Conway, but from what I have read, none of it looks like the perl I know and love.

    Why not give a wholly new name and make a clean break?
    • Having done a chunk of non trivial perl 6 coding (A Scheme Interpreter), I can tell you that it 'feels' like Perl. My general feeling was along the lines of "Why can't I do this in Perl now", and not just for the // operator. given/when, the new subroutine prototyping rules, lexically scoped subs and all the rest just felt right.
    • Hmmm. I've had this argument several times.

      I've argued that this language is still Perl in the sense that the code (as Piers says above) still feels a lot like Perl. Remember that the stuff always being talked about are the differences not what has stayed the same.

      I've argued (recently, with limited success) that Perl 6 is Perl because Perl is the community and the devlopers, not any one bit of software or code.

      However, I've also argued quite a lot that maybe it should have a different name (if just


    • from what I have read, none of it looks like the
      perl I know and love.

      The Apocalypses and Exegeses can easily give that impression. But so can reading perldelta for any particular release of Perl 5. And the reason is the same: those documents are all about what is changing, and rarely mention what is staying the same (because then they'd be 10 times longer!)

      But Perl 6 really is Perl. It feels like Perl to program in, and most of its syntax and semantics are identical to those of Perl 5.

      It's like the

      • If you're interested in seeing just how similar Perl 6 is going to be to Perl 5 in most cases, check out ...And Now For Something Completely Similar [samag.com]

        Good article. It eliminated my trepidation about perl6. Now that I have a new eye to the changes, I'll have to read the Apocalyse and Exegesis docs in earnest.

        Thanks!
  • Well, since I submitted this beast, I might as well follow up.

    Some of the more interesting things on the list recently:

    * Precedence will be a property that you can manipulate for your subroutines.
    * String interpolation will likely get some kind of overhaul based on the results of the regexp work.

    There's a lot of other stuff, but I have work to do ;-)

    --
    Yet Another Just another perl hacker, // essays.ajs.com