🦋 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: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
07:26 sena_kun joined 07:38 sena_kun left
[Tux] Rakudo v2024.07-169-g5cca0b4fc (v6.d) on MoarVM 2024.07-13-g5e52422f4
csv-ip5xs0.257 - 0.261
csv-ip5xs-201.119 - 1.130
csv-parser1.464 - 1.524
csv-test-xs-200.141 - 0.141
test1.802 - 1.852
test-t0.394 - 0.403
test-t --race0.263 - 0.267
test-t-204.875 - 4.934
test-t-20 --race1.162 - 1.179
07:59
tux.nl/Talks/CSV6/speed4-20.html / tux.nl/Talks/CSV6/speed4.html tux.nl/Talks/CSV6/speed.log
5 2024-08-01 13:21:54 test-t 0.403 08:00
4 2024-08-05 14:33:33 test-t 0.399
3 2024-07-18 08:42:10 test-t 0.399
2 2024-08-01 13:22:46 test-t 0.395
1 2024-08-19 09:58:29 test-t 0.394
20240801 0.403❙20240805 0.399❙20240718 0.399❙20240801 0.395❙20240819 0.394❙
smallest possible win :) 08:01
08:56 MasterDuke left
nine m: use Test; ok EVAL('not OUTER::<$x>:exists'), 'OUTER::<$x>'; my $x; #OK not used 10:47
camelia ok 1 - OUTER::<$x>
nine Ok, why is this the correct behavior? The evaled expression's outer scope is the one that contains the my $x 10:48
The ticket this test was written for is github.com/Raku/old-issue-tracker/issues/655 which only talks about my $a if 0; say $a leading to a compiler crash. The commit message only says that the test is for this ticket and the test description is anything but descriptive. 10:49
m: use Test; my $x; ok EVAL('not OUTER::<$x>:exists'), 'OUTER::<$x>'; 10:54
camelia ok 1 - OUTER::<$x>
nine This ^^^ makes it look somewhat suspicious. Why is the variable declared after the EVAL when it's actual position doesn't matter? That introduces an unneeded element to the test that can only serve to confuse the reader. 10:55
m: use Test; ok EVAL('not OUTER::OUTER::<$x>:exists'), 'OUTER::<$x>'; my $x; #OK not used 10:56
camelia not ok 1 - OUTER::<$x>
# Failed test 'OUTER::<$x>'
# at <tmp> line 1
10:58 guest555 joined
nine And here there's a plot twist! This change reveals that all the test is really testing is that the EVAL implementation does not use a variable called $x. Presumably because the old frontend generates an additional lexical scope wrapped around a comp unit.. 10:59
m: my $x; EVAL('say OUTER::.keys') # Outer scope of eval'ed code is empty.
camelia ()
nine m: my $x; EVAL('say OUTER::OUTER::.keys') # Go out one more scope to get to the actual outer scope
camelia (::?PACKAGE GLOBALish $=pod !UNIT_MARKER $_ $¢ $/ $?PACKAGE $x EXPORT $=finish $!)
nine I'm gonna remove that test. It's bogus, undocumented, has never done what it intended and would fail if we fixed it. 11:00
lizmat +1 11:01
11:18 guest555 left
Geth roast: 2cfdc68b89 | (Stefan Seifert)++ | S04-declarations/my-6e.t
Remove bogus test

