Hacker News new | ask | show | jobs
by lizmat 1611 days ago
You might want to have a look at the Raku Programming Language (https://raku.org). It doesn't parallelize automatically, but only if you hint at it being ok, or if you are explicit (in this case using the `.hyper` method):

The millionth prime number using 1 CPU:

    $ raku -e 'say (1..Inf).grep(*.is-prime).skip(999999).head'
    15485863
    real 0m5.515s
Using whatever CPU cores are available (using `.hyper`):

    $ raku -e 'say (1..Inf).hyper(batch => 10000).grep(*.is-prime).skip(999999).head'
    15485863
    real 0m2.036s