🦋 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.
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
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
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
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
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)
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
tbrowder__ Voldenet: thnx i'll try that in a module first to see how that effects load times 01:44
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`
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
gfldex 06:21
ugexe zef turned 10 years old today 12:01
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
El_Che ugexe++ 13:31
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
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
japhb El_Che++ 16:22
tbrowder__ El_Che++ and thanks 16:25
and...upgraded on Deb 11 16:26
coleman happy birthday zef 16:55
Anton Antonov @coleman Good to know! 17:44
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
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
coleman Here is a snippet of markdown that links to Raku's sponsored Zulip instance envs.sh/zi 19:45
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
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