Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

when is perl6 as fast as perl5

by xiaoyafeng (Deacon)
on Jun 16, 2019 at 04:55 UTC ( [id://11101422]=perlquestion: print w/replies, xml ) Need Help??

xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

hi monks,

I'm been drooling for perl6's neat and rich expression for years. This year, I've bought learning perl6 and start to learn perl6 officially. ;) During leaning, I'm very satisfied with perl6. To be honest, perl5 is good, but most of time, program in perl5 is a little bit like assemble weapons, you use many modules on cpan( image dzil) in one program which means you have to endure various programming style(moo, moose, bless etc.) in my own application. But perl6 not, it has a consistent class system, type system, and sigil system, that will let you keep your own style during program. Now, I've already replaced some perl5 stuff with perl6. i.e: getopt to MAIN, Devel::REPL to perl6's version etc. and I really enjoy it.

But the problem is performance. I hope I can use perl6 in production. But I found when I use perl6 to deal with large files (thousands files and each file with ten thousands lines), the program's performance decrease really fast. After google search, I notice tux's website which keep record perl6's benchmark, what frustrate me is although perl6's performance improve greatly compared before, it's still slower 10 times than perl5. I'm not expert of language compiler. but I fuzzily remember Reini Urban's criticism about perl6 that because of rakudo's wrong 3-stage design, perl6 would be never as fast as perl5! Is that right? Actually, I'd like to port all my code to perl6 if perl6's performance is the same as perl5's. if he's conclusion was wrong, when can I use a decent fast perl6?

does perl6 deserve to invest for career? or just treat it as hobby? Please enlighten me. TIA.





I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Replies are listed 'Best First'.
Re: when is perl6 as fast as perl5
by moritz (Cardinal) on Jun 16, 2019 at 18:57 UTC
    I'm not expert of language compiler. but I fuzzily remember Reini Urban's criticism about perl6 that because of rakudo's wrong 3-stage design, perl6 would be never as fast as perl5! Is that right?

    That sounds like a very dubious claim to me. Maybe the staged approach limits the performance of compilation time, but the problems you've mentioned (working with many and large files) sounds like they are limited by run time performance, not by compilation time.

    if he's conclusion was wrong, when can I use a decent fast perl6?

    Such things are very hard to predict in a volunteer-driven project. You could also ask when you can expect a Perl 5 that supports easy to use and robust concurrency, or a Perl 5 with less gotchas about mixing string and binary data, and probably not get a very good answer.

    There are use cases for which Perl 6 is fast enough now, and there are small niches where Rakudo on MoarVM can be faster than Perl 5 right now (for example integer arithmetic when you use native types in Perl 6).

    does perl6 deserve to invest for career? or just treat it as hobby? Please enlighten me. TIA.

    If you want to make money now, Perl 6 isn't your best choice. Treat it as a hobby, and learn one of the trending languages like Javascript or Python for making money.

      "You could also ask when you can expect a Perl 5 that supports easy to use and robust concurrency" ... that's available in Perl (as you know): see the Perl Many-Core Engine.


      The way forward always starts with a minimal test.
        Nice module. But neither native nor core.
      I just want a way to both make money and stay in perl community. ;) Besides, Technically, I can't find any advantage of Javascript and Python compared to perl5.




      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Re: when is perl6 as fast as perl5
by Your Mother (Archbishop) on Jun 16, 2019 at 15:09 UTC

    FWIW Perl5 is extremely fast for a dynamic language. Perl6 is deeply interesting. It deserves investment on that basis, like choroba was saying. If you can find, say, even 3 job postings online today that say they are hiring for Perl6, there is a small possibility of it turning into a career path. Indeed.com today lists: Perl5, 14K; Java, 69K; iOS, 15.8K; JavaScript, 40K; C++, 40K; Perl6, 0.

Re: when is perl6 as fast as perl5
by choroba (Cardinal) on Jun 16, 2019 at 08:48 UTC
    It would be great if you could find links to Tux's benchmarks and rurban's criticism.

    Besides that, learning anything is a good investment for one's career. Always try to know more and never stop learning!

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: when is perl6 as fast as perl5
by thechartist (Monk) on Jun 20, 2019 at 00:25 UTC

    For most tasks, Stable Perl (ie. perl 5) is plenty. I'm still a fan of Perl 6; I hope the performance continues to improve over time. It might be worth it to write something in Perl 6, find the slow spots, and then move them to something faster (like C), until the VM improves. That takes advantage of improved Native C Calling interface.

Re: when is perl6 as fast as perl5
by Jenda (Abbot) on Aug 01, 2019 at 17:47 UTC
    when is perl6 as fast as perl5

    When you copy both to the same make of flash drive and drop both drives from the roof. Rest assured though that a version of Perl 6 with decent performance will be available before Christmas (TM). No way to say which year though.

    perl6 deserves to be treated as a failed experiment and a warning.

    Jenda
    1984 was supposed to be a warning,
    not a manual!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11101422]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found