🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
Anton Antonov @guifa Cook in a more segregational manner, then. 00:14
guifa that's normally the plan. I got sidetracked with some stuff and they ended up all over the place. But finally getting them all to a cohesive point 00:15
Anton Antonov For me "releasing to public" usually means writing a lot of documentation. 00:16
@guifa Do you have - and use -- a dependency graph of the packages you develop?
guifa Yeah I have one — there was one point where I had to lay everything out to be very careful to avoid a circular dependency 00:18
and had to make the call for where I was ultiamtely going to have to duplicate some minor bits of code for the sake of modularity 00:19
Anton Antonov @guifa Ok, a few related questions: 1) Is it automatically derived? 2) Is in some "formal" language, e.g. PlantUML or Mermaid-JS (not just JSON or XML) ? 3) If it is automatically derived, is it with a package? 00:21
guifa 1 - no. I just drew it in OmniGraffle haha
Anton Antonov Yeah, unfortunately, it seems I "have to" duplicate functionalities to achieve modularity in my DSL packages. 00:22
guifa I've managed to reduce it by a lot but it took a lot of work 00:26
Anton Antonov I am interested in making these kind of package dependencies graph: i.imgur.com/33P7QmG.png . But instead of using Mathematica, to produce, say, Mermaid-JS, and/or graphviz specs. 00:30
ToddAndMargo Windows-11 22H2.  Is there a way to get my session ID?  And predefined variables?  I need this for learn.microsoft.com/en-us/windows/...ndmessagea  `[in]  DWORD  SessionId` when I am running as administrator from Task Scheduler (otherwise -1 works) 00:31
tellable6 2022-11-12T10:08:17Z #raku <bartolin> ToddAndMargo: That looks like the problem described in github.com/rakudo/rakudo/issues/5096. I'd guess that Rakudo hasn't write permissions for a precomp directory when running as administrator.
ToddAndMargo that sure looks like it.  And I did a native call right before I did exit.  But that did not happen on the other exact calls that were not followed by and exit.  I sighed up for the thread.   Thank you!!! 00:33
guifa anton antonov: jeez.... yeah I keep my graph at the high level. I tried to start to do one for Intl::CLDR and it was.... nightmarish lol 00:37
imgur.com/a/NwyOGXi
^^ the complex web of international module dependencies
interesting 00:47
so I'm renaming a module
Anton Antonov [![](mermaid.ink/img/pako:eNptkD0OwjAMh...qQlAfGTye9
guifa In the old name, I issue a warning and then do `use Foo::NewName`, and pass along all the symbols 00:48
all works well, including with named arguments but it bombs on positional ones 00:49
The error is "Could not evaluate arguments"
Anton Antonov @guifa Here is a Mermaid-JS start:
```
graph TD
LTsh[Intl::LanguageTaggish]
LT[Intl::LanguageTag]
CLDR[Intl::CLDR]
UL[User::Language]
FN[Intl::Fornat::Number]
FU[Intl::Fornat::Unit]
LT --> LTsh
CLDR --> LT
UL --> LT
FN --> UL
FU --> FN
FU --> LT
FU --> UL
FU --> CLDR
```
guifa oh nice 00:51
Anton Antonov @guifa Here is a Mermaid-JS start:
```
graph TD
LTsh[Intl::LanguageTaggish]
LT[Intl::LanguageTag]
CLDR[Intl::CLDR]
UL[User::Language]
FN[Intl::Format::Number]
FU[Intl::Format::Unit]
LT --> LTsh
CLDR --> LT
UL --> LT
FN --> UL
FU --> FN
FU --> LT
FU --> UL
FU --> CLDR
```
@guifa You can enter that Mermaid code here: mermaid.live . 00:52
@guifa You can enter that Mermaid code here: mermaid.live . 00:53
perryprog Anton, it might be better if you use a pastebin service for codeblocks 00:58
Anton Antonov Ok, I will try. 00:59
perryprog mainly for IRC readability and so discord-raku-bot doesn't get automatically kicked for flooding or something silly :P 01:00
Anton Antonov I see... 01:02
perryprog (I'm pretty certain that won't happen though since it looks like it's ratelimiting itself) 01:04
gfldex perryprog: you are correct! see: gist.github.com/gfldex/c69612be47e...f3972fc3f2 01:24
guifa The big issue is editing things means it resends all the messsages lol 01:27
Anton Antonov Right ! I notice that some time ago -- should keep it in mind. 01:28
[Coke] (package deps: github.com/coke/raku-zef-deps) 02:04
Geth doc: 552607a6a1 | Coke++ | xt/search-categories.t
Revert "slight improvement to output"

This reverts commit 830d524a39098cdda34d2fa375648d24dc266344.
the CI is using an old version of raku
02:13
doc: coke assigned to Altai-man Issue Put “Raku” in page titles github.com/Raku/doc/issues/3989
coke self-assigned Clarify testing levels, supporting code and execution github.com/Raku/doc/issues/3935

2colours++ created pull request #4129: Fix the link of "arity" at Multi-dispatch section
02:18
ToddAndMargo I have to go.  If anyone wants to contact me, I am always looking at the perl6 mailing list or eMail me at [email@hidden.address] 04:09
I have to go.  If anyone wants to contact me, I am always looking at the perl6 mailing list or eMail me at ToddAndMargo@zoho.com
Nemokosch I think resending on edits is a feature, not a bug 08:05
The problem is, rather, that you cannot edit messages on IRC at all
Is there a way to not count ANSI escape characters in strings? 08:38
it would be highly useful for actual visual string width
CIAvash m: my &string_width = *.subst(:g, /"\e[" <[0..9;]>+ 'm'/, '').chars; say string_width "\eThis is bold\e" 08:51
camelia 12
Nemokosch that much I understand... the deeper I look, the more demotivating this whole escape sequence business seems 08:59
CIAvash I don't know what you are doing, but there are modules for dealing with ANSI, raku.land/zef:lizmat/Terminal::ANSIColor raku.land/cpan:UZLUISF/Colorizable raku.land/cpan:BDUGGAN/Terminal::ANSI 09:19
Nemokosch Can I check the matching multi candidates for a certain capture? 09:30
CIAvash: I wanted to check Prettier::Table in case there is a low-hanging fruit - but didn't seem like that with this ANSI madness 09:33
ohh, this is the cando method 09:38
SmokeMachine m: use nqp; class Bla is Regex { method ACCEPTS($a) { my $slash = [ %(bla => $a), ] but NQPMatchRole; nqp::decont(nqp::getlexcaller(q[$/]) = $slash); $slash } }; say 42 ~~ Bla.bless; say $/ # Is Regex the only class allowed to return values when smart matched? Is this the only way of doing this? 09:58
camelia [{bla => 42}]
[{bla => 42}]
Anton Antonov Where is this method? 10:03
Nemokosch docs.raku.org/routine/cando
Anton Antonov I asked first then looked for it… 🙂 10:04
SmokeMachine Is Regex the only class allowed to return value different from Bool when smart matched? 10:05
lizmat there is no specific check on return values of .ACCEPTS methods in the core
afaik
Nemokosch SmokeMachine: what do you mean? I think anything can return any value from ACCEPTS and that value will be the return value of the smartmatch. The rest is all up to the context.
lizmat indeed
Nemokosch Moreover, there is the horrible anomaly I called out several times in the last couple of weeks: Match.ACCEPTS will just return itself, no matter what 10:06
lizmat fwiw, I think this is all down to wanting to have Perlish behaviour for m:/foo/ 10:07
SmokeMachine m: class B { method ACCEPTS(|) { “not Bool” } }; say 42 ~~ B.new # it usually boolify it… 10:08
camelia True
Nemokosch that's because of Callable.ACCEPTS
SmokeMachine m: class B is Regex { method ACCEPTS(|) { “not Bool” } }; say 42 ~~ B.new # but not if it’s a regex…
camelia Cannot make a B object using .new
in block <unit> at <tmp> line 1
SmokeMachine m: class B { method ACCEPTS(|) { “not Bool” } }; say 42 ~~ B.bless
camelia True
SmokeMachine Something wrong on this example… but it’s true on my first example… 10:09
lizmat m: class B { method ACCEPTS(|) { “not Bool” } }; dd B.bless
camelia B.new
lizmat he
m: class B { method ACCEPTS(|) { “not Bool” } }; dd B.ACCEPTS 10:10
camelia "not Bool"
lizmat m: class B { method ACCEPTS(|) { “not Bool” } }; dd B.bless.ACCEPTS
camelia "not Bool"
SmokeMachine But not with ~~
Nemokosch lizmat: and you are right, probably. I wonder if it's worth it in the first place, and also, since it looks "slangish" like crazy, it could be syntax special-cased, if it's so important
lizmat well, at one point in time is was considered very important...
SmokeMachine m: class B { method ACCEPTS(|) { “not Bool” but NQPMatchRole} }; say 42 ~~ B.new 10:11
camelia 1
Nemokosch maybe we can pull the RakuAST card again, and say it might become much easier to syntax special-case something when that lands 10:14
lizmat well, it will definitely will make slangs much easier to make 10:15
so theoretically, we could create a slang that would no longer have the current semantics
and maybe make that the default for future language versions
El_Che (would slang not result in perl-like critiques of "difficult to read") 10:16
lizmat there is always that
SmokeMachine m: use nqp; class Bla is Regex { method ACCEPTS($a) { nqp::decont(nqp::getlexcaller(q[$/]) = $a); $a } }; say "Bla: ", 42 ~~ Bla.bless; say "Bla: ", $/; class Ble { method ACCEPTS($a) { nqp::decont(nqp::getlexcaller(q[$/]) = $a); $a } }; say "Blae: ", 42 ~~ Ble.bless; say "Ble: ", $/ 10:17
camelia Bla: 42
Bla: 42
Blae: True
Ble: 42
SmokeMachine m: use nqp; class Bla is Regex { method ACCEPTS($a) { nqp::decont(nqp::getlexcaller(q[$/]) = $a); $a } }; say "Bla: ", 42 ~~ Bla.bless; say "Bla: ", $/; class Ble { method ACCEPTS($a) { nqp::decont(nqp::getlexcaller(q[$/]) = $a); $a } }; say "Ble: ", 42 ~~ Ble.bless; say "Ble: ", $/
camelia Bla: 42
Bla: 42
Ble: True
Ble: 42
Nemokosch El_Che: I think $foo ~~ m/ bar / is already "difficult to read" unless you specifically know this very structure by heart. It doesn't integrate well with the rest of the language. Same for this use of s, tr and all. 10:18
SmokeMachine I'm testing it to try to make a RakuAST matcher and make it feels like Regexes/Grammars is anyone working on something like that? 10:19
Nemokosch So my sentiment is rather, don't break the concept of ACCEPTS for the sake of this "insider slang" 10:20
and right now, it is broken
SmokeMachine: this stuff is beyond me but I wonder if what we are seeing here isn't simply a bug
lizmat SmokeMachine: nine maybe ? 10:21
"right now, it is broken" is a judgement
SmokeMachine Nemokosch: if it's a bug, it's an old one...
tellable6 SmokeMachine, I'll pass your message to Nemokosch
lizmat Nemokosch: please don't pass judgement too easily :-) 10:22
tellable6 lizmat, I'll pass your message to Nemokosch
Nemokosch yes, it is a judgement definitely. the very same judgement as "horrible anomaly"
SmokeMachine .ask nine Are you working on some kind of RakuAST matcher? 10:23
tellable6 SmokeMachine, I'll pass your message to nine
lizmat Nemokosch: you'd be surprised how much of the interwebs is held together by horrible anomalies
tellable6 lizmat, I'll pass your message to Nemokosch 10:24
Nemokosch Match.ACCEPTS returning itself, well, if you have a better way to put it _without_ taking away the part that it goes against the whole designed semantics of ACCEPTS, I welcome it
lizmat fixing horrible anomalies may actually break a lot of useful stuff
Nemokosch I don't think that's the case here. Let's find out. 10:30
Anton Antonov "you'd be surprised how much of the interwebs is held together by horrible anomalies" -- this should be kept secret, otherwise, "strangely consistent" would be looked at with a great(er) suspicion. 11:35
lizmat well, I was more thinking of legacy systems there :-) 11:36
Anton Antonov @lizmat Ok, good to know! I will stop googling "how to switch to Rust from Raku" ... 11:45
For the record, I would rather program in Swift, not Rust. (Well, if I do not spend that much time with Raku...)
Nemokosch I like the word/concept of "consistency" in general because it rules out a lot of subjectivity. You can like something or not but that has no effect whatsoever if it is consistent or not. 11:52
guifa SmokeMachine I am :-) 11:55
SmokeMachine guifa: great! So I don't need doing that! (that's kinda sad because it seems fun...) 11:56
guifa Right now IIRC the way that I coded the Polyglot::Regexen module is to basically create nodes that are virtually identical in function to RakuAST nodes, but just stringify into EVAL'able code (at least until RakuAST has more regex support) 11:58
but after that
I'm going to return to the idea of a binary regex. I've got some really promising stuff sitting on my drive but I it's been half baked enough times that I probably should start over from scratch — and that'll ultimately compile to something internally that's not regex at all, methinks 11:59
SmokeMachine guifa: that sounds interesting... 12:01
Nemokosch by binary regex, you mean better matching possibilities for binary data?
guifa Nemokosch: yes. a syntax designed exclusively for binary stuff (so it'll match against blobs, rather than strings) 12:02
tellable6 guifa, I'll pass your message to Nemokosch
Anton Antonov @guifa So, "Polyglot::Regexen" lives only here: raku.land/zef:guifa/Polyglot::Regexen ? 12:07
guifa AntonAntonov: github.com/alabamenhu/PolyglotRegexen 12:08
Anton Antonov @guifa Ah, I searched with "Polyglot::Regexen" (not "PolyglotRegexen".) 12:10
@guifa "Right now IIRC the way that I coded the Polyglot::Regexen module is to basically create nodes that are virtually identical in function to RakuAST nodes, [...]" -- This makes want to study your code. 12:12
guifa ah actually ignore me. I think that's in an update and not in that released code 12:14
(unreleased update... remember what I said last night about too many in-progress things hahaha)
Anton Antonov @guifa Good to know! I recently worked on "random sentence generation" from Raku grammars. I was told that with RakuAST that might/should be easy, but until RakuAST is released, I am interested in "current Raku" solutions. 12:16
@guifa Ok, I remember -- I should have realized it is a blanket excuse that covers future references to non-released features. 12:18
guifa The idea is understanding that most all of the RakuAST nodes can ultimately stringify into actual Raku code 12:19
so for instance, you could create a StringLiteral node that stringifies to '…', escaping the backslashes and single quotes 12:20
Anton Antonov @guifa Yes! That is what I discovered over the weekend -- I can get strings of the code definitions for the regexes in grammars.
nine SmokeMachine: what do you mean by "RakuAST matcher"? 12:22
SmokeMachine nine: I mean something that you'll use to find something inside your AST (for, for example, change it) 12:24
nine No. That will come once it's time to create an optimizer. 12:25
guifa okay time for $day-job 12:30
SmokeMachine nine: I was thinking on making something like a Regex/Grammar for that, but it seems guifa is doing that already... (I'll probably only play with that)
Anton Antonov @guifa Same here after 1.5 hours. 🙂 12:34
nine guifa, SmokeMachine: why don't you join the RakuAST implementation effort? You are both obviously interested in the topic and in the kind of challenges this entails. If want to hvae RakuAST ever see the light of the day, helping may even be necessary. I honestly don't know if I can ever finish it by myself. 12:36
SmokeMachine nine: I'd love to help... I'm just not sure if I have enough time or knowledge... I'm struggling to find some time for Red... 12:38
nine Knowledge can be acquired (and I'd be happy to help there). And every little bit helps. 12:39
SmokeMachine nine: is there a list of tasks from where I could get an easy one (related to RakuAST, I mean)? 12:40
Anton Antonov <@886919719066697749> "I'm struggling to find some time for Red..." -- I am struggling finding time for Red and Dan...
nine src/Raku/ast/README.md in the rakuast branch gives some general information and has a few TOODs for the RakuAST node compiler. Work is easy to find though: just run a spectest with RAKUDO_RAKUAST=1 set in the environment, look at the failures and pick one that doesn't look too scary and try to fix it. I'd go with syntax errors since those can usually be solved by copying some code from src/Perl/Grammar.nqp to 12:44
src/Raku/Grammar.nqp and following up in Actions and maybe RakuAST nodes
Nemokosch I should watch vrurg's presentation from last year at least, and then maybe I'd have a general understanding of the architecture 12:47
by the way: are method forms of operators really not visible globally? Does one essentially have to add operators as multi sub candidates all the time? 12:49
SmokeMachine nine: I'll give it a try today after work, thanks 13:41
nine ++SmokeMachine
Nemokosch Actually, is there a detailed description of the multi dispatch process and tiebreakers anywhere? 15:01
I couldn't find what I was looking for even in the so-called old design docs, let alone the docs site
lizmat clickbaits rakudoweekly.blog/2022/11/14/2022-...butterfly/ 16:24
[Coke] rakudo's multi dispatch *process* is probably an implementation detail, not part of the spec/docs. 16:28
And I would suppose that it's different between RakuAST/Existing - might be worth reading jnthn's notes about moving to AST that probably describe both. 16:29
Trying to find the slide deck that covered this. 16:30
no love. (but always a good time to go through jnthn's videos/slides) 16:32
Nemokosch The exact order should be specified, I'd assume 16:33
And that's what I am mostly curious about. I'm not sure how much the implementation can be flexible if the outcome is defined but that's beside the point. 16:40
[Coke] there is roast's S06-multi 17:02
tbrowder nine: wouldn't it be helpful to have a reasonably visible RakuAST page or link on one of the Raku websites? maybe inside or linked to the CONTRIBUTING page. I just took a quick look and don't see anthing. 18:35
*anythingo
**anything
^^^ tried to use aussie lingo :-D 18:36
SmokeMachine nine: Am I doing something wrong to compile this? usercontent.irccloud-cdn.com/file/.../image.png 18:40
nine SmokeMachine: yes. The setting cannot be compiled with RakuAST yet. So just run make and then RAKUDO_RAKUAST=1 make test 19:01
tbrowder: sure that would be useful. Feel free to create such a page :)
nine [Coke]: RakuAST does not affect multi dispatch in any way. The former is compile time, the latter a runtime thing. 19:08
Nemokosch the thing is, what I strongly suspect but hard to find written anywhere: slurpiness is a stronger tiebreaker than given types 19:11
which probably wouldn't cause problem in 95% of cases but I wonder what would the other 5% break, if anything 19:12
SmokeMachine it seems I have an error on configure.pl... 19:14
usercontent.irccloud-cdn.com/file/.../image.png 19:15
let me try on a intel machine... 19:16
Nemokosch github.com/Raku/infrastructure-doc I see this was last maintained when moritz did the lifting. Is there anything similar but more up-to-date? 19:43
[Coke] nine: thank you! 20:00
that repo is probably a good place to refresh going forward. not sure if rba et al. have been using someplace else. 20:02
SmokeMachine on my intel machine it's working... 20:15
ugexe SmokeMachine: are you on apple silicon? if yes, is rosetta installed (does `pgrep oahd` show a number)? 20:33
El_Che building Fedora 37 pkg 20:35
SmokeMachine ugexe: yes, apple silicon... 20:36
usercontent.irccloud-cdn.com/file/.../image.png 20:38
ugexe i just got a m2 the other day and, after installing rosetta, got moar 2022.07 to install via rakubrew 20:40
[Coke] i'm using rakubrew on m2 20:45
tbrowder nine: WILCO 20:53
El_Che new rakudo-pkg release with support for fedora 37 and workaround for zef install problem is ready, waiting on cloudsmith to add the repo 21:24
xinming releasable6: status 21:50
releasable6 xinming, Next release will happen when it's ready. There are no known blockers. Changelog for this release was not started yet
xinming, Details: gist.github.com/dda48f5ba74d625ab1...60b25892bd
xinming So, we are waiting for the christmas release. :-) 21:51
lizmat not if I can help it :-( jdv ? 21:53
El_Che weekly: a new rakudo-pkg release with support for Fedora 37 github.com/nxadm/rakudo-pkg/releas...2022.07-03 22:25
notable6 El_Che, Noted! (weekly)
[Coke] ugexe: do you have a method in zef that can extract the bits from module::name:ver<x>:this<that>? 23:09
(want module name, and then a hash of the colon bits. 23:10
ugexe use Zef::Identity; say Zef::Identity.new("Foo::Bar:ver<1.0>:api<0.1>").hash 23:14
use Zef::Identity; say identity2hash("Foo::Bar:ver<1.0>:api<0.1>").hash 23:16
[Coke] sweet, thanks! 23:17
ugexe github.com/ugexe/zef/blob/main/lib...od#L13-L30 23:18
that grammar is pretty small for c&p as well 23:19
[Coke] I'm already using zef guts in this thing, so the sub is perfect. 23:21
Geth doc: 2colours++ created pull request #4130:
Fix (cont) link around the .contains gotcha
23:26
[Coke] 'zef-deps' now has a --json flag on master; feedback on the format welcome before I push a release. 23:35
ugexe++ for doing the hard part ages ago. 23:36
tonyo what're you writing [Coke] ? 23:38
[Coke] .seen gfldex 23:47
tellable6 [Coke], I saw gfldex 2022-11-15T01:24:40Z in #raku: <gfldex> perryprog: you are correct! see: gist.github.com/gfldex/c69612be47e...f3972fc3f2
gfldex o/
[Coke] tonyo: github.com/coke/raku-zef-deps 23:48
gfldex: looking at github.com/Raku/doc/pull/4126 - the space doesn't seem to be required
gfldex m: sub foo(|c(Int, Int)) {} 23:49
camelia ( no output )
gfldex I did have problems with that on glot.io . 23:50
[Coke] Looks like a glot.io issue?
maybe it's an old version of rakudo? 23:51
gfldex could very well be
I will investigate further and close the pull request when it's a false alarm.
[Coke] Going to close the PR; thanks, though!
gfldex ok
[Coke] ... ok, that works too!
Just trying to be better about new PRs going forward. ;) 23:52
(some of those got olllld)
Geth doc: 09900e5c44 | (Márton Polgár)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
Fix (cont) link around the .contains gotcha

Closes github.com/Raku/doc/issues/4128
doc: 7bb93fcacb | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
Merge pull request #4130 from 2colours/patch-2

Fix (cont) link around the .contains gotcha
linkable6 Link: docs.raku.org/language/traps
gfldex Today I learned that super nova explosions create 10**58 neutrinos. Looks like we should pitch Raku to astronomers. 23:54
Geth doc: bb05d9b70c | (Márton Polgár)++ (committed using GitHub Web editor) | doc/Language/glossary.pod6
Fix the link of "arity" at Multi-dispatch section

Closes github.com/Raku/doc/issues/4127.
23:55
doc: a7451ce0cf | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/glossary.pod6
Merge pull request #4129 from 2colours/patch-1

Fix the link of "arity" at Multi-dispatch section
linkable6 Link: docs.raku.org/language/glossary
[Coke] .seen kaipei 23:56
tellable6 [Coke], I saw kaipei 2022-10-04T15:16:09Z in #moarvm: <Kaipei> be careful not to break ($a, $b) = ($b, $a) in the process