|
🦋 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. |
|||
|
00:04
jpn left
00:15
lichtkind left
00:53
jpn joined
00:58
jpn left
01:10
jpn joined
01:20
kylese left
01:21
jpn left,
kylese joined
01:25
jast joined
01:28
ilogger2_ joined
01:29
jdv_ joined
01:34
Guest5764 left,
dpk left,
jargan left,
atweedie left,
toddr left,
jdv left,
ilogger2 left
01:43
toddr joined
01:56
stanrifkin joined
02:08
jdv_ is now known as jdv
02:11
Guest5764 joined,
dpk joined,
atweedie joined
02:15
kylese left,
kylese joined
02:43
jpn joined
02:53
jpn left
03:06
Aedil joined
03:31
stanrifkin_ joined
03:33
stanrifkin left
04:30
kylese left
04:32
kylese joined
04:37
jpn joined
04:42
jpn left
05:17
Sgeo left
05:30
kylese left
05:32
kylese joined
05:33
jpn joined
05:38
jpn left
07:02
jpn joined
07:07
jpn left
07:33
sorenson left
07:35
sorenson joined
08:06
dakkar joined
08:24
lichtkind joined
09:18
lizmat_ joined
09:21
lizmat left,
lizmat_ left,
lizmat joined
09:23
jpn joined
09:54
jpn left
10:02
greenfork left,
thatonelutenist left,
greenfork joined,
thatonelutenist joined
10:16
donaldh left
10:21
Aedil left
10:26
Aedil joined
|
|||
| tbrowder | yep, trimming down is helpling though. the repo is on github, and my trim-down is in a new test file... | 11:23 | |
| giving up on trimming. repo github:tbowder/Mi6-Helper, git branch "next-ver", test is in subdir "bad" | 12:31 | ||
| antononcube | This link should work: github.com/tbrowder/Mi6-Helper/tre...xt-ver/bad | 12:36 | |
| tbrowder | thnx | ||
| wonder if chatgpt could convert my old perl website to raku and cro--that would be really cool! | 12:38 | ||
| antononcube | It can, but proper prompts have to be used. Probably example conversions too. | 12:39 | |
| I am having a similar use case -- converting R/Shiny interactive interfaces to Raku/HTMX. | 12:40 | ||
| tbrowder | yes, i was really impressed how it produced the code from my pretty decent directives | 12:41 | |
| antononcube | The promptCodeWriterX from "LLM::Prompts" is pretty good at producing good Raku code with the most recent LLMs. | 12:44 | |
| tbrowder | i'll take a look-see | 12:45 | |
| glad to see someone using Text::Utils! | 12:49 | ||
| antononcube | Yes, for the paragraph wrapping -- that is needed in Markdown files. | 12:52 | |
| BTW, it can be replaced with an LLM function, but that is -- of course -- way too slow. | |||
|
12:53
donaldh joined,
donaldh left
|
|||
| tbrowder | ref my current prob. it's not a real show stopper, desired output seems good, just frustrating i can't figure out why the exception is leaking out of dies-ok. | 13:01 | |
| lizmat | perhaps because it returns a Faiilure, that then throws outside of the dies-ok ? | 13:02 | |
| tbrowder | i've tried a little to CATCH but no luck. | 13:03 | |
| lizmat | where did you put the CATCH ? | 13:04 | |
| tbrowder | in code below where the code is about to die from finding an existing directory | 13:05 | |
| i did a try {} around that chunk, but my catch foo is seriously weak and foggy | 13:06 | ||
| so my prog drives mi6. mi6 will fail if there is an existing dir it wants to create. | 13:08 | ||
|
13:08
jpn joined
|
|||
| tbrowder | i have tried (1) letting mi6 do the failure and (2) letting my code test and throw before mi6 is executed. | 13:10 | |
|
13:13
jpn left
|
|||
| tbrowder | it's ugly, but i'll try them both with CATCH today sometime | 13:14 | |
|
13:22
jpn joined
13:29
donaldh joined
|
|||
| tbrowder | antononcube: what i really want to do is convert my old website to using cro behind an apache front end | 13:30 | |
|
13:31
donaldh left
13:32
lichtkind left
|
|||
| tbrowder | the site is mostly static, but it does need a secure password capability. right now it uses private ssl certificates, but my old target users now aren't comfy with that. | 13:34 | |
|
13:38
lichtkind joined
13:42
donaldh joined
|
|||
| antononcube | How about using "Humming-Bird" instead of "Cro"? Maybe, it fits better your website implementation/design/ | 13:43 | |
|
13:49
jpn left
|
|||
| ugexe | tbrowder: you seem to be overlooking either the difference between a failure and an exception | 14:19 | |
| essentially your `run` returning non-0 will give you a failure that you need to have an exception raised for the dies-ok | 14:20 | ||
| m: use Test; my $foo; dies-ok { $foo = run("asdfasfd"); sink $foo } | |||
| camelia | ok 1 - | ||
| ugexe | m: use Test; my $foo; dies-ok { $foo = run("asdfasfd"); } | ||
| camelia | not ok 1 - # Failed test at <tmp> line 1 |
||
| ugexe | to your point i'm not sure why it needs to be sunk explicitly though | 14:21 | |
| i guess because the return value is a Proc object that emulates a failure or something, instead of being a Failure object | 14:22 | ||
| m: use Test; dies-ok { fail 42 }; | |||
| camelia | ok 1 - | ||
| ugexe | for instance that works as expected | ||
| lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2025/04/15/2025-15-in-place/ | 14:52 | |
| antononcube | @lizmat Thank you for the new blog post! You mentioned the update of "Lingua::NumericWordForms" twice. | 15:09 | |
| (Fine with me, but some might be puzzled.) | 15:10 | ||
| lizmat | thanks for the headsup, fixed | ||
|
15:30
jpn joined
|
|||
| tbrowder | ugexe: thnx, and you are right, i do not know diff between Failure and an Exception | 16:39 | |
| docs to me are a bit confusing on the diff and how to handle that. | 16:41 | ||
|
16:41
dakkar left
|
|||
| tbrowder | i know you helped me with one case a couple of yrs ago, but this one does seem diff | 16:42 | |
| melezhik. | . | 16:44 | |
| tbrowder | i’ll look at skaji’s code a bit closer | 16:48 | |
|
16:48
jpn left
|
|||
| grondilu | Hi | 16:53 | |
| I'm not too happy with the way I caught csi codes for my chess module. Is there any chance I could find idiomatic code to do that? | |||
| ugexe | tbrowder: for the sake of what you are doing you can workaround the issue by sinking any Proc object inside dies-ok and lives-ok, i.e. `dies-ok { $proc = run(...); sink $proc; }` | 16:54 | |
| grondilu | m: $*IN.print: "foo"; say "got `{get() // "nothing"}`" | 17:02 | |
| camelia | Failed to write 3 bytes to filehandle: Bad file descriptor in block <unit> at <tmp> line 1 |
||
|
17:52
abraxxa-home joined
18:00
DarthGandalf left
18:01
DarthGandalf joined
18:06
vrurg left
18:10
vrurg joined
|
|||
| [Coke] | m: $*IN.say: "OH HAI" | 18:23 | |
| camelia | Failed to write 7 bytes to filehandle: Bad file descriptor in block <unit> at <tmp> line 1 |
||
| [Coke] | ... that works on the command line here. weird. | 18:24 | |
| I would expect it to always fail. | |||
| timo | not necessarily | 18:32 | |
| your fds may be different than what you expect | |||
| if you have a TTY, often times stdin, stdout, and stderr are just clones and they are all the pty | |||
| but camelia most probably doesn't have a PTY | 18:33 | ||
|
18:41
melezhik joined
|
|||
| melezhik | o/ | 18:41 | |
| anyone familiar with the business who's owner created this post about porting Rust to Raku/Perl ? fedi.seriousbusiness.international...RcQUBcxG4W | |||
| I am just curious | |||
| has known about this from today's RW | 18:42 | ||
| [Coke] | news to me | 18:43 | |
| melezhik | oh, I get something after a bit googling - seriousbusiness.international | 18:44 | |
| they say there - "Government agency grade* link redirection software (written in Raku for highest resource consumption)" | |||
| ugexe | sounds fake as hell | ||
| melezhik | among their services | ||
| [Coke] | Searching for that name on google gits some hits about it being a fake/insult name for Elon Musk. | 18:45 | |
| melezhik | and their link from that, but I am not going to "spam" the channel with some unchecked stuff, anyways, | ||
| ah, ok - may they just utilize the Raku name? | 18:46 | ||
| [Coke] | Sounds like the whole thing is fake, honestly. | ||
| melezhik | may -> maybe | ||
| ugexe | i think i broke their hyperlink application by entering ././.htaccess as the url | 18:47 | |
| it doesnt load anymore | 18:48 | ||
| melezhik | oh ) | ||
| ugexe | Government agency grade | ||
| i think its all LLM generated or something | |||
| [Coke] | agreed. | 18:49 | |
| lizmat: I'd remove the link to "why we rewrote..." - seems bogus | 18:50 | ||
| melezhik | yeah, probably ... why LLM related stuff recently seems associated with Raku? Just wondering )) | 18:51 | |
| lizmat | wonder if Dr. Leon Kums is an anagram for something | ||
| [Coke] | lizmat: "Elon Musk" | ||
| lizmat | heh | ||
| duh | |||
| melezhik | oh, yeah, that's right | 18:52 | |
| lizmat | removed | ||
| I should have seen that, sorry | 18:54 | ||
| melezhik | I have a steady progress with helping Rocky linux team starts using Raku/Sparky/Sparrow for their internal tasks, so let's see . We've already tested for some use cases ... | ||
| lizmat: that's ok, I also bought into it ))) | |||
| this is why btw I asked recently about RPM install support for Rakudo | 18:55 | ||
| lizmat | afk& | 18:56 | |
| melezhik | irclogs.raku.org/raku/2025-04-14.html#17:31 | ||
| timo | well, nine is working with opensuse, so there's a bunch of rpm-related stuff available for rakudo right? | 18:57 | |
| melezhik | yeah, but I referenced to github.com/nxadm/rakudo-pkg | 18:58 | |
| I guess the project is supported , right ? | |||
| .seen nxadm | |||
| tellable6 | melezhik, I haven't seen nxadm around, did you mean nadim? | ||
| grondilu | I'm trying to use $*IN.Supply and I can't make it work as I want. It seems to block until EOF. Why? Isn't it a supply, working asynchronously or something? | 18:59 | |
| gist.github.com/grondilu/dc94f3612...4c208af4c3 | |||
| I mean it works if I wrap $*IN.Supply inside a start block, and tap it to emit the value by a supplier. | 19:06 | ||
| as in revision 2 of the gist above. | |||
| that seems overly complicated. | |||
| [Coke] | by default $*IN is buffered, I do not think there's a way to say "don't buffer on input" - for output there out-buffer=0 | 19:07 | |
| there *is* | 19:08 | ||
| grondilu | well there is raw mode | ||
| melezhik | .tell El_Che: - could you please follow up on that irclogs.raku.org/raku/2025-04-14.html#17:31 ? thanks! | ||
| tellable6 | melezhik, I'll pass your message to El_Che | ||
| grondilu | I've tried with it and it didn't change anything | ||
| grondilu tries again with raw mode from Term::termios | |||
|
19:14
melezhik left
19:15
Aedil left
|
|||
| ugexe | grondilu: see github.com/rakudo/rakudo/issues/24...-435531319 | 19:21 | |
| timo | Terminal::LineEditor uses a start block where it reads one byte at a time from the input file descriptor, and if you don't "makeraw" it first, you'll get at least line-buffering i think | 19:26 | |
| grondilu | ugexe: noted, thanks. | 19:27 | |
| so $*IN.Supply is out, then. I suppose I have to make my own supply which would emit bytes from its own thread. | 19:30 | ||
| timo | grondilu: github.com/japhb/Terminal-LineEdit...kumod#L373 | 19:31 | |
| grondilu | I see this repo depends on Terminal::ANSIParser. I guess I should look this up, as catching ANSI escape codes can't be much different than catching CSI ones. | 19:39 | |
| timo | it does parse CSI sequences i think? | 19:41 | |
| grondilu | it does indeed. good news. | 19:42 | |
| timo | highly recommend checking all the things japhb's got, there's many a terminal-related thing | 19:45 | |
|
19:47
jpn joined
|
|||
| grondilu | indeed again. | 19:53 | |
| tbrowder | ugexe: are congrats due on yr zef upgrade to ver 1.0.0? that's a giant leap in versions, although the auth: looks different | 20:00 | |
| timo | the auth reflects which source you got it from | 20:01 | |
| well, at least when it comes from an ecosystem i think? | |||
|
20:06
notna joined
20:14
jpn left
|
|||
| japhb | Awww, thanks for the free advertising, timo! ;-) | 20:16 | |
| timo | :3 | ||
|
20:46
abraxxa-home left
20:47
abraxxa-home joined,
abraxxa-home left
20:48
abraxxa-home joined
20:56
abraxxa-home left
20:57
notna left
21:17
jpn joined
|
|||
| grondilu | japhb: your Terminal::ANSIParser seems exhaustive but complicated to use. Like I'm trying the most basic form `my &parser := make-ansi-parse emit-item => { note .raku }; loop { &parser($*IN.read(1)[0]) }` and it does not stop on EOF. I don't get it. | 21:27 | |
| *make-ansi-parser | |||
|
21:27
jpn left
|
|||
| grondilu | shouldn't it stop on EOF? It keeps emiting zeros. | 21:28 | |
| japhb | You're forcing it to keep going with loop {}. At EOF the parser would pass on the undefined value it receives, as a marker. It doesn't use a control exception. | 21:30 | |
| grondilu | but shouldn't read block? I thought it was blocking. | 21:31 | |
| japhb | What would it be waiting for if the input already shut down? | 21:33 | |
| grondilu | yeah I guess I did not realize I don't know how read behaves when stdin is closed. | ||
| hum it seems that what I need to look at is your Terminal::Print::DecodedInput | 21:46 | ||
| japhb | Yeah, that's an older version of the logic that got rearranged and improved into Terminal::ANSIParser and bits of Terminal::LineEditor. | 21:48 | |
| Still functional for what it needs to do. :-) | |||
| (FWIW, the driving impetus for that rewrite is that I needed to be able to support *querying* the terminal, which meant that I really needed more brains in the code than the simplistic method that T::P::DI uses.) | 21:50 | ||
| grondilu | T::P::DI seems to come more in 'batteries included' form, though. As it has code to actually set stdin in raw mode and create a supply and so on. | 21:51 | |
| though maybe Terminal::LineEditor has that? | 21:52 | ||
| well surely, but it's likely hidden in much more code that I don't need | 21:53 | ||
| japhb | grondilu: Yeah, T::LE has all that. And the core of that is used to make Terminal::Widgets work. | ||
| No worries. If T::P::DI was unusable, I'd fix it. It works for the basic use cases. And it's about as simple as I could manage at the time. :-) | 21:54 | ||
| Plus if you're doing terminal work, you're probably depending on T::P at some point anyway. | 21:55 | ||
| (There are certainly folks that avoid it entirely, but ... :shrug:) | |||
|
21:56
jpn joined
21:58
jpn left
|
|||
| grondilu | so far I've been using Term::termios to make stdin raw but I see you used Terminal::MakeRaw | 21:59 | |
| which I don't find on raku.land | 22:00 | ||
| found it | 22:01 | ||
| ah maybe Terminal::LineEditor::RawTerminalInput | 22:07 | ||
| this is some impressive work, ngl | 22:12 | ||
| japhb | Thank you! :-) | 22:14 | |
| tbrowder | ugexe: i looked at the App::Mi6 code and see lots of plain "die"s. i tried the "sink $proc" on lives-ok and dies-ok. no diff on lives-ok, dies-ok still fails. | 22:24 | |
| i counted 51 "die" instances. | 23:06 | ||
| in mi6 code | 23:07 | ||
|
23:09
japhb left
|
|||
| ugexe | you shouldnt have to change anything in App::Mi6 | 23:12 | |
| After this line -- github.com/tbrowder/Mi6-Helper/blo...-dir.t#L33 -- add `sink $proc;` and also `say $proc.raku;` (for debugging purposes) | 23:14 | ||
| grondilu | japh: I'm trying `my Terminal::LineEditor::CLIInput $term .= new; $term.enter-raw-mode; my @dim = await $term.detect-cursor-pos; $term.leave-raw-mode; say @dim;`, and seemingly nothing happens until I press enter. Only then I can see the cursor position report was correctly parsed. | ||
|
23:14
sdomi left
|
|||
| grondilu | I mean I thought the point of raw mode was that I would not need to press enter. | 23:15 | |
|
23:15
sdomi joined
|
|||
| tbrowder | wow! i finally got it to work. i put my own die just ahead of @skaji's expected "die" and it fired and was caught by dies-ok. as @lizmat and @ugexe pojnted out there must have been a subtle error that was procedural rather than semantic and i just kept not seeing it. i can sleep better tonight. | 23:21 | |
|
23:22
Sgeo joined
|
|||
| tbrowder | ah, what did it for the dies-ok was not using $p = run.., but just "run..." | 23:26 | |
| as was suggested by ugexe. weird, but "whatever" | 23:27 | ||
|
23:32
japhb joined
|
|||