🦋 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.
Geth rakudo/align_precomp_files: 7882aa030c | (Timo Paulssen)++ | src/core.c/CompUnit/PrecompilationUnit/File.rakumod
Align bytecode part of precomp files to 8 bytes

Otherwise all the alignment we do when actually creating the moar bytecode file contents are useless.
In particular, we want the actual opcodes to be on 2 byte alignment.
05:16
rakudo: timo++ created pull request #5793:
Align bytecode part of precomp files to 8 bytes
05:18
[Tux] Rakudo v2025.02-30-ga83a0fb7e (v6.d) on MoarVM 2025.02-3-gbe8f690b4
csv-ip5xs0.260 - 0.263
csv-ip5xs-201.088 - 1.093
csv-parser1.125 - 1.160
csv-test-xs-200.137 - 0.138
test1.893 - 1.907
test-t0.410 - 0.416
test-t --race0.270 - 0.281
test-t-204.985 - 5.072
test-t-20 --race1.258 - 1.278
07:25
tux.nl/Talks/CSV6/speed4-20.html / tux.nl/Talks/CSV6/speed4.html tux.nl/Talks/CSV6/speed.log
Geth rakudo/align_precomp_files: 83c3134fc3 | (Timo Paulssen)++ | src/core.c/CompUnit/PrecompilationUnit/File.rakumod
Align bytecode part of precomp files to 8 bytes

Otherwise all the alignment we do when actually creating the moar bytecode file contents are useless.
In particular, we want the actual opcodes to be on 2 byte alignment.
07:53
rakudo/main: aa1578054a | (Stefan Seifert)++ | 3 files
RakuAST: remove some attach method stragglers

Follow up to commit 6276062f7a26056b3f67deab43dfd5ba41725c7d
08:58
Geth rakudo/main: ecfc3a8e11 | timo++ (committed using GitHub Web editor) | src/core.c/CompUnit/PrecompilationUnit/File.rakumod
Align bytecode part of precomp files to 8 bytes

Otherwise all the alignment we do when actually creating the moar bytecode file contents are useless.
In particular, we want the actual opcodes to be on 2 byte alignment.
09:06
lizmat here I was wondering how .assuming handled defaults on parameters, and it turns out it doesn't 09:44
m: sub a($a, $b = 42) { say $b }; my &b = &a.assuming(666); b # expecting 42 instead of Nil 09:45
camelia Nil
nine m: class Foo { has $!a; method new($a is rw) { self.CREATE.BUILD($a) }; submethod BUILD($a is rw) { $a = 2 } }; my $a; Foo.new($a); say $a 09:47
camelia 2
nine but:
m: class Foo { has $!a; method new($a is rw) { self.CREATE.BUILD($a) }; submethod BUILD($!a is rw) { $!a = 2 } }; my $a; Foo.new($a); say $a
camelia (Any)
lizmat well, you're not supposed to call BUILD yourself ?
nine That's missing the point a bit... 09:48
lizmat the first one is just a very convoluted way to say: 09:50
m: sub a($a is rw) { $a = 2 }; my $b; a($b); say $b 09:51
camelia 2
lizmat it has nothing to do with being a class or having attributes ?
nine Point is we allow traits on attribute arguments when they don't have any effect at all. 09:52
lizmat I guess I am missing the point ?
nine Also:
m: class Foo { has Str $!a; method new($a) { self.CREATE.BUILD($a) }; submethod BUILD(Int $!a) { } }; my $a; Foo.new(3); say $a
camelia Type check failed in assignment to $!a; expected Str but got Int (3)
in submethod BUILD at <tmp> line 1
in method new at <tmp> line 1
in block <unit> at <tmp> line 1
nine We allow conflicting type restrictions on such arguments 09:53
lizmat and if we fix that in RakuAST, do we break spectests ?
nine I don't know. For sure not gonna add any more work to the already too large pile :) 09:57
lizmat understood 09:59
timo would it be easy to build assuming on top of a dispatcher? 10:06
oh, that's not the important bit
the important bit is for the thing "assuming" returns to have a correct signature itself?
lizmat yes
I'm getting close to handling it with some RakuAST 10:07
the tricky bit was the handling the default value of a Parameter
but that isn't handled by .assuming anyway, so that's one less issue to worry about
timo right, as it can be a callable, right?
lizmat in and out, indeed 10:08
timo it can be a callable that can refer to other parameters i think?
lizmat don't think so?
timo m: sub test($a, $b = $a * 2) { dd :$a, :$b }; test(1); test(10); test(10, 5); test(10,15);
camelia :a(1)
:b(2)
:a(10)
:b(20)
:a(10)
:b(5)
:a(10)
:b(15)
timo yeah it can
lizmat ok, now do assuming with sub test ? 10:09
timo m: sub test($a, $b = $a * 2) { dd :$a, :$b }; my &other = &test.assuming(9); other(1); other(10); other();
camelia :a(9)
:b(1)
:a(9)
:b(10)
:a(9)
:b(Nil)
timo yeah it doesn't do the correct thing anymore 10:10
lizmat did it ever ?
timo no idea
lizmat I don't think it can, because the default on a Parameter is a block
and one cannot see at .assuming time what is in that block 10:11
nine Could you closure clone the original static coderef in the newly generated code? 10:13
Geth rakudo/main: 56e26ea211 | (Stefan Seifert)++ | 2 files
RakuAST: support binding method arguments to attributes

