🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | log inspection situation still under development | For MoarVM see #moarvm
Set by lizmat on 22 May 2021.
00:08 reportable6 left 01:09 reportable6 joined 02:09 notable6 left, squashable6 left, statisfiable6 left, greppable6 left, evalable6 left, releasable6 left, linkable6 left, tellable6 left, bloatable6 left, unicodable6 left, shareable6 left, reportable6 left, sourceable6 left, coverable6 left, quotable6 left, committable6 left, benchable6 left, bisectable6 left, nativecallable6 left, frost joined 02:10 releasable6 joined, benchable6 joined, tellable6 joined 02:11 statisfiable6 joined, nativecallable6 joined, quotable6 joined, greppable6 joined, committable6 joined 02:12 evalable6 joined, shareable6 joined 02:56 squashable6 joined 03:10 notable6 joined, sourceable6 joined 03:11 coverable6 joined, linkable6 joined
Geth rakudo: eb151d53bd | (Daniel Sockwell)++ | 2 files
Improve error msg for traits passed invalid args

Previously, traits called with invalid arguments would throw an X::Trait::Unknown error, which was confusing when the trait _was_ known. With this commit, they'll now throw an X::Trait::Invalid instead.
... (9 more lines)
rakudo: a2cf0ea5fb | (Daniel Sockwell)++ | src/core.c/Exception.pm6
Fix typo
rakudo: 0e9b2b7c91 | (Daniel Sockwell)++ (committed using GitHub Web editor) | 2 files
Merge pull request #4786 from codesections-forks/x-trait

Improve error message for traits passed invalid arguments
rakudo: 232a55b96d | (Daniel Sockwell)++ | src/core.c/traits.pm6
Remove unneeded/confusing can('prec') checks

This builds on commits caba0d3 and a7ccfc6 (admittedly not that promptly!). The prior commits moved the .prec method to Code with the to prevent the need of checking whether various functions can prec; this commit removes six such `can('prec')` checks in the `is equiv`,
  `is tighter` and `is looser` traits.
... (12 more lines)
rakudo: 6e6ef03c88 | (Daniel Sockwell)++ (committed using GitHub Web editor) | src/core.c/traits.pm6
Merge pull request #4787 from codesections-forks/trait-checks

