ugexe yes 00:01
presumably you are reaching the end of your script before all the threads have finished 00:02
you should await all of your promises first
SrainUser Should I use map for await then? 00:03
I'm not sure how else to assign to promises in a loop. 00:08
.landyacht. you can do a gather, e.g. my @promises = gather for 1..5 { take start { say 'hi'; } }; 00:21
I believe await can take an array, so you don't even need to await each individually 00:22
ugexe or push them into an array you await outside the loop 01:41
my @promises; for 1..5 { push @promises, start { say "hi" }; }; await @promises; 01:42
evalable6 hi
hi
hi
hi
hi
ugexe await eager gather for 1..5 { take start { say "hi" } } 01:43
evalable6 hi
hi
hi
hi
hi
ugexe await (1..5).map({ say "hi" });
await (1..5).map({ start { say "hi" } });
evalable6 hi
hi
hi
hi
hi
timo m: await do for 1..5 { start { say "hi $_" } }; say "done" 02:07
camelia hi 1
hi 2
hi 3
hi 4
hi 5
done
melezhik do we have Rakudo binaries for ARM/Linux? don't see any on rakudo.org/downloads/rakudo 10:18
wayland Hi! A question (probably for librasteve): Do we have anything that makes a Raku library that's basically just stubs around a Rust library? I'm looking at github.com/ballsteve/xrust (since I've had plenty of problems with libxml, and am looking for an alternative). I noticed github.com/librasteve/raku-Inline-Rust from librasteve++ and am wondering how far we've moved in that direction, and how much work it'd be to wrap a library like the 10:24
one I linked. I'm guessing from the doco that it's pretty bare-bones and we don't currently do any auto-generation?
librasteve wayland: yup ... my puny attempt was really a set of notes to self on how to combing FFI and Rust ... as noted I never felt it was worthy of module status 11:33
generally I would recommend wrapping a native C library rather than a Rust one since Rust has no ABI ... the implication is that generally you cannot map a random struct and then pass back and forth (I think that's the case, but I am definitely not an expert in FFI) ... so the way I ended up working with Rust was to stick to vanilla native Array and Pointers and then translate data up and down to objects ... kind 11:39
of like every Rust object can be represented by a Raku proxy - but very action at a distance-y
wayland: i read www.ottorask.com/blog/creating-an-...ry-in-rust that there is a way to C bindgen from rust 11:41
wayland: chatgpt.com/share/67b86704-e768-80...df8b64404b may also be a clue as to consuming c bindings into raku -- iirc someone here was working on automating this ... so maybe others can help? 11:45
antononcube @wayland Using Rust is not a good idea. It is too much of a "moving target." 12:52
There are plenty of good, exemplary packages for binding Raku with C. Say, by titsuki or bduggan. 12:54
tbrowder .tell timo i updated doc PR 14:46
tellable6 tbrowder, I'll pass your message to timo
tbrowder hi, i've asked @ugexe about this before, but is there any practical way to disambiguate two zef/installed binaries with the same name? from my user view the internam 16:58
*internal used modules do that, but afaik currently a new module with a binary of the same name will just over-write the duplicate. 16:59
i guess it would take an overhaul or extension of the existing system. 17:00
ugexe not really no. fwiw the binary does not get overridden though. when you install raku code with a bin file it also gets a wrapper. the wrapper could theoretically provide options to disambiguate and choose a different one 17:01
you can sort of do it if you put all your bin/ code in a module, but then you have to invoke it like `raku -e 'use Zef::CLI:ver<0.1.2>' install Foo::bar` 17:02
tbrowder hm, too bad. i've been naming my bin files with a short prefix based roughly on the parent module name... 17:04
oh, well, "c'est la vie!" 17:05
ugexe the problem is there just isnt a good way to allow disambiguating that is also easy for the user. adding flags like --use-version --use-auth etc to the wrapper (i.e. `myscript --use-version=0.1.2` means users MAINs cannot use options with the same name when installed (while working fine when not installed). having environment variable that could be used like `RAKU_BIN_USE_VERSION=0.1.2 myscript`
doesn't work because that env var would affect any other script invocations that myscript may itself spawn
tbrowder yepper, thnx for reminder 17:06
hm, on linux one can easily provide aliases for command, so maybe that could be lee 17:07
*leveraged with yr zef bin location somehow 17:08
ugexe raku -e 'require ($*REPO.repo-chain.grep(CompUnit::Repository::Installation).map({ .files("bin/zef", :ver<0.22.7>).Slip }).grep(*.defined).map(*.<source>).head)' 17:14
you can replace bin/zef and :ver<...> with whatever binary and version you want
which should suffice for writing your own wrapper for an alias or whatever 17:15
tbrowder thanks! 17:43
sounds like it should be mentioned in the raku weekly (as well as someone's blog) 17:45
melezhik I don't know why but zef install is extremely slow on my qemu instance 20:47
it literally hangs on installing even a simple module without even dependencies  , like Kind
real0m14.640s for command `zef --version` 20:48
which is weird 20:49
timo melezhik, can you check what you get when you set RAKUDO_MODULE_DEBUG=1 to see if it's doing any precompilation? if it is doing precompilation, it might be using more ram than your qemu instance has configured maybe? are you on an architecture without moarvm JIT (anything except x86_64), etc? can you share more details? 20:55
wayland76 antononcube: OK, good to know. Is it a moving target at the language level, or just the ABI level? As to using C, I don't really like any of the C XML libraries -- libxml crashes (segfaults) too much, and think the others are proprietary. 21:41
librasteve: Thanks! Good info. 21:42
librasteve wayland76: fwiw I have had some success with the raku.land/zef:raku-community-modules/XML and raku.land/zef:tony-o/HTML::Parser::XML modules, not sure what they use under the hood 21:45
guess you want speed 21:46
wayland76 At this point, speed is optional, but I'm struggling with XML; will probably post a gist soon. I've already done a couple of PRs to address the problems I see. 21:48
I hadn't seen HTML::Parser::XML; I might need to check that one out.
librasteve since I am lazy, I would use Inline::Perl5 and metacpan.org/pod/XML::Parser - using libexpat.github.io on the basis that it may well be stable and quite fast - and likely to be quick to assemble the parts ;-) 21:49
librasteve_ ? 21:50
wayland76 Oh, nice idea! I've also just spotted DOM::Tiny, so looks like I've got some good options :) 21:51
librasteve_ some notes to self on how to do stuff with raku XML module www.irccloud.com/pastebin/6meVfH3B
wayland76 antononcube, I've just seen the answer to my own question: blog.rust-lang.org/2025/02/20/Rust-1.85.0.html indicates language changes.
librasteve_: I'm trying to make something that will walk any kind of tree, and I'd like that to include XML trees. I'm not much fussed what backend I use, as long as the Element object "does Positional" for child nodes, and "does Associative" for attributes. 21:53
librasteve here's the full source of what I did on XML to migrate some pesky files 21:53
github.com/librasteve/ACPI-Migration
oh, ok - i think i see 21:54
wayland76 librasteve_: Not sure I understand why you sent the "?" -- I'm assuming you didn't follow something I said, but I don't know which part.
librasteve well HTML is XML right
wayland76 Subset of XML with more leeway, but yes :). 21:55
librasteve that's just me going from discord to ircloud and chaking i am on the same channel (easier to post text snippets), sorry 21:56
wayland76 Oh, OK :) 22:02
wayland76 DOM::Tiny has the same bug I just fixed in the XML class -- the HasChildren role doesn't "does Positional" 22:52
Hi all! I'm struggling with a bug, probably in XML, but could be my code. I've made a gist at gist.github.com/wayland/c414a6b563...2a7bebf62f with code, output, and a comment that explains it. If anyone can help, that'd be much appreciated. Thanks! 23:10
lizmat there's a lot of superstituous parens here: gist.github.com/wayland/c414a6b563...p-raku-L33 23:41
my @inputs = ('A',), ('B','C', ('E','F','G', %( A => 'E', E => 'A')));
wayland76 I probably could've reduced that a bit, but I wanted it to walk some of the nodes and not others. Specifically, it's walking the nodes that do Positional. 23:43
lizmat for @inputs.grep(Positional) -> $input
maybe better readable, then lose the next line
for @inputs.grep(Positional) -> @inner { 23:44
wayland76 But will that grep descend into all descendents? I'm trying to make a generic treewalk that works on both regular arrays and XML documents.
lizmat grep will not descend
wayland76 That's what I expected. 23:45
lizmat it'll smartmatch with the topic
wayland76 To clarify, it's really line 19 that I'm trying to debug.
lizmat if you're sure the elements are Positional, you can have them bound to an "array" -> @inner 23:46
wayland76 ...and line 5.
Why is it descending properly on the regular arrays, and not on the XML ones?
lizmat line 19 should probably be: 23:47
@retvals.append(WalkTreeMatch($child)); ?
wayland76 OK, just tried that, and it's still an infinite loop. 23:49
lizmat are you sure there are no recursive structures ? 23:50
lizmat wayland76: anyways, it's way past my bedtime... I'll look at it tomorrow and leave anything I find (unless someone else beats me to it) 23:51
wayland76 Pretty sure -- it's a straight XML document, so shouldn't be recursive. Line 15 even prints out the first child according to [], and that's correct, but then when I loop over $input, 23:55
... 23:56
I think I've figured out that I'm debugging the wrong line. Line 17 is not actually going to the child, it's sitting on the same node it already was. If I can't sort it, I'll update the gist with one more line of debugging, and then wait for your response tomorrow. 23:57