🦋 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);'
00:09 reportable6 left
leont Installed it by hand for now, kind of got my hands full on the other issue 00:15
00:15 evalable6 joined 00:16 linkable6 joined, nativecallable6 joined
leont Thread 1 is definitely hanging in Semaphore.acquire 00:16
Backtrace doesn't work on half of the threads though
00:27 djerius left, dextercd left 00:30 djerius joined
leont I'm beginning to see what's happening here 00:30
00:32 colemanx joined
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
01:10 reportable6 joined
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
01:14 lizmat_ left, lizmat joined 01:16 releasable6 joined 01:18 Geth joined
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); }
01:22 RakuIRCLogger left 01:23 RakuIRCLogger joined
Voldenet Eh, nevermind, it's not a deadlock 01:23
01:29 SqrtNegInf joined
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
02:12 SqrtNegInf left 02:15 unicodable6 joined 03:07 colemanx left 04:07 evalable6 left, linkable6 left 04:08 evalable6 joined 04:50 Sgeo left 04:58 Darkcoal joined 05:02 Sgeo joined 05:54 pierrot left 05:55 pierrot joined 06:09 reportable6 left 06:11 reportable6 joined 07:11 committable6 left, shareable6 left, squashable6 left, nativecallable6 left, sourceable6 left, bloatable6 left, reportable6 left, unicodable6 left, evalable6 left, tellable6 left, coverable6 left, notable6 left, quotable6 left, releasable6 left, statisfiable6 left, benchable6 left, bisectable6 left, greppable6 left, squashable6 joined, clarjon1 joined, quotable6 joined, nativecallable6 joined 07:12 shareable6 joined, notable6 joined, reportable6 joined, statisfiable6 joined, bloatable6 joined 07:13 sourceable6 joined, tellable6 joined, committable6 joined 07:14 evalable6 joined, greppable6 joined 08:10 linkable6 joined 08:12 unicodable6 joined 08:13 bisectable6 joined 08:35 jjido joined 08:50 Garbanzo__ left 08:55 jjido left 09:01 lockywolf left 09:09 frost joined, frost left, frost joined 09:13 releasable6 joined 10:13 linkable6 left, evalable6 left, jjido joined 10:14 linkable6 joined 10:15 frost left 10:16 evalable6 joined 10:29 jjido left 10:34 stoned75 left 10:45 jjido joined 10:51 abraxxa-home joined 11:12 benchable6 joined 11:13 coverable6 joined 11:20 Sgeo left
077AAD8E0 hi, just checking my nick 11:25
dang!
11:26 sivoais left 11:28 suman joined
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
11:37 sivoais joined 11:54 Xliff_ left
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
12:07 reportable6 left 12:11 suman left
077AAD8E0 but if you want that capability, you can file an issue and lobby for your case 12:33
12:39 perlbot left, simcop2387 left 13:15 jjido left 13:28 perlbot joined 13:30 simcop2387 joined, thundergnat joined
thundergnat m: sub postfix:<%> { ($^p * 100).fmt: "%.2f%%" }; say (1/3)% 13:31
camelia 33.33%
thundergnat :-)
13:58 jjido joined 14:10 reportable6 joined 14:15 jjido left 14:17 jjido joined 14:21 jjido left 14:37 abraxxa-home left 15:37 linkable6 left, evalable6 left 15:38 linkable6 joined 15:40 evalable6 joined
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
15:50 jjido joined 16:50 linkable6 left, evalable6 left 16:53 linkable6 joined 17:15 jjido left 17:34 jjido joined 17:50 lichtkind joined 17:51 evalable6 joined 18:07 reportable6 left 18:13 Garbanzo__ joined 19:07 abraxxa-home joined 19:09 reportable6 joined 19:12 Sgeo joined 19:17 Manifest0 left 19:29 [Coke] left 19:32 [Coke] joined 19:34 dogbert11 joined 19:36 dogbert17 left 19:38 dogbert11 left 19:42 Xliff joined 19:43 Od1n1 left 19:46 dogbert11 joined 19:50 dogbert17 joined 19:51 dogbert17 left, dogbert17 joined 19:53 dogbert11 left 20:00 Darkcoal left 20:14 Manifest0 joined 20:19 lichtkind left
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
21:03 colemanx joined 21:07 dogbert11 joined 21:10 dogbert17 left 21:37 jjido left 21:39 dogbert11 left, dogbert11 joined
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
22:22 dorkdoggler joined
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
22:40 oodani left
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
22:41 oodani joined
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
23:02 squashable6 left
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/
23:05 squashable6 joined
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
23:16 abraxxa-home left
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 )
23:50 thundergnat left