02:28 kvw_5_ joined 02:32 kvw_5 left 04:59 linkable6 left, releasable6 left, quotable6 left, coverable6 left, squashable6 left, shareable6 left, notable6 left, benchable6 left, statisfiable6 left, evalable6 left, nativecallable6 left, sourceable6 left, committable6 left, greppable6 left, bloatable6 left, tellable6 left, bisectable6 left, unicodable6 left, coverable6 joined, sourceable6 joined, unicodable6 joined 05:00 squashable6 joined, quotable6 joined, shareable6 joined, greppable6 joined, bisectable6 joined, linkable6 joined 05:01 notable6 joined, committable6 joined, nativecallable6 joined, releasable6 joined, benchable6 joined, tellable6 joined, evalable6 joined, statisfiable6 joined 05:02 bloatable6 joined 06:31 sourceable6 left, bisectable6 left, evalable6 left, quotable6 left, coverable6 left, nativecallable6 left, shareable6 left, unicodable6 left, linkable6 left, greppable6 left, bloatable6 left, squashable6 left, notable6 left, benchable6 left, releasable6 left, statisfiable6 left, committable6 left, tellable6 left 06:32 squashable6 joined, releasable6 joined 06:33 sourceable6 joined, unicodable6 joined, tellable6 joined, nativecallable6 joined, shareable6 joined, greppable6 joined, bisectable6 joined, committable6 joined, coverable6 joined 06:34 benchable6 joined, linkable6 joined, bloatable6 joined, evalable6 joined 06:35 notable6 joined, quotable6 joined, statisfiable6 joined
gfldex codesections: You may have been thrown off by BagHash.add because it doesnt follow the OOP principal "In doubt return self.". 07:07
07:37 domidumont joined
moritz that is not a general OOP principle 07:57
it's popular in the context of "fluent" interfaces 07:58
nine MasterDuke: elems on a type object usually indicates that something went wrong. We'd lose the notification if it just returned 0 instead of throwing an exception. Usually the sooner an error gets pointed out, the easier it is to debug. 08:40
08:42 epony left 08:56 sena_kun left 09:01 sena_kun joined
MasterDuke nine: true... and fwiw, github.com/rakudo/rakudo/pull/4239 still has problems after that change. any suggestions? 09:10
nine: oh, and for raku at least, github.com/rakudo/rakudo/blob/mast...ny.pm6#L87 elems on a type object is supposed to return 1 09:17
09:52 [Tux] left 09:56 [Tux] joined 10:21 epony joined
sena_kun reluctantly started a blin run 11:21
lizmat sena_kun++ 11:24
11:29 Altai-man_ joined 11:30 sena_kun left 11:55 MasterDuke left
Altai-man_ at 0: expected a json object, but got '"<?xml ve"' 11:55
in sub parse-thing at /opt/rakudo-pkg/share/perl6/site/sources/BB6CD9B6E68F5CEA96238D619F384C2590058CDA (JSON::Fast) line 709
in sub from-json at /opt/rakudo-pkg/share/perl6/site/sources/BB6CD9B6E68F5CEA96238D619F384C2590058CDA (JSON::Fast) line 717
in sub MAIN at bin/blin.p6 line 168
not this time, my friend 11:56
11:56 MasterDuke joined
lizmat Altai-man_: hmmm... can you always represent XML as a JSON structure? If so, perhaps we should make that DWIM? 12:03
tbrowder hi, folks
Altai-man_ lizmat, no, that's something going wrong somewhere and I don't have enough time until this evening to investigate. 12:05
lizmat Altai-man_: understood 12:06
tbrowder i want to lobby for a couple of additions to the raku core: (1) a "frac" routine and (2) a new way to instanciate a DateTime object by a Julian date value (from the astronomical value of a date) 12:07
lizmat tbrowder: PR's are welcome! :-)
tbrowder: DateTime object from Julian date, or Date object? 12:08
tbrowder i asked for the frac routine a year but got shot down (i'm happy to do a PR).
lizmat: hi 12:09
lizmat ah? did it get shot down in a PR or somewhere else ?
tbrowder from Julian date to start
it got shot down in discussion here (or raku-dev) 12:10
lizmat well, it might still get shot down in a PR, but at least it may get more eyes on it then 12:11
I don't have any recollection of it being suggested, but that may well be my memory going :-)
tbrowder but we have some new and younger ppl now ;-D
mine, too 12:12
lizmat also: perhaps create an associated problem solving issue
as it appears to have been shot down on lack of merit, rather than on the implementation ?
tbrowder ok, on frac, what about Julian date <=> DateTime, same thing? 12:13
as i recall on frac it was more like "use '$x - $x.truncate'; we don't need another builtin math routine" 12:16
but i'll see about a PR first. 12:17
lizmat fwiw, by that same logic, we wouldn't need %% vs % :-) 12:18
tbrowder exactl! i don't want to go the python route, i love the huge amount of built-in stuff! 12:19
gimme more! 12:20
bye 12:21
lizmat notable6: weekly 12:28
notable6 lizmat, 2 notes: 2021-03-05T13:22:19Z <CIAvash>: lobste.rs/s/diluza/imagining_ideal...or_writing ; 2021-03-05T15:36:15Z <lizmat>: lobste.rs/s/diluza/imagining_ideal...or_writing
lizmat notable6: weekly reset 12:29
notable6 lizmat, Moved existing notes to “weekly_2021-03-08T12:29:48Z”
Geth nqp: c098e878e9 | (Elizabeth Mattijsen)++ | tools/templates/MOAR_REVISION
Bump MoarVM to get latest fixes
lizmat Files=1346, Tests=117203, 232 wallclock secs (30.21 usr 8.13 sys + 3218.90 cusr 299.46 csys = 3556.70 CPU) 13:04
Geth rakudo: 1d1cd829b4 | (Elizabeth Mattijsen)++ | tools/templates/NQP_REVISION
Bump NQP to get the latest fixes
lizmat Altai-man_ ^^ a more up-to-date Rakudo to run Blin on :-) 13:17
m: my Int(Num) ($a,$b) = <42 666>; dd $a, $b # vrurg: shouldn't this fail ? 13:58
camelia IntStr $a = IntStr.new(42, "42")
IntStr $b = IntStr.new(666, "666")
lizmat aaha... I guess because IntStr is an Int, it doesn't check the source type? 13:59
afk for a few hours&
14:26 Xliff joined
Xliff o/ 14:26
timotimo: Was it you who came up with a method to run C-function pointers into raku? 14:27
I can't seem to find that on IRC search. Do you remember what you did?
Nevermind. I found it in the docs!~ 14:30
15:03 Xliff left
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/03/08/2021-...ated-star/ 17:05
17:27 domidumont left 17:40 camelia left 17:49 camelia joined
gfldex m: for '.' { next if !.IO.d; .IO.dir()».&?BLOCK when .IO.d; } 18:05
camelia Failed to get the directory contents of '/home/camelia/.cpan/build/BSD-Resource-1.2910-9GYCiC/t': Failed to open dir: Permission denied
in block <unit> at <tmp> line 1
gfldex Could anyone confirm that this loops forever an HEAD please?
This used to work (I think) and it breaks my code. :( 18:06
18:14 domidumont joined
lizmat gfldex: looks like, but only if you have a subdirectory in "." 18:28
which makes sense, as it in that case will call itself ??
gfldex there seams to be a problem with recursing via ».&?BLOCK with a next. If I replace next with if/else it works fine. Sadly this is as far as I can golf it. 18:29
lizmat hmmm... looks like something in the past weeks reduced startup time from 120 msecs to < 100 msecs ?
at least for me
gfldex: please make an issue for that, it feels like a weird way of doing recursion to me, but it should work 18:44
gfldex: or do you have the idea this is a recentish regression ?
bisectable6: old=2021.02.1 <a b c>.deepmap: { next if $_ eq "b"; .say } 18:46
bisectable6 lizmat, Bisecting by exit signal (old=2021.02.1 new=1d1cd82). Old exit signal: 0 (None)
lizmat gfldex: ^^ that would be a golf
bisectable6 lizmat, bisect log: gist.github.com/f442cb65ba260110da...6e226c9822 18:47
lizmat, (2021-02-21) github.com/rakudo/rakudo/commit/41...6dd1ffc062
lizmat yeah, figured :-(
gfldex: confirmed regression 18:49
18:49 domidumont left
lizmat Altai-man_: if you're working on a Blin run, please hold off for another 15 mins or so 18:52
Altai-man_ lizmat, I am trying to make Comma work, so no worries. :) 18:53
lizmat ok, moar power to you :-)
Geth rakudo: 171d3c4642 | (Elizabeth Mattijsen)++ | src/core.c/Exception.pm6
Make printf directive error more descriptive
rakudo: d18653c423 | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Fix regression found by gfldex++

