News for hackers. Stuff that matters.
Re:Ask HN: New Programming Language? by lizmat on Thursday January 13, 2022 @05:25PM (#29927804)
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

There are no comments on this comment yet.