Remove unneeded/confusing can('prec') checks
04:10 bloatable6 joined 04:12 reportable6 joined 05:11 bisectable6 joined 06:08 reportable6 left 06:10 reportable6 joined 07:10 unicodable6 joined
lizmat Files=1351, Tests=117115, 300 wallclock secs (36.27 usr 10.20 sys + 4167.31 cusr 342.20 csys = 4555.98 CPU) 07:43
08:33 evalable6 left, linkable6 left
MasterDuke weekly: blog.sunfishcode.online/bugs-in-hello-world/ 08:50
notable6 MasterDuke, Noted! (weekly)
lizmat MasterDuke: the odd thing is, that I think Raku *does* have the bug ? 09:02
MasterDuke yeah, i was a little surprised, but haven't gotten around to doing any testing
lizmat afaik, "say" always returns True 09:13
Geth Terminal-Width: b8e637d143 | (JJ Merelo)++ | 3 files
Terminal-Width: 2988276aa5 | (JJ Merelo)++ | .gitignore
moon-child it _returns_ true, but it throws an exception 09:22
Geth Terminal-Width: b2ad6e5646 | (JJ Merelo)++ | t/00-use.t
Debug Github action
09:32 kjp left 09:33 linkable6 joined 09:34 evalable6 joined
MasterDuke is there any `<foo>` where i can do `my Int $r = <some random Int>; $r == <foo>` and it will always be false, but without a warning? e.g., not Nil, because that warns `Use of Nil in numeric context` 09:35
gfldex m: my $r = 42|0|Inf; say $r == NaN; 09:37
camelia any(False, False, False)
Geth Terminal-Width: 5397430c45 | (JJ Merelo)++ | .github/workflows/test.yaml
Adapt workflow to repo
gfldex MasterDuke: ^^^
moon-child also the DIY route: class Special {}; multi infix:<==>(\x, Special \y) { False }
gfldex You have to make sure not to produce any NaN ofc.
moon-child gfldex: why?
m: say NaN == NaN
camelia False
gfldex I forgot about that. :) 09:39
moon-child :)
gfldex But then, Raku is way smarter then me.
moon-child (though, you still get a warning if you don't initialise $r)
m: say Int == NaN
camelia Use of uninitialized value of type Int in numeric context
in block <unit> at <tmp> line 1
Geth Terminal-Width: 5a6dfdf406 | (JJ Merelo)++ | .github/workflows/test.yaml
No sudo :bug:
MasterDuke m: my $a; $a = do given NaN { when NaN { "nan" }; default { "default" } } for ^10; say $a
camelia nan
moon-child gfldex: I don't know if that's Raku being smarter than you so much as ieee754 being stupider than you, and raku acquiescing :) 09:41
m: say NaN == NaN; say NaN ~~ NaN; say NaN === Nan #MasterDuke
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared name:
Nan used at line 1
moon-child agh
m: say NaN == NaN; say NaN ~~ NaN; say NaN === NaN
camelia False
09:48 sena_kun left 09:52 sena_kun joined
MasterDuke looks like that may work 10:10
10:26 Xliff joined
Xliff \O 10:26
Is there an example implementation of CALL-ME documented somewhere?
MasterDuke m: class A { method CALL-ME($name) { say "Hi, $name" } }; my $a = A.new; $a("Bob")      # you mean something simple like this? 10:29
camelia Hi, Bob
Xliff Hmm... probably not. I thought CALL-ME was used for every method call. 10:30
m: class A { method CALL-ME($name) { if name.lc eq 'bob' { say "Hi, $name" } }; }; my $a = A.new; $a.bob 10:31
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
name used at line 1
Xliff m: class A { method CALL-ME($name) { if $name.lc eq 'bob' { say "Hi, $name" } }; }; my $a = A.new; $a.bob
camelia No such method 'bob' for invocant of type 'A'
in block <unit> at <tmp> line 1
Xliff And no, I don't mean FALLBACK, here.
Basically, I want to be able to intercept all method calls made to an object or its children. 10:32
MasterDuke hm. don't have any methods in the class and have FALLBACK instead call subs with the given name? 10:34
10:41 ShaneC left
MasterDuke m: class A { method !a($name) { say "hi, $name" }; method FALLBACK(|c) { my $method = c[0]; my \args = c.skip; say "sneakily intercepted a call to '$method'"; self!"$method"(|args) } }; A.new.a("Bob") 10:42
camelia sneakily intercepted a call to 'a'
hi, Bob
Xliff LOL! I see whut you did, thar. 10:44
That actually might work in the long run.
Still, setup would be slow since FALLBACK is expensive, no?
MasterDuke i think it got a bit faster with new-disp, but sure, it's probably somewhat slower 10:45
m: class A { method !a($a) { $a + 1 }; method FALLBACK(|c) { my $method = c[0]; my \args = c.skip; self!"$method"(|args) } }; my $a = 0; my $A = A.new; $a = $A.a($a) for ^1_000_000; say now - INIT now; say $a 10:47
camelia 3.626851472
MasterDuke m: class A { method a($a) { $a + 1 }; method FALLBACK(|c) { my $method = c[0]; my \args = c.skip; self!"$method"(|args) } }; my $a = 0; my $A = A.new; $a = $A.a($a) for ^1_000_000; say now - INIT now; say $a
camelia 0.041119068
MasterDuke so ~100x slower
nine Grammar::Tracer does what you seem to want: github.com/jnthn/grammar-debugger/...Tracer.pm6 10:50
Xliff Yeah. 100x slower is not so good. 10:53
nine: Huh! So it does. Thanks! 10:54
nine The Grammar::Tracer method should avoid any slowdowns (except for the one imposed by your wrappers themselves)
Xliff And I've looked at this code before. Kinda was hoping I didn't have to resort to messing with the HOW, but alas...
MasterDuke i'm trying to do ^add_method in FALLBACK, but FALLBACK keeps getting called 10:56
Xliff Hahaha!
Was wondering about that.
MasterDuke but then i do get the error `Package 'A' already has a method 'a' (did you mean to declare a multi method?)`, so it's getting installed, but not called 10:57
Xliff And this doesn't work, either. Surprisingly, I'm surprised this is geting called on BUILDALL! 11:07
12:08 reportable6 left
Geth rakudo: MasterDuke17++ created pull request #4814:
Restore optimization for given/when with Numeric cases
12:55 sena_kun left 12:57 sena_kun joined 13:11 reportable6 joined
Geth Terminal-Width: 6ef432924a | (JJ Merelo)++ | .github/workflows/test.yaml
Use docker installation to check tput
Terminal-Width: 5d9ab442eb | (JJ Merelo)++ | 2 files
Check with new install
Terminal-Width: cb8dd700f1 | (JJ Merelo)++ | .github/workflows/test.yaml
Fix :poop:
Terminal-Width: 628aae98a6 | (JJ Merelo)++ | .github/workflows/test.yaml
Address 'not a TTY' :bug:
Terminal-Width: 84eb945b3c | (JJ Merelo)++ | META6.json
Almost ready to release, closes #3
Terminal-Width: 58143c1443 | (JJ Merelo)++ | lib/Terminal/Width.pm6
Test for existence of tput, closes #2
Terminal-Width: deedb0cb24 | (JJ Merelo)++ | META6.json
:arrow_up: for release
14:11 evalable6 left 15:02 frost left 15:23 squashable6 left 15:24 squashable6 joined
MasterDuke m: my $a; $a = do given "NaN" { when NaN { "nan" }; default { "default" } }; say $a       # is this correct? 15:36
camelia nan
MasterDuke bisectable6: old=2021.05 my $a; $a = do given "NaN" { when NaN { "nan" }; default { "default" } }; say $a 15:37
bisectable6 MasterDuke, Bisecting by output (old=2021.05 new=6e6ef03) because on both starting points the exit code is 0
MasterDuke, bisect log: gist.github.com/29342d490a15139094...e0aec84ce2
MasterDuke, (2021-12-27) github.com/rakudo/rakudo/commit/58...fbdfaa6e43
MasterDuke committable6: 2021.11 my $a; $a = do given "NaN" { when NaN { "nan" }; default { "default" } }; say $a 15:38
committable6 MasterDuke, ¦2021.11: «Cannot find this revision (did you mean “2021.12”?)»
MasterDuke committable6: 2021.10 my $a; $a = do given "NaN" { when NaN { "nan" }; default { "default" } }; say $a
committable6 MasterDuke, ¦2021.10: «default␤»
[Coke] doc test shows that we have Range.sum doc'd as returning Numeric, but the source doesn't have that restriction. Should it? 15:52
nine lizmat: FWIW I would approve your PR on "Preparing the Raku Ecosystem for the Future", but I'm not a reviewer in the problem-solving repo :) 15:55
15:56 cognominal joined
MasterDuke [Coke]: can't think why not, though fwiw, none of the sum methods or subs have a return type 15:58
[Coke] nine++ for making me check that apparently I was a requested reviewer.
Performance concerns?
Seems like being explicit is good, esp. these days? 15:59
nine Python mantra says "explicit is better than implicit"
Return type checks can be speshed away. That was one of the original goals for spesh plugins and later new-disp. 16:00
They are what makes return "dispatchy"
[Coke] I can put together a PR that makes all the sums Numeric and see if it breaks anything. 16:02
16:13 evalable6 joined
lizmat nine: wonder why Github allows me to select you as a reviewer, and not allowing you to review :-( 16:58
nine: could you try again? 17:01
17:50 Kaipi left 18:07 reportable6 left 18:09 reportable6 joined 18:29 Xliff left
nine lizmat: oh, Github would allow me, but I've never signed up to be a reviewer in problem-solving 18:44
18:45 Kaipi joined
nine I was just happy to leave this pondering to others as I usually have no problem staying busy anyway :) 18:45
cognominal It seems many people have no problem lizmat acting as benevolent dictator. Within the raku community. Outside, it seems to be different. Liz tried to drafted me too. I am not competent. 18:49
* draft
And I prefer not to talk about the fracture between the Perl and the raku community. I have been ousted in France from the former and I don't really feel worthy for the later :) 18:51
18:57 ShaneC joined
lizmat nine: ok, sorry for the misunderstanding 19:01
cognominal lizmat++ for taking care
20:22 notna joined
[Coke] indeed. 20:32
so I tried changing all the sums to declare --> Numeric... and a spectest about junctions failed.
m: my @a = km-cd-webapp.ame.intela.deloitte.c...tax-matrix 20:33
camelia ===SORRY!=== Error while compiling <tmp>
at <tmp>:1
------> my @a = https:⏏//km-cd-webapp.ame.intela.deloitte.com/U
expecting any of:
colon pair
[Coke] carp
MasterDuke HA 20:35
s/HA/ha 20:36
20:37 sena_kun left 20:38 sena_kun joined
[Coke] m: dd (2, 3|4, 5, 6|7).sum 20:38
camelia any(any(16, 17), any(17, 18))
[Coke] so the sum returns a Junction and the declared -->Numeric fails.
20:43 notna left
gfldex m: dd (True, True).sum; 21:33
camelia 2
gfldex So to make return type constraints work (not just for sum), Junctions would need to become Nilish. 21:38
What makes sense to me, as Junctions stand outside the ordinary type system. 21:39
22:14 Xliff joined