4 ms·
If Perl6 is ever performant, I'll be dropping Python for a lot of Scripting uses. Perl6 is a big language, but has a lot of power and beauty.
by 6thaccount2 7y ago
If Perl6 is ever performant, I'll be dropping Python for a lot of Scripting uses.
Perl6 is a big language, but has a lot of power and beauty.
- petre 7y agoYeah too bad it's slow. I write Perl 5 code at work on a daily basis and really wanted to like Perl6. Too late, too slow.
- 6thaccount2 7y agoLizormato and some other folks have put in hundreds of performance fixes...I think these things just take time. The language might have been in development and design since the 90's, but it only just got to 1.0 or a "stable release" in 2017 I think. I'm surprised Larry Wall hasn't written a Perl6 book yet. Plenty of other authors have, but I was really looking forward to something from him or Damien Conway.
- petre 7y agoI've installed just about every release since 2017. It's a nice language but still slow and lacking library support. The best thing about it is probably the rational math.
- 6thaccount2 7y agoThanks for the information! 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.
- 6thaccount2 7y agoSome things are already significantly faster, but there are other common operations that are still slower. I wonder if the JIT will interfere with scripts where startup time is not acceptable?
- petre 7y agoI did some tests for prime number crunching. For example the C-style loop statement is faster than Perl's own foreach. Perl6 was the slowest of them all while the fastest was LuaJIT. The whole code is two loops with a bunch of multiplications and additions, an array push, loading a hash and looking up values in it. https://news.ycombinator.com/item?id=16720027 https://news.ycombinator.com/item?id=16720027
- colomon 7y agoThis seems like a very odd standard to use? I understand that you wanted to compare performances of different languages, that's great. 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.
- 6thaccount2 7y agoThat is impressive!
- petre 7y agoIt's just stuff that I use daily in normal code, so this benchmark pretty much serves the pupose very well: it uses mundane operations, also uses memory, one can adjust it by raising the bar 10x times, so the actual algorithm takes several orders of magnitude longer than the JIT penalty. In fact most of the interpreted languages would pretty much crunch for minutes at 10⁴, while Go, Crystal, D and Rust would take seconds or tens of seconds. Perl6 is basically stuck there forever and at the other end of the spectrum are Node and Dart. LuaJIT would run out of memory at that figure, otherwise it's among the fastest.
- proverbialbunny 7y agoThe article mentions this: >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.
- colomon 7y agoFor what it's worth, for maybe half of my scripting purposes, Perl 6 was already performant enough back in 2010. The big things I remember it having speed issues on were things you wouldn't normally have considered Perl 5 a solution for, like using a grammar to parse a multi-megabyte CAD file or calculate a Mandelbrot set using elegant high-level code. 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.