Perl 6 is fixing 20 years of problems

The must-have features for Perl 6

The must-have features for Perl 6
Image by : 

opensource.com

Perl 6 came out in general release around Christmas 2015, and since then I've heard a lot of questions about it, both from people in and out of the Perl community. Jeff Goff is a longtime member of the Perl community and a good friend who's been heavily involved in Perl 6 development, so I asked him a few of the questions from what I've been hearing others ponder.

Jeff has been speaking on the topic at conferences this year, including the upcoming OSCON London event. Get the inside scoop from my interview with him.

What's something about Perl 6 you wish everyone knew?

Mostly that Perl 6 is out there in production, and they're fixing 20 years of accumulated problems. Plus, Inline::Perl5 lets you run all 170,000+ Perl 5 modules while letting you get on with new Perl 6 development.

What are the must-have features for Perl 6 that have not already been backported to Perl 5 in one form or another?

Concurrency and complete Unicode support.

New users are continually enabling threading and running into issues involving the multiple-interpreter model, then they come into a support channel and are told "Don't do that." Perl 6 supports more of the full Unicode spec than pretty much any other language out there, and while Perl 5 is already ahead of most other languages, with a few hints from Perl 6, it could take over.

Subroutine signatures as of 5.18 are already good enough for regular use. Moose and its kin take care of Perl 5 along with roles and proper inheritance. And while there isn't yet a module that ports Perl 6 grammars back to Perl 5 faithfully, the features that really make the grammars work simply can't be backported to the Perl 5 core. Junctions and hyperoperators can be emulated, but the lack of strong/gradual typing makes it hard to port, and that was a reason why the ~~ operator got pulled from perl5 after being in for a few versions.

For your own coding, what feature of Perl 6 are you most happy with?

I can finally create proper custom operators, and once my current stack of projects that I want to finish up is sufficiently short, I'm going to add enough APL operators that my equation (see the image below) populates the @primes array with the prime numbers from 2 to 97. I've been doing a lot of work with grammars as well, but I have plans that merge custom operators and the ability to redefine Perl 6's own internal grammar, so I'm having fun with both.

My Perl equation

Should large companies stay with Perl 5, or is there a path for them to a switch to Perl 6?

