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
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
lizmat clickbaits rakudoweekly.blog/2025/03/31/2025-...t-journey/ 10:07
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"」
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
antononcube Sure, those generations have to be proofread. But, you have a blog post written at least 75%. 12:24
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
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
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
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
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
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
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?
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
grondilu tries to rename `auth` to `github:grondilu` in META6 19:16
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
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
antononcube @melezhik I might write a blog post about generating blog posts from StackExchange / StackOverflow. 20:28