🦋 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.
[Coke] . 00:22
tellable6 2022-10-28T16:44:25Z #raku <Voldenet> [Coke]: original thing was Dash compatible DocSets for the Raku documentation for viewing in kapeli.com/dash
Nemokosch theweeklychallenge.org/blog/perl-w...188/#TASK2 hmmm, this task could be funny if it was defined properly... 00:25
like, if I have $x = $y = 42, what do I do? The only thing I can come up with is they can both go to zero in one step
But that's not really what the task says
Xliff japhb: What is the Terminal::ANSIParser interface for decoded-input? 00:37
Nemokosch with that assumption, it's a nice post condition loop task
Xliff And with today's commit, I am at 803kloc for p6-GLib-Suite 00:42
ToddAndMargo How do I put a literal string in the target of a regex?  (I know about subst.)  This works, but how do I replkace teh six back slashes with a literal string? 00:55
$ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\\\\\|;print $x ~ "\n"'
a\\\b\\\c\\\d
japhb Xliff: I don't think I understand the question ... Terminal::ANSIParser was created *after* Terminal::Print, and Terminal::Print doesn't know anything about Terminal::ANSIParser.
ToddAndMargo But this does not work: 00:56
$ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"'
aQ[\]bQ[\]cQ[\]d
I am after replacing the a single forward slash with three back slashes 00:57
I am not sure what you mean by Terminal::ANSIParser 00:58
Nemokosch ToddAndMargo: I don't understand the question (and the excerpt makes me freak out)
ToddAndMargo Oh you know what.  You guys forcing me to write more clearly, I figured it out.  It is the same as before source! 01:00
echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|$(Q[\\\])|;print $x ~ "\n"'
I forgot the $()
Thank you!
All those \\\\\\\, I was having a perl 5 moment! 01:03
Nemokosch I never liked when somebody asks a vague question and then goes like "thanks for nothing, I figured it out", it always makes me feel like an idiot. xD 01:05
When it's usually more like only the asker knew what they meant and nobody else got a chance to answer
ToddAndMargo I was thanking you guys for forcing me to think more clearly. 01:06
Nemokosch Sorry then. I've spent too much time with 14 "hacker" kiddos who know nothing but want everything, and obviously for free... 01:07
ToddAndMargo Happens to me all the time.  I am a small business consultant.  A customer will go crazy with a problem and decide to call me.  Whilst the phone rings, because their mind is thinking differently, I get "I figured it out" when I answer the phone.  I tell them their computer is afraid of me!  Same thing happens to me all the time when I have to 01:12
call tech support myself.  I figure it out whilst I was on hold.  It is because your/my brain is changing what it is doing and no long it wearing a hole in the carpet running is place.  Funny how that happens!
Nemokosch Oh right. The other thing is, nobody wants to be stupid, and whenever we decide to actually ask/call/something, we check further things 01:20
And focus more, in general 01:20
However, in those skid communities, it's more like they really get stuck with something absolutely banal, like how a console program works on Windows, and then they describe it so poorly that only they can solve it afterwards xD 01:22
ToddAndMargo Ya, no fooling.  Part of what I have to do is to read though folks giving me what sounds "technical" when they have no idea what the term means.  "My computer won't boot" means "my internet is down".   "I don't have a web browser.  I only have google" mean they are using "chrome browser".   "My WiFi is down" mean almost anything.  So you 01:27
slowly ask them what they are experiencing and slowly walk them into a proper description.  It is actually fun when you get the hand of it.  But it is not suppose to happen to me.  Never!!!  What????  Okay, once or twice.
Oh ya, Go To Assist is great.  Show me what is happening. 01:28
Xliff japhb: I understand that. What I was asking is this: What is the Terminal::ANSIParser equivalent Terminal::Print's decoded-input-supply 03:33
.tell japhb I understand that. What I was asking is this: What is the Terminal::ANSIParser equivalent Terminal::Print's decoded-input-supply
tellable6 Xliff, I'll pass your message to japhb
japhb Xliff: Ah! Terminal::ANSIParser only does the conversion of bytes or codepoints to escape sequences; it expects a $*IN pump to feed it codepoints. In theory you could use Terminal::Print::RawInput for this, with something like `use Terminal::Print::RawInput; use Terminal::ANSIParser; my $parsed = supply { my &parse-codepoint := make-ansi-parser(emit-item => { emit $_ }); whenever raw-input-supply() { 03:59
tellable6 2022-10-30T03:33:47Z #raku <Xliff> japhb I understand that. What I was asking is this: What is the Terminal::ANSIParser equivalent Terminal::Print's decoded-input-supply
japhb parse-codepoint($_) } };` (or somesuch, that was freehanded)
Xliff: So once you have a $parsed Supply, you need to turn that into actual keys, which is a lot of what github.com/japhb/Terminal-LineEdit...#L374-L507 is doing. 04:02
Xliff: But of course that's complicated, which is why I wrapped that up in github.com/japhb/Terminal-Widgets/...al.rakumod . 04:03
Xliff: I guess the big answer to this is "There's no existing medium-level simple API equivalent to decoded-input-supply, but based on Terminal::ANSIParser instead of Terminal::Print::DecodedInput" -- because I wrote low-level and high-level ones instead. 04:05
Sigh, all of this means "Spend more time on Terminal::Widgets" I guess.
ETOOMANYPROJECTS
japhb goes back to being very annoyed that existing terminals don't handle skin tone diversity for emoji properly 04:07
lizmat RakuIRCLogger 07:55
Nemokosch "goes back to being very annoyed that existing terminals don't handle skin tone diversity for emoji properly" it would be really nice to get away without statements like this 09:25
it would even align with -Ofun I think because I 100% refrain from bringing my politics here and it makes me lose heart to listen to this priority set of a Raku representative 09:30
lizmat why is a comment about a technical issue a political statement ? 09:34
Nemokosch mostly because of the framing that this is "diversity" and something to be "very annoyed with" 09:36
lizmat I think you're reading too much in that message: Unicode allows for a very wide range of skin tones in emojis, the "diversity" bit in that statement was about that technical reality 09:47
Nemokosch You may be right. To be honest, reading about MUGS didn't help with my prejudice. 09:51
Although it's also a part of reality that toned emojis have low user adoption which might contribute to how important they are treated, not the other way around. 09:53
lizmat indeed
also: "prejudice" has as first meaning according to dictionary.com: 09:54
an unfavorable opinion or feeling formed beforehand or without knowledge, thought, or reason.
I would say one should be aware of one's prejudices
lizmat had a case of that yesterday, and is not proud of that 09:55
Nemokosch yes, I'm not saying it's a good thing 09:56
But it's based on "evidence", so to speak, and regarding the given person. I tried to kinda swallow it but I can say if I ever contribute to MUGS, it will be in the form of an "unofficial" fork because of the contribution policies written there 09:59
lizmat link?
Nemokosch github.com/Raku-MUGS/MUGS/blob/mai...andards.md 10:01
I'm not saying this because I want to make some "public case" about it, and therefore I don't expect you to agree with me 10:03
It's just I personally really don't feel positive about the "CoC-first development", like enforcing certain ideals is presented as more important as the content itself 10:05
Marcool04 Hi all! 10:09
lizmat Well, gaming, unfortunately, has been an area, and many would argue still is, a world with a lot of misogyny and prejudices
Marcool04 I'm running into some problems when using Promise.anyof 10:10
lizmat feels right to make an extensive CoC for that
Marcool04 Specifically, I notice that docs.raku.org/type/Promise#method_anyof says "The result of the completed Promise is not reflected in the result of the returned promise which will always be Kept."
how does one go about doing that then?
what I'm doing is trying to make a promise-factory kind function that, given a promise and a timeout, returns a "time caped" version of the promise, that will either just do whatever the promise should have, or throw an exception in case of a timeout 10:11
lizmat well, in the case of the code example there, one could set a flag in the "start" block to indicate that that is the one that kept the promise
Marcool04 right 10:12
yes that was my first thought, is there no issue of concurrency there? which thread is actually accessing the Bool when and such?
lizmat well, do you want the result of the non-timeout promise ? 10:13
Marcool04 yes
so something with .then I guess... 10:14
lizmat and you only have 1 timeout promise, and one other promise / start block ?
Nemokosch reminds me that I should also learn Promises 😅
gfldex Marcool04: see: github.com/gfldex/raku-proc-async-...imeout.pm6
Marcool04 lizmat: yes one promise, and one Promise.in($timeout) 10:16
gfldex: thanks I'm just trying to see if I can fix my example with help from that
(what do you recommend as a codeshare for raku code here?) 10:17
gfldex gist works fine
lizmat Marcool04: maybe something like; gist.github.com/lizmat/180e31661db...56bc1bf0cd 10:19
check if the returned promise is Kept, then you know it didn't timout 10:20
Marcool04 right 10:23
but I need to pass a Promise to the function...
gist.github.com/Marcool04/cfeca8df...f6f123f10d
that's something that doesn't work... 10:24
but has all the pieces in the way I would like them to work
lizmat that's because timeout_promise is returning the "anyof" promise
instead of $p ?
actually $promise 10:25
also, why do you need to pass the promise, if the promise is always the result of a start block? 10:26
or isn't it ?
Marcool04 it isnt
that's just a simplified example
lizmat updated the gist to take a promise: gist.github.com/lizmat/180e31661db...56bc1bf0cd 10:27
Marcool04 this function is used throughout a load of calls to an network endpoint, each call is in the form of a Promise, 99% of the time the Promise will succeed, but I wanted to guard against the risk of it hanging, with a timeout
lizmat: does this reflect your changes gist.github.com/Marcool04/cfeca8df...f6f123f10d 10:29
lizmat yeah, basically
Marcool04 still fails the test :/
or is my test badly written?
lizmat badly written tests could be a case of a failing test, yes 10:30
Marcool04 I did wonder about that :)
I commented on my gist with the output 10:31
the code dies, but not with the correct exception apparently
oh no sorry, it doesn't even die 10:32
ok, seems to work like this: gist.github.com/Marcool04/cfeca8df...f6f123f10d 10:38
and I've now added a "positive" test case 10:40
where the promise doesn't time out
can you see anything wrong with it? 10:41
lizmat passes all tests for me
lizmat which version of Rakudo are you using ? 10:42
Marcool04 Welcome to Rakudo™ v2022.07. 10:43
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.07.
lizmat hmm... weird 10:44
Marcool04 does it look like it should fail for you?
lizmat output: gist.github.com/lizmat/8a77b851249...ba9c7d9a09
looks to me it should pass and it passes :-) 10:45
tbrowder g'day, all 11:23
tbrowder i'm trying to access the $=pod object from an external pod file. i've tried using @dmaestro's Module::Pod and Module::Loader but it expects an installed module (Compunit**). 11:26
i think jmerelo has a suitable $=pod extractor but i haven't yet found it again 11:28
oops, never mind. raku.land is working much better now... 11:31
tbrowder the one i'm looking for is jmerelo's Pod::Load. i hope that solves my problem. 11:35
tbrowder that did it--kudos to jj and dwarring: good pipeline 11:45
gfldex tbrowder: sorry for not hepling you with something you didn't need help with! :-> 11:47
tbrowder and antonocube. three sets of modulesthat can go from markdown to pod to pdf! 11:49
gfldex: you are welcome, i'm glad you're here as backup. i tend to use this place as a sounding board :) 11:51
my wife is not much help (artistic, not geeky) 11:52
you folks are like sherlock holmes' dr watson 11:53
(who is not the dummy as portrayed in the old movies) 11:55
tbrowder well, my excitement was premature. i was fooled by no errors, but visually the md2pdf flow is not yet ready for prime time 12:13
guifa ugh 12:58
guifa I went to go push an update to Timezones::ZoneInfo and they made some upstream code changes that prevents a tool from compiling and I don't know enough C to fix it =/ 12:59
lizmat meh 13:00
perhaps someone on #moarvm could be of help
afk for a bit& 13:02
Xliff \o 13:06
Hi, lizmat!
guifa I can thankfully use the C code from the previous version but yeah... this is a bit annoying =/ 13:08
Xliff \o guifa 13:09
guifa o/ 13:10
Nemokosch Hello 🤠
Xliff o/ Nemokosch 13:22
Nemokosch What are you up to today? 13:24
Marcool04 ok lizmat, gfldex thanks for your help, I think I have something that seems to work now... 13:50
gfldex Concurrency tends to "seem" in general. :) 13:51
Nemokosch works "seemlessly" 13:55
Marcool04 yeah... didn't even realise I used to caveat words in that sentence... "I think" and "seems" 13:57
two caveat words*
so, it "seems", until it next blow up 13:58
the timeout think is only a small detail of the whole mess
I'm trying to write an event-driven app that can either: receive commands from a cro webservice, react to a change on a supply tied to a piece of hardware, or react to events from an MPD server which I'm talking to over a socket... 13:59
the whole things is, how should I put it. Precarious
but *seems* to work 😅
tbrowder FYI, i just discovered a fatal bug in Markdown::Grammar, issue filed. 14:08
heh, i now have a good start on an advent article! 14:09
md -> pod -> pdf
tbrowder erg, a new fatal bug in Markdown::Grammar... 14:48
but workaround is available for now 14:52
thundergnat Xliff (or anyone who might be interested) I saw you woes with Term::ReadKey, had struggled with that in the past. I wrote an updated Terminal::Readkey that reads multibyte characters, wonder if you could test it to see if it would be useful. 15:00
It isn't in the ecosystem yet, but is on github. github.com/thundergnat/Terminal-ReadKey
Can install with zef install git://github.com/thundergnat/Terminal-ReadKey.git to test it. 15:01
[Coke] thundergnat: 'zef test .' in a git clone passes, fwiw. 18:14
(mac M2)
... your test suite isn't testing anything, though. 18:15
ugexe looks like doc type graphs are showing '404' for some entries such as docs.raku.org/type/Distribution::Locally 18:21
docs.raku.org/type/Distribution::L...Type_Graph 18:22
tbrowder ugexe: how do you feel about “zef upgrade some::missing::module” prompting something like “not found, install?” 18:43
ugexe honestly removing `zef upgrade` altogether makes the most sense 18:45
`zef upgrade some::module` is already almost entirely the same as `zef insall some::module` since we can't just remove the old version 18:46
i.e. `upgrade` doesn't make as much sense when you can have multiple versions of something installed / depended on 18:47
`zef upgrade` is sort of useful in that it installs newer versions of anything, but not `zef upgrade $thing` 18:48
s/anything/everything/
guifa ugexe: perhaps if "upgrade" could install the new one and then recompile modules depend on the newer one (assuming their :ver<> would prefer the newer one) it could distinguish itself more? 18:59
guifa I know that would definitely increase the level of complexity, though 19:00
ugexe things like optional dependencies make it mostly impossible for now
there also isn't a public api for re-precompiling things, that would require additional core functionality 19:02
such functionality would be useful for other stuff though. for instance the core could potentially detect orphaned dependencies 19:04
lizmat weekly: dev.to/lizmat/dont-fear-the-grepper-5-38bf 19:23
notable6 lizmat, Noted! (weekly)
tbrowder ugexe: for a data point yesterday i did "zef upgrade" and got a good total upgrade run for lots of modules. sorry i didn't count them 19:46
guifa ugexe: yeah I figured it wasn't anything that could be done super soon, but just an idea of how it might oculd be made distinct from install 20:23
Actually, is there a module data storage location that could be used in, say, Build.pm6 that could be shared between versions? I don't think there is, but if there were, that would definitely solve some of my tz update issues 20:34
ugexe just do `my $storage-location = $*HOME.add(".myapp/whatever");` 22:12
guifa works but I guess it feels a bit... unsatisfying maybe? lol 22:30