🦋 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.
00:01 reportable6 left 00:03 reportable6 joined 03:08 evalable6 left, linkable6 left, tellable6 left 03:09 evalable6 joined 03:10 tellable6 joined, linkable6 joined 04:47 Xliff left 06:00 reportable6 left 06:02 reportable6 joined
Geth rakudo/main: 55bf595d72 | ab5tract++ (committed by Stefan Seifert) | 3 files
RakuAST: Add support for 'enum'

This adds RakuAST::Type::Enum. Currently there are a few deviations from base:
   - Base (sort of) allows re-declaration of an installed symbol:
   `class E::C {}; enum E<C>`
... (11 more lines)
08:42
08:58 frost joined
Geth rakudo/main: f4335a8491 | (Stefan Seifert)++ | src/Raku/ast/code.rakumod
RakuAST: remove broken interpretation of code objects

We didn't handle arguments at all and there's no easy way to do the argument binding, so for now, always compile code objects when called at BEGIN time.
08:59
rakudo/main: 463e7ed4ff | (Stefan Seifert)++ | src/Raku/ast/call.rakumod
RakuAST: support interpretation of term calls
rakudo/main: d769af80e5 | (Stefan Seifert)++ | src/Raku/ast/code.rakumod
RakuAST: support interpretation of Block objects

Result in their meta-object, just like routines
09:03 frost left 09:54 Xliff joined
Xliff cRaku-GLib suite timing statistics for Raku 2023.02.35.gec.8.cdd.540 09:56
Total number of projects: 33 (503134 loc)
Total non-parallel compile times: 8880.060 (269.093 avg)
Total parallel compile times: 1742.104 (52.791 avg) 5.097x speedup
125% speedup over parallel compile times. I'm beginning to think this is due to the chaotic nature of file locking. 09:57
125% over last week's time, that is.
nine lizmat: github.com/rakudo/rakudo/blob/d769...kumod#L250 is wrong. $resolver.current-package only gives you the package that your declaration is in during the attach call. BEGIN processing may be triggered at a completely different point. 10:05
lizmat: I'll fix it as part of my current work on a different constant issue 10:10
10:18 Xliff left
nine Also, shouldn't it be $package.WHO.EXISTS-KEY instead of $package.HOW.EXISTS-KEY? 10:31
Oh oh....fixing those issues reveals a bug in the old frontend and a spectest: 10:42
m: module Foo::Bar {}; BEGIN say Foo::.values; module Foo { constant Bar = 1; }; BEGIN say Foo::.values;
camelia ((Bar))
(1)
Nemokosch hm, is the former the bug? 10:45
nine the former? 10:47
Geth roast: 9264554973 | (Stefan Seifert)++ | S02-lexical-conventions/unspace.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.
rakudo/main: 84d1ec71e7 | (Stefan Seifert)++ | 3 files
RakuAST: fix blocks that are part of constant initializers missing

With constant foo = { $_ }(1); we didn't add that block from the initializer to the QAST, so the QAST compiler would then complain about this.
rakudo/main: 1bfe7a0bef | (Stefan Seifert)++ | src/Raku/ast/variable-declaration.rakumod
RakuAST: fix subtle error in our-scoped constant exists check

Only at the time of the attach call is the resolver guaranteed to be at the package the declaration was made in. PERFORM-BEGIN may be triggered in a completely different place.
rakudo/main: e3e250c2fe | (Stefan Seifert)++ | src/Raku/ast/variable-declaration.rakumod
RakuAST: fix error in our-scoped constant exists check

