This channel is intended for people just starting with the Raku Programming Language ( Logs are available at
Set by lizmat on 8 June 2022.
00:52 discord-raku-bot left 00:53 discord-raku-bot joined 01:53 discord-raku-bot left, discord-raku-bot joined 01:55 jaguart left 02:53 discord-raku-bot left, discord-raku-bot joined 03:53 discord-raku-bot left, discord-raku-bot joined
MasterDuke Nemokosch, JsExplorerNeil: fwiw, while the jvm backend is frequently slower, there are some instances where it pulls ahead. obviously it won't win on startup time, but long running processes can have better throughput, the jvm is a pretty incredible piece of engineering 04:24
04:29 jaguart joined
jaguart :nahita: thanks :) 04:48
04:51 jaamer joined 04:53 discord-raku-bot left 04:54 discord-raku-bot joined 05:53 discord-raku-bot left 05:54 discord-raku-bot joined 06:53 discord-raku-bot left 06:54 discord-raku-bot joined 07:54 discord-raku-bot left, discord-raku-bot joined 08:54 dakkar joined
Nemokosch The thing is that the JVM backend is mostly lagging behind in terms of features in the first place. It's not plain unusable (like I'd say the JS backend is) but it's not really guaranteed to even provide the same functionality as the MoarVM backend 09:04
jaguart can I have a list of substitutions to apply to a bunch of strings? I can't seem to get s/// to behave like a first-order thing 09:09
Nemokosch it really isn't a first-order thing 09:10
you could have a list of callables that represent substitutions, probably that's the closest 09:11
jaguart ok thanks 09:25
I'm finding .subst a pita - it doesnt seem to work well with regex - makes me feel Perlish using s/// 09:26
Nemokosch why doesn't it seem to work well with regex? 09:27
jaguart weird - working now... I had various incarnations of simple things like `/<-[A..Z a..z 0..9 . -]>+/` 09:32
I will rework tomorrow as I prefer .subst over ~~ just for asthetics if nothing else 09:33
Nemokosch I would have preferred ~~, or at least considered it 09:57
but it got unfixed
10:34 Heptite left 10:56 Manifest0 joined
Manifest0 Hi. Can someone tell me why this doesn't work? 11:06
I have this function: sub MAIN('--option',:$p1,:$p2 where .IO.e,:@p3) {say "In!"}
I'm trying to invoke it through the command line: raku test.raku --option --p1="parameter1" --p2=./test.raku --p3="p31" --p3="p32"
But i always get the usage message. Why?
Nemokosch m: sub MAIN('--option',:$p1,:$p2 where .IO.e,:@p3) {say "In!"}; @*ARGS = ['--option', p1 => 'parameter1', p2 => '.', p3 => <p32 p32> ] 11:17
by the way, from what I know, named arguments need to precede positional arguments by default 11:18
Manifest0 i added "my %*SUB-MAIN-OPTS = :named-anywhere;" 11:19
but no change in the behaviour
Nemokosch seems like the leading dashes kill the positional parsing of a string 11:22
CIAvash use :$option where :so, --option is considered an option not a string
Nemokosch or Bool :$option! I suppose 11:24
Manifest0 CIAvash: that works :-)
so if i understood i can't use "--string" in the arguments. Got it 11:25
Nemokosch not sure if this is intentional design or just a limitation 11:26
CIAvash You can write MAIN('option', and pass option though. Like creating commands, I don't know if that's what you want 11:29
Manifest0 i wanted to have an uniform way of passing arguments. I didn't want to have dashed arguments and non-dashed arguments mixed. For now the :$option solution is good enough 11:31
lakmatiol I would do something like 12:27
my @a = {S/a/b/}, {S/b/c/}
``` for a list of substitutions
jaguart I'll give it a spin 🙂 13:07
13:08 jaguart left 13:40 jaguart joined 13:44 ab5tract joined 14:29 ab5tract left 14:36 guifa joined
lizmat And yet another Rakudo Weekly News hits the Net: 15:15
16:06 jaamer left 16:33 ab5tract joined 16:49 ab5tract left 16:54 discord-raku-bot left, discord-raku-bot joined
Manifest0 i just noticed that if i add a named array as a parameter in the signature of a MAIN sub, it will change the other named scalars to array. 17:06
Example: sub MAIN( :$option, :@tag) { say $option.WHAT;}
$ raku test.raku --option --tag=jn 17:07
is this expected?
if i remove the :@tag from the signature i get the expected Bool 17:08
stevied so I'm looking at 17:13
Nemokosch I wouldn't think of this as a feature, that's for sure...
stevied there is one version there, 0.1. And only one version in REA. This version fails to install. However, there is a version here, 0.2: 17:15
if I clone that repo with version .2, I can install it, no problem 17:17
is zef just broken? 17:18
Nemokosch probably not; it's just the second version hasn't been published 17:22
as you can see, this distribution is published on CPAN
not p6c (and not the "zef ecosystem" either, for that matter) 17:23
stevied here is the META6.json for version .2:
so you're say8ing the developer hasn't bothered to publish to anything other than cpan? 17:25
i guess i'm confused. the page at shows a link to github, not cpan 17:27
I can't even find the thing on cpan 17:28
Nemokosch always shows a link to github, no?
stevied I don''t know. trying to make sense of all this. I don't get it.
why would they show a link to github if it's on cpan?
Nemokosch because that's what they can access? 17:29
stevied if they can access it on github, why are they not showing the latest .2 version of the module?
Nemokosch because there is only one version published 17:30
just don't link these things together in your mind
stevied I don't even see it on cpan
where is it published?
it's got to be pulling it from github. if it's pulling it from github, seems like it should see version 0.2 17:32
Nemokosch what do you think makes a version?
17:36 dakkar left
in particular: is a random repository on github, and some tags in it, an ecosystem? Why would there be a workflow to act as if it was, and try to make sense of those tags as versions? 17:53
stevied I don't know. I just know my own workflow using mi6 which pushed out to github and creates a new version for me automaticlaly. I don't know how others do it. 18:02
the most important thing I need to figure out is how to reliably get modules that work via zef
am I stuck manually cloning and the installing from the git repo? 18:12
well, I created an issue for this: 18:17
hopefully module author can fix
19:01 Heptite joined
Skarsnik Maybe the meta is not updated? 19:18
You never had need to create a tag or such for zef to update, just the meta file
Nemokosch which ecosystem are you talking about, for starters 19:19
from what I can tell, all your modules still live on p6c. Stuff has changed since 19:20
stevied i looked at the meta file, it say version 0.2 19:50
my modules? no, all of mine are uploaded via fez using mi6 19:51
Skarsnik I am still not sure why we did not use cpan in the end x) 19:54
19:56 rf joined
stevied i'm going to guess it's because cpan did not have ability to track auth/ver/api 20:04
this guy says meta6.json is not used to determine version:
rf No, I'm saying he hasn't uploaded his module in awhile. So the dist server has no idea that 0.2 exists, therefor you can't get it from zef. 20:07
Nemokosch well in some sense it's "not used" 20:08
it's not like it's scanned automagically
stevied he hasn't pushed it?
hasn't pushed it to where? git? or the ecosystem? 20:09
rf Zef.
Or whatever hes using I think CPAN in this case
The dist servers have no clue whats going on in Git from what I can tell. So just because its 0.2 on git does not mean it will be the 0.2 version on the dist servers 20:10
Skarsnik But was zef using one repo with the list of all module repo/meta do update stuff?
stevied he pulled the module from cpan and moved it to GH
so he pushed .2 to git but not with fez. 20:11
rf Git is just a service, it is not connected to Fez/Zef (I believe).
Github I mean (git is a tool). 20:12
Nemokosch this is not the p6c days anymore, after all
Skarsnik It was not zef I think for p6c? 20:13
stevied yeah, how it all works is jumbled in my head. I did start out n pf6 then switch to mi6 with fez. I've never really had to think about it since because it's all just works 20:14
Nemokosch zef could fetch from p6c already
but p6c is obsolete
Skarsnik It was panda 🙂
Nemokosch zef as well
it can retrieve p6c to this very day actually
and it exists for a long time
stevied zef is obsolete? 20:15
Nemokosch p6c is
stevied you said "sef as well"
Nemokosch that was for "it was panda"
zef does date back to the days when p6c was the only ecosystem
confusingly enough 20:16
Skarsnik I think zef came when compunit was more stable
Nemokosch that was still at least 5 years ago
Skarsnik All I remember is when module precomp appear x)
It was so annoying to change one line in a module and every module get recompiled ><
Nemokosch anyway, nowadays "the ecosystem" is not like a bunch of repositories on github 20:17
stevied yeah, I think that's where I was confused. I thought zef somehow checked the meta.json file or something like that. 20:18
Skarsnik That's better x) 20:19
stevied so basically, the NativeHelpers::Caller module is kind of like a zombie with no home, I guess. it exists as a tarball in REA and nowhere else from the point of view of the Raku ecosystem and it still thinks it can be found on CPAN 20:20
Nemokosch it can be that it can actually be found on CPAN
after all, REA is getting the modules from somewhere, and spoiler, not from git 20:21
Skarsnik You could fork and push it with fez I guess then?
stevied well, only on backpan from what I could tell
looks like he pulled it from cpan
i think rea originally got it from CPAN
Nemokosch there are new modules on CPAN, too 20:22
like Leon's stuff
however, that should be disregarded because CPAN will probably be discontinued (for Raku) anyway
for now, it's disabled in zef by default, in favor of REA entries, and REA has some cron job to fetch the modules from CPAN 20:23
stevied oh really? I thought you could still do raku modules on cpan
Nemokosch you could but it's not a good idea anyway
stevied ok, right, that's what I thought 20:24
21:12 ab5tract joined 21:28 ab5tract left
how can I get this to work on the command line? `raku -e 'say qw^one two three^.join("' '")' ` 21:47
I've tried everything but I can't get those single quotes in there to print
jaguart in bash: raku -e 'say qw{one two three}.join("'' ''")' 21:55
od: raku -e 'say <one two three>.join("'' ''")'
stevied the single quotes don't print for me 21:56
jaguart oh yeah :o 21:57
Nahita `raku -e $'say qw^one two three^.join("\' \'")'` might do it
12th thing here
added $ before the opening quote
added escapes before singles inside
as the difference
stevied bam! nice. thanks! 21:58
Nahita np
jaguart yay :) 22:04
stevied so i'm trying to migrate installed modules from 2022.07 to 2022.12 using this suggestion: 22:06
so I run this command: 22:07
raku -e $'print "\'"; print $*REPO.repo-chain.grep(CompUnit::Repository::Installation).map(*.installed.Slip).grep(*.defined).map({$_).Str }).join("\' \'"); print "\'"' | zef install
but zef throws an error
zef [--fetch] [--build] [--test] [--depends] [--build-depends] [--test-depends] [--force] [--force-resolve] [--force-fetch] [--force-extract] [--force-build] [--force-test] [--force-install] [--timeout[=Int]] [--fetch-timeout[=Int]] [--extract-timeout[=Int]] [--build-timeout[=Int]] [--test-timeout[=Int]] [--install-timeout[=Int]] [--degree[=Int]] [--fetch-degree[=Int]] [--test-degree[=Int]] [--dry] [--up
not sure why I can't pipe the list of modules into zef 22:08
Nemokosch I mean... unless it's implemented, of course you can't
have you tried passing - as the argument?
stevied no. my bash/zsh skills are weak 22:09
jaguart do you need the quotes?
if you're piping
stevied that gets me a different error
I tried it without quotes before, same error. So I figured I needed quotes 22:10
Nemokosch I'm just not sure if zef install can consume the names from stdin 22:12
that's not something you'd "get for free" in processes
stevied ok, so I guess passing data as args is different than passing in as stdin? 22:13
i always thought of args as stdin. guess that's wrong 22:14
Nemokosch yes, that's different
jaguart you can just add 'run "zef install " ~ at the front :)
stevied yeah, i guess that's true 22:15
Nemokosch well, almost 22:16
jaguart I'm wondering if zef dont like the empty api<> maybe?
Nemokosch you'd still need to make the command produce string in-place, rather than write to stdout - but that's not difficult
backtick-quoting or $() would do 22:17
stevied maybe I should just write a script.
I don't know how people whip out one-liners like they do. it always leads to confusion and frustration for me. 22:18
Nemokosch anyway, what about this: 22:19
jaguart on the quoting - move it into your map i.e. "\'" ~$_).Str ~ "\'"
then you can just join " " 22:20
Nemokosch ```sh
zef install $(raku -e $'print "\'"; print $*REPO.repo-chain.grep(CompUnit::Repository::Installation).map(*.installed.Slip).grep(*.defined).map({$_).Str }).join("\' \'"); print "\'"')
jaguart and no need for leading and trailing
stevied ok, yeah, that loosk good
gonna have to try after dinner. gotta run. thanks! 22:21
jaguart this seems to work ok: raku -e $'my $x = "zef install -- " ~ $*REPO.repo-chain.grep(CompUnit::Repository::Installation).map(*.installed.Slip).grep(*.defined).map({ "\'" ~$_).Str ~ "\'" }).join(" "); qqx{ $x } ' 22:28
Nemokosch but it turned into a nightmare on discord 😄 22:29
jaguart lol 22:37
23:10 artal joined 23:12 artal left
jaguart whats the JSON::JWT fix for decode HS256 failing? 23:37
Nemokosch what happens? 23:40
jaguart lines 12 and 14 fail: 23:41
assume its Digest::HMAC issue 23:42 has no <auth> 23:43
Nemokosch #worksForMe 23:44
uninstall Digest and Digest::HMAC 23:46
jaguart You probably dont have the alt Digest::HMAC installed then... `zef list --installed | Digest` please ?
Nemokosch Digest::HMAC:ver<1.0.5>:auth<zef:jjmerelo> 23:47
jaguart thanks 23:48
23:55 loken joined