00:09 MasterDuke left 02:17 lucasb left 02:32 leont left 02:39 maggotbrain left 02:40 maggotbrain joined 05:16 frost-lab joined 05:25 jdv79 left, jdv79 joined 05:54 lucs left 07:59 Altai-man joined 08:10 sena_kun joined 08:12 Altai-man left 08:17 domidumont joined 09:00 MasterDuke joined
MasterDuke m: my $a; my $s = now; $a = do given "hi" { when 3 { "three" }; when 5 { "five" }; when "hi" { "hello" }; when * > 40 { "> 40" }; default { "default" } } for ^40_000; say now - $s; say $a 09:10
camelia 7.73646496
hello
MasterDuke interesting. a profile of ^^^ shows the time dominated by github.com/rakudo/rakudo/blob/mast...ce.pm6#L98 44% of the entire execution is spent there 09:11
that's coming from the failed `"hi".Numeric` -> `val` -> `parse-real` -> etc. 09:15
the Backtrace is being created here github.com/rakudo/rakudo/blob/mast...re.pm6#L13 from github.com/rakudo/rakudo/blob/mast...re.pm6#L32 from github.com/rakudo/rakudo/blob/mast...e.pm6#L147 09:21
09:23 eater joined
MasterDuke is there a way to know we can create a cheaper Failure? it's coming from here github.com/rakudo/rakudo/blob/mast...#L216-L222 maybe the fact that it's being sunk can be propagated forward? 09:27
09:52 maggotbrain left 10:32 MasterDuke left
sena_kun releasable6, status 10:37
releasable6 sena_kun, Next release in ≈9 days and ≈8 hours. 1 blocker. Changelog for this release was not started yet
sena_kun, Details: gist.github.com/31b2233050d141a062...1a301f1f4e
10:38 MasterDuke joined
lizmat MasterDuke: it's been a while since I looked at making Backtrace cheaper 10:56
aaahh... val processing.... another one of my dead projects :-( 10:57
MasterDuke lizmat: that would obviously have the most global help. but cheaper failures, or cheaper failures at that particular spot, would at least help this specific usecase 10:59
lizmat I'll see if I can muster the courage to look into that again 11:00
MasterDuke but i have almost no knowledge/understanding of Failures, Exceptions, sinking, and how they all interact
i was attempting to gen more optimized code for given/when, but then noticed very little difference because the runtime is dominated by that fail->...->backtrace path. Amdahl strikes again... 11:02
lizmat welcome to much of my world :-)
MasterDuke heh
fwiw, i have sped up that previous example from ~4.2s to ~3.3s locally, passing a spectest (and some ah-hoc test cases that broke, but weren't covered by the spectest). but it's codegen changed in Actions, and i'm not sure how much it would change/survive the rakuast branch 11:06
lizmat MasterDuke: if you figure out a smarter codegen for when, then I'm pretty sure that's going to be portable to the rakuast branch 11:15
MasterDuke it's not particularly smart or pretty, but i'll clean it up and PR it for improvement suggestions 11:17
11:32 MasterDuke left 12:09 Altai-man joined 12:12 sena_kun left, lucs joined 12:18 frost-lab left 12:39 leont joined 13:04 MasterDuke joined 13:37 tyil left 13:38 tyilanmenyn joined 13:39 tyilanmenyn is now known as tyil 13:48 lucasb joined 13:51 raku-bridge left, raku-bridge joined
MasterDuke hm. i've come up with a new test case that reveals a problem with my change not covered by a spectest 14:21
m: given Int { when 0 { say "zero" }; default { say "default" } }
camelia default
MasterDuke my change warns about `Use of uninitialized value of type Int in numeric context` and then prints 'zero' 14:22
ugexe `"depends" : [";top:from<native>"]` -- there is code in the ecosystem (not zef) that will run arbitrary code just parsing dependencies. i wonder how we, or the ecosystem, should handle security issues of this severity
MasterDuke because i gen when of a QAST::IVal as iseq_i to .Numeric called on the given value 14:24
and Int:U coerces to 0 14:25
m: say 0.ACCEPTS(Int) 14:26
camelia False
14:27 Kaiepi left, Kaiepi joined
MasterDuke anyone have a good idea for getting around this? heh, i could only do it if there's a compile time value != 0... 14:28
vrurg m: given Int { when Int { say "Int" }; when 0 { say "zero" }; default { say "default" } } 14:32
camelia Int
vrurg MasterDuke: ^
MasterDuke yeah, that still works with my changes. the problem comes if you don't have the `when Int { ... }` 14:34
with my changes it matches the `when 0 { ... }` 14:35
vrurg What changes have you done, BTW? Just yesterday I was modifying Bridge to work with new coercions. 14:36
m: say Int ~~ 0
camelia False
vrurg m: say 0 ~~ Int 14:37
camelia True
lizmat ugexe: could you make a problem-solving issue for that ?
MasterDuke vrurg: gist.github.com/MasterDuke17/99599...d7ebfe708c
vrurg MasterDuke: Ha, wait for R#3891 to merge. Your sample gives me 'default' on that branch. 14:39
linkable6 R#3891 [open]: github.com/rakudo/rakudo/pull/3891 [data types][type captures] New coercion semantics
vrurg And, with regard to that PR, I'd like someone with JVM background to help me locate a problem in it. 14:40
MasterDuke that branch + my diff?
vrurg No. Just my branch gives me 'default' on the given/when above. 14:42
⇒ rakudo-m -e 'given Int { when 0 { say "zero" }; default { say "default" } }' 14:43
default
MasterDuke yeah, master does too. but my branch/changes give 'zero' (plus a warning) 14:44
btw, what's the JVM problem with that PR. 14:46
vrurg Ah, I'm still sleepy, perhaps. :(
MasterDuke: dev.azure.com/Rakudo/rakudo/_build...8&l=67 14:47
MasterDuke if i get some free time i'll take a look, but i'd really recommend pinging bartolin/usev6 14:50
fwiw, there are a bunch of XXX/TODOs in the PR
vrurg Will try them later today. I never remember who's good with JVM. 14:51
[Coke] sees src/vm/js took a different approach than moar/jvm (lacks a stage0 with .js files) 14:54
(nqp)
vrurg MasterDuke: the only XXX to be really taken care of is about taking care of nominalization. coerce_type to be marked deprecated at some later time, after, say, two Rakudo releases.
MasterDuke oO(weekly: [Coke]++ is well started on his promised new .NET 5.0 backend for NQP) 14:56
[Coke] THAT IS A LIE 14:57
You know what I did? I learned enough C# to iterate over argv and dump it out. that's it. :) 14:58
but I imagine a dotnet version would check in DLLs there.
vrurg MasterDuke: with regard to your smartmatch patch, you just shouldn't invoke coercion methods on undefined. I see that under QAST::Want branch you don't check for this. So, if the `Int` in a Want, you invoke Numeric unconditionally on it. This certainly results in a warning and a 0 as the return value. 15:00
MasterDuke yeah, the problem is i'm trying to find a smaller/faster implementation than the default of just calling .ACCEPTS which does handle this fine. so i want to add as little checking code as possible. but yeah, maybe i'll have to gen a !isconcrete branch in the checks 15:04
[Coke]: does .NET use dlls on linux?
vrurg: i've run into this kind of problem before when trying to optimize stuff that promises a smartmatch in the semantics. smartmatch does so much, that even trying to optimize simple cases is tough 15:08
vrurg MasterDuke: Unfortunately, there is no other workaround anyway. Let's just hope that if+isconcrete is fast enough. :) 15:10
It should be faster for sure because .ACCEPTS results in more than one code invocation. And is unlikely to be inlined. 15:12
[Coke] MasterDuke: it does on os x, anyway. 15:35
MasterDuke huh
[Coke] you can run it directly, or do a build which generates dll files, and then run those 15:37
(based on intro understanding)
16:07 finsternis left 16:10 sena_kun joined 16:12 Altai-man left 16:24 vrurg left
MasterDuke timotimo: do you have a 2020.10 appimage made? 16:36
[Coke] if I want to work on stuff in nqp that also touches nqp-configure, fork both, how do I configure my copy of nqp to look at my copy of nqp-configure? 17:12
MasterDuke [Coke]: maybe you can edit your .gitmodules? 17:14
in nqp
17:14 Kaiepi left 17:15 Kaiepi joined 17:16 Kaiepi left, Kaiepi joined
[Coke] Danke. 17:18
17:19 vrurg joined
[Coke] ... guess I need to read up on submodules. 17:21
17:59 squashable6 left 18:02 squashable6 joined 18:10 domidumont left 18:42 MasterDuke left 20:09 Altai-man joined 20:12 sena_kun left 20:24 MasterDuke joined 20:29 MasterDuke left 21:08 MasterDuke joined 21:56 MasterDuke left 22:31 Altai-man left 22:32 sena_kun joined 22:41 Kaiepi left 22:49 Kaiepi joined
timotimo .tell MasterDuke github.com/timo/rakudo-appimage/re...ag/2020.10 23:13
tellable6 timotimo, I'll pass your message to MasterDuke
23:16 sena_kun left 23:23 JJAtria[m] left 23:24 JJAtria[m] joined