🦋 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.
jaguart I note that `rakudo\src\Perl6\Metamodel\ParametricRoleGroupHOW.nqp` has `auth` and `ver` methods but no `api` - even though you can `$x.^candidates.map(*.^api)` - would it be presumptuous to put in a PR? 04:36
nine makes sense 07:30
lizmat nine: I think I'm gonna take a stab at implementing the missing phasers 09:13
nine lizmat: cool! I think the existing LEAVE phaser support should make that quite straight forward 09:18
lizmat I was thinking the same thing
Geth rakudo/main: b1234bcc33 | (Elizabeth Mattijsen)++ | src/Raku/ast/term.rakumod
Normalise RakuAST class specifications (6/N)
11:56
Geth rakudo/main: 454507c0e6 | (Elizabeth Mattijsen)++ | src/Raku/ast/term.rakumod
Add RakuAST::Term::(True|False)

Just a shortcut, for ease of use and clarity of intent
12:08
rakudo/main: 672ac1849f | (Elizabeth Mattijsen)++ | t/12-rakuast/statement-phaser.rakutest
Refine the LEAVE phaser tests

Making sure that the LEAVE phaser runs *after* the block has completed. Also implicitely add tests for RakuAST::Term::(True|False)
lizmat nine: shouldn't a use of "temp" not also set the has_exit-handler flag on a block ? 15:33
nine Err....could be? I never claimed to understand any of this :D But if the old frontend does it, we should do it, too 15:41
lizmat ok, will check the old frontend :-) 15:45
Geth roast: 3279fed5b7 | (Stefan Seifert)++ | S02-lexical-conventions/comments.t
Fix error in comment test

The test originally used dies_ok and that passed as the code actually dies. But it does not do so for the reason it was meant to. Instead of the invalid comment syntax, it died because of the undeclared variable. A refactor to move away from dies_ok (for precicely this reason) then made the wrong test explicit. Fix the test and the expected result to what it was actually meant to test.
17:09
roast: 19094ab96f | (Stefan Seifert)++ | S12-construction/destruction.t
Fix more spurious failures in destructor tests

Destructors may run at any time and concurrently. Protect the
  @destructor_order array from concurrent modification using a lock.
Apparently the previous assumption that the WHERE of an object was stable when we already decided to destroy it was wrong. So instead rely on default stringification to give a unique and stable identifier (as Rakudo uses nqp::objectid for constructing the stringification)
nine Have run that test in a loop for 20 minutes now without a failure. Seem to have finally made it 17:20
lizmat nine++ 17:30
nine: does this ring a bell? 17:31
No such method 'trace' for invocant of type
'RakuAST::StatementPrefix::Phaser::Next
I added the RakuAST::StatementPrefix::Phaser::Next class, is there something else that needs to be done?
NEXT and LAST phasers don't require any code addition to the block afaik, apart having them added as phasers 17:32
nine That means you have a non-statement in a StatementList 17:34
lizmat hmmm 17:36
ack 17:37
yup! 17:38
Geth rakudo/main: 35b6b6d6be | (Elizabeth Mattijsen)++ | 6 files
Implement support and tests for NEXT and LAST phasers

  - Added tokens in Grammar
  - Added methods in Actions
  - RakuAST::StatementPrefix::(Next|Last) classes added
  - Slight refactor of RakuAST::ScopePhaser to prevent repetition
  - Deparsing support added
  - Tests added
18:04
lizmat m: TEMP { say "temp" } 18:19
camelia ( no output )
lizmat I wonder if this is intentional or not
there's apparently grammar support for a TEMP phaser
but it doesn't do anything 18:20
the practical effect is that *anything* in a TEMP phaser is actually eradicated from the generated bytecode
but *is* actually parsed and checked for completeness 18:21
m: TEMP { sat "temp" }
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
sat used at line 1. Did you mean 'set', 'say'?
lizmat m: TEMP { $a }
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$a' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> TEMP { ⏏$a }
japhb
.oO( Obfuscated code contest, here we come ... )
18:22
lizmat there are even tests for it apparently 18:23
t/spec/S04-blocks-and-statements/temp.t
dinner&
nine "You can also modify the behaviour of temporized code structures, by giving them a TEMP block. As with .TEMP methods, this block is expected to return a closure, which will be executed at the end of the temporizing scope to restore the subroutine to its pre-temp state" 18:55
Has never been implemented. Like the TEMP method 18:56
Nemokosch where did you find it? 18:57
nine design.raku.org/S06.html#Temporization 19:32
lizmat "Note that dynamic variables may be a better solution than temporized globals in the face of multithreading." 19:44
so I was tempted to implement it, but I think I won't after that notion 19:45
however, I find the current behaviour of the TEMP phaser interesting
in that it would allow you to keep code around, that would actually not make it into a precomp 19:46
but rename it to IGNORE
if you want to get rid of a statement temporarily, you could simply prefix it with IGNORE 19:48
japhb "Commenting out" turned up to 11? 19:55
lizmat yup
japhb Oh, I guess you said it actually does syntax check the insides though, so it wouldn't help people trying to silence incomplete code. Although I guess IGNORE followed by wrapping in a heredoc .... 19:56
lizmat what I like about IGNORE still checking the inside, is that it makes sure the syntax stays correct 19:57
japhb nodnod 20:00
It is a useful case.
And I know a number of times that I've commented out code, refactored around it, and then found that uncommenting results in a new syntax error, so ... use case confirmed, I guess. :-) 20:01
lizmat yep, been there, done that
Geth rakudo/lizmat-IGNORE: 0f61de61bf | (Elizabeth Mattijsen)++ | src/Perl6/Grammar.nqp
Introduce the IGNORE phaser

This phaser will allow you to have the *runtime* completely ignore a statement or a block. Any code inside the IGNORE phaser **will** be checked for syntax and legality, but will **not** cause any bytecode to be generated.
This allows a developer to de-activate code (semi-)permanently, while ensuring that the code inside this phaser remains in sync with the rest of the code (which would not be the case if the de-activated code would live on as comments).
20:16
rakudo: lizmat++ created pull request #5161:
Introduce the IGNORE phaser
notna Hi Devs. Who knows how the "Rakudo Star Bundle MacOS .dmg disk image file" on rakudo.org/star/macos was build in the past? 20:43
Any script or "how-to" somewhere, which I could start from?
patrickb notna: I seem to recall, that rba once built the DMG images. (Or was it Coke?) 21:52
tellable6 patrickb, I'll pass your message to notna
[Coke] wasn't me 22:28