🦋 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.
nine Nemokosch: no? 07:41
tellable6 nine, I'll pass your message to Nemokosch 07:42
nine MasterDuke: no?
tellable6 nine, I'll pass your message to MasterDuke
nine Nemokosch: disregard, ENOCOFFEE
tellable6 nine, I'll pass your message to Nemokosch
nine MasterDuke: you are looking for the wrong name. Should be '&one', not 'one'. But you don't have to do that for the called name as it's going to be handled in method resolve-with already. self.resolution gives you the result of that. 07:48
tellable6 nine, I'll pass your message to MasterDuke
nine lizmat: looks like the phaser handling code has a fatal flaw: it doesn't take phasers added via traits (like is-DEPRECATED) into account. 08:47
lizmat hmmm 09:16
actually, feels to me we don't actually need a phaser for that in the RakuAST world? 09:17
the QAST handling of the code could just codegen the call to &DEPRECATED into the QAST directly? 09:18
nine What about other traits that add ENTER phasers? 09:21
FWIW I retract the "fatal". I think we just need to extend it to add calls to phasers added this way. Might only be a bit difficult to distinguish them from the ones created via RakuASt. 09:22
lizmat am currently deep into the declarator doc business... will look into it after that 09:23
nine might beat you to it
lizmat that would be fine :-) 09:24
nine Oh....a more severe flaw in the ENTER phaser specifically is that it's not thread safe. The Scalar for the result is shared between all callers. 09:36
The trick with writing the result into a Scalar works for INIT because that's guaranteed to only run once. ENTER needs to write its result into a local variable. 09:38
lizmat hmmm ... I recall just having copied qast from the legacy grammar... wouldn't be surprised that would be an issue in the legacy grammar as well ? 09:41
nine No, that creates a local: $enclosing.unique('enter_result_'); 09:45
nine@sphinx:~/rakudo (main *=)> RAKUDO_RAKUAST=1 ./rakudo-m -e 'my $bag = await((^1000).map({start { ENTER { $_ } }})); say $bag.Bag' 09:48
Bag(999(1000))
Bag(0 1 10 100 101 102 103 104 105 106 107 108 109 11 110 111 112 113 114 115 116 117 118 119 12 120 121 122 123 124 125 126 127 128 ...
nine@sphinx:~/rakudo (main *=)> RAKUDO_RAKUAS=1 ./rakudo-m -e 'my $bag = await((^1000).map({start { ENTER { $_ } }})); say $bag.Bag'
But first, groceries and breakfast... 09:49
lizmat hmmm.. I wonder whether the check for existence of private methods shouldn't be a CHECK time thing in RakuAST, rather than an optimizer thing 10:40
something to run on compose of a class? 10:41
nine definitely CHECK time 10:55
Geth rakudo/main: 283eb48471 | (Stefan Seifert)++ | 3 files
RakuAST: support need statements
13:11
rakudo/main: 4682d2ed66 | (Stefan Seifert)++ | 2 files
RakuAST: make ENTER phaser results thread safe

We must not share the Scalar the result of an ENTER phaser gets stored in between callers. Creating a Scalar at compile time works for INIT phasers because they are guaranteed to only run once in the life time of a program. ENTER can be called multiple times and in parallel, so we need to store the result in a local variable instead.
rakudo/main: 45dd84f664 | (Stefan Seifert)++ | src/Raku/ast/code.rakumod
RakuAST: support ENTER phasers added by traits

The DEPRECATED adds an ENTER phaser via meta methods. This phaser is not part of the source code but purely a runtime object. We need to generate calling code for these as well.
MasterDuke . 17:33
tellable6 2023-04-08T07:42:10Z #raku-dev <nine> MasterDuke: no?
hey MasterDuke, you have a message: gist.github.com/0c272ba3924ba46db6...49d5d75129
MasterDuke heh. the error message this work was about even suggests `&one`. i've made that mistake before, and never seem to learn from it... 17:37