I used to be a big fan of Perl but it seems to have fallen behind the times, I doubt Perl 6 is enough to catch up.
I used to be a big fan of Perl but it seems to have fallen behind the times, I doubt Perl 6 is enough to catch up.
But I don't really want to give a laundry list of features, because that alone is not a compelling enough reason to pick a language (P6 obviously needs to develop an ecosystem). As someone who appreciates both OO and FP, both static and dynamic typing, P6 really hits a sweet spot. I encourage you to look at Perl 6 as a new language with the feel of Perl but which solves many modern problems.
The jvm startup speed is actually surprisingly good these days. We were experimenting with writing several commandline tools with Scala, and didn't think they would work because of this "well-known" issue. Turns out it was fast enough even to enable letting Scala handle things like the code completion and still have it feel very snappy.
Edit: I should add that there's a Perl 6 JVM backend. While it's not as up-to-date as the default MoarVM, it could also be ready "for Christmas" :)
1) Async. While I was initially enamored of core.async, I've found promise combinators and supplies to be a more useful and higher level abstraction for the type of work I do. I also had huge problems debugging generated core.async code, but maybe that's changed over time. I suppose I could use RxJava with Clojure for supplies, but I have a feeling that it's not really seen as being in the same style. This is also why I'm not as big of a fan of Go as I once was, too.
2) As peatmoss mentioned, startup time. I work at a web hosting company and as you can imagine we write lots of small scripts. Clojure really can't compete in this area.
3) Gradual typing. Perl 6 supports gradual typing, with functions being checked at compile time and methods being checked at run time (the latter was a decision to allow both a powerful metaobject protocol and also easy interop with other languages using things like Inline::Python). I know that Clojure has core.typed, but that's not really what I'm looking for, although I do think it's an excellent project.
A final quality of life difference: Perl 6 has invested a lot of effort into awesome error messages, including things like suggesting a close lexical variable if you mistyped one. While every Clojurist learns to deal with the stack trace o' doom, there's something good to be said about this. :)
Why build something in Perl? The same reasons you'd write something in Python, Ruby, C#, Java, etc:
- Mature tooling - Excellent library support - Code samples written for relevant projects by vendors for their libraries [0] - Experts available
Given the fact that there are a lot of good options, it's probably best to factor in, "Do I like it?" and/or "Would someone pay me for it?". For all the above the answer is yes.
Additionally, Perl 6 is more or less a new language. If it scratches enough developer's itches, it'll likely take off on its own. It's mostly getting flack due to taking forever and Perl 5's perceived lack of sex appeal. I think if you frame your question with languages like Lua, Haskel, Schema, etc you'll find a good set of answers from users in each community.
[0] https://www.elastic.co/guide/en/elasticsearch/guide/current/...
> There are quite a few Perl shops in LA writing new code
These include Broadbean (in Irvine) and ZipRecruiter in central LA.TicketMaster used to have a Perl codebase but I think the murmurings I've heard point to them having switched everything to Java.
ps: I found this talk pretty convincing about pragmatism https://www.youtube.com/watch?v=lpu-3UF_b48
One interesting thing Larry mentioned related to that long term view was that due to Perl 6 being a multi paradigm language, it could potentially become the defacto teaching language in academia, because it fulfills the roles of OO, functional, procedural, and logic programming in a single package. Eventually, that new generation of Perl 6 learners would go on to form startups and create bigger and better things. I'm not sure if this will come to fruition, but I think it's certainly worth keeping an eye on.
By that logic we should just stick to assembler or C. You can built anything in C, if you really wanted to.
Perl or any other language, remains relevant as long as there are system depending on it and developers who use it. I view Perl a little like Cobol, you and I might not see it every day, but for a rather large, and perhaps a little obscure, subset of people it's still the tool they use every day.
If you have 10 Perl developers employed already, it might be a wasted of effort to retrain to Python, Node, C# or what ever, and just do you next project in Perl 6.
The biggest threat to Perl 6 might be Perl 5 though.
>What would you build in Perl today that you wouldn't build in another language instead?
You could turn it around too: what could you build in another language that you couldn't build in Perl? Well, nothing really. It's a matter of taste, and I think what continues to set Perl apart is its syntax, which could be really good and readable when you don't try to do code golf.
print "match" if something =~ /thing/i
Captures with $1 etc. are there as are named captures using the same syntax in the regex.
But this thread really ought to be focused on Perl 6.
In Perl 6 one can write:
print "match" if something ~~ /<thing>/
It looks superficially similar. But it's a scalable parsing feature, not a mere regex. That line of code will work when `something` is ten thousand lines of complex Perl 6 code and `thing` is the top rule in a grammar for parsing Perl 6 code.Perl 6 is not Perl 5.
In both Perl 5 and Perl 6, smart match (`~~`) with a regex on the right hand side is just an alternate spelling (Perl 5) or correct spelling (Perl 6) for `=~`. It's a tiny, trivial difference.
But a Perl 6 "regex" can be an arbitrary full blown parser or compiler. And it assumes character=grapheme. In these two regards, as in several others, Perl 6 is quite unlike Perl 5 and other langs that adopted Perl 5 regexes and/or that adopted Unicode codepoints (or worse) rather than graphemes as their fundamental "character" unit.
I'm also curious in which type of application regex is so important that it will be a deciding factor of language choice. I mean, if you have a regex in one out of 100 files, does it really matter if you have to write 2 lines instead of one.
I mean, yeah. We're all going to be using Node.js in another year or two. But that's because our industry is bloody ridiculous. Not because Perl is ill-equipped for the "modern" age (People raving about MVC, the actor model, and promises in 2015 is tiring)