Perl6 is a big language, but has a lot of power and beauty.
Perl6 is a big language, but has a lot of power and beauty.
Today, while those two things are still slow enough in Perl 6 I wouldn't make Perl 6 my primary language for doing them, I can't even remember the last time I wrote a script in Perl 6 and it was too slow to be usable.
Mind, I think Perl 5 is still faster on things Perl 5 was super-optimized for -- regex processing, for instance. But on a normal week, I throw together a couple of quick Perl 6 scripts to get stuff done. It's usually a joy to program in and execution speed just hasn't been a problem for me.
>Perl 6 performance has now gotten to the point where it's often comparable to Perl 5 or surpasses it. It still needs some work in this area, but the work is clear, the goals are straightforward, and Perl 6 is going to easily oustrip Perl 5 in terms of performance.
I hope it's true. Perl was a great language that was ahead of it's time. Eg, most complaints about Perl boil down to needing an equivalent of PEP8 and a linter.
Yea... libraries are always good (especially for math and analysis), but I find that powerful languages need far fewer libraries to get things done. APL can do something with a few characters that might commonly be implemented as a lengthy function or library in some languages.
Windows Powershell can surprisingly do a lot of what Perl 6 can do and people mostly understand the limitations. You can automate processes, build your own DSL, have full OO support, full .NET interop, concurrency, you can pipe data around kind of like with FP...etc. It doesn't have some of the more perlish features though.
I wonder if the JIT will interfere with scripts where startup time is not acceptable?
But if you actually wanted to get the job done idiomatically, the code is one short, simple line of Perl 6. The performance, while admittedly slower, is within the same order of magnitude as your Perl 5 version.
To me, this is the magic of Perl 6. Sure, if you want to use 16 lines of loopy integer-crunching code to calculate the first N primes and you care about speed, Perl 6 should not be your choice. On the other hand, if you'd prefer to say
(1..$N).grep(*.is-prime)
and get the answer back in reasonable speed, Perl 6 is perfect.