🦋 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.
00:02 reportable6 left 00:31 evalable6 joined 01:03 reportable6 joined 01:24 alex35 joined, alex35 left 02:24 quotable6 left, tellable6 left, unicodable6 left, statisfiable6 left, linkable6 left, squashable6 left, greppable6 left, notable6 left, sourceable6 left, coverable6 left, bloatable6 left, nativecallable6 left, benchable6 left, bisectable6 left, committable6 left, reportable6 left, releasable6 left, shareable6 left, releasable6 joined, unicodable6 joined 02:25 committable6 joined, coverable6 joined, bisectable6 joined 02:26 statisfiable6 joined, greppable6 joined 02:27 reportable6 joined, squashable6 joined, shareable6 joined 02:33 Doc_Holliwood left 03:25 notable6 joined 03:54 tejr left 04:00 tejr joined
Razetime is there any image manipulation library in raku 04:08
japhb Razetime#5187: Some, but I wouldn't say extensive, so it depends on what exactly you need; you can search on raku.land for suspects. 04:17
moon-child there are apparently imagemagick bindings (modules.raku.org/dist/MagickWand:cpan:AZAWAWI). No idea how good they are
japhb Hmmm, raku.land searches should be able to find substrings. One of the searches I did was for 'Magick' but it returned 0 results. :-( 04:18
tbrowder, leont, tonyo, El_Che: Just pushed 0.0.2 of github.com/japhb/serializer-perf , now with support for 3 different TOML modules. Unfortunately, I also had to add bulletproofing and reliability tests because the TOML codecs really struggled for some inputs. Unfortunately, at least one TOML codec/input combo can *still* panic MoarVM. :-( 04:21
.oO( It's japhb sad face time ... )
04:22 tejr left 04:23 tejr joined
japhb (The panic-ing is why it's still not uploaded to fez/zef, just git pushed.) 04:24
04:24 bloatable6 joined 04:25 quotable6 joined, tellable6 joined 04:26 benchable6 joined 04:43 Doc_Holliwood joined 04:45 Sgeo left 04:46 Sgeo joined 05:26 Doc_Holliwood left 05:27 linkable6 joined 05:42 ufobat joined 06:02 reportable6 left 06:05 reportable6 joined 06:42 gfldex left 06:43 gfldex joined, gfldex left, gfldex joined 06:49 ufobat left 07:23 jmcgnh left 07:26 sourceable6 joined, nativecallable6 joined 07:28 jmcgnh joined 07:34 Doc_Holliwood joined 07:36 Sgeo left 07:44 dakkar joined 08:36 Oshawott left 08:42 Kaipi left
nine japhb: do you have a reduced test case for those panics? 08:48
09:14 jess joined 09:41 ufobat joined 10:17 Kaiepi joined 10:24 Guest9 joined, Doc_Holliwood left 10:34 archenoth joined
tbrowder moon-child: i've used GraphicksMagic Perl modules and they worked well for me. Some time ago I seem to remember the crowd went from Image* to Graphicks* because of some issue (maybe not keeping up devel). 10:55
11:13 demostanis[m] left 11:34 simcop2387 left, perlbot left 11:50 Guest9 left 12:03 reportable6 left
tbrowder sorry, that's GraphicsMagick, website outlines genesis of its spinoff from ImageMagick in 2002. imho, any raku effort ought to be with it rather than ImageMagick 12:03
latest update was 2020
12:06 simcop2387 joined 12:07 perlbot joined 12:22 Doc_Holliwood joined 13:05 reportable6 joined
Razetime would be useful to have something standalone 13:08
13:24 nahita joined 13:46 Sgeo joined 13:55 Doc_Holliwood left 13:57 Xliff joined 14:18 nahita left 15:18 evalable6 left, linkable6 left 15:19 evalable6 joined 16:00 vrurg left 16:02 perryprog left, oodani left 16:03 ingy left 16:04 MasterDuke left, olve left 16:05 oodani joined 16:07 vrurg joined 16:13 perryprog joined, ingy joined 16:15 MasterDuke joined 16:33 ufobat left 16:34 vaskozl joined, vaskozl is now known as vasko
vasko Raku is so cool, I love it. It's so cool I really want to put it in production at work. 16:36
Is hub.docker.com/_/rakudo-star the image to use when you want reliability? 16:37
16:37 dakkar left
El_Che star releases are not more reliable than regular releases 16:42
16:42 Xliff left
El_Che but, sure, it's certainly a good option 16:44
16:45 Doc_Holliwood joined
El_Che for my own use, I create alpine or ubuntu containers with packages github.com/nxadm/rakudo-pkg 16:45
that way the image is smaller 16:46
vasko Thanks, do you have a recommend Dockerfile with the zef install and how you manage dependencies? 16:52
Also do any of you use QMK Firmware and Linux? 16:53
I'm wondering what the best way to start typing unicode is.
I'm still painfully copy pasting symbols from the web browsers :(
MasterDuke there's a unicode entry section on the docs website 16:56
i.e., how to enter unicode
16:57 vasko left 17:16 vasko joined 17:19 linkable6 joined 17:29 Sgeo left 17:32 Sgeo joined 17:33 Sgeo left 17:34 Sgeo joined 17:43 Sgeo left 17:48 Sgeo joined 17:58 patrickb joined 18:02 reportable6 left 18:03 reportable6 joined 18:05 patrickb left 18:07 Sgeo left, Sgeo joined
Geth doc/py-nutshell-enumerate-patch: bc1de2cd80 | (Trey Harris)++ (committed using GitHub Web editor) | doc/Language/py-nutshell.pod6

  @JJ — I noticed that in this doc, `L<>`’s to routine docs are not in `C<>`’s, so appear as regular text instead of monospaced. This seems to be a case where there’s different styles on different pages—but should I submit a separate patch to change all these routine-link `L<>`’s to code font? Thanks.
18:27 perryprog left, perryprog joined
japhb nine: Nope, panic not reduced yet. I'll see what I can do in that direction. :-) 18:29
19:00 casaca left 19:02 jess left
[Coke] I should be able to return a new Exception (subclass) from a sub, aye? (I Swear I'm returning it in some cases, but when I check the return value type, it's always a Hash (which is the normal happy return path) 19:04
19:12 abraxxa-home joined
[Coke] ... ah. I think I'm accidentally turning the exception into a fail and then getting an empty string out of it. 19:14
vrurg [Coke]: and it doesn't explode? Are you boolifying it somewhere? 19:37
19:40 abraxxa left 19:41 abraxxa-home left 19:58 abraxxa-home joined
jdv [Coke]: do you turn a lot of things into fail often? 19:59
[Coke] jdv: it's just one of my powers. 20:05
20:12 casaca joined
jdv i knew it! 20:14
codesections Is there a reason why the following is: 20:20
m: say (-1).sqrt; say (-1.Complex).sqrt 20:21
camelia NaN
codesections I would have expected those to both return 0+1i (that is, the NaN surprised me) 20:22
[Coke] you have to declare if you want Complex, yes.
m: -1.^name.say
camelia WARNINGS for <tmp>:
Useless use of "-" in expression "-1.^name.say" in sink context (line 1)
[Coke] m: (-1).^name.say 20:23
camelia Int
codesections yeah, I see that that is the case. I would have expected an auto conversion, and I was wondering why we didn't go that route
m: 1.sqrt.^name.say 20:24
camelia Num
codesections plenty of fns convert
[Coke] would you want *every* math operator to upgrade to Complex? 20:25
operator +/or function
An argument could be made either way, but it would be an argument. 20:26
codesections no? I mean, I wouldn't want *every* math operator to upgrade to Num either -- just the ones that need to
How many would need to return a Complex result?
moritz well, Larry was against turning (-1).sqrt into 1i. He said most folks don't know, want or need complex numbers
[Coke] moritz++
moritz and for somebody who isn't familiar with the concept, getting the information that there was an undefined operation is much more useful than some mathematical concept they don't know 20:27
codesections I see. That makes sense – it's trading off consistency, but getting something useful in return.
moritz you could also call Num in, Num out consistent :D 20:28
codesections not sure I agree, but I can see the force of the argument. Thanks, that was exactly what I was asking :D
moritz dates himself by recalling a probably decade-old discussion with TimToady :D 20:29
and you're welcome
codesections well, but Int in, Num out is inconsistent then! (I.e., there's *some* inconsistency with how Raku expands numeric types) 20:30
well, that's why I asked -- I figured there was a years-ago discussion that I hadn't been around for :)
Oh, I see ^^^ in the docs, actually (I was going to add a note, but there's already one there -- I just didn't look in the right place) 20:43
it also points out &roots
m: say (-1).roots(2)[0] =~= i 20:44
camelia True
20:46 nullheroes left 21:00 sono joined 21:02 jess joined
Util m: class L {has Str $.l}; my $c = 0; multi sub infix:<cmp> (L $a, L $b) { say "called {++$c} times"; $b.l cmp $a.l }; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort; my $z = @a[0] cmp @a[1]; # Why is my custom cmp not called by .sort? 21:10
camelia called 1 times
codesections I'm not 100% sure this is right, but I believe it's because your &infix:<cmp> isn't in the lexical scope for &sort's definition. But you can pass it in as a custom comparator with .sort(&infix:<cmp>) 21:18
Util codesections: thanks, I am familiar with custom comparitors in sort. I am really playing with .minpairs, which says it uses <cmp>. Sort should also use <cmp> even more frequently, hence my use of it here. 21:22
Also, the infix:<cmp> definition is after the close of the class, so it *is* in lexical scope, for my explicit single call to cmp, and for the sort. 21:23
codesections I agree that it's in lexical scope for your call to cmp. But isn't it in dynamic scope for &sort? (That is, in scope at the callsite, but not where &sort was defined) 21:25
But I might be wrong about how multis handle scope... 21:27
Util I don't quite follow you on scoping. Can you see some variant of what I am doing that would use my custom <cmp> for sorting or .minpairs? 21:29
21:35 jmcgnh left
codesections hmm, not the most elegant, but this would work I think: 21:35
21:37 thundergnat joined
thundergnat m: class L {has Str $.l}; my $c = 0; multi sub infix:<cmp> (L $a, L $b) { say "called {++$c} times"; $b.l cmp $a.l }; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort(&infix:<cmp>); my $z = @a[0] cmp @a[1]; 21:38
camelia called 1 times
called 2 times
called 3 times
called 4 times
called 5 times
called 6 times
called 7 times
called 8 times
called 9 times
called 10 times
called 11 times
called 12 times
called 13 times
called 14 times
called 1…
thundergnat It IS odd that you need to pass in the declared cmp routine...
codesections m: class L {has Str $.l}; my $c = 0; &infix:<cmp>.wrap(->| { say "called {++$c} times"; $b.l cmp $a.l }) ; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort; my $z = @a[0] cmp @a[1];
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b' is not declared
at <tmp>:1
------> 3>.wrap(->| { say "called {++$c} times"; 7⏏5$b.l cmp $a.l }) ; my @a = map {L.new: :
codesections m: class L {has Str $.l}; my $c = 0; &infix:<cmp>.wrap(->$a, $b { say "called {++$c} times"; $b.l cmp $a.l }) ; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort; my $z = @a[0] cmp @a[1]; 21:39
camelia called 1 times
Died with X::Method::NotFound
in block <unit> at <tmp> line 1

called 2 times
called 3 times
thundergnat It is probably some sort of scoping issue but I am not seeing the reason for it
codesections m: class L {has Str $.l}; my $c = 0; &infix:<cmp>.wrap(->| { say "called {++$c} times"; callsame }) ; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort; my $z = @a[0] cmp @a[1];
camelia called 1 times
called 2 times
called 3 times
called 4 times
called 5 times
called 6 times
called 7 times
called 8 times
called 9 times
called 10 times
called 11 times
called 12 times
called 13 times
called 14 times
called 1…
codesections (and then unwrap after, which is part of what makes it less elegant) 21:40
jdv it could be a optimization that made overloading cmp impossible? 21:41
lizmat would probably know
lizmat what is the nature of the programmatical emergency? 21:42
jdv just skimming src/core.c/Rakudo/Sorting.pm6 hints at that, maybe
thundergnat There are 14 candidates for cmp. github.com/rakudo/rakudo/blob/efb3...er.pm6#L14
Util Classes should be able to define their own ordering. My understanding is that such should be done via custom `multi sub infix:<cmp>` with 2 params, each of the class. 21:43
lizmat that is the idea, yes
thundergnat Util: I agree, it _should_ work 21:44
Util .minpairs *relies* on it working, since it cannot take a &by custom comparitor at call-time.
lizmat is still not sure what should work 21:45
Util From docs/announce: 21:46
2017.04.md:74: + Made Any.maxpairs/.minpairs use `cmp` and return Seq [5927186]
2018.06.md:54: + Made .minpairs/.maxpairs about 25% faster [788cda94]
2018.12.md:32: + Fixed semantics of `minpairs`/`maxpairs` (ignore undefined values) [7bf7a2c6] 21:47
Unfortunatly, I don't have working Docker Rakudo that far back.
21:55 casaca left
Util There is a note in docs.raku.org/routine/cmp : "if $a eqv $b, then $a cmp $b always returns Order::Same." 22:00
but when I also specify a custom <eqv>, it does not get called.
lizmat Util: do you have a golf? 22:01
Util lizmat: just the one I posted shortly before you originally spoke: 22:03
thundergnat colabti.org/irclogger/irclogger_lo...07-28#l202
Util m: class L {has Str $.l}; my $c = 0; multi sub infix:<cmp> (L $a, L $b) { say "called {++$c} times"; $b.l cmp $a.l }; my @a = map {L.new: :l($_) }, <a b c a b c a>; @a .= sort; my $z = @a[0] cmp @a[1]; # Why is my custom cmp not called by .sort?
camelia called 1 times
Util Maybe relevant parts of Roast:
github.com/Raku/roast/blob/c07c5b9...eric.t#L69 22:04
22:05 jmcgnh joined
Util The golf of my actual use-case is: 22:06
m: class L {has Str $.l}; my $c = 0; multi sub infix:<cmp> (L $a, L $b) { say "called {++$c} times"; $b.l cmp $a.l }; my @a = map {L.new: :l($_) }, <a b c a b c a>; say @a.minpairs; my $z = @a[0] cmp @a[1]; # Why is my custom cmp not called by .minpairs?
camelia (1 => L.new(l => "b"))
called 1 times
22:07 casaca joined
lizmat Util: if you change the sort to "@a .= sort(&[cmp]);" it works 22:08
it will then use the infix:<cmp> known in that scope 22:09
I think this is actually one of the things that new-disp will fix
the &[cmp] that .sort sees, does not include your added candidate 22:10
I'm not sure whether that is actually a bug or not, but it *is* incovenient as hell :-)
Util I strongly view it as a bug. 22:11
22:13 casaca left
lizmat testing some stuff now 22:13
Util I see a branch named `new-disp`, but I don't know it's history. Is there already a summary anywhere?
lizmat 6guts.wordpress.com/2021/04/15/rak...ispatcher/ 22:14
Util Oh, *that* one :^) Thank you. 22:17
lizmat ok, I have a fix, but it involves using CALLERS:: 22:22
and I'm pretty sure jnthn doesn't like that :-)
and it will affect performance for the "normal" case 22:23
codesections Util: does the &wrap workaround I suggested address your usecase? (ugly though it might be) 22:26
lizmat Util: have something that may fix this without too much performance loss for the common case 22:37
will make a PR for it tomorrow, as I would like to have more eyes on it
lizmat is now off to bed :-)
Util lizmat: Thanks! I will try to shore up my argument for how custom <cmp> should change the behaviours of other ops and methods. 22:39
22:39 abraxxa-home left
Util codesections: I should not use it for this usecase (exhibition code), but would consider it for real-world, 22:41
if I saw how to actually use it to change the comparator;
`->|` does not give me access to $a&$b to do the real calculation, and `->$a, $b` errors.
Thanks for your efforts, though!
thundergnat, jdv: thank you for contributing! 22:42
codesections (I think you could capture the args in |c and then check if they're $a & $b, but that'd get even uglier and it sounds like there will be a better way soon) 22:43
22:51 squashable6 left 22:52 squashable6 joined 23:00 Doc_Holliwood left