🦋 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] .seen Util 00:24
tellable6 [Coke], I saw Util 2024-04-16T20:36:58Z in #raku: <Util> Summary: (1) we want more Raku talks. (2) Rakudo internals qualifies for the Science track (paper or poster). Thanks!
[Coke] ^^ there was an attempt to get more talks. 00:25
antononcube @Coke Right, I remember the call for papers. I strongly considered going, then I decided it is too far and not worth it. 00:43
Xliff m: role U[$class] { method-get-class ($a) { ::($ = $a) }; class A does U[B] { }; class B { has $.c }; A.get-class.^attributes.gist.say; 11:28
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$a' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> role U[$class] { method-get-class (⏏$a) { ::($ = $a) }; class …
Xliff m: role U[$class] { method-get-class { ::($ = $class) }; }; class A does U[B] { }; class B { has $.c }; A.get-class.^attributes.gist.say;
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared name:
B used at line 1
Xliff m: role U[$class] { method-get-class { ::($ = $class) }; }; class A does U['B'] { }; class B { has $.c }; A.get-class.^attributes.gist.say;
camelia ===SORRY!=== Error while compiling <tmp>
Could not instantiate role 'U'; exception details:

lang-call cannot invoke object of type 'VMNull' belonging to no language
in sub at <tmp> line 1
in any package_declarator:sym…
Xliff m: role U[$class] { method get-class { ::($ = $class) }; }; class A does U['B'] { }; class B { has $.c }; A.get-class.^attributes.gist.say; 11:29
camelia (Mu $!c)
tbrowder ugexe: using the Build module, what is the correct way to have an installation script get the *contents* of file X in the /resources directory? 12:12
tbrowder the docs say: $?DISTRIBUTION.content(“resources/X”); 12:22
antononcube @tbrowder Can't you just you slurp over %*RESOURCES<X> ? 12:52
lizmat clickbaits rakudoweekly.blog/2024/07/01/2024-...learnings/ 13:08
tbrowder antononcube: it’s a subtle issue in my brain. during a Build and install action i just want to make sure the docs are correct. i’m assuming they are but i like to have ugexe to verify that. 15:24
antononcube @tbrowder Good luck! 15:25
ugexe you don't get access to $?DISTRIBUTION in Build. Build implies that it must occur before the distribution truly exists 15:31
if the distribution hasn't been built, how could $?DISTRIBUTION exist in other words 15:32
at build time i 15:34
that being said, you could just do:
class Buikd { method build($dist-path) { my $dist = Distribution::Path.new($dist.IO); say $dist.content("resources/foo.txt") } }
rather: class Build { method build($dist-path) { my $dist = Distribution::Path.new($dist-path.IO); say $dist.content("resources/foo.txt") } }
at build time though I'd probably just access the paths directory without using a distribution object 15:35
i.e. class Build { method build($dist-path) { say $dist-path.IO.slurp } }
either one should work for you 15:36
i don't know why you'd have a Build.rakumod file to verify docs are correct though. that means it would be occuring on every users computer that installs that distribution, when in reality it should only ever need to be verified once by the author 15:37
so maybe that verification would be better in a xt/foo.rakutest file that you as the author manually run 15:38
[Coke] +1 16:13
tbrowder maybe not. the resources include a font file that may or may not already exist the first time the module is installed. it also installs a user font config file if it doesn’t exist. if it does exist, the user may have misconfigured it. 16:36
and it will be repaired. 16:37
ugexe distributions should be immutable 16:47
adding things to resources/ at build time is mutating it 16:48
if you have some file to instal that may or may not exist, it should be installed outside the scope of raku. i.e. install to $HOME/.some-known-directory, and have your code reference that 16:49
tbrowder that’s what i’m doing 16:50
ugexe ah i parsed your sentence wrong then 16:51
tbrowder not adding to resources, using them
ugexe i think you have to be careful around assuming if it exists that it might be misconfigured 16:52
for example, someone installs your module which runs that Build.rakumod and installs that file. Then they uninstall that distribution which does nothing to remove the file you installed with Build.rakumod. Then they later go to install it again
tbrowder yes. i just check it for proper contents and structure and inform user 16:53
and fix it
the config file is a hash for quick lookups of local but required font files 16:57
librasteve o/ 18:02
just coming on the chat - @ingy has made some counterpoints to mine - so, maybe I am out of line - what is the "show of hands" on this channel about the recent tprc (+) means good for raku, (-) means bad for raku, (++) / (--) weight for folks that attended... 18:04
antononcube @librasteve You are not "out of line." I, on the other hand, consider writing a blog post "Reasons not to use Raku." I have a few versions of it, BTW. 18:05
I have written similar for other languages -- WL, Python, R, Swift. 18:06
(Reasons not to use those, that is...)
librasteve on the basis of Murphys law, that would probably boost interest in raku
antononcube Yeah, "Streisand law", I think. 18:07
librasteve we need to collect all the counter fashionistas 18:08
antononcube Yeah, that would be good. 18:09
I need to finish my R rant / blog. I was just explaining the main reason "why not R" to a computer scientist. 18:13
The thing is for R there is well know effort doing that kind criticism -- that cannot be criticized -- called "The R Inferno." 18:14
That is high bar to reach...
@librasteve I think your ±raku / ±perl study has to be done via Google forms or similar. 18:16
librasteve well - I see that you have not confined yourself to my +/- format
antononcube Of course, we can/should write a "Cro" app for that. (Or "HummingBird" one.)
@librasteve 🙂 I am using your "around / interval" arithmetic post as guide. 18:17
librasteve as a guide to "why not raku"? 18:18
antononcube no, to use "±raku" and "±perl" -- I misunderstood. 18:19
...And I was referring to this post : rakujourney.wordpress.com/2023/11/...rithmetic/ 18:20
librasteve thank you and you're welcome! 18:21
antononcube Sure. The keyword Around is from WL, by the way. I strongly susptect it was introduced because of units-related workflows. 18:22
Interval and co., on the other hand, have "always" been in Mathematica. (Most like post version 2.0.) 18:26
librasteve my recent reading suggests that Interval arithmetic is a useful tool in rather an abstract way, but that its inability to represent Gaussian means that it is not a useful tool for physicists 18:27
ie to represent physical measurements 18:28
antononcube Hmm... I wonder is Around of Mathematica / WL trying to address that. See here: reference.wolfram.com/language/ref/Around.html 18:29
librasteve ah! thanks for the references