Need to ask the stash, not the meta class
rakudo/main: a620d0fb76 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: workaround for substr error when reporting parse error
11:30
lizmat nine: glad to see you're back 11:35
nine Yeah, seems like today I've finally cought up on my sleep, too 11:36
lizmat hehe
Geth rakudo/main: ae4ce14a77 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: throw correct exception on missing digit after decimal
lizmat meanwhile, it appears to me that VarDeclaration::Constant is borked ?
gist.github.com/lizmat/0dfb6aca896...193c652d0f
nine Oh darn... I forgot to make test. Seems I got a little rusty 11:37
lizmat yeah, there are tests in t/../var.rakutest 11:38
and they fail
Geth rakudo/main: 6489eb8248 | (Elizabeth Mattijsen)++ | 3 files
Fix deparsing/.raku on VarDeclaration::Constant
11:39
nine Ah, yes, fails with "Required named parameter 'initializer' not passed" 11:41
lizmat not after ^^ fix
then we haz another error
nine No, still getting the same. And it makes sense, since the test really does not pass this parameter. 11:44
Geth rakudo/main: 6c3468c8f0 | (Elizabeth Mattijsen)++ | 2 files
Add deparsing/.raku for Type::Enum
11:45
lizmat argh... forgot to push changes to tests :-(
Geth rakudo/main: b3d704fe24 | (Elizabeth Mattijsen)++ | t/12-rakuast/var.rakutest
Attempt to unbork VarDeclaration::Constant tests
11:46
lizmat nine ^^
12:00 reportable6 left 12:02 reportable6 joined
nine Ah, even RAKUDO_RAKUAST=1 ./rakudo-m --target=qast -e 'dd constant foo = "bar"' shows what's going on 12:08
lizmat I guess my QAST reading capability is below par 12:16
ah, dd gets a Block instead of a QAST::Var ? 12:19
Geth rakudo/main: c74e1608e3 | (Stefan Seifert)++ | src/Raku/ast/variable-declaration.rakumod
RakuAST: fix constant declarations yielding code instead of value
12:31
rakudo/main: 3bc6e5254e | (Stefan Seifert)++ | src/Raku/ast/variable-declaration.rakumod
Fix infinite loop on declaring constants containing infinite lists.

my constant $l = (−∞…∞); must not be sunk
lizmat checks 12:33
nine t/spec/S02-lexical-conventions/minimal-whitespace.t would pass if this:
m: 42.:all
camelia ===SORRY!=== Error while compiling <tmp>
Decimal point must be followed by digit
at <tmp>:1
------> 342.⏏:all
nine wouldn't also report "Malformed postfix call" in addition to the expected sorry 12:34
lizmat m: say Q|my constant foo = now|.AST 12:47
camelia ===SORRY!===
Unknown compilation input 'qast'
lizmat m: say Q|my constant foo = 42|.AST
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::VarDeclaration::Constant.new(
scope => "my",
name => "foo",
initializer => RakuAST::IntLiteral.new(42)
)
)…
nine Required effort to implement RakuAST: |=============BEGIN TIME STUFF============--------PACKAGES-------.rest.| 12:48
lizmat hehe
ok, this gets weird: say Q|BEGIN now|.AST works with RAKUDO_RAKUAST=1 12:51
but not without it
nine: so should I worry about that or not?
it seems to go awry in self.IMPL-BEGIN-TIME-EVALUATE 12:52
nine Honestly, I'd just ignore that for now. All of this is complicated enough, without trying to support every corner case on the old frontend as well. 12:54
lizmat the meh thing is that "make test" on the old frontend will then fail, as I have a test for it 12:55
I guess that test will go then for now :-( 12:56
nine Just todo it?
lizmat todo won't cut it, as it dies 12:57
Geth rakudo/main: e32bcd1f41 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
Tweak some .raku presentations
13:03
rakudo/main: 7f6cfaa82e | (Elizabeth Mattijsen)++ | t/12-rakuast/var.rakutest
Add some more VarDeclaration::Constant tests
lizmat 704 / 1354! 13:07
nine indeed :) 13:15
lizmat ok, on to writing some RakuAST::Type::Enum tests 13:16
Geth rakudo/main: 003c775380 | (Stefan Seifert)++ | src/Raku/ast/call.rakumod
RakuAST: Fix fully qualified calls to named routines

