🦋 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:00 reportable6 left 00:01 reportable6 joined 00:05 ab5tract left 00:34 codesections left 00:35 codesections joined 01:28 codesections left 01:57 epony joined 02:38 discord-raku-bot left 02:39 discord-raku-bot joined 02:59 kjp left 03:06 kjp joined 05:29 linkable6 left, evalable6 left 05:30 linkable6 joined 05:31 evalable6 joined 05:39 discord-raku-bot left, discord-raku-bot joined 05:46 discord-raku-bot left, discord-raku-bot joined 05:54 kjp left 05:56 kjp joined 06:00 reportable6 left 06:01 reportable6 joined 06:39 discord-raku-bot left, discord-raku-bot joined 06:43 discord-raku-bot left 06:44 discord-raku-bot joined 06:48 discord-raku-bot left, discord-raku-bot joined 06:52 discord-raku-bot left 06:53 discord-raku-bot joined 08:39 discord-raku-bot left, discord-raku-bot joined 09:19 sena_kun joined 09:39 discord-raku-bot left, discord-raku-bot joined 10:31 sena_kun left 10:39 discord-raku-bot left 10:40 discord-raku-bot joined 10:47 ab5tract joined 11:12 ab5tract left 11:20 ab5tract joined 11:22 sena_kun joined 11:30 ab5tract left 11:39 discord-raku-bot left 11:40 discord-raku-bot joined 11:51 Xliff left 11:58 ab5tract joined 12:00 reportable6 left 12:01 reportable6 joined
Geth rakudo/main: d5dfb5236a | (Elizabeth Mattijsen)++ | 6 files
Implement FIRST phaser + deparsing and tests

