1,154 karma · joined January 23, 2018
raku -e 'say lines.pick(4).join' < /usr/share/dict/words
In Raku, the comparison operator is basically a subroutine that uses multiple dispatch to select the correct candidate for handling comparisons between Rat's and other numeric objects.
Please also not that all string handling in Raku (the `Str` class) is based on graphemes, not just some added functions. This e.g. means that a newline is always 1 grapheme (regardless of whether it was a CR or LF or CRLF). And that for é there is no difference between é (LATIN SMALL LETTER E WITH ACUTE aka 0x00E9) and (LATIN SMALL LETTER E, COMBINING ACUTE ACCENT aka 0x0065, 0x0301).
Please note that for any combination between characters and combiners for which there does not exist a composed version in Unicode, Raku will create synthetic codepoints on the fly. This ensures that you can consider your texts as graphemes, but still be able to roundtrip strange combinations.
{
# do stuff
my $dbh = DB.connect(...);
# do stuff
LEAVE .disconnect with $dbh;
# do stuff
}
Whenever the scope is left (this could be because of an execution error, or a `return`), the code of the LEAVE phaser will be executed. The `with $dbh` checks whether the $dbh variable contains an instantiated object. If so, it topicalizes (set $_ to it) and calls the disconnect method (`.disconnect` being short for `$_.disconnect`).For more complex uses, and more tuneable finalizing, there is the `FINALIZER` module in the ecosystem: https://modules.raku.org/dist/FINALIZER
In October 2019, the Perl 6 community decided that a rename of the language would be in the best interest of everybody involved. Since then, the language is called "Raku" (https://raku.org).
Zoffix is still sorely missed.
Just for the record: yes, there are faster ways of finding the 10000th prime, but I use this example often as an example of a CPU-intensive task that can be spread over multiple threads easily.
Also, please note that all features of the example are built-in into Raku: no external module loading needed.
Threading can make a difference on non-IO bound tasks if you're interested in wallclock rather than CPU: for instance, `say (1..Inf).grep( { .is-prime } )[9999]` (showing the 10000th prime number) runs 22 seconds on my machine, but the threaded version of that: `say (1..Inf).hyper.grep( *.is-prime )[9999]` runs in 8 seconds. That's just by adding the `.hyper` method to the chain!
Could you elaborate on how you got that impression? Do you have any benchmarks that the Raku core developers could look at?
Not sure what this would imply for a future Python 3 -> Python 4 transition.
Could you expand on why it is a totally irrational idea? Seems pretty rational to me. But then I'm not really a mathematician.
> autoconversion to floating point when you hit a 2^64 denominator
Please note that this is after normalization. And it has come from practicality: having the denominator also be an BigInt, slows down the use of the Rational number significantly. However, if you do need that type of precision, then you can by using infectious FatRats: any expression with a FatRat, will result in a FatRat (unless explicitly coerced to something else, of course).
With regards to the Zero-denominator Rats: they are just special cases just as IEEE has special cases for -Inf, Inf and NaN. So what's the problem there?
perlpackages.com perlcontainers.com perlvm.com perlclouds.com perlaccessibility.com perlinstall.com perlgames.com perloffice.com perlapps.com perlservers.com perlgrandchallenges.com perlhackathons.com spacescouting.org perlscouts.com certifiedyouthprogrammer.com programmingmeritbadge.com mlperl.com scienceperl.com perldemos.com perljobs.work perllegacy.com perlpodcasts.com perlvideos.com perlbrochures.com perlflyers.com perlmerchandise.com perlpapers.com perlnewsroom.com perlblogs.com perlinfographics.com perlbeer.com perlparties.com perlconferences.com perlmulticore.com perlsupercomputers.com perlspeed.com perlfamily.org
In other words: he's doing Perl the worst possibly favour.
This is untrue.
> and even incorporate some of 6 in their work (that's where 11 comes from 5+6=11)
None of this EVER materialized.
Let it be noted that I have defended Will Braswell publicly and privately many times in the past, most recently in https://liztormato.wordpress.com/2019/07/13/on-crime-and-pun...
But since the stunts he has pulled after the rename of Perl 6 to Raku became official (both public as well as in private messages), I have decided he has migrated to the plonk category of people in my life (the sound of garbage hitting the bottom of the bin).
I've asked him to remove all mentions of Raku on his site (as Raku is no longer part of the Perl future), but he has refused to do so.
It's http://perl11.org all over again, but with improved graphics and UI. But it's still the same sour wine.