Fixes: method foo($!a) { }
nine 1202
lizmat I guess one could, but what if it referred to a parameter that is now being assumed?
I think I'll go for butting the code block for literal values with the literal value 10:14
nine Well I'm assuming (pun intended) that there's still gonna be a lexical for that parameter
lizmat anyways, I don't think we have a way to solder a Block into a RakuAST tree ? 10:15
ah, actually, I don't need to do that 10:17
nine m: foo(1) 10:24
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
foo used at line 1
nine but:
m: e(1)
camelia ===SORRY!=== Error while compiling <tmp>
Variable '&e' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> <BOL><HERE>e(1)
nine but but:
m: 'e(1)'.AST.EVAL
camelia ===SORRY!=== Error while compiling EVAL_0
Undeclared routine:
e used at line 1
nine I argue that RakuAST is correct here :)
lizmat yup
spectest needs adapting I guess ? making it less precise ?
nine Spectest expects an X::Undeclared but gets an X::Undeclared::Symbols (which is *not* a subclass) 10:26
lizmat so making it a subclass would solve this ?
nine Yep. Making me wonder: why isn't it a subclass? 10:28
lizmat I'll make it a subclass... 10:29
nine Looks like X::Undeclared is more about one specific undeclared thing while X::Undeclared::Symbols is a container for all the undeclared symbols we encountered
So X::Undeclared::Symbols is NOT really a special X::Undeclared, thus making it a subclass would be wrong.
lizmat ok, then I won't :-) 10:31
Geth rakudo/main: e3ac543ea8 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: fix unepexected argument multiness passed in fake signatures

Fixes: multi foo(&code:(Int)) { }
10:49
patrickb lizmat: Can we delete or rename the `MAIN-worry-is-rw` branch on rakudo/rakudo repo? The name is a bit unfortunate for a few stupider autocompletions out there. (Issue being it starting with "main" but not being lowercased, hampering completing to a plain "main".) 11:10
Coming back to the removal of "master". Is there anything we need to be careful about? (Probably not, it's been two years...) Shall we just delete it? 11:12
nine go for it
lizmat patrickb: also wrt to MAIN-worry-is-rw, as it effectively got merged 11:32
m: sub a (|c) { c.list.join(",") }; my &b = &a.assuming(1,2,3); say b 42,666 11:46
camelia 1,2,3,42,666
lizmat nvm thought I'd found a bug 11:47
patrickb Can someone give me admin privs on rakudo/rakudo? 13:01
Looking at the config, nom and prerelease are also protected branches. I think both are things of the past. Prerelease is 6 years old. I'll remove the protection of those two branches as well (but I won't delete them). 13:12
Aaaand with that rakudo master is gone. \o/ 13:13
nine patrickb: you're admin now
patrickb Yes. I've already used my power to unprotect three branches and delete one of them. Unsure if that counts as honouring the "with great power comes great responsibility" thing... 13:15
PSA: The "master" branch in the rakudo repo has been deleted. If you observe any error related to a missing "master" branch, you are warmly recommended to s/master/main/. Do note that the master branch has been frozen for more than two years by now. 13:19
lizmat: ^ that's one for the weekly.
lizmat weekly: PSA: The "master" branch in the rakudo repo has been deleted. If you observe any error related to a missing "master" branch, you are warmly recommended to s/master/main/. Do note that the master branch has been frozen for more than two years by now. 13:29
notable6 lizmat, Noted! (weekly)
Geth rakudo/main: 394b19da42 | (Stefan Seifert)++ | src/Raku/ast/code.rakumod
RakuAST: don't set default type on role signatures

