🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:00 reportable6 left, perlbot left, reportable6 joined 00:01 simcop2387 left 00:03 simcop2387 joined, jpn joined 00:04 perlbot joined 00:08 deoac joined 00:09 jpn left 00:12 deoac left 00:31 Xliff_ joined 00:33 Xliff left 01:02 jpn joined 01:07 jpn left 01:27 perlbot left 01:29 simcop2387 left 01:30 simcop2387 joined 01:31 eseyman left 01:32 perlbot joined 01:38 eseyman joined 02:35 _Xliff joined 02:38 Xliff_ left 02:46 jpn joined 02:51 jpn left 02:54 razetime joined 03:04 exp left 03:05 exp joined 03:23 rf left 03:44 simcop2387 left 03:45 simcop2387 joined
vrurg_ tonyo: if it's not too late. :) github.com/vrurg/raku-Config-BINDish for example. But, basically, pretty much any of my personal repos use .gitignore 04:05
04:34 jpn joined 04:38 perlbot left 04:40 jpn left, simcop2387 left 04:42 perlbot joined 04:43 simcop2387 joined 05:20 _Xliff left 05:21 perlbot left 05:22 simcop2387 left 05:23 simcop2387 joined 05:26 perlbot joined 05:27 simcop2387 left 05:29 simcop2387 joined 06:00 reportable6 left 06:01 reportable6 joined 06:22 jacob37 joined 06:23 jpn joined 06:24 perlbot left 06:25 jacob37 left, perlbot joined 06:28 jpn left 06:31 simcop2387 left 06:32 perlbot left 06:37 perlbot joined 06:38 simcop2387 joined 06:39 razetime left 06:44 perlbot left 06:47 simcop2387 left, tea3po left 06:48 tea3po joined 06:49 tea3po left, tea3po joined 06:50 tea3po left 06:51 tea3po joined, simcop2387 joined 06:52 perlbot joined 06:58 knarkhov joined 07:12 Sgeo left 07:13 derpydoo left 07:15 derpydoo joined 07:39 jpn joined 07:40 jpn joined 07:53 squashable6 left 07:54 squashable6 joined 08:08 razetime joined 08:19 jpn left 08:22 jpn joined 08:34 jpn left 08:46 jpn joined 08:48 squashable6 left 08:51 squashable6 joined 09:10 abraxxa joined, razetime left, dakkar joined 09:16 perlbot left
Geth App-Rakubrew: 465c933509 | (Patrick Böker)++ | 6 files
Fix `self-upgrade` on ARM MacOS
09:18 simcop2387 left 09:21 simcop2387 joined 09:24 perlbot joined 09:25 simcop2387 left 09:26 simcop2387 joined 09:31 squashable6 left, squashable6 joined 09:55 knarkhov left 09:58 abraxxa left 10:11 derpydoo left 10:13 derpydoo joined
Voldenet > Cannot classify a lazy list onto a Hash[Any,Any] 10:25
I hate how I need to write `classify` for my use case
is `lazy` supposed to always mean `infinite` 10:27
Nemokosch Hash[Any, Any] is really just a worse version of Hash
Voldenet I know, but here I simply wanted to group generated data into buckets without evaluating whole sequence 10:28
so .classify would've worked
guifa Voldenet, wouldn't it need to evaluate the whole sequence as soon as you call %hash<category> ? 10:29
Voldenet Yes it would, but it wouldn't need to store that data a few times 10:30
guifa lazy doesn't mean infinite per se. just means it doesn't eagerly evaluate items 5-100 if you've only requested 0-4
10:31 knarkhov joined
Voldenet I get the point that classify could hang for lazy infinites 10:31
but still, it should let me shoot my foot 10:32
if I wish :P
guifa push %hash{.head}, .tail for @list; # <-- maybe this works?
guifa is afk
lizmat Voldenet: then .eager it ? 11:01
Voldenet I just rewrote things to use gather/take properly 11:04
.lazy is risky to use when things need tons of memory anyway 11:05
tbrowder__ .seen jforget 11:07
tellable6 tbrowder__, I haven't seen jforget around, did you mean jorge?
11:10 dakkar left 11:12 dakkar joined
Nemokosch there is some discrepancy in the lazy terminology 11:19
is-lazy doesn't actually check what it claims to, only a very tight subset of it
it's rather "is it obvious by the definition of this iterator that it is lazy", so it can easily give false negatives 11:20
lizmat well, it's a contract: ask the underlying iterator if it thinks its lazy, and report that 11:21
Nemokosch is-lazy is actually more like is-infinite - except it will also report True if you explicitly mark something lazy
lizmat if the underlying iterator lies, then garbage in, garbage out applies
Nemokosch the iterator doesn't lie, it just doesn't tell you the complete truth 😛 mostly because laziness is usually a more holistic concept so an iterator just genuinely doesn't have a clue about it 11:36
lizmat disagree: the iterator *does* know because it says so (implicitely) with the "is-lazy" method 11:44
11:47 thundergnat joined
thundergnat It can be difficult (and time consuming) to determine if a particular is infinite or not. It uses some heuristics and best guess estimates, and gets it right more often than not, but anything it says is a best guess, and if you deliberately lie to it, it will assume you know what you are doing. 11:50
m: my \Δ = $ = 1; say (flat 0, [1..9], {last if .not; ++Δ; [(.flat X~ 0..9).grep: * %% Δ]} … *).tail; # NOT an infinite iterator
camelia Cannot tail a lazy list
in block <unit> at <tmp> line 1
thundergnat my \Δ = $ = 1; say (flat 0, [1..9], {last if .not; ++Δ; [(.flat X~ 0..9).grep: * %% Δ]} … *).eager.tail; # NOT an infinite iterator 11:51
11:51 abraxxa joined
evalable6 3608528850368400786036725 11:51
tbrowder__ hi, i'm working on another holiday module and need a reality check with a person familiar with the hebrew calendar. anyone here? 11:52
Nemokosch lizmat: this is a bit of a tautology, though 11:53
yes, it says what it knows but it cannot always give the right answer - this is the thing
thundergnat Yep. Exactly my point. 11:54
lizmat well, suppose we also had a "don't know" setting in iterators, how would it be different from "is lazy" semantically ?
11:55 derpydoo left
Nemokosch m: my $seq1 := 1, 4, 7 ... 10000; dd $seq1; my $seq2 := 1, 4, 7 ... *; dd $seq2; 11:56
11:57 jmcgnh left
uh oh... that's definitely not what I wanted to show 😅 11:57
dd wasn't a good idea here
tbrowder__ from looking at @jforget's Date:📆:Hebrew (and using it), i can get the hebrew date for the first day of Hanukkah and convert it to a Date (Gregorian). the slight wrinkle is the hebrew day starts at sunset so the calculated G date for the H date looks like it needs to be reduced by 1 to get results correct for online data i've found. does that seem correct? 11:58
11:58 Nemokosch joined
Nemokosch m: my $seq1 := 1, 4, 7 ... 10000; say $seq1; 11:59
camelia (1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 124 127 130 133 136 139 142 145 148 151 154 157 160 163 166 169 172 175 178 181 184 187 190 193 196 199 202 205 208 211 21…
Nemokosch not because it's not (supposed to be) lazy but because it doesn't know it about itself and reifies the first 100 elements for gist
11:59 derpydoo joined
Nemokosch m: my $seq2 := 1, 4, 7 ... *; say $seq2; 11:59
camelia (...)
12:00 reportable6 left
Nemokosch on the other hand, this clearly knows about itself that it's lazy and therefore won't reify values for something as mundane as providing a gist 12:00
lizmat my $seq2 := 1, 4, 7 ... *; say $seq2.eager
m: my $seq2 := 1, 4, 7 ... *; say $seq2.eager 12:01
Nemokosch that will probably hang
camelia (timeout)
lizmat it should just produce 100 elements ?
Nemokosch I think .eager itself hangs
.eager is so eager it doesn't care when and how it will be consumed 12:02
lizmat yeah, looks like you're right.... I wonder if that isn't a bit LTA
12:02 reportable6 joined
Nemokosch $seq1 would be the middle ground. It doesn't call itself lazy but it's not eager either, in the strict sense 12:03
it's like lenient
12:06 Nemokosch left
thundergnat Technically _all_ iterators are lazy. Whether or not they reify some (or all) elements depends on what you do with them. 12:07
lizmat well, iterators are reactive: they don't do anything unless you ask them to provide a value
thundergnat Exactly. That's what I meant even if I phrased it wrong. 12:08
12:08 jmcgnh joined
lizmat gotcha 12:09
Nemokosch And that's what I meant by the holistic stuff 😛 12:10
thundergnat the is-lazy attribute is a hint to the compiler whether it is feasible, or even possible, to go ahead and try to reify the whole list if you perform some operation that may request it. 12:11
If it is-lazy, it won't even try. 12:12
Unless you specifically tell it too.
Nemokosch yep, this makes sense
it's just the name is kind of misleading. There are three levels of laziness, at least 12:13
thundergnat And again, it sometimes gets it wrong when it tries to guess if it is-lazy or not.
12:14 jmcgnh left, Xliff joined
thundergnat perhaps is-infinite may have been a better term 12:14
Xliff \o
Nemokosch or one can say: is-lazy is accurate and misnamed for iterators, while it is well-named but inaccurate for iterables
Xliff Does Raku have tools to generate public and private cryptographic keys?
Nemokosch is-infinite won't cut it, by the way, because of the lazy keyword 12:15
thundergnat yeah, that would have a whole other set of semantic difficulties.
Nemokosch Xliff: isn't there something like that around the Digest macroverse? 12:17
12:18 nima joined, thundergnat left
Xliff Nemokosch: I know not. That's why I'm asking. :) 12:19
tellable6 Xliff, I'll pass your message to Nemokosch
12:19 nima left
Xliff Aha! Crypt::RSA! 12:20
However the key generation parameter is in number of digits, and I'm not sure how that relates to bitsize. 12:24
12:37 perlbot left, simcop2387 left 12:53 tbrowder__ left, tbrowder__ joined 13:12 jpn left
Voldenet >It can be difficult (and time consuming) to determine if a particular is infinite or not. 13:16
It's possible to simply require infinite sequences be marked as such or just execute operations 13:18
in case of classify, I realized that I needed a version of classify that given N categories would generate N iterators, which is a lot different from what classify originally does 13:19
Xliff: to start with `Crypt::RSA` doesn't look like something to be used in production 13:38
if that doesn't scare you, you can use your own random-prime-generator that would return a random prime 13:39
lizmat Voldenet: are you sure you mean iterators, and not supplies? 13:42
Voldenet Yes, the iterator that wasn't infinite but long enough that it didn't fit in the memory 13:44
13:51 jpn joined
Voldenet Xliff: that's what I'd use: `use Crypt::OpenSSL::RSA:from<Perl5>; say Crypt::OpenSSL::RSA.generate_key(1024).get_private_key_string();` 13:54
13:56 jpn left 14:04 xinming left 14:06 xinming joined
lizmat and yet another Rakudo Weekly News hit the Net: rakudoweekly.blog/2023/03/13/2023-11-ainions/ (yesterday already :-) 14:10
14:12 jpn joined
Voldenet (primary issue of Crypt::RSA is that it can pick p and q very close to each other and there's no way to control that behavior) 14:12
[Coke] lizmat++ 14:13
Thank you for this huge run of blog posts!
14:25 Sgeo joined 14:59 jmcgnh joined
tbrowder__ lizmat: good weekly, as usual. i would love to see Slang::Forgiven in core! 15:00
that is: allow the topical $_ use with named keys/values 15:04
15:04 grondilu joined
tbrowder__ worth filing a feature request? 15:05
grondilu can I not put comments at all inside qw{}? 15:17
15:17 perlmaros left, rf joined
rf Morning folks 15:17
Nemokosch grondilu - probably not 15:19
15:23 knarkhov left 15:24 thundergnat joined, knarkhov joined
thundergnat m: my $var = 'no comment'; say <<a b #`{{a comment!}} $var c d>>; 15:25
camelia (a b no comment c d)
15:25 thundergnat left 15:30 abraxxa left 15:41 summerisle left 15:42 summerisle joined 15:56 vrurg joined, vrurg_ left 15:57 vrurg_ joined 15:58 simcop2387 joined 15:59 perlbot joined 16:00 vrurg left
tbrowder__ any seconds on filing rakudo feature request for adding capability of new module Slang::Forgiven to core? 16:04
tonyo vrurg_: i have the changes in master for fez it should _just work_ now 16:18
16:22 Xliff left 16:24 kostas joined, simcop2387 left, perlbot left 16:27 knarkhov left
tonyo if you don't want to install from master lmk and i'll publish 16:27
16:41 simcop2387 joined 16:42 perlbot joined 16:48 perlmaros joined 16:53 kostas left
tonyo vrurg_: i trued up the globber with what git archive would make in bindish and it was very similar (missing just the raw directories in the resulting tar) but for the most part looked reasonable 17:03
17:32 simcop2387 left 17:34 perlbot left 17:37 dakkar left, perlbot joined 17:38 simcop2387 joined 17:40 simcop2387 left, perlbot left 17:42 perlbot joined 17:43 simcop2387 joined
lizmat tbrowder: it feels a lot like it is a feature "you think it is a good idea now" :-) 17:47
and what is wrong with adding "$_ := $num" at the top of the body of the loop ? 17:48
you do *not* have to use given to set the topic
18:00 reportable6 left 18:01 reportable6 joined
Voldenet tbrowder__: in the form `for given @it { when * > 0 { } }` -> `for @it { given $_ { when * > 0 { say "$_ is positive" } } }` it would make more sense probably 18:03
but 18:04
m: for 1, 2, -3 { when * > 0 { say "$_ is positive" } } # why even need that "given" 18:05
camelia 1 is positive
2 is positive
18:40 ToddAndMargo joined 18:50 teatwo joined 18:53 jpn left, tea3po left 18:58 grondilu left 19:06 squashable6 left 19:08 squashable6 joined 19:15 vrurg_ left, vrurg joined 19:16 perlbot left, simcop2387 left 19:18 jgaz joined 19:23 simcop2387 joined 19:24 perlbot joined 19:33 yoreei joined 20:03 sivoais left
snonux m: say "$_ is positive" if $_ > 0 for 1, 2, -3; 20:12
camelia 1 is positive
2 is positive
tonyo m: (1,2,3,-1,-2,-3).map({ when * > 0 { "$_ is positive" }; default { "$_ is negative" } })>>.&say 20:14
camelia 1 is positive
2 is positive
3 is positive
-1 is negative
-2 is negative
-3 is negative
tonyo i'd probably not put the slang in core given the for when syntax works fine already ^ 20:15
20:16 yoreei left
tonyo vrurg: i'm going to release the next fez and then the only thing left in my dist branch would be writing a pure raku gzipper 20:18
anyone having problems with fez's globber/sdist stuff, please update! 20:20
rf tonyo++ 20:24
20:30 yoreei joined
tbrowder__ ok, thanks for weighing in with good comments. i will try to improve my “foreach” practices. 20:45
20:52 ToddAndMargo left 21:01 jgaz left 21:03 sivoais joined 21:11 perlbot left 21:12 perlbot joined
vrurg tonyo: I have switched to using --file anyway already. :) 21:18
21:18 jpn joined
vrurg tonyo: but hope it would prove to be useful for others. 21:18
21:22 yoreei left, jpn left 21:23 jmcgnh left 21:45 squashable6 left 21:47 squashable6 joined, jmcgnh joined 22:04 perlbot left 22:06 simcop2387 left 22:07 perlbot joined 22:10 simcop2387 joined 22:31 elcaro left
guifa before forgiven I'd like to see for { … } else { … }. Damian already hacked that one together a while ago ha 22:44
Nemokosch it doesn't take an AlexDaniel to say: please no 22:45
more barely useful structures that need a whole lot of reasoning to get right, or even decide whether it's semantically clean 22:46
guifa I think for else is really straight forward: if no iterations, then handle the else 22:47
Nemokosch I don't think I've ever found myself wanting to do that. On the other hand, Python's else clause does something else that I did find useful quite often 22:49
guifa what's that?
Nemokosch code that executes when the loop exits "normally", not hitting any break's (or return's, for that matter) 22:50
22:50 jmcgnh left
mind you, I don't find the name else particularly good for that either. I think a for just shouldn't have something called else in the first place 22:51
guifa for { … } otherwise { … } lol 22:52
Nemokosch but when it comes to usefulness, I find the Python choice way more useful than "execute this when the loop turned out to be empty"
guifa hmm, I wonder how I might be able to create a Python-ish style one. I'd definitely do a different name for it though. It's just I don't think there's a good short word to encompass "and if ended without a last statement being called") 22:56
22:58 jmcgnh joined 23:07 jpn joined 23:11 jpn left 23:42 japhb left, japhb joined 23:52 derpydoo left
vrurg guifa: you don't need 'otherwise' or alike to handle any control event. 23:58
m: for ^10 { CONTROL { when CX::Last { say "HERE WE DO SOMETHING ON LAST"; .rethrow; }; }; .say; last if $_ == 3; }
camelia 0
guifa vrurg you've got the goal backwards: the goal is to do something if and only if last is never called
vrurg So, when loop has finished successfully? 23:59