5 ms·
I use perl for new code all the time. It's not a trendy language, so it won't get much coverage on HN, but the language and libraries are great IMO. Also, perl
by joosters 10y ago
I use perl for new code all the time. It's not a trendy language, so it won't get much coverage on HN, but the language and libraries are great IMO.
Also, perl 6 is effectively a completely different language from 'normal' perl (i.e. perl 5.x). The difference between the two is far far bigger than say python 2 -> 3.
As a perl programmer, I see no obvious benefit from switching from perl 5 -> 6, it would be the same as switching from perl to a completely different language. You're not going to be able to take your existing code and familiar libraries with you.
- gkya 10y agoIIRC there's a module for parsing and running Perl 5 in 6. Am I wrong or is it not practically useful?
- gabriel 10y agoI think you mean Inline::Perl5: https://github.com/niner/Inline-Perl5 https://github.com/niner/Inline-Perl5. It doesn't parse Perl 5 and run it inside of Perl 6 though, it just runs the Perl 5 interpreter for you from a Perl 6 program and lets you marshall data between the interpreters. It's a legitimate technique.
- raiph 10y ago> lets you marshall data between the interpreters. To be clear, Inline::Perl5 (and the other inlines like Inline::Python) automatically marshal data. And exceptions. And classes (so you can sub-class a Perl 5 or Python etc. class in Perl 6). Etc.
- Ultimatt 10y agoThere is the v5 project implementing Perl 5 targetting nqp to be compiled inline with a Perl 6 program. https://github.com/rakudo-p5/v5 https://github.com/rakudo-p5/v5 The project has mostly stalled since Inline::Perl5 became so effective. v5 had the issue of being unable to easily support binary XS type modules. Which means it could never support CPAN, unlike Inline::Perl5. It was meant for people to be able to copy their high mental cost algo code into a new Perl 6 project without fuss.
- marvy 10y agoAs someone who knows neither version, I find this surprising. Surely, even if none of your code works, switching from Perl 5 to Perl 6 is much less of a "culture shock" than switching to, say, Ruby or Python?
- ribasushi 10y agoThat's the thing - what OP said is exactly the case. Perl5 is an order of magnitude closer to ES6 than it is to Rakudo.
- labster 10y agoES6 is a language specification and Rakudo is software. When Perl is written in uppercase it usually means the language, so what you said is true but not informative.
- v64 10y agoAs someone who still occasionally has to write Perl 5 for a living, Perl 6 really is a new language. And because Perl 6 isn't as mainstream as Ruby or Python, there is a bigger culture shock when trying to find resources or figure out the "right way" to do things (I know, I know, There Is More Than One Day To Do It). There are big changes to the syntax too that make it feel like less of a successor and more of a new language inspired by an old one.
- cestith 10y agoSwitching from Perl5 to Perl6 isn't completely shocking, but it's not just copying code over to a new project either. Programming in Perl6 back to back with programming in Perl5 indeed feels quite a bit like switching back and forth between Perl5 and Ruby. Everything's similar enough that you have to mind the differences. It's a much different feeling than going back and forth between C and JavaScript or between Forth and Pascal where the syntaxes are so different you'd never try the other way to do something for just a couple of lines.
- cutler 10y agoPerl6 is not, IMHO, a completely different language and I can't understand why the Perl6 community beat this drum so hard. "use <version>;" "my" variables, context awareness, $@% variable identifiers, list emphasis. At the syntactic level Perl6 is very similar to Perl5. OK, it's OO under the hood, unlike Perl5. If it's a completely different language why name it Perl6?
- b2gills 10y agoThe OO part is actually one of the tiniest of changes. You can get basically the same thing in Perl 5 by using Moose. It has signature, and subsignature parsing, built-in concurrency, not to mention over a dozen other features that are not in Perl 5. The main reason it is called Perl 6 is how the project began. It started out as Perl 5 minus a few warts. As someone who well versed in both, they are very similar, and very different at the same time. I like to categorize the differences like this: Perl 4 is to C, as Perl 5 is to C++, as Perl 6 is to Haskell,Scheme,C#,D,Go,BNF... That is Perl 6 brings in features from many diverse programming languages, and combines them in such a way that it feels like they have always belonged together.
- cutler 10y agoPerl was my goto language for over 10 years but I lost my patience with the Perl6 for Christmas meme around 2013 by which time Ruby was a much better proposition. If the Perl5 community had finally found a way to adopt a MOP they might have had a chance of competing with Ruby and Python. I also feel Perl might have had better adoption in web development if the community had rallied round Mojolicious instead of Catalyst. Catalyst's routing via subroutine signatures is an abomination.
- dotandimet 10y agoCatalyst routing isn't via subroutine signatures, it's via attributes, which are similar to decorators in Python and Typescript/ES7+ and whatever other languages have them. Mojolicious is a much younger project than Catalyst, started by the original developer of Catalyst several years after he left the project, So the chronology doesn't work out - by the time Mojolicious showed up, Catalyst was already very well established as the serious Perl web framework. Although for devs who wandered back to Perl from Rails, Node, Python or elsewhere, Mojolicious has a lot to offer.