|
> a lot of the community has wandered off to other 'cool' languages and frameworks I am just one such. Half my career was writing Perl. But these days, most of my work is in Ruby and as a longtime fan of Erlang (but never having had the opportunity to use it in production), I'm taking a long look at Elixir+Phoenix. This tutorial wasn't enough to entice me back to Perl, and I'm wondering if there is anything at all that could. In general we choose a language for their applicability to the problem domain. The focus on text manipulation in Perl 4, and then extension of this with an object framework in Perl 5, made it a shoo-in in the 90s and early C21 when we all needed form parsing, HTML template stuffing, and email mangling tools. In these days of dynamic DOM manipulation and event-driven microservices, it doesn't seem so relevant; whilst Node and Go and Elixir look entirely on point. If you go look at the Perl 6 FAQ, there's a section, "Why should I learn Perl 6?". It lists a grab-bag of language features, rather than a set of problems that Perl 6's new design can solve. As a result it feels much like a solution in search of a problem. That wasn't even ever true of JavaScript, even though JS took years to come of age. If I was designing a language today, and I am not, but if I were, I would look at how dominant Java seems to be in the big data community and try knocking it off that perch with appropriate language primitives, constructs and libraries. It seems to me this is the modern problem domain homologous to the bulk text mangling for which Perl originally became famous. |
Promise combinators are built into the language to provide composable concurrency. But unlike using something like Q in Node.js, you can truly perform tasks across promises in parallel (and with static typing to boot!)
Perl 6 has channels for when you want Go style semantics, but you also have Supplies for when you want their dual: instead of pushing events through channels you pull them reactively. This allows you to write highly declarative code; see https://gist.github.com/muraiki/222814d5928f648be3c1
I think that P6 will also be awesome for data munging. Here's a pipeline that processes text from a file with 4 parallel workers.
Since the operations are done in scalar context, they essentially operate lazily, pulling one value through the chain at a time. The pipeline is only activated once coerced to list context at the end, and only enough values as are required to find the 9th match are processed.I've used Elixir before. It has some great features and having the power of BEAM and OTP is quite awesome. But sometimes the actor model is not what you want. I think that Perl 6 will be not just a great glue language, but also a powerful language for writing multi-paradigm applications that meet the demands of modern systems.