I'm betting that Inline::Perl5 and Perl 5's companion Inline::Perl6 modules, along with tools like BlueTiger and Perl::ToPerl6, are going to be the way to migrate to Perl 6 in the long term. I've already successfully migrated most of Dancer2's test suites to Perl 6 with the help of Perl::ToPerl6 and Inline::Perl5. Using those tools I can launch a brand new Perl 6 application that uses the original battle-tested Perl 5 modules, and gives users an upgrade path by letting them replace one Perl 5 module at a time with its Perl 6 equivalent. (Full disclosure: I'm the author of Perl::ToPerl6.)

Why did you get involved in Perl 6? You've been a part of the Perl community for quite a while.

"Quite a while" is a bit of an understatement. I think I wrote my first Perl code back in 1996 or so? So 20+ years off and on.

I was originally involved in Perl 6 when it was called Parrot. I took over release management duties from Simon Cozens in 2002 or so. The company I was working for at the time allowed me to spend one day per week working on Parrot/Perl 6, and when that company folded, so did the free time I had available.

Fast forward to 2013. I started reading about what was coming out of the Perl 6 project, starting with proper subroutine signatures, moving on to built-in parsing tools, and hints at a proper macro facility (which we're still working on and my latest tool is addressing). Having proper multicore and concurrency support doesn't hurt either. I've spent enough time in the Perl 5 space to know what trips newcomers up, especially with regards to what these dollar signs are doing all over the place, and why subroutine calls still look like they've just woken up from a Bash-induced dream.

People needed to know about these features, but I wasn't seeing much communication outside the Perl 6 forums about it. It wasn't anyone's fault really. Social media sites are now imposing their recommendation "algorithm" on the population as a whole. ("You looked at pictures of cats? Great, talk to these people that like cats!" And the users just click share and never venture outside of that silo.) And there were some people delivering papers with information at small conferences and sharing ideas outside the Perl 6 group. But I saw room to grow that, to open up things to a wider field.

11 Comments

Chankey Pathak

I really wish some big organization (like Booking.com) start sponsoring Perl. We have done so much with just contribution, imagine the improvements when it starts getting some attention.

Vote up!
1
Vote down!
0
druthb

Chankey,

Both Perl 5 and Perl 6 have benefitted from sponsorships from companies like Booking.com, Craigslist, LiquidWeb, and cPanel (where I currently work), as well as numerous sponsorships from smaller companies and consultancies around the world. Even more would be nice, of course, and if you know of a company that's a heavy Perl user and would like to help sponsor Perl development, get them in touch with The Perl Foundation at http://www.perlfoundation.org!

Vote up!
1
Vote down!
0
Larry Sherwood

Ruth-

Without, I hope, sounding utterly churlish (and therefore highly unPerlish), I would like to note that I have twice given small amounts of money to the Perl Foundation. Ok, I can't be a sponsor, but it's the thought that counts, right (well, no, I know, but ...). Neither of my contributions received a simple "thank you".

Small contributors should not expect adulation, but I think a simple "On behalf of the Perl community ...." would be appropriate. I would even be willing to take on that chore for the good of the cause. Ok, I'll slink away now ....

Vote up!
0
Vote down!
0
Jeffrey Goff

Ofttimes it's just a matter of asking. As others have been pointing out there's a lot of support for Perl out there, but its users tend to be a less vocal bunch than the Python or Ruby gangs. It's time to start changing that, and even though I'm personally a serious introvert, I'm trying to get out there and if not lead the way, at least show people that it can be done.

Vote up!
0
Vote down!
0
prairienyx

I love Perl 5, but we're developing curriculum materials to help get kids and teens involved in learning Perl 6 coding. My rationale is that the "fixes" to the language will be worth it for people starting new with coding. The Perl community needs to nurture new interest, but most people experienced with UNIX and Linux get around to discovering Perl eventually. :-) It would be nice to see more paths to be exposed to Perl 6 early on!

Vote up!
0
Vote down!
0
druthb

Prairie, as I pointed out in my article on CoderDojo last year (https://opensource.com/life/15/9/coderdojo-technology-skills), y'all are absolutely crucial to helping grow the next generation of developers. Keep up the great work!

Vote up!
0
Vote down!
0
sethkenlon

First I'd heard of Inline:: modules. Thank you!

Vote up!
0
Vote down!
0
druthb

You're very welcome!

Vote up!
0
Vote down!
0
Jeffrey Goff

You're welcome. Having migration tools available for people that want to make the sideways move from Perl 5 to 6 is important, and one of those tools is the ability to reuse existing code. By way of example, Perl 6 has the Bailador framework, which is kind of a clone of Dancer2 in Perl 5. The thing is that lots of (in fact I'd say almost all) people use Template Toolkit for generating their HTML content. What I'm going to do once I finish up the *current* project is do a wrapper around Template Toolkit that lets Bailador users use their current .tt files in Perl 6+Bailador, without having to resort to the existing Template6. Template6 is great, and while it fulfills most of the needs that a TT user has, you need to rewrite your existing Perl 5 .tt files, and that's going to hinder adoption. So I'm going to wrap TT first, then finish the complete Perl6 replacement I'm working on.

Vote up!
0
Vote down!
0
Nigel Hamilton

For those interested in learning Perl 6 there is are lots of resources at: http://perl6.org

Vote up!
1
Vote down!
0
Olivier

APL operators in perl? Be still my heart! Would you say that a full implementation of APL or one of its derivatives (A+, J, K) with Perl6 as the host language would be possible?

Vote up!
1
Vote down!
0