The old compiler frontend creates an additional lexical scope that's wrapped around the compunit's scope. Thus OUTER::.keys in an EVAL would always return an empty list. To access the actual outer scope of the EVAL, one would have to access OUTER::OUTER. Thus this test did not actually check whether the variable could be found in the intended ... (17 more lines)
11:20
lizmat notable6: weekly 11:44
notable6 lizmat, No notes for “weekly”
nine Is it me or did this commit introduce a missing semicolon error in line 15? github.com/Raku/roast/commit/d7f03...4834539919 11:57
lizmat it did, and it wasn't caught because of the + on the next line 11:58
nine RakuAST caught it because it throws a "Cannot use variable $sample in declaration to initialize itself" error which I think is quite correct. 11:59
Of course when I add that semicolon, 2 tests fail now: ok picker-seems-random( { $z = @array[ rand*@array ]; } ), '$z = @array[ rand*@array ];'; 12:00
Btw. what the hell is the point of just repeating the tested code in the test "description" that's so common in the spec tests?! 12:01
That doesn't tell the reader anything at all 12:02
lizmat it does the watcher of the test output
nine Doesn't tell them what the test means either 12:03
lizmat there's that...
nine # Failed test '$z = @array[ rand*@array ];'
So what now?
ab5tract Is it broken in base as well? 12:04
Re: description, I like it best when there is both an explanation and a representation of the (at least some of the) test content 12:06
nine yes it is 12:07
m: my $i = 0; my $sample = set (1..15).map({ $i++ }); dd $sample 12:10
camelia $sample = Set.new(5,6,2,10,9,4,1,12,14,0,7,11,3,13,8)
nine m: my $i = 0; my $z; my $sample = set (1..15).map({ $z = $i++ }); dd $sample
camelia $sample = Set.new(14)
nine This ^^^ difference is why it fails
My guess is that we repeatedly add $z's container to the set, thus we retain only the last added element. 12:11
lizmat m: my $i = 0; my $z; my $sample = set (1..15).map({ $z = $i++; $z<> }); dd $sample
camelia $sample = Set.new(11,4,6,2,10,1,0,8,3,5,13,9,7,14,12)
lizmat indeed
maybe dd should be taught to show containers as well 12:12
nine Test is taken straight from a blog post. Original is: 12:13
# Pick a random array element
$z = $array[ int(rand scalar(@array)) ];
$z = $array[ rand @array ];
So that $z = is just copy pasta
Geth roast: e6502dcf1c | (Stefan Seifert)++ | integration/advent2011-day23.t
Fix missing semicolon in test

Commit d7f03fcb90d3cc26ae0c284ac879364834539919 introduce a missing semicolon error. This however did not surface because the following line starts with a prefix + which without the semicolon was interpreted as an infix. The result is that the test sub always returned a true value.
... (9 more lines)
12:17
14:13 coleman left 14:21 coleman joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/08/19/2024-...ing-ahead/ 14:51
Geth roast: 99ab3a00bd | (Stefan Seifert)++ | S12-class/augment-supersede.t
Fix syntax error in test

The test contains an expected error but also an unintended syntax error. If the compiler delays reporting the expected error, it may never get to the point of reporting it. So fix the unintended error.
15:34
jdv nine: is this your full time job for the moment? 15:36
Geth rakudo/main: 9 commits pushed by (Stefan Seifert)++ 15:38
nine 1119 - a lot of work for a single test file
jdv: well it has been for the past 3 weeks thanks to the grant. But I have to prioritize another customer for now. 15:39
Wanted to do so today already but thought I'd finish up that one test file I had already started working on yesterday first. Didn't anticipate this to be such a hard one 15:40
jdv cool. does your real job use raku at all? 15:55
nine Actually no :) 15:57
Well, a really tiny bit
jdv probably safer for the moment:) 15:58
Geth rakudo/main: f829dd376b | (Stefan Seifert)++ | src/Raku/ast/variable-declaration.rakumod
RakuAST: fix our-scoped signature declarations writing to package

We accidentally only updated the declared variables' scopes when there were also traits to apply.
Fixes: package Foo { our ($a) = 1; }; say Foo::a
16:20
nine And then there are simple straight forward bug fixes like this bringing us up to 1120 16:21
16:40 sena_kun joined 16:50 lizmat left 16:51 lizmat joined 19:31 dawids_ joined
Geth rakudo/main: efea1da0fd | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: fix mis-parsing version-like variable names as versions

Fixes: my \v1 = 42; say v1
19:44
nine That was literally a 5 minute job :)
1121 19:49
Geth rakudo/main: 67ab2fb43f | (Stefan Seifert)++ | src/Raku/ast/signature.rakumod
RakuAST: remove counter productive invocant type check on Grammar methods

Grammar methods like tokens or rules are odd in that they are not called with the grammar itself as an invocant but instead with a Match object. Thus doing the usual type check on the invocant would prevent calls from succeeding. The old frontend does not do any type check and so we shouldn't either.
Fixes: grammar D { our token doo { doo }; }; say "doo" ~~ &D::doo
20:05
nine Number 1122 did not take much longer
21:41 dawids_ left 21:47 sena_kun left 23:01 MasterDuke joined