Fixes Foo::Bar::do-something() trying to call Foo::Bar::do.WHO
13:26
nine 706
lizmat whee! 13:28
meanwhile, I see a test fail in operators :-(
aaahh.. it fails in v6.e.PREVIEW 13:31
m: use v6.*; my %h = x => { :1a, :2b }, y => { :3a, :4b }; dd %h{"y";"a"}
camelia 3
lizmat m: my %h = x => { :1a, :2b }, y => { :3a, :4b }; dd %h{"y";"a"} 13:32
camelia (3,)
lizmat is that an intentional change with v6.e
?
13:39 squashable6 left 13:42 squashable6 joined
lizmat looks like it is a correction of behaviour, as single literal arg always returns a single value, not a list 13:46
Geth rakudo/main: 6c035ff246 | (Elizabeth Mattijsen)++ | 30 files
Simplify boilerplate for RakUAST tests

Since "use v6.e.PREVIEW" now implies availability of RakuAST classes and we will get to that language version eventually, we might as well set it to that language version now.
Also, "use Test" implies "use MONKEY", so we don't need that either.
Also fix Multi-dimensional hash indexing test to 6.e semantics.
13:50
lizmat m: enum foo (a => 42, b => "bar") # wow, that's an LTA message 13:59
camelia ===SORRY!===
Incompatible MROs in P6opaque rebless for types Str and foo
lizmat slightly closer to home: 14:01
m: enum foo (:a<42>, :b<bar>)
camelia ===SORRY!===
Incompatible MROs in P6opaque rebless for types Str and foo
lizmat I wonder whether that shouldn't automatically downgrade the IntStr to Str 14:02
m: enum foo of Str <a b c>
camelia ===SORRY!=== Error while compiling <tmp>
No such method 'set_of' for invocant of type
'Perl6::Metamodel::EnumHOW'
at <tmp>:1
lizmat seems I found a nest of LTAs :-) 14:03
m: say Q|<a b c>|.AST.statements[0].expression 14:28
camelia RakuAST::QuotedString.new(
segments => (
RakuAST::StrLiteral.new("a b c"),
),
processors => (
"words",
"val",
)
)
lizmat ah, but the QAST returns a List as a WVal *phew* 14:30
guifa lizmat: the AST.raku returns a small error (I think) on RakuAST::Initializer::Assign. It generates `RakuAST::Initializer::Assign.new(expression => foo)`, but it should be just `RakuAST::Initializer::Assign.new(foo)` 14:56
lizmat checks
Geth rakudo/main: 2b0d1019f7 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: make QuotedString.raku more in line with common usage
14:57
lizmat guifa: you're right :-) also with ::Bind 14:59
guifa maybe just got done writing about a thousand lines of RakuAST by hand last night so… his eye is a bit attuned to those little things haha 15:00
Geth rakudo/main: a220d715a6 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: fix Initializer::Assign|Bind.raku

  guifa++ for the spot
guifa (Also Comma is complaining about StatementList only accepting a single positional argument. Not sure if that's a comma thing or Rakudo. I'd imagine the signature should be a plus slurpy
lizmat method new(*@statements, Bool :$trace) 15:01
looks ok to me?
guifa hmm, must be a comma issue then 15:06
lizmat when does it complain exactly? if there is only one argument? 15:07
m: dd RakuAST::StatementList.^find_method("new").signature 15:08
camelia ===SORRY!=== Error while compiling <tmp>
Use of RakuAST is experimental; please 'use experimental :rakuast'
at <tmp>:1
------> dd RakuAST::⏏StatementList.^find_method("new").signat
expecting any of:
argument list…
lizmat m: use v6.*; dd RakuAST::StatementList.^find_method("new").signature
camelia :(RakuAST::StatementList: Any @statements, Bool :$trace)
lizmat so yeah, looks like the introspection on the class is off 15:09
which is no surprise, considering how that class is put together :-)
does nqp have slurpies? 15:10
yeah, looks like it does
guifa please let me know if you spot more .raku issues 15:12
there are no tests for it yet
guifa lizmat: the opposite, it (Comma) complains if there's more than one argument. It seems to run just fine
When the syntax highlighting bothers me too much, I just wrap it in an extra set of parentheses and profit 15:13
lizmat I guess we either need to improve RakuAST's signatur introspection, or teach Comma to work a bit differently on RakuAST classes
I guess the former would be best
m: dd enum foo <a b c> # TIL 15:17
camelia Map.new((:a(0),:b(1),:c(2)))
ugexe [Coke]: have you built windows jvm rakudo by chance? i'm wondering how it would act with those path length examples 15:33
[Coke] i have not 15:38
my need for jvm stopped about 4.5 years ago when I changed $dayjobs, so I haven't been keeping up 15:39
guifa lizmat: on a similar issue, RakuAST::Signature.new( parameters => ( … ) ), is a stickler for receiving a list. Just spent a few minutes banging my head trying to fix my RAST::PrettyPrint only to realize I needed to add a comma lol 15:51
(so it maybe needs to be a slurpy, I think)
lizmat sadly, RakuAST cannot take slurpies for named arguments 15:52
guifa aaah
lizmat and at that time, there are no multies 15:53
Geth rakudo/main: 543ecd9d13 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: fixes for problems found with initial .raku tests
16:12
rakudo/main: f2fff6eae6 | (Elizabeth Mattijsen)++ | 27 files
RakuAST: add initial .raku tests

