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.

About the author

D Ruth Bavousett
Ruth Holloway - Ruth Holloway has been a system administrator and software developer for a long, long time, getting her professional start on a VAX 11/780, way back when. She spent a lot of her career (so far) serving the technology needs of libraries, and has been a contributor since 2008 to the Koha open source library automation suite.Ruth is currently a Perl Developer at cPanel in Houston, and also serves as chief of staff for an obnoxious cat.