🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
melezhik weekly: www.reddit.com/r/rakulang/comments...g_sparrow/ 01:13
notable6 melezhik, Noted! (weekly)
melezhik weekly: dev.to/melezhik/validating-k8s-dep...arrow-5f3f 01:38
notable6 melezhik, Noted! (weekly)
melezhik .tell lizmat I also shared a reddit post for comments, but looks it was marked as spam by reddit again )-: www.reddit.com/r/rakulang/comments...g_sparrow/ 01:39
tellable6 melezhik, I'll pass your message to lizmat
eof i've just moved across the country and it's taken a good bit of attention away from my improved emacs mode project. i think i was working on q langs. 02:17
lizmat . 07:56
tellable6 2021-07-26T01:39:23Z #raku <melezhik> lizmat I also shared a reddit post for comments, but looks it was marked as spam by reddit again )-: www.reddit.com/r/rakulang/comments...g_sparrow/
lizmat .tell melezhik approved
tellable6 lizmat, I'll pass your message to melezhik
patrickb lizmat: I just noticed that the sidebar in the rakulang reddit topic is outdated in several places. I think you have permissions to change the sidebar. Could you: - Change the download section to just link to rakudo.org (rakudo.org hosts a quite all encompassing overview of the different download options. Duplicating it in different places will always miss options and become out of date). - Maybe switch modules.raku.org over to raku.land. - Cha 08:24
- Change freenode to libera. - Change colabti to liz.nl (or irclogs.raku.org should that already be available.) 08:25
lizmat looking at it now.... the mod tools are a bit... confusing :-) 08:26
lizmat patrickb: I think I covered all now on the new as well as the old reddit 08:54
patrickb lizmat: Thank you! That was really guick.
There are two reddits?
lizmat felt like it took hours though :-)
patrickb The downloads bit still only lists Star and rakudo-pkg. Did you miss that or was it intentional? 08:56
lizmat I guess I misunderstood what you meant? 08:58
sidebar or menu?
old / new reddit ? :-) 08:59
patrickb Uhm.. I have only looked at the thingy on the right. I didn't know there were two reddits (link?). Oh! There is a menu! Never noticed that! 09:01
To be more explicit I looked at the box labeled "Links" on the right of the feed at this page: www.reddit.com/r/rakulang/ The second subhading labeled "Installation" is what I referred to. 09:03
japhb Decided to pull my data structure serialization codec tests out into a repo of its own. github.com/japhb/serializer-perf if anyone is curious what the lay of the land at this moment. 09:04
moon-child couple of other things I noticed: there is a link to ideone.com, which does not seem to support raku (perhaps it used to, then changed?); the cheat sheet link labeled 'pdf' does not link to a pdf, but to a github page containing only svgs; the cheat sheet link labeled 'ascii' might be better called 'text'; the link labeled 'mailing lists' and the link labeled 'community' point to the same page 09:05
lizmat patrickb: so what link is incorrect now?
patrickb I'd remove the Rakudo *, Docker and rakudo-pkg links altogether and instead link to rakudo.org/downloads 09:06
lizmat patrickb: done 09:12
patrickb lizmat: Looking good. Thank you!
lizmat moon-child: removed ideone 09:14
the really annoying thing is that everything must be done twice :-( 09:15
Doc_Holliwood (Int) routine is-prime 11:48
Returns True if this Int is known to be a prime, or is likely to be a prime based on a probabilistic Miller-Rabin test.
What exactly does "known" mean? 11:49
Does Raku keep a list of primes somewhere? And if it does, why can't I access it?
lizmat Doc_Holliwood: I think that is hidden somewhere in the library that's used for primes, somewhere in MoarVM land 11:51
Doc_Holliwood Might be worth it to expose that, yes? 11:52
$*PRIMES =)
lizmat but why?
could well be a bitmap 11:53
Doc_Holliwood Because primes are used for a lot of things
lizmat so you'd want to randomly select a prime? 11:55
or get the next prime?
tbrowder japhb: do you plan to add TOML or HJSON?
MasterDuke Doc_Holliwood: it's so fast to calculate whether or not something is prime that it isn't worth the memory to keep a list around 12:10
tbrowder if anyone is interested in my Draw2D::Furniture module, i'm almost ready for a major new release and could use a tester 12:11
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/07/26/2021-...in-summer/ 13:27
Util m: say 42; 17:05
evalable6 42
Util m: my @n = 41, 42, 43, 44, 45; my $c; my $min = @n.min({ $c++; 1 }); say $c; 17:06
evalable6 8
Util No! Bad evalable6! Don't let it be true! Rakudo could not possibly use a O(NlogN) algo for min, when O(N) is so easy! 17:09
[Coke] Util: should be easy enough to check the algo used. 17:22
ugexe probably loops over the elements once, but runs the block multiple times 17:22
Util github.com/rakudo/rakudo/blob/74d7....pm6#L1586 17:24
Whew, it is 2N instead of NlogN. Still needs fixing via caching of the &by value of the current $min, but not nearly as bad as I thought. 17:26
m: my @n = 1..1000; my $c; my $min = @n.min({ $c++; 1 }); say $c; 17:27
evalable6 1998
[Coke] caching should probably be done via 'is cached'
ugexe caching an intermeditary list, not the result of the method
schwartzian transform essentially 17:28
Util Coke: 'is cached' is overkill for this. Just keep an extra loop variable, replaced when $min changes. 17:30
Util ugexe: we don't even need an intermediate list, just a variable declared outside the loop, that is conditionally updaed inside the loop. 17:32
ugexe m: my $c; my &foo := { $c++; $^a }; my @n = 45,41,42,43,44; my $min = @n.sort(&foo).head; say $c; say $min 17:35
evalable6 5
41
ugexe sort with single arity will swartizian transform already
Util ugexe: Yes, Raku has fantastic sorting, but min and max should not need to sort. They are done with just a linear scan, a single pass is sufficient. 17:38
ugexe that example is also a linear scan with a single pass, no? 17:39
Util ugexe: Oops, I think I mistook your point.
ugexe although for a min/max it wouldnt be ideal memory wise i suppose 17:41
Util ugexe: right; when sorting, if you don't want to ever re-evaluate the comparitor for a value, you must cache or use S.T. or some such trick. 17:44
In a min or max, the cache only needs to be one value.
(in size)
japhb tbrowder: Someone had said that TOML wasn't very good for serializing data structures, but if that was just "not as good as other things, but still technically works", I'm fine with adding it. HJSON I'm unfamiliar with. Do we already have a module for that? 17:45
tbrowder japhb: yes, there is a raku module, it’s loose json, allows comment, etc. converts to json easily. 17:48
japhb tbrowder: OK, sure, I can add those. 17:50
Oh wow, there's 5 different TOML modules on raku.land! 17:52
leont TOML makes sense as a format written by humans, not as a format written by computers 18:20
It's at a sweet spot between INI and YAML 18:23
El_Che leont: if by sweet you mean sour, yes :P 19:06
leont Touché 19:07
tonyo mine is toml 1.0.0 compliant, which can be a headache if you're trying to serialize an array of mixed types 19:08
['a', 1.0, false] is not a valid toml 1.0.0 array
it's also the fastest if the toml is actually parsed 19:09
gfldex m: my $*this; say <1 10 0 7 2>.&{$*this = $_}.map(* / $*this).sum; 19:36
camelia 4
gfldex mykhal: If you want a `this` you have to set it yourself. ^^^