Sadly, this just makes the FIRST phaser parse and install itself, but some essential QAST-patching is not working yet. So the tests are todoed (although deparsing and such works already).
Adds a RakuAST::Statement::Phaser::First class.
12:11
12:16 ab5tract left
Geth rakudo/main: ac5fef4301 | (Elizabeth Mattijsen)++ | src/Raku/ast/code.rakumod
Normalise RakuAST class specifications (7/N)
13:00
13:11 Xliff joined 13:24 epony left 13:39 discord-raku-bot left, discord-raku-bot joined 13:48 ab5tract joined
lizmat m: my $a = "foo"; say $a ~~ s{o} = "x"; say $a # according to doc, all ok 13:50
camelia 「o」
fxo
lizmat m: my $a = "foo"; say $a ~~ s/o/ = "x"; say $a # why does this fail? Is the alternate delimiter necessary ? 13:51
camelia ===SORRY!=== Error while compiling <tmp>
Malformed replacement part; couldn't find final /
at <tmp>:1
------> Is the alternate delimiter necessary ?⏏<EOL>
expecting any of:
postfix
lizmat or is this a bug ?
13:59 ab5tract left 14:06 vrurg left
Nemokosch where did y = "x"; never worked from what I can tellu find it? 14:09
oops
so... s/o/ = "x"; never worked, from what I can tell 14:10
it's odd that it is even listed in the comment
it's quite funky that s{o} = "x" does work though 14:11
anyway, good that you made it to that part, there are some interesting questions around there 14:13
lizmat yeah, working on RakuAST deparsing made me spelunk a lot of stuff, and learn some on the way :-)
Nemokosch 1. the one you raised 2. where should tr and TR belong 14:14
14:14 vrurg joined
or m// itself, I think it falls into the "quoted regex" category or what it was called - somewhat misleading name for something that isn't a regex any more than s{o} was a regex 14:15
well let me rephrase: s{o} is not a "quoted regex" and m/o/ is not more of a regex than s{0}, set it is one 14:16
yet/set
lizmat fwiw, I dislike s/// and m// and such 14:17
wouldn't mind them being deprecated and removed
too perly and thus, too magic
vrurg lizmat: what's instead? Methods? 14:18
lizmat .subst indeed
.match indeed
vrurg I don't mind of m//, barely use it anyway. But s/// comes very hand once too often. 14:19
*very handy
Nemokosch Well, I don't have a strong opinion on the broad picture, for one. What I do mind is that right now, smartmatching on m// is the reason smartmatching of Match objects itself is nonsensical 14:21
so either gradually move away from this magic - or at least make it indeed magic, which seems possible with codegenning from RakuAST. That's why I looked this part up in the first place. 14:22
in a little more details, so you can tell if it has some obvious fault: when there is ~~ and the right child of it is an m// kind of construct (whatever it would be called eventually), generate that directly as a match call 14:25
vrurg BTW, speaking of magic, we can deprive s/// of ability of accessing $_ directly and make it translate directly into a call to subst. And, perhaps, seriously consider removal of implicit setting of $/. 14:27
That would make it non-magical as much as possible. 14:28
lizmat I would start with .subst not setting $/ :-)
Nemokosch wait, .subst does set $/? lol 14:29
vrurg I know. I still rather like that feature, but can survive without it.
lizmat so does .match :-( 14:30
vrurg Access to $_ is a big problem too because it doesn't allow to lower the topic when otherwise it could be done.
Nemokosch I mean... $/ is nice in my opinion as well - but it would be good to have some really simple and straightforward rule when it is set
14:31 ab5tract joined
vrurg The rules are rather clear now. The problem is in optimization complications. 14:32
Nemokosch a less design-y question: so, where does tr and TR belong regarding RakuAST nodes? 14:33
lizmat m: say Q| my $a = "foo"; say $a ~~ tr/o/x/ |.AST.dump 14:34
camelia ===SORRY!===
Substring length (-3) cannot be negative
lizmat I'd say, that's still undecided
Nemokosch is there some Raku-related event this weekend? I somehow feel I'm forgetting something 14:37
lizmat there's FOSDEM in a few weeks ? 14:43
15:10 epony joined
[Tux] Rakudo v2022.12-1-gd52342eb0 (v6.d) on MoarVM 2022.12-15-g6b456a6c0
csv-ip5xs0.825 - 0.871
csv-ip5xs-205.264 - 5.875
csv-parser3.753 - 3.853
csv-test-xs-200.409 - 0.424
test6.430 - 6.492
test-t1.468 - 1.540
test-t --race0.952 - 0.968
test-t-2020.743 - 21.928
test-t-20 --race6.324 - 7.110
15:15
15:17 ab5tract left 15:40 discord-raku-bot left, discord-raku-bot joined 15:44 discord-raku-bot left 15:45 discord-raku-bot joined 15:59 vrurg left 16:01 vrurg joined 16:02 vrurg left
lizmat m: (my $s = "foo") ~~ s:g:i/o/x/; say $/ 16:04
camelia (「o」 「o」)
lizmat m: use MONKEY; say EVAL Q|(my $s = "foo") ~~ s:g:i/o/x/; say $/|.AST 16:05
camelia Code object coerced to string (please use .gist or .raku to do that)
「o」
True
in block <unit> at /home/camelia/EVAL_0 line 1
Code object coerced to string (please use .gist or .raku to do that)
in block <unit> at /home/camelia/EVAL_0…
lizmat anyways, that also sets $/ to 「o」 incorrectly, rather than to (「o」 「o」) 16:07
16:11 vrurg joined 16:13 vrurg left 16:14 vrurg joined
lizmat nine jnthn looking at how s/// is being codegenned in RakuAST 16:16
16:20 ab5tract joined
lizmat and I *think* I see a possibility for simplification 16:22
why don't we:
codegen:
$a ~~ s/a/b/ 16:23
as $a = $a.subst(/a/b)
and:
hmmm 16:24
[Coke] ... 16:29
profit
lizmat if only we wouldn't set $/ currently as well 16:30
nine lizmat: I'd leave any such musings till after RakuAST is fully working. Without fully working tests you'll never know what you're missing. 16:35
lizmat indeed...
I found a bug in RakuAST handling of s:g///
The pre-RakuAST 16:36
# compiler frontend explicitly checked if it got a Match object or a
# non-empty List.
that was a simplification that introduced a bug :-)
However, those are both truthy, and all the non-match 16:37
# cases would be falsey, so we can just emit a truth test.
however, I think we can simplify the test to a compile time check for :g
as *that* determines whether a List is returned or not 16:38
m: my $s = "foo"; dd $s ~~ s:g/x/y/'
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> my $s = "foo"; dd $s ~~ s:g/x/y/⏏'
expecting any of:
infix
infix stopper
postfix
statement end
lizmat m: my $s = "foo"; dd $s ~~ s:g/x/y/ 16:39
camelia ()
lizmat m: my $s = "fox"; dd $s ~~ s:g/x/y/
camelia (Match.new(:orig("fox"), :from(2), :pos(3)),)
16:39 Xliff left
lizmat ok, giving up on trying to fix that now 16:53
apparently, using nqp::p6store is not the problem
m: use nqp; my $a; nqp::p6store($a,(1,2,3)); dd $a
camelia List $a = $(1, 2, 3)
17:10 ab5tract left 17:34 sena_kun left 17:42 codesections joined 18:00 reportable6 left 18:01 reportable6 joined 18:09 sena_kun joined
Geth rakudo/main: 6cbd0617a5 | (Elizabeth Mattijsen)++ | src/core.c/RakuAST/Deparse.pm6
Fix deparsing of RakuAST::Substitution

Also add deparsing for RakuAST::SubstitutionReplacementThunk
18:11
rakudo/main: 598a9d9c69 | (Elizabeth Mattijsen)++ | 2 files
Add tests for Regex::Substitution
18:33 notna joined
Nemokosch This is really a touchy topic 18:54
What lizmat++ is doing seems absolutely safe though, the syntactic structure is pretty much uncontroversial and universally understood 18:56
19:40 notna left 19:43 notna joined, notna left 19:54 dogbert11 joined 19:56 dogbert17 left 20:11 epony left 20:18 codesections left 23:27 melezhik joined 23:31 melezhik left 23:36 sena_kun left