The signature default type of Any would not accept unresolved generics, in type captures, so we have to leave them as Mu typed instead.
13:41
nine 1203
Geth nqp/main: 33795cfd0f | (Elizabeth Mattijsen)++ | tools/templates/MOAR_REVISION
Bump MoarVM to get Windows timer fix, Jimmy Zhuo++
14:42
roast: 6d58693398 | (Stefan Seifert)++ | S06-operator-overloading/circumfix.t
Fix accidental re-declaration of our-scoped constant in same package

Constants are our-scoped by default. While an EVAL is a different lexical scope, it doesn't change the current package. So running two EVALs, each declaring the same our-scoped constant should yield a redeclaration error. However, rakudo did not check for this condition and silently replaced the old stash entry with the new one.
Similar to commit 172634a3cdce36f07123c58afb3f2375e3476180
14:48
rakudo/main: 2d12d3edf7 | (Elizabeth Mattijsen)++ | tools/templates/NQP_REVISION
Bump NQP to get Windows timer fix, Jimmy Zhuo++
14:53
rakudo/main: df08bdd845 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: add missing stopper matcher in statement token

If there is a stopper mixed into the grammar, a statement list should, well, stop at that.
15:28
rakudo/main: fdacf4831f | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: actually implement action methods for (post)circumfix categoricals
rakudo/main: e5b214fcd3 | (Stefan Seifert)++ | 3 files
RakuAST: support embedded code blocks for compile time value of quoted string

Fixes: my constant sym = "a b"; << {sym} >>
nine 1205
jdv the line for switching to rakuast is both test suites pass? 15:33
lizmat and that the setting builds with it :-) 15:46
timo when i run the repl under the debugger and breakpoint maybe-start-supervisor i see that precompile from SETTING::src/core.c/CompUnit/PrecompilationRepository.rakumod:465 leads up to start SETTING::src/core.c/Proc/Async.rakumod:325 and that asks for an affinity queue which then runs into the maybe-start-supervisor 16:29
if everything is already precompiled, that doesn't happen, but instead: 16:32
start-decoder from site#sources/AE4392F23B76889C7044F8D2C9BB4CF2277D0D1E (Terminal::LineEditor::RawTerminalInput):390 is the place that causes the threadpool scheduler's supervisor to be started 16:35
lizmat wonder why the start is needed there 16:38
patrickb ^^
patrickb without looking at the code, T-LE is dealing with the terminal and needs to asynchronously communicate with it. 16:58
nine Regardless of why it gets started, there's no reason for it to consume measurable amounts of CPU time when nothing's going on. 17:03
Like should we even check resource utilization when the task queue is empty?
Geth rakudo/main: 3b48f42ba3 | (Stefan Seifert)++ | 2 files
RakuAST: fix package term not recognized as a constant

Fixes: package Foo { constant term:<ℵ₀> = Inf; }; dd Foo::term:<ℵ₀>
17:29
rakudo/main: 55e48af92a | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: fix lookup of terms defined as subs

Fixes: sub term:sym<foo>() { }
nine That's 1206 17:30
Geth rakudo/main: c1ad0834b4 | (Stefan Seifert)++ | 2 files
RakuAST: properly deal with :["..."] syntax for categoricals

