🦋 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:05 maylay left 00:07 maylay joined 00:27 Aedil joined 01:34 hulk joined, kylese left 02:15 hulk left, kylese joined 02:48 yewscion joined 02:58 yewscion left 03:14 yewscion joined 03:19 yewscion left 04:09 yewscion joined 04:16 yewscion left 04:17 kjp left 04:18 kjp joined 04:24 kjp left, kjp joined 04:30 kylese left 04:33 kylese joined 05:30 kylese left 05:32 kylese joined 06:12 yewscion joined 06:17 derpydoo joined 06:18 yewscion left 06:21 derpydoo left 06:22 derpydoo joined 06:39 dano left 07:16 dano joined 07:49 Sgeo left 08:05 yewscion joined 08:10 dakkar joined 08:15 yewscion left 08:34 apac joined 08:56 sena_kun joined
melezhik. antononcube: thanks . You will need to follow all my answers where I have Raku/Sparrow and talk about parsing ( alternative solution to sed / perl / bash and friends ), except the last ( old ) one where I talk about Python scripts deployments it’s irrelevant 08:59
Yesterday I had a good session with some rockylinux team guy where he successfully launched qemu instance and run some test scenarios on it using Sparky, very good experience 09:01
grondilu Saw 1 occurrence of deprecated code. 09:06
================================================================================
Method Str (from Distribution::Resource) seen at: SETTING::src/core.c/Mu.rakumod, line 831
Please use %?RESOURCES<key> directly instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
lizmat heh
grondilu weird, right? 09:07
lizmat ulti method Stringy(Mu:D $:) { self.Str }
m
guess the problem is where .Stringy is being called 09:08
grondilu BTW I think this was when trying to interpolate %?RESOURCES<images/checkerboard.pgn> in a string. 09:09
github.com/grondilu/chess/blob/fe4...kumod#L897 09:10
lizmat and what do you want to do with that string ? 09:11
grondilu no my bad, that's not the interpolation the problem. 09:12
Initially I wanted the absolude path name but when using .absolute I was getting a warning about deprecated code.
Saw 1 occurrence of deprecated code. 09:14
================================================================================
Method absolute (from Distribution::Resource) seen at: /var/home/grondilu/.local/src/chess/lib/Chess/Graphics.rakumod (Chess::Graphics), lines 5,8
Please use %?RESOURCES<key> directly instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
lizmat does it say that if you do: %?RESOURCES<images/foo.jpg>.absolute; ?? 09:15
grondilu yes
and if I don't I get the former message 09:16
lizmat then we at least have a doc issue, as that is what docs.raku.org/language/variables#%?RESOURCES describes
grondilu indeed
09:26 jpn joined
lizmat the important bit of that doc though: 09:26
Note that paths and names of resource files can be mangled in an installed distribution, so do not rely on their values in any other case besides using them as keys for the %?RESOURCES variable.
in App::Rak I use %?RESOURCES with either .slurp(:close) or .lines 09:27
but I guess you need to refer to the actual path to be able to show the images, right ? 09:28
perhaps ugexe has thoughts about this
grondilu yes I wanted the path to use the file in a shell script (using imageMagick commands) 09:29
before that I was slurping the file, base64 encode it, and decode it in the script. That was quite convoluted. 09:30
and by shell script I mean qx{}, to be clear. 09:36
lizmat I have no other recommendation than ignoring the warning about .absolute for now 09:40
grondilu got it 09:41
09:55 jpn left, jpn_ joined 10:04 xkr47 left
lizmat clickbaits rakudoweekly.blog/2025/03/31/2025-...t-journey/ 10:07
10:11 xkr47 joined 10:25 maylay left 10:28 maylay joined 10:41 jpn_ left 10:49 jpn joined 11:08 JimmyZhuo joined
grondilu m: say q{"foo bar"} ~~ /\" ~ \" <print>*/ 11:14
camelia ï½¢"foo bar"ï½£
print => ï½¢fï½£
print => ï½¢oï½£
print => ï½¢oï½£
print => ï½¢ ï½£
print => ï½¢bï½£
print => ï½¢aï½£
print => ï½¢rï½£
grondilu m: say grammar { token TOP { \" ~ \" <print>* } }.parse: q{"foo bar"}
camelia Nil
grondilu ^what am I missing here?
m: say q{"foo bar"} ~~ /\" ~ \" <.print>*/
camelia ï½¢"foo bar"ï½£
grondilu m: say grammar { token TOP { \" ~ \" <.print>* } }.parse: q{"foo bar"} 11:15
camelia Nil
grondilu m: say grammar { token TOP { \" <.print>* \" } }.parse: q{"foo bar"}
camelia Nil
grondilu m: say grammar A { token TOP { \" <.print>* \" } }; say q{"foo bar"} ~~ /<A::TOP>/ 11:16
camelia (A)
Nil
grondilu m: say grammar { regex TOP { \" <.print>* \" } }.parse: q{"foo bar"}
camelia ï½¢"foo bar"ï½£
antononcube @melezhik. I put a blog-post generation workflow in a notebook and a couple of generation results. See: github.com/antononcube/RakuForPred...tion.ipynb
grondilu I think I get it. the token version takes the ending \" in <print>, but does not backtrack once it doesn't see anymore \" at the end. 11:20
m: say grammar { token TOP { \" <.print>*? \" } }.parse: q{"foo bar"}
camelia ï½¢"foo bar"ï½£
grondilu m: say grammar { token TOP { \" ~ \" <.print>*? } }.parse: q{"foo bar"}
camelia ï½¢"foo bar"ï½£
11:32 yewscion joined 11:37 yewscion left 11:58 derpydoo left 12:16 jpn left 12:17 melezhik joined
melezhik . 12:17
antononcube: thanks ! interesting though in general results look correct, however all three LLMS have failed to pasre Sparrow Task Check DSL synstax, which is probably ok, as it ( yet )) not well known at all 12:19
12:21 jpn joined
antononcube Sure, those generations have to be proofread. But, you have a blog post written at least 75%. 12:24
12:26 jpn left
ugexe The deprecation message is legit please look at the commit message or PR explanation 12:34
if you need the original file names then do not use resources 12:35
Copy the files at build time to a know location or some such 12:36
melezhik antononcube: sure 12:39
12:51 jpn joined 12:57 jpn left 13:02 melezhik left, melezhik joined 13:09 maylay left 13:11 melezhik left 13:12 maylay joined 13:19 yewscion joined 13:21 jpn joined 13:22 yewscion left 13:28 jpn left 13:34 JimmyZhuo left 13:35 yewscion joined 13:42 phogg left 13:51 jpn joined 13:53 phogg joined 13:56 sena_kun left, sena_kun joined 14:00 maylay left 14:01 maylay joined 14:16 sena_kun left 14:17 sena_kun joined 14:18 Geth left, Geth joined, maylay left 14:21 maylay joined 14:23 sena_kun left 14:24 sena_kun joined 14:27 maylay left 14:36 apac left
grondilu ugexe: so basically I should not expect any of the files that I declare in resources to be actually present in the filesystem after installation of the module. They are only available as things I can slurp or as an IO::Handle. Right? 14:37
I suppose that makes using them inside a shell quoting tricky.
I'll probably have to revert to base64 encode/decode in process substitions. 14:39
14:41 maylay joined, maylay left
grondilu instead of qqx{some-shell-command {%?RESOURCES<resource-name>.absolute}} I have to do qqx{some-shell-command <(basenc -d --base64 <<<{use Base64; print encode-base64(%?RESOURCES<resource-name>.slurp).join})} 14:44
14:45 yewscion left 14:49 maylay joined, maylay left 14:53 human_blip left 14:54 human_blip joined 14:58 maylay joined, maylay left 15:01 jpn left 15:06 maylay joined 15:17 maylay left 15:22 maylay joined, maylay left 15:23 apac joined 15:27 yewscion joined
librasteve there is something wrong with this subset Inner where Str is export; but I cannot work out how to fix it (works fine with subset Attr of Str is export;) please can someone diagnose? 15:31
Two terms in a row at /Users/.../Air/site#sources/CB0FAAA02D002ECCE7CF2AC692253B93C992C781 (Air::Functional):112 ------> subset Inner where Str<HERE> is export; expecting any of: infix infix stopper postfix statement end statement modifier statement modifier loop
15:31 yewscion left 15:40 maylay joined, apac left 15:41 yewscion joined, maylay left 15:50 maylay joined, maylay left 15:51 jpn joined, stanrifkin joined 16:00 jpn left 16:04 maylay joined 16:42 dakkar left 17:01 maylay left 17:03 maylay joined
ugexe grondilu: they do exist on the file system but you aren't supposed to assume they are 17:22
things like CompUnit::Repository::Github could return data from a socket when %?RESOURCES<foo> is called for instance 17:23
grondilu noted 17:24
17:38 apac joined
grondilu I'm still struggling to make it work. It works fine when I run the code from the repo directory with -Ilib, but after install I get "Use of uninitialized value element of type Any in string context.". Basically not getting anything from %?RESOURCES, apparently. 17:41
github.com/grondilu/chess/blob/2eb...kumod#L901 17:42
ugexe you'd see the same issue with -I. presumably
did you populate the resources section of meta6.json? 17:43
i dont see images/checkerboard.png for instance 17:44
grondilu oh 17:53
indeed I had forgotten about the checkerboard 17:54
regarding -I, I'm a bit confused. Should I use -I. or -Ilib?
ugexe -I. is going to use the meta data as an authority 17:55
-Ilib is as if the META6.json doesn't exist so it infers things like the provides or resources section by what is on the file system
grondilu I see
ugexe since installed modules use what is in META6.json you generally want to use -I. once a META6.json has been created for your project
grondilu it works now, thanks! 17:56
grondilu is trying to upload Chess with fez 18:10
fez complains about files in ./resources that are not in meta. These files are part of a submodule for which I need only a few files. I guess I should put the submodule somewhere else and use links to the files I need? 18:11
18:13 apac left
ugexe well it doesn't make sense to distribute them as part of your distribution if they aren't used by it does it? 18:26
arguably fez could allow ignoring certain files so it doesn't put them into the tar file
grondilu moved the submodule somewhere else and created links to relevant files 18:28
ok now fez complains about the old files not in the meta, and mentions the new files (the links) are in the meta but are not expected. 18:32
what are its expectations based on?
18:37 apac joined
grondilu I mean they are in the meta and they are in ./resources. What's the problem? 18:40
ok apparently fez did not like symbolic links. I made hard links and now the upload worked fine. 18:49
now on rakuland I have a note about the author names not matching. zef:grondilu vs github:grondilu. 18:51
18:59 derpydoo joined
grondilu tries to rename `auth` to `github:grondilu` in META6 19:16
19:22 DarthGandalf is now known as [LLM]DarthGandal 19:28 Aedil left 19:32 yewscion left
ugexe it has to be zef:* to be uploaded to zef 19:39
so you shouldn't change it
raku.land may take some time before it has e.g. raku.land/zef:grondilu/Chess available 19:41
if not then something is wrong with raku.land
[Coke] I think there is a delay, for sure
19:48 melezhik joined
melezhik so I have 11 correct and tested recipes of replacing sed/awk/perl with Raku and Sparrow, please vote if you like them - stackoverflow.com/search?q=Raku%2FSparrow 19:49
19:56 stanrifkin left 20:08 melezhik left
antononcube @melezhik I might write a blog post about generating blog posts from StackExchange / StackOverflow. 20:28
20:45 Sgeo joined 20:49 yewscion joined 20:52 kst left 21:02 kst joined 21:07 derpydoo left 21:40 maylay left 21:43 maylay joined 21:53 human_blip left 21:58 [LLM]DarthGandal is now known as DarthGandalf 21:59 sena_kun left 22:19 yewscion left 22:59 yewscion joined 23:05 yewscion left