🦋 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 00:03 reportable6 joined
tbrowder__ another laziness question please 00:09
i have a large hash i've put in a module. it takes a long time to load it. is there any way to reduce its load time if the only use is when the caller wants to see all keys and values? 00:13
00:17 jpn left
tbrowder__ i could just put the hash as a line by line file and load it dynamically i 00:22
guess. that may be the answer 00:23
that was it's not "use"d. 00:25
00:29 derpydoo joined
Voldenet maybe turn it into an array and produce hash on demand 00:39
nemokosch this whole asymmetry is not nice tbh 00:40
the negative real number is also a real number; the whole thing could be defined just as much as the negative value rotated with 180° more 00:41
00:42 rf joined
this is a special enough relation of the values (that they are both real numbers, that is) 00:42
no question, the square root could be computed with ln and e, or some convergent series, in a way that sqrt 9 wouldn't be exactly 3. However, somehow it is computed accurately, even though there is nothing "magical" about the number 9 computation-wise. It does seem inconsistent that the "real-ness" of roots of positive real numbers is not preserved, even though that's at least as much a fundamental "special case" 00:47
computation-wise
Voldenet to be honest, it'd be quite sane to have roots version for roots(Int, 2), roots(Int, 4) and so on 00:51
s/and so on/ 00:53
actually, it only makes sense for very few select cases 00:54
on the other hand 00:56
00:58 bigdata joined, MasterDuke joined
Voldenet m: for 2, 4 { say roots(3 ** $_, $_).map(*.round(1e-14)) } 00:58
camelia (3+0i -3+0i)
(3+0i 0+3i -3+0i 0-3i)
Voldenet it gets a lot better if you simply accept minor precision loss 00:59
nemokosch as i said, I'm more bothered by the inconsistency. If it can be accurately an integer for well-chosen integers (exact powers), it should be accurately a real number for well-chosen real numbers (positive numbers) 01:00
the great thing about inconsistencies is that they are objective, it's not a matter of opinion. What is a matter of opinion is if the analogy of the situations is fair - for that, I would say "realness" is actually more reasonably expectable in these cases than "integerness" so I think the analogy is even generous 01:02
I think it would be much less annoying if you didn't get it in your face that complex roots can be actually perfect integers 01:03
Voldenet m: say (sin(0), cos(0), cos(pi), sin(pi)) 01:15
camelia (0 1 -1 1.2246467991473532e-16)
01:15 laidback_01 joined
Voldenet if only all calculations on pi were symbolic, there wouldn't be any precision loss 01:15
m: say sin(2 ** 59 * pi) # and you wouldn't be able to see this monstrosity 01:22
camelia -0.9959748854655721
Voldenet Yes, it's -1 instead of 0
since rational numbers are a thing, then maybe angle numbers could be 01:24
01:35 tbrowder__ left, tbrowder__ joined 01:43 bigdata left
tbrowder__ Voldenet: thnx i'll try that in a module first to see how that effects load times 01:44
01:51 jpn joined 01:56 jpn left 02:03 derpydoo left 02:05 xinming_ left 02:08 xinming_ joined 02:11 euandreh joined 02:12 euandreh left
Voldenet Hm, maybe it would be a worthy addition to raku to express Deg and have a special implementation for sin(Deg) so `tan(pi / 2) == Inf, cos(pi / 2) == 0` and so on 02:15
and ofc `sin(pi / 2) == 1`
02:27 tea3po left, tea3po joined 02:28 tea3po left, tea3po joined
Voldenet m: class Deg { has $.m; method new(Rat() $r) { self.bless(m => $r) }; method mul(Rat $r) { Deg.new($r * self.m); }; method gist { $.m ~ "°" }; method a { self.m % 360 } }; my \pie = Deg.new(180); multi sub sin(Deg $a) { given $a.a { when 180 { 0 }; default { sin($_/180 * pi) } } }; multi sub cos(Deg $a) { given $a.a { when 270|90 { 0 }; default { cos($_/180 * pi) }}}; multi sub infix:<*>(Rat() $r, 02:30
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> * pi) }}}; multi sub infix:<*>(Rat() $r,⏏<EOL>
Voldenet Deg:D $a) { $a.mul($r) }; for (-1.5, -1, -.5, 0, .5, 1, 2**59).map(* * pie) { say ($_, cos($_), sin($_)) }
that sort of works gist.github.com/voldenet/76b4e2965...c405c18e04 02:37
02:45 xinming_ left 02:46 jpn joined 02:47 xinming_ joined 02:50 jpn left 02:57 rf left 02:58 rf left 03:40 jpn joined 03:44 jpn left 03:50 jpn joined 03:55 jpn left 04:38 ugexe left, ugexe joined 05:01 jpn joined 05:08 jpn left 05:14 derpydoo joined 06:00 reportable6 left 06:02 reportable6 joined 06:15 jpn joined 06:20 jpn left
gfldex 06:21
06:23 abraxxa joined 06:32 xelxebar left 06:40 xelxebar joined 07:40 jpn joined 07:43 sena_kun joined 07:51 jpn left 08:00 jpn joined 08:05 jpn left 08:25 jpn joined 08:34 El_Che left 08:35 El_Che joined 08:37 jpn left 09:02 Sgeo left 09:10 jpn joined 09:15 jpn left 09:21 sena_kun left 09:24 jpn joined 09:32 derpydoo left 10:32 linkable6 left, evalable6 left 10:34 linkable6 joined 10:35 evalable6 joined 10:46 ab5tract left 10:48 jpn left 10:53 abraxxa left 11:21 jpn joined 11:26 jpn left 11:40 jpn joined 11:47 jpn left 11:48 merp left 11:50 merp joined 11:57 merp left 12:00 reportable6 left
ugexe zef turned 10 years old today 12:01
12:02 reportable6 joined
librasteve Physics::Measure has class Angle, I have made an issue to add in this improvement in over there one day maybe... github.com/librasteve/raku-Physics.../issues/56 12:08
separately, maybe do something like subset RatPlex of Complex where *.re ~~ Rat && *.im ~~ Rat 12:15
then coercion to go .Rat on both components to tidy up 12:17
m: say -3+3.6739403974420594e-16i.Rat 12:18
Raku eval -3
12:22 tejr left 12:25 tejr joined 13:24 jpn joined 13:30 rf joined
El_Che ugexe++ 13:31
13:43 jpn left 13:59 jpn joined 14:03 jpn left 14:28 teatwo joined
El_Che lizmat: package are ready, chances are the one you need already uploaded. Waiting on cloudsmith to add debian trexie to the mix. With every release I need to poing them to add the code name or the release number of new releases :) 14:31
14:31 tea3po left
lizmat hehe El_Che++ 14:31
El_Che haha: "Hey there! As usual thanks for being our early indicator to add a new Version. That has been added for you now! " 14:34
tbrowder__ ugexe++ excellent 14:43
El_Che rakudo-pkg 2023.06 released 15:11
lizmat El_Che++ 15:12
15:15 jpn joined 15:25 jpn left 15:47 Sgeo joined
japhb El_Che++ 16:22
tbrowder__ El_Che++ and thanks 16:25
and...upgraded on Deb 11 16:26
16:44 squashable6 left 16:46 squashable6 joined 16:53 ab5tract joined
coleman happy birthday zef 16:55
17:11 ab5tract left 17:21 jpn joined 17:25 jpn left, sena_kun joined
Anton Antonov @coleman Good to know! 17:44
18:00 reportable6 left 18:03 reportable6 joined
tonyo . 18:51
anton antonov: yea i use DOT and some of the cli stuff to actually generate the images 18:52
i've been saying this for a few years and got most of the way there already but i want to set up the infrastructure to smoke/report the zef ecosystem
and then, eventually, i'd like to put a UI and allow for privatization of ecosystems (for private organizations) 18:53
19:03 evalable6 left, linkable6 left 19:04 linkable6 joined 19:05 evalable6 joined
Anton Antonov @tonyo Great! I would try to translate grammars into Graphiz / DOT also. Currently, I translate grammars into Mermaid-JS: github.com/antononcube/Raku-Functi...-for-ebnfs 19:10
tonyo very pretty 19:11
i used graphiz just because it was really easy to translate text -> text and end up with an image rather than trying to construct anything myself 19:13
i think [Coke] also used it for something but i'm failing to recall for what
Anton Antonov @tonyo I used Graphviz a lot until Mathematica shipped with GraphPlot. Since a year or two target Mermaid-JS at first (and often "at most") because Mermaid-JS graphs are rendered in many places by default. 19:20
@tonyo ... and thanks! 19:21
19:25 ab5tract joined 19:39 eseyman left
coleman Here is a snippet of markdown that links to Raku's sponsored Zulip instance envs.sh/zi 19:45
19:49 mr_z joined 19:50 manu_ joined, manu_ left, manu_ joined, manu_ is now known as eseyman 19:51 mr_z left, mr_z joined 19:52 mr_z left 19:57 guifa left
tonyo coleman: is zulip chat <-> irc? (and thanks for the happy birthday on zef) 20:03
coleman No, it isn't. They have an integration, but I suspect it'd be more trouble than it's worth 20:05
might be wrong about that, but Zulip is a different paradigm 20:06
I'm interested in using it's API as an alerting target. The multi-feed model might have advantages there 20:07
20:08 sena_kun left 20:09 ab5tract left 20:14 abraxxa-home joined 20:18 abraxxa-home left 20:19 abraxxa-home joined
tonyo alerting for something in raku or just in general? 20:48
coleman Raku docs site deploys, builds, anything 20:49
The function Zulip serves here is kind of like RSS or email alerts 20:50
...plus a forum? It's kind of its own thing. 20:51
21:08 squashable6 left 21:11 squashable6 joined 21:23 abraxxa-home left 21:24 abraxxa-home joined 22:11 abraxxa-home left 23:11 linkable6 left, evalable6 left 23:12 linkable6 joined, evalable6 joined 23:58 derpydoo joined