🦋 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.
Geth ¦ problem-solving: coke self-assigned How to report an issue related to the Rakudo webpages? github.com/Raku/problem-solving/issues/397 00:46
tbrowder__ question for macos users: can i, a debian user, rely on user home, bash, path settings, system file tree (including /etc) being available on macos after the proper raku and zef are installed? 13:22
ab5tract_ bash is very old on macOS, for one. 13:52
AFAIK, You can more or less rely on those things existing, yes. Regarding what things do in `/etc`, I’m not sure you can rely on a one-to-one mapping of expectations from linux WRT service configuration 13:55
So.. kinda? 13:56
tonyo tbrowder__: most of the config stuff is in a different location depending on how the user got it in the first place. brew places that stuff away from the system, compiling and installing would be somewhere different by default (for the most part) 14:01
what are you expecting in /etc?
golu Hello I am learning Perl5, in your opinion I should learn raku first or keep learning Perl5? 14:22
ab5tract_ Right, brew keeps a tree in `/opt/homebrew` 14:41
tbrowder__ golu: imho definitely raku
ab5tract_: so /opt/homebrew/raku....? 14:42
ref /etc/profile; /etc/environment; /etc/skel for starters 14:43
golu tbrowder_: what is imho ?
tbrowder__ in my humble opnion 14:44
my story: i suffered with perl 5 for years, raku is the perl improvement i always wanted 14:47
and better than i ever expected
golu I see 14:50
golu tbrowder__: Which things you did not like in Perl5? 14:53
ab5tract_ tbrowder__: no, /opt/homebrew/etc, /opt/homebrew/share, /opt/homebrew/lib, /opt/homebrew/include, etc
But there is no guarantee that a user will have installed raku view brew 14:54
Some will have used rakubrew, others ??? 14:55
tonyo ^^ 15:04
what are you trying to achieve tbrowder__ ? this might help us help you
tbrowder__ i'm working on a module to (1) download and install the latest release of the rakudo binary download and (2) set the system files necessary to use the adduser function so a new user has a fully capable raku system available with no further setup needed on his or her part 15:11
i can do that on debian and probably most linux systems, but some /etc details may vary a bit. same with macos 15:12
but the module would need full testing on non-debian hosts (maybe vms could be used for most linux varieties) 15:15
ab5tract_ Where are you installing the binary?
tbrowder__ under /opt/rakudo (/opt/rakudo/bin ... etc.) 15:16
ab5tract_ ok 15:17
I don’t think ‘adduser’ is a real thing on macos 15:18
tbrowder__ how about useradd (lower level)
ab5tract_ nope
tbrowder__ hm, how do you add a new user? or is macos not designed for multi-user? 15:19
ab5tract_ Not in “root’s” $PATH anyway (sudo adduser; “command not found”)
tbrowder__:you do that by using the system settings 15:20
tbrowder__ sorry, stupid question
can you do that remotely by cli?
ab5tract_ not sure
tbrowder__ hm github workflows does it somehow 15:21
maybe not, just used su or sudo
golu apple.stackexchange.com/questions/...e-in-macos 15:22
tbrowder__ great link, thanks! 15:25
i think i just need to get a mac and experiment. bugging ppl here is a bit of a nuisance for others 15:27
ugexe fwiw if any software created a new user on my Mac I’d probably be a bit annoyed 15:35
Don’t let that stop you, I’m just pointing out as a user I would not prefer new users being created 15:36
golu What is fwiw ? 15:46
coleman An abbreviation: "For what it's worth" 16:00
suman How can I get the indices of the elements of a sorted array in initial unsorted array? For example my @a =[12,5,13,8,8]; say @a.sort # [5,8,8,12,13]. I need to get [1,3,4,0,2] 16:32
m: my @a =[12,5,13,8,8]; say @a.sort
camelia (5 8 8 12 13)
lizmat suman: as of 2023.08, sort has a :k named arg 16:40
my @a =[12,5,13,8,8]; say @a.sort(:k)
m: my @a =[12,5,13,8,8]; say @a.sort(:k)
camelia (1 3 4 0 2)
suman Fantastic thank you. Exactly what I wanted: Rakuish way. 16:41
m: my @a =[12,5,13,8,8]; my @b = [3,40,5,6,9]; say @a.sort(:k).map: {@b[$_]} 16:45
camelia (40 6 9 3 5)
suman Can it be improved? 16:46
lizmat suman: in what way? 16:49
@b[@a.sort(:k)] ?? 16:50
suman lizmat: Yes. That would be faster I guess. 16:52
m: my @a =[12,5,13,8,8]; my @b = [3,40,5,6,9];say @b[@a.sort(:k)]
camelia (40 6 9 3 5)
suman lizmat: If I want both @a.sort and @a.sort(:k) in a single pass, is it possible? 16:57
lizmat no, not at the moment... 16:58
it would basically do @a.sort(:k).map: { $_ => @a[$_] } under the hood 16:59
actually
m: my @a =[12,5,13,8,8]; my @b = [3,40,5,6,9]; say @b[@a.sort(:k)]:p 17:00
camelia (1 => 40 3 => 6 4 => 9 0 => 3 2 => 5)
lizmat suman: like that? ^^
suman lizmat: I need to pass sorted array @a.sort and @b[@a.sort(:k)] to a function. So I was thinking if it can be done in the same pass. Otherwise I have to call sort twice. 17:07
lizmat ah... weird you'd have to pass both... 17:09
lizmat my @c = @a.sort(:k); @a[@c], @b[@c] ? 17:09
suman lizmat: Yes. That would be better. 17:11
lizmat my int @c = @a.sort(:k); @a[@c], @b[@c] for speed 17:14
(possibly)
suman lizmat: Definitely was looking for speed. Thank you. 17:17
lizmat hmmmm I wonder whether postcircumfix [] has int @ candidates 17:18
it probably should have
suman: if using native int indices doesn't make it faster, you should probably make an issue about it 17:23
suman lizmat: Yes I got speedup. Down to 14 secs from 20. 17:28
lizmat nice
suman lizmat: I asked in SO also but did not get good reply. While converting Raku Array to CArray before passing to C like: my $first = CArray[num64].new(@data1>>.Num); 17:40
        my $second = CArray[num64].new(@data2>>.Num). Is this right?
Is there a better way?
tonyo tbrowder__: another way to go about it is to inspect the path and pick some obvious one. OSX's default path (regardless of shell) include /usr/local/bin (same as any linux i'm familiar with) and that's your safest bet if you want system wide binaries 17:45
tbrowder__ good idea. if nothing else, my mod will ease selecting the download. 18:20
librasteve suman: why not go @data1>>.num64 in your example? 20:50
suman: i have answered your SO (in the negative, I'm afraid) 21:18
Geth raku.org: e382e35315 | (Will Coleda)++ | 2 files
Remove link to old Gabor vids
22:30
Geth raku.org: ad24728249 | (Will Coleda)++ | source/resources/index.html
Reorg sections, use same style from other pages
23:34