Basically, next was causing infinite looping when used inside of the recently re-imagined .nodemap / .deepmap / .duckmap methods. Apparently nqp::handle needs to have a 'NEXT' handler specified, even if it doesn't actually do anything.
roast: 96e05f576d | (Elizabeth Mattijsen)++ | 2 files
Add tests for "next" on nodemap/deepmap/duckmap
gfldex lizmat: quite recentish acutally :)
lizmat yeah... the >>. should have been a trigger for me 19:06
but I got distracted with the .IO handling :-)
afk for a few hours& 19:08
gfldex lizmat: my code works again. Thanks for the swift aid. 19:22
vrurg lizmat: with regard to Int(Num) – you're guessed it right, IntStr ~~ Int. 19:59
*you've 20:00
20:12 patrickb joined
ugexe is $! thread safe? 21:42
gist.github.com/ugexe/7f5cec97ca59...5e46fb472e -- wondering if $! or $_ is getting set incorrect in this example
i didn't think it was thread safe, and i was checking to show in a recent SO question that using $! probably isn't a good idea
codesections: ^ 21:44
codesections ugexe: interesting, thanks. (That is a _dense_ line of Raku code, by the way. By the time I reached the end, I think I'd learned at least two things that weren't even the point you were trying to show!) 21:52
lizmat vrurg: but, note the "from" constraint! 21:53
m: my Int(Num) $a = "42" 21:54
camelia Type check failed in assignment to $a; expected Int(Num) but got Str ("42")
in block <unit> at <tmp> line 1
lizmat m: my Int(Num) $a = 42
camelia ( no output )
lizmat 42 is *not* a Num!
m: my Int(Num) $a = 42e0
camelia ( no output ) 21:55
ugexe yeah a bit of boilerplate to make it keep running until it eventually fails
(1..100000).race(:batch(1), :degree(20)).map: { try die $_; die "$_ -- $!" unless $_ eq $! }
is the key bit
codesections yeah, I got there :-)
I take it that an inner CATCH block would be threadsafe? 21:56
ugexe yeah
21:56 patrickb left
codesections m: my Int(Str) $a = 1 21:56
camelia ( no output )
codesections lizmat: ^^^^ isn't it just that it passes the type constraint without needing to convert? 21:57
vrurg lizmat: yes, no conversion takes place. Why should it? 21:58
lizmat well... the way I always interpreted it, is that the type between () is the constraint that should match the value *before( coercion
vrurg lizmat: so, you were always wrong. :)
lizmat vrurg: but it doesn't check the constraint type in that case
vrurg Coercion is about loosening restrictions, not about tightening them. 21:59
So, it makes possible to accept more input types than without it.
vrurg feels like we had this discussion before. :)
lizmat m: multi a(Int(Num)) { "Num" }; multi a(Int(Str)) { "Str" }; say a "42" 22:00
camelia Str
lizmat note that it selected the candidate with the Str "from" constraint
vrurg Sure it will.
lizmat m: multi a(Int(Num)) { "Num" }; multi a(Int(Str)) { "Str" }; say a <42> 22:01
camelia Ambiguous call to 'a(IntStr)'; these signatures all match:
(Int(Num) $)
(Int(Str) $)
(Int(Str) $)
in block <unit> at <tmp> line 1
22:01 tyil left
vrurg Of the two coercions Int(Str) is possible, but Int(Num) is not. 22:01
22:01 tyilanmenyn joined
vrurg And this is also correct because IntStr is both Int and Str and how do we know where to pass it? 22:01
codesections vrurg: so how do you mentally "read" a type constraint. I've always read `Int(Str)` as "a Str that can be coerced into an Int". But that reading wouldn't allow an Int:D. How should one read it? 22:02
lizmat vrurg: in the last case, there are 3 candidates shown, that's also, weird ?
vrurg I read it as "I want Int, but Str would also be OK"
lizmat: where it takes the third candidate is rather a question to multi dispatch which I'm not very well familiar with. 22:03
m: multi a(Int(Num)) { "Num" }; multi a(Int(Str)) { "Str" }; say &a.candidates
camelia (&a &a)
lizmat I guess it's just listing the Int(Str) candidate twice
aka, a problem in error reporting, not in the dispatch itself 22:04
vrurg Apparently it does, but it has nothing to do with coercion.
lizmat I guess I'm still just misunderstanding 22:05
what does Int(Num) mean in a signature ?
MasterDuke ugexe: might be the same as github.com/MoarVM/MoarVM/issues/1434
lizmat vrurg: does it dispatch on Num or on Int ?
vrurg lizmat: See my reply to codesections. It means "we need Int but will accept Num if necessary"
First it tries to dispatch on Int. If this doesn't work it considers Num or Str. 22:06
But more precisely, it checks if IntStr ~~ $param.type and collects variants. Then candidates are given weight coefficients to choose better match. 22:07
In case with IntStr coefficients for the two candidates turns out to be the same and we get ambiguity. 22:08
I think jnthn can tell better than me. I never actually analyzed multi-dispatch code deep enough, just some parts of it. 22:09
ugexe well its a little more detailed than that of course -- sub foo(Int(Num) $x) { } and sub foo($x where Int|Num) { } aren't the same but both read "we need Int but will accept Num if necessary"
vrurg ugexe: it's because in `where` case $x is Any. 22:13
So, yes, technically it's more detailed.
I'd describe the second case as "I want Any but only if it's Int or Num" 22:14
ugexe i was thinking something like "I want a Foo, but if its a Bar turn it into a Foo first" 22:15
which might be wrong... but basically the actual coercion part isn't explained (or maybe it was just implied) 22:16
vrurg ugexe: your variant is certainly better as it does include the coercion part 22:18
Altai-man_ lizmat, sadly, I am afraid there will be no new Blin runs until I get a better hardware.
lizmat :-( 22:19
vrurg Altai-man_: if you have a setup I can simply unroll and start with one command – I can try it on my blin-dedicated VM. 22:20
Altai-man_ vrurg, git clone -b ugexe-patch-1 github.com/Raku/Blin.git; docker build -t myblin -f docker/Dockerfile . (or `cd docker; docker build -t myblin -f Dockerfile .`, I honestly don't remember which one is correct, but the wrong one will fail :) ), then `docker run -ti -v /var/tmp/Blin-volume:/mnt myblin --nproc=20`. 22:23
this is more than a single command, but you can && it. :P
Altai-man_ remembers that old "gentoo installation in just three commands" joke 22:24
vrurg Altai-man_: will it auto-publish the results?
Altai-man_ vrurg, you need to create /var/tmp/Blin-volume for it to mount and work with. Then inside you will found output directory with failures.md file you can gist. 22:25
It is already prettified and all, so just gist is okay and I'll help in case there are difficulties.
vrurg Ok. Let's try it. I was running blin from a cloned repo dir. 22:26
22:27 tyilanmenyn is now known as tyil
Altai-man_ vrurg, that's an option too, but using docker is safer than a real system, because you know why. 22:28
vrurg, thanks.
vrurg Altai-man_: that's why I have a dedicated VM. If anything – I just re-clone it from a template. 22:29
Altai-man_ vrurg, fair enough.
vrurg So, I basically don't need docker then. 22:30
Altai-man_: then if I just run it with 'raku -Ilib ./bin/blin.p6 --new=master' – will it do what you need? 22:31
Altai-man_ vrurg, yes, --new can be omitted, plus set --nproc to number of threads you can afford (better to be a bit lesser than the maximum, say you have 24 - set 20 instead), plus make sure you are on the patched branch. 22:36
vrurg Altai-man_: does it pick up the number of cores automatically? I guess it is. The VM is already limited to 50 out 56 cores. 22:40
Altai-man_ vrurg, if you don't specify it it will just take result of `nproc` execution. 22:41
vrurg, it is always neater IMO to set it yourself.
Altai-man_ goes to sleep
codesections 56 cores? 22:42
codesections whistles
vrurg codesections: an old HP Z840. Bought it last Sep specifically to offload development from macbook. 22:44
ugexe MasterDuke: i was thinking $! was inherently not thread safe
codesections very cool
ugexe m: (1..100000).race(:batch(1), :degree(20)).map: -> $i { try die $i; sleep (1..5).pick; die "$i -- $!" unless $i eq $!; } 22:45
camelia A worker in a parallel iteration (hyper or race) initiated here:
in block <unit> at <tmp> line 1

Died at:
3 -- 20
in block at <tmp> line 1
MasterDuke very well could be. that just looked like the error i'd seen recently in two other unrelated examples
ugexe adding a sleep makes its very easy to show
vrurg codesections: absolutely must have when hunting for rare race conditions in code. Spared me many hours on testing. 22:46
ugexe if $! indeed isn't thread safe i wonder if internal use of $! should be changed to use something like gist.github.com/ugexe/69beaf940646...cb567c2a08 23:14
vrurg .tell Altai-man Blin at ugexe-path-1 branch fails for me: gist.github.com/vrurg/a40d86aa09a6...5b4df3355b Will run it on master.
tellable6 vrurg, I'll pass your message to Altai-man_
ugexe the master branch doesn't have access to the new ecosystem, so i suspect many dependencies will be missing 23:17
vrurg ugexe: but the patch just doesn't work. 23:27
23:30 MasterDuke left
Geth nqp/QAST-Node-doc: d6c5e57d49 | (Stéphane Payrard)++ | docs/qast.markdown
Update QAST documentation. All nodes present. 2 are placeholder
tbrowder m: say -1.5e0.Int 23:56
camelia -1
tbrowder m: say -1.5e0.abs
camelia -1.5
tbrowder that looks like a bug, does it not? 23:57