Basically only making sure that they don't die for now
16:13
lizmat m: "use v6.e.PREVIEW; RakuAST::Node".EVAL 16:18
camelia ===SORRY!=== Error while compiling /home/camelia/EVAL_0
Use of RakuAST is experimental; please 'use experimental :rakuast'
at /home/camelia/EVAL_0:1
------> use v6.e.PREVIEW; RakuAST::⏏Node
expecting any of:
term
lizmat vrurg: opinions ^^
nine What a perfect waste of time.....at least our washing machine seems to still be water tight. Lesson of the day: maybe just hire a professional and do what you're really good at. 16:19
lizmat well, at least you learned to call a professional ? :-) 16:25
vrurg: I guess your remark: "that location is ok, but I would make it in the Grammar, right after <lang-version> at line 839"
applies, but I don't see *what* exactly I should be adding there
I mean: how do I get the language revision there ? 16:26
Geth rakudo/main: a003c3c80e | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: fix QuotedString.raku if there are no processors
16:39
lizmat afk& 16:58
Geth rakudo/main: 7e334408fd | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: fix misc heredoc parsing errors due to missing cheat_heredoc
17:45
rakudo/main: 6669c0f2f4 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: properly unindent heredocs when tabs are involved
rakudo/main: 377f6015b0 | (Stefan Seifert)++ | src/Raku/Grammar.nqp
RakuAST: fix heredocs accidentally getting treated as inside scope

In cases such as the following, the heredoc must be treated as outside the scope from which it was referenced (as it's body is actually outside): sub f() { my $a = 1; q:to/END/ }
  $a
END
To accomplish this, cheat_heredoc temporarily leaves the current scope and then re-enters it. This is ugly, but then, it's already a cheat...
nine 707 :) 17:46
18:00 reportable6 left, reportable6 joined
Geth rakudo/main: dadeb74e3d | (Elizabeth Mattijsen)++ | 2 files
RakuAST: add .raku roundtripping tests for calls
18:42
rakudo/win-rel2abs-longpath: ad8065d9e0 | (Nick Logan)++ (committed using GitHub Web editor) | src/core.c/IO/Spec/Win32.pm6
[win]: Fix rel2abs handling of long path prefixes

The previous behavior did not generate correct absolute paths for UNC paths (like `\\\\UNC\\share\\C:\\foo\\bar.txt`) or long/raw paths (like `\\\\?\\C:\\foo\\bar.txt`) due to the way the `rel2abs` method decides when a path is relative and thus needs to be transformed. This updates the windows version of `rel2abs` to check for absoluteness using `.is-absolute`, which allows one to get the expected
18:51
rakudo: ugexe++ created pull request #5226:
[win]: Fix rel2abs handling of long path prefixes
rakudo/main: 7f3802c49a | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: some .raku fixes, found while writing tests
19:24
lizmat meh, getting an error at src/Raku/ast/call.rakumod line 714 and it only has 709 lines :-( 19:57
nine off by....a few? 20:07
20:10 tellable6 left, evalable6 left, gfldex left, djinni` left, samcv left, nativecallable6 left, benchable6 left, sourceable6 left, bloatable6 left, unicodable6 left, statisfiable6 left, bartolin_ left, japhb left, jjatria left, sivoais left 20:11 tellable6 joined, evalable6 joined, gfldex joined, djinni` joined, samcv joined, nativecallable6 joined, benchable6 joined, sourceable6 joined, bloatable6 joined, unicodable6 joined, statisfiable6 joined, bartolin_ joined, japhb joined, jjatria joined, sivoais joined 20:12 djinni` left 20:14 djinni` joined 20:17 sivoais left 20:18 sivoais joined
vrurg lizmat: I was away, sorry. nqp::getcomp().language_revision. With the current implementations it return an integer where 1 stands for c, and so on. 20:29
*returns
lizmat ok i'll try that
vrurg Just in case, I'll be away for a while again. 20:33
lizmat ack
20:39 Xliff joined
Xliff . 20:39
lizmat: Did you get my message? 20:40
lizmat About the RakuAST article ?
Xliff Yep! 20:41
lizmat did you read my response ?
Xliff No. For some reason I don't think it got sent. 20:42
lizmat I'm working on it
Xliff OK
Geth rakudo/main: c32836f271 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Raku.pm6
RakuAST: more .raku fixes / tweaks
20:55
lizmat blog post driven development :)
Geth rakudo/main: 93609de3c7 | (Elizabeth Mattijsen)++ | 8 files
RakuAST: add more .raku roundtrip tests

And handle more tests in loops
20:59
lizmat and that concludes my hacking for today& 21:00
Xliff lizmat: So you are writing your blog post as you are working on RAST? 21:16
lizmat yeah, because I found a number of issues :-( 23:40
gfldex lizmat: I know that feeling. :) 23:41