Fixes: sub prefix:["foo"]($x) {...}
18:00
nine 1207
timo nine: we can probably skip out on it while all queues are empty. we do however use a moving average instead of the direct value, so after a full pause we'd want to run a few measurement ticks before we make any decisions? 18:09
lizmat which would add more overhead in normal usage :-( 18:11
that's why I think jnthn at the time wanted to have that loop as simple as possible 18:12
timo it would be cool if someone could get like a Event Tracing for Windows recording or so from what the supervisor thread does? so we can maybe figure out what part of getrusage is so bad, and whether we can actually do anything about this apart from calling it less often
do we have a known-to-work-well-and-fast way to nom stuff in Grammars until a multiple characters long stopper is encountered? 18:59
that doesn't move past the stopper 19:00
i don't think [<!before '-->'>.]*? is optimal 19:02
but it is correct at least and won't do unwanted backtracking 19:09
Geth rakudo/main: 7b7b450a65 | (Stefan Seifert)++ | 2 files
RakuAST: fix scope confusion when adding categoricals

Only when add-category is called while we're in the new operator's block should we add %?LANG to the outer scope. In all other cases it needs to be installed into the current scope. Otherwise we risk confusion when categoricals are added in multiple blocks and then someone does an EVAL.
19:20
rakudo/main: 2a09cb0129 | (Stefan Seifert)++ | src/Raku/ast/circumfix.rakumod
RakuAST: fix no such method literal-value

Fixes: BEGIN my $plus = "+"; is &infix:[$plus](3,4)
nine 1208
nine Oh nice, yet another case of a new feature implemented in the RakuAST frontend breaking a spectest. 19:24
lizmat ah, which one ? 19:25
FIRST ?
nine commit cfa7f8d7172 19:26
linkable6 (2023-07-11) github.com/rakudo/rakudo/commit/cfa7f8d717 RakuAST: allow → ↔ as unicode version of -> <->
lizmat aaah... ok
should be fixable with a todod test ?
nine How about we wait with that till we actually have a fully working regression test suite? 19:27
lizmat I'm fine with reverting for now
Geth rakudo/main: 2db41c004b | (Stefan Seifert)++ | src/Raku/Grammar.nqp
Revert "RakuAST: allow → ↔ as unicode version of -> <->"

This reverts commit cfa7f8d7172bc7f7c4539df2a1e614139264ecda
It led to bogus errors when those unicode arrows were included in double quoted strings.
19:29
timo funny(?) thing: if you `rakudo --profile` into the REPL, every line you write will also get the profiling stuff wrapped around it, which makes it unhappy, and then of course you have END blocks running that tell you it can't stop a profiling that hasn't been started :D 19:30
nine Argh....of course that now breaks 2 other spectests 19:32
t/spec/S04-statements/for.rakudo.moar and t/spec/S12-methods/chaining.t 19:33
lizmat: can you please take care of this?
lizmat will do 19:34
are the failures now with or without RAKUDO_RAKUAST=1, nine? 19:38
nine with
lizmat ack
m: for (1..3)->$n { } # isn't this really testing for a Perlism? 19:47
camelia ===SORRY!=== Error while compiling <tmp>
Unsupported use of -> as postfix. In Raku please use: either . to
call a method, or whitespace to delimit a pointy block.
at <tmp>:1
------> for (1..3)-><HERE>$n { } # isn't this really testing for…
lizmat m: for (1..3) ->$n { } 19:48
camelia ( no output )
timo m: sub postfix:«->»($a, $b) { $b }; say (1..3)->"lol"; 19:49
camelia ===SORRY!=== Error while compiling <tmp>
Unsupported use of -> as postfix. In Raku please use: either . to
call a method, or whitespace to delimit a pointy block.
at <tmp>:1
------> ostfix:«->»($a, $b) { $b }; say (1..3)-><HERE>"lol";
timo :(
lizmat what I said
timo ah, so you want this to become an ism so it can be used after `no isms;` 20:00
lizmat well, it is testing for a Perlism, without mentioning it 20:01
just that it doesn't parse
BTW, I have no idea how that revert made those errors pop up again :-( 20:02
looks like token postfix:sym«->» doesn't fire
nine: appears the tests are fixed with this change: 20:10
- $<sym>
+ '->'
and I'm thinking: WTF ?
nine Oh, $<sym> is not <sym> 20:13
lizmat ok, lemme double check that :-) 20:15
Geth rakudo/main: 2ad1b62ec2 | (Elizabeth Mattijsen)++ | src/Raku/Grammar.nqp
RakuAST: reclaim 2 files borked with 2db41c004b
20:25
lizmat afk& 20:28