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."
It does kind of feel that way. Since all previous versions have worried much about maintaining backward compatibility, a lot of new stuff has been added without removing the old stuff (merely deprecating it). Because of the "history" behind things. With Perl6, though, they're ripping everything apart and rebuilding it from scratch, using the experience and wisdom that have been gained over the years. What was good and we'd like to keep? What was bad and should be done away with? What was a nice concept but implemented poorly? These are the questions the designers are asking themselves. I think something people are dreading is that since this is a total rewrite, looking more towards Doing It Right than making sure it still works like it used to, there will be much to relearn. But personally I'm glad they decided to do it this way, because it means they can do exciting things, and get rid of annoying things, and not have to worry about the compatibility. In the end, I think it will turn out to be a much cleaner, more consistent, more powerful, and even friendlier Perl. It will be like a breath of fresh air, and each Apocalypse gives more to be excited about.
--
Promoting critical thinking since 1994.
I think a syntax change is necessary - this new stuff is so NOT _regular_ expressions. If you want a regex, use the Perl 5 regex constructs (although technically they're far from regular too).
This is standardising cutting-edge (even compared to most lisp + prolog AI-related parsing stuff, and that's always ad-hoc) parser as part of the standard language.
If you don't like it, you don't have to port it.
There are still people using emacs 18 to edit their files because it's small and it works.
There are still people running Windows 98 to run their games because it works.
Nobody's forcing you to move to Perl 6. That's the beauty of Open Source. Perl 5 is going to be developed for a long time to come. Don't give up hope.
-Dom
couldn't they have been gentler? However, if it lets me handle HTML easily, without having to learn all kinds of packages that do lots of things I don't need, then I'm all for it. John Roth Watch that speed limit sign on the learning curve!
I only had time to skim the article, and anyway it would take anyone a while to absorb all that code. Here's the short summary:
Regex's in Perl have accumulated too much cruft to be called regular expressions anymore. So now they're full grammers.
That's right. Now you can pattern match with a very readable grammer syntax that is easily decorated with Perl code to do parsing. YACC for Perl. You can find packages for this on CPAN, but this is integrated with the language.
No whining about the bad old days of Perl regex syntax for me... now I'm actually excited by the prospect of needing to buy a new llama book.
Except that compatability modes rarely are. And if they are, they're not maintained for long.
Here's why I'm not panicking. I read the apocalypse, and realized that I've never used any of the (?.....) expressions in a regular expression, and I've been Perling for 4 years and have written 2 formal parsing modules, and scads of scriptlets to pull data from very loosely formatted files.
/x flag is improving, but I'm ignoring most of apocalypse 5 (until I find that I need advanced parsing capabilities), relying on the assurances that most of what I do with regexes will be preserved, and happily awaiting topicalizers and hyper operators
I'm glad that support for the
Don't forget, the last one stayed up. And it was the strongest castle in all of Britian.
She sat at the window watching the evening invade the avenue.
You are upset that Perl 6 is changing significantly enough that you feel it could be classified as a different language. And you don't want to learn a new language so to solve your dilemma you are going to learn a different language? :)
The problem is, really, that Perl 5 and Perl 6 are two completely separate languages. You shouldn't even bother thinking about backwards compatibility; the developers aren't. Larry stepped on that before much of anything else.
From what I've read, Regexen are staying _basically_ similar (basically), but Damian Conway being the sick evil bastard he is, they're going to incorporate some higher capabilities into the engine that look an awful lot like his Parse::RecDescent grammar parsing module.
I mean, really, at their base, he's moving around flags a little, making whitespace default insignificant, and tinkering a few flags. It's when he starts making rules and backtracking capabilities (which exist in the current language, in clunky form, as he demonstrated) that it starts getting wacky.
What it comes down to, though, is that noone should be thinking 'Oh, man, now I'll have to port all my perl to perl 6.', because Perl 5 isn't going to die out or anything, just get phased out like perl 4 - left at a stable rev for support purposes.
"Wacky is filling your gas tank with 3-octane gasoline.
Absurd is filling your gas tank with a ferret."
-