🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
ugexe you'd have to modify github.com/ugexe/zef/blob/3edbbcf2...kumod#L173 this little bit to see what the output from git it (alas the shell stuff doesn't have a way to communicate back generally yet) and then run 00:04
raku -I. -e 'use Zef::Service::Shell::git; Zef::Service::Shell::git.new.fetch(q|git@github.com:pierre-vigier/Perl6-Data-MessagePack.git|, "./bar@HEAD".IO);'
leont Installed it by hand for now, kind of got my hands full on the other issue 00:15
leont Thread 1 is definitely hanging in Semaphore.acquire 00:16
Backtrace doesn't work on half of the threads though
leont I'm beginning to see what's happening here 00:30
leont pastebin.com/FxQeTWg3 00:33
I this means it will hang if you emit while it's replaying 00:35
Though there's still a piece I'm missing 00:40
I'm pretty sure that piece is react/whenever related, so probably one of the locks in ThreadPoolScheduler 00:49
Voldenet well, `react whenever` uses .act on a supply if I'm not mistaken 00:55
m: sub n { state $n = now; say sprintf("%s%s%.1f", $*THREAD, $^t, (now - $n)) }; my $s = Supplier::Preserving.new; start { for ^10 { n("e"); $s.emit(Any); sleep .1; }; $s.done }; sleep .3; react whenever $s.Supply { n("r"); sleep .1 } 00:56
camelia Thread<4>(GeneralWorker)e0.0
Thread<4>(GeneralWorker)e0.1
Thread<4>(GeneralWorker)e0.2
Thread<1>(Initial thread)r0.3
Thread<4>(GeneralWorker)e0.3
Thread<1>(Initial thread)r0.4
Thread<1>(Initial thread)r0.5
Thread<4>(GeneralWorker)r0.6
Voldenet m: sub n { state $n = now; say sprintf("%s %s%.1f", $*THREAD.id, $^t, (now - $n)) }; my $s = Supplier::Preserving.new; start { for ^10 { n("e"); $s.emit(Any); sleep .1; }; $s.done }; sleep .3; react whenever $s.Supply { n("r"); sleep .1 } 00:58
camelia 4 e0.0
4 e0.1
4 e0.2
1 r0.3
4 e0.3
1 r0.4
1 r0.5
4 r0.6
4 e0.8
4 r0.8
4 e1.0
4 r1.0
4 e1.2
4 r1.2
4 e1.4
4 r1.4
4 e1.6
4 r1.6
4 e1.8
4 r1.8
Voldenet so no new value will be emitted until all the values were consumed 00:59
I don't see whether docs anything about this blocking behaviour though 01:03
leont Well, deadlocks are never intentional 😉 01:09
perryprog Unless you're playing the game Rush Hour 01:11
Voldenet Well, I don't mean the deadlock, but .emit actually running the receiving block on its thread
Voldenet once you know that, it's enormously trivial to make a deadlock: 01:19
my $s = Supplier::Preserving.new; start { $s.emit(1); }; react whenever $s.Supply { $s.emit(2); }
you don't even need that start, just: my $s = Supplier::Preserving.new; $s.emit(1); react whenever $s.Supply { $s.emit(2); }
Voldenet Eh, nevermind, it's not a deadlock 01:23
lizmat m: my $m = Promise.new; await $m 01:29
camelia (timeout) 01:30
Voldenet Of course, but I was on about blocking `emit`
lizmat m: await $_ with Promise.new # even shorter
Voldenet my $s = Supplier::Preserving.new; start { for ^2 { $s.emit($_); sleep .2; say "emit"; }; }; react whenever $s.Supply { $s.emit($_ + 1); } 01:31
camelia (timeout)
Voldenet supply would be going infinitely and the thread would never emit second value
ugexe m: my $s = Supplier::Preserving.new; start { for ^2 { $s.emit($_); sleep .2; say "emit"; }; }; react whenever start $s.Supply { $s.emit($_); } 01:32
camelia ( no output )
ugexe m: my $s = Supplier::Preserving.new; start { for ^2 { $s.emit($_); sleep .2; say "emit"; }; }; react whenever $s.Supply { $s.emit($_); }
camelia (timeout)emit
Voldenet m: my $s = Supplier::Preserving.new; start { for ^2 { $s.emit($_); sleep .2; say "emit"; }; }; react whenever $s.Supply { .say; $s.emit($_ + 1) if $_ < 5; } 01:33
even more puzzling that this never completes
camelia (timeout)0
Voldenet i'd expect (0 1 2 3 4 5 emit 1 2 3 4 5 emit) 01:34
m: my $s = Supplier::Preserving.new; start { for ^2 { $s.emit($_); sleep .2; say "emit"; }; $s.done; }; react whenever $s.Supply { .say; $s.emit($_ + 1) if $_ < 5; }
camelia 0
1
2
3
4
5
emit
1
2
3
4
5
emit
Voldenet …again nevermind
077AAD8E0 hi, just checking my nick 11:25
dang!
suman This is in python print("A = {:.2%}".format(1/3)) outputs A = 33.33% 11:30
Can it be similarly done in raku?
moon-child m: printf "%.2f\n", 1/3 11:32
camelia 0.33
077AAD8E0 hay
moon-child % thing is cute, you would have to multiply by 100 yourself
suman moon-child Python seems to do it without multiplying by 100 11:58
moon-child yes. That is not something you can do in raku, as far as I know 11:59
077AAD8E0 but if you want that capability, you can file an issue and lobby for your case 12:33
thundergnat m: sub postfix:<%> { ($^p * 100).fmt: "%.2f%%" }; say (1/3)% 13:31
camelia 33.33%
thundergnat :-)
077AAD8E0 well there you go, the power of raku coupled with saput it in a module and publish it 15:46
*coupled with smart users 15:47
ph88 what is the go to web framework on raku ? 20:38
[Coke] cro.services/ 20:41
El_Che I couldn't follow fosdem 20:49
how went the raku talks? 20:50
Xliff weekly: gist.github.com/Xliff/9a93ab12c32a...ab49c47f2d 22:13
notable6 Xliff, Noted! (weekly)
jdv [Coke]: how crazy you wanna go with the copyright stuff? 22:14
there seems to be a bunch more than just s/2021/2022/ in a bunch of repos 22:15
dorkdoggler raku has good support for unicode and even some logic/math symbols are there any libraries/modules that do SAT to 3MAP  "solving" so you could make a machine that works directly with statement/clause like A∨B∨∼C instead of having to parse encode everything? I'm looking at this python library and exercise: 22:31
sahandsaba.com/understanding-sat-b...ython.html and wondering if any perlistas or rakistas(? rakuites? rakuians?) have worked on modules/libraries/grammars in the area. Where do I search raku modules?
I found github.com/taboege/raku-SAT-Solver-MiniSAT 22:33
jdv some peeps like "rakoon". im not a fan. 22:34
dorkdoggler cool ... I thought maybe there were more raku modules I might have missed somewhere. I guess I'm used to CPAN (with decades of uploads :-D) After a few weeks I conclude that raku seems to be a simpler to use language "plain" ... with more built in so less modules needed (and having had less time to build them). 22:36
MasterDuke i think that's a pretty accurate assessment 22:37
jdv perhaps. raku is younger. cpan is older:)
amusingly there are raku modules ar cpan so its not so clear cut:) 22:38
*at/on
dorkdoggler MasterDuke plus OK I am so impressed that I think I must be making a mistake ... but NativeCall ... WTF???! We get to use every decently written C library in the world out of the box?!??! 22:40
MasterDuke yes(-ish, i think, i don't really use NativeCall so am not the best person to ask) 22:42
dorkdoggler MasterDuke yeah I used it with a couple of C libraries and am not an expert. But it made me think raku has already take over the world and no one noticed 22:43
I don't know if it's easier or faster than FFI::Platypus (perl5) but only because FFI::Platypus is not built-in and doesn't get as much use (usually cuz there's 12 perl modules that do the thing some c library can do). 22:48
MasterDuke i know Xliff is a big nativecall user, he might have some insight 22:54
Xliff dorkdoggler: Not quite out of the box. You have to tell raku how to call the routines. 23:03
Voldenet dorkdoggler: not "out of the box" as said earlier, but there is github.com/Skarsnik/gptrixie 23:04
Xliff Something like this: github.com/Xliff/p6-GLib/blob/mast.../Array.pm6
Voldenet however I didn't use the tool much because it's very to write C mappings
s/very/very easy/
Xliff Yes. gptrixie is very complex. I have a tool that will take most GLib-based .h files and covert them into Raku 23:05
leont now also has binds working in his async postgres client 😄 23:17
Xliff leont++ 23:25
moon-child dorkdoggler: I think most languages can use c libraries 23:26
Xliff moon-child: But as you are aware, most languages require more work than Raku. 23:35
Voldenet `use` comes in different forms, not many languages can just do this ootb 23:37
m: use NativeCall; sub free(Pointer) is native { * }; sub malloc(int32, –> Pointer) is native { * }; free(malloc(42))'
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> ter) is native { * }; sub malloc(int32, ⏏–> Pointer) is native { * }; free(malloc
Voldenet m: use NativeCall; sub free(Pointer) is native { * }; sub malloc(int32 –> Pointer) is native { * }; free(malloc(42))' 23:38
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> inter) is native { * }; sub malloc(int32⏏ –> Pointer) is native { * }; free(mallo
expecting any of:
constraint
formal para…
Voldenet uh, *nervous chuckle* 23:39
m: use NativeCall; sub free(Pointer) is native { * }; sub malloc(int32) returns Pointer is native { * }; free(malloc(42))
camelia ( no output )