It’s time for that perennial event known as the Perl 6 Update. What will Larry tell us about Perl 6 this year? He probably won’t be announcing a release date (we should be so lucky). Unfortunately, Damian Conway couldn’t be at OSCON this year, so this session won’t be nearly as entertaining as it has been in years past. On the plus side, Larry informs us that Damian did write the slides… now he just has to interpret them.
New features include adverbial typing, such that class and module names can include adverbial modifiers. These specify things like author, authorities, and versions. The syntax is a bit scary, but they can be aliased.
Perl 6 now has inline comments (yay!). It’s typically Perl, too. The syntax is #{inline comment}, instead of the usual C-like syntax.
Wait, what’s this? Built-ins no longer default to using the $_ variable? How will I write confusing code now?
The zipper/yen operator has been renamed to Z. This is good for me, as I’ve never been very good at memorizing Vim’s digraphs.
The min and max operators now have infix versions. Strange at first, but it looks like it could be useful in some situations ($foo min= $bar).
Ranges are really lazy. So lazy they can be unbounded: for $i (1..*)... (to infinity and beyond!).
The power of the new file test operators demonstrate quite well how useful Perl 6 will be. It takes TIMTOWTDI to levels few Perl coders could ever have imagined.
There’s a MAIN subroutine now. It’s like we’ve stepped back 30 years to be C programmers again. The power it gives the programmer to define command line processing is very cool, though. Perl 6 will even call USAGE for you, if you’ve happened to define it.
Perl 6 has real repeat (do..while) loops now. Real, as in all the loop control statements work.
As if postfix control statements weren’t confusing enough. Now they can be nested! say $foo if $bar while $baz. Actually, I can’t tell you how many times I’ve wished for this.
Continuing the theme of parallelism, Perl 6 will make it easy to parallelize map and even do atomic locking on serial statements. I appreciate that Larry managed to change his slide to mirror what Simon Peyton Jones talked about in his keynote this morning. Very apropos.
Fixed-length arrays? Seriously, what is this, Java? Well, at least it allows you to define array bounds as “eh, whatever.” I especially like the “whatever whatevers” operator (**).
POD lists are dramatically cleaned up. Thank goodness. No more =over or =back. Nested lists! Tables! Bigger! More markup! Better! Includes! More awesome! Really! Useful! POD!
Honestly, I can’t wait to move to Perl 6. I can already see a lot of my code getting a lot shorter. Imagine, entire job control systems that fit in one screen of code!
Fun stuff. If you want to experiment with perl 6 now, check out pugs (http://pugscode.org)
A lot of the things spec’d haven’t been implemented yet, but it’s a good way to get a feel for it.
Pingback: OSCON 2007: Perl 6 Update, by Larry Wall :: canspice.org