disbot <jubilatious1_98524> Why NAUGHTY? raku.land/tags/naughty 03:03
03:10 topnep left 03:12 topnep joined 05:02 kjp left 05:16 topnep left 05:19 topnep joined 05:24 kjp joined 05:32 kjp_ joined, kjp left 06:54 kjp_ left 06:55 kjp joined 07:23 topnep left, topnep joined
disbot <rcmlz> I found use v6.e.PREVIEW; say "élève".nomark; # eleve on raku-advent.blog/2024/12/25/day-25...24-review/ so there is even more options to tackle this sorting problem in the future. 08:37
lizmat yeah, the nomark in String::Utils was backported from that 08:39
disbot <simon_sibl> is there a better way to stop a react block when some whenever block are done ? termbin.com/ysa5, not sure this is the most Raku way 09:03
09:16 deadmarshal_ left 09:27 deadmarshal joined, topnep left 09:28 topnep joined 10:11 disbot left, disbot8 joined 10:40 cleo left
disbot8 <jubilatious1_98524> @simon_sibl Looks good! That's more graceful that what I've tried (tailing a logfile): unix.stackexchange.com/a/721958/227738 11:40
<simon_sibl> now that I saw this, I wonder if its possible to pass arguments to raku one-liner without Raku trying to open them as file to read 12:01
<jubilatious1_98524> Sure, use the %*ENV trick: unix.stackexchange.com/a/611077/227738 12:12
<jubilatious1_98524> ( ...got that from Larry Wall!)
<jubilatious1_98524> More generally, there are many other examples where I've used it: unix.stackexchange.com/search?q=us...38+%25*ENV 12:13
<simon_sibl> oh I used another trick that I just found 12:14
<simon_sibl> tail -F logs | raku -ne 'my @a; BEGIN {@a=@*ARGS;@*ARGS=();}; say $_.split(/";"|"="/,:skip-empty)[1..*].hash{@a}:kv' ares_recv
<simon_sibl> not amazing but well 12:15
<simon_sibl> actually using :p instead of :kv here looks better 12:19
<jubilatious1_98524> Are you calling @*ARGS twice? I've never seen that. Generally if you want to take a value/file pair you would use my $value = @*ARGS[0]; my @array = @*ARGS[1].IO.lines;
<simon_sibl> and does what the guy seem to want
<simon_sibl> oh I first copy @*ARGS and then I empty it otherwise it will try to open them as file
<jubilatious1_98524> What's in ares_recv ? 12:20
lizmat m: my @a = <a b c d e>; my @b := @a.splice; dd :@b, :@a # fast way of copying & emptying out an array 12:21
camelia :a([])
:b(["a", "b", "c", "d", "e"])
disbot8 <simon_sibl> oooh nice !
<simon_sibl> so the one liner: tail -F logs | raku -ne 'my @a; BEGIN {@a=@*ARGS.splice}; say $_.split(/";"|"="/,:skip-empty)[1..*].hash{@a}:p' "$@" 12:22
<simon_sibl> the "$@" is because I added it in a script
lizmat this actually just moves the internal list of @a to @b, and reinitializes the internal list in @a
disbot8 <simon_sibl> ares_recv is one of the key in the log file, you can give multiple key as argument and it shows those
<simon_sibl> thats exactly what I needed, thanks ! 12:23
13:37 topnep left 13:38 topnep joined
disbot8 <simon_sibl> I just a person on Quora asking why Raku is faster than Python, but usually when I do benchmark Raku is slower, like I did a test between my Raku code and my colleague Python code for the scheduler and the Python one ran 10x faster (I’ll send a link to both code) 14:12
<simon_sibl> raku: termbin.com/znm3, python: termbin.com/oic2 14:13
<simon_sibl> I am pretty sure they're not completely equivalent but they do the same thing
<simon_sibl> raku: 255.78 millis, python: 18.25 millis 14:14
lizmat well, if you're doing that type of benchmark, Raku will always lose, as you should currently expect about 100 ms at least for Raku's startup 14:20
disbot8 <simon_sibl> Removing 100ms for startup, it’s still 130ms behind 14:42
lizmat true, but how does it compare with a workload of several seconds? 14:43
on Intel, MoarVM has a JiT, and that takes a bit of warming up 14:44
disbot8 <simon_sibl> By intel you mean x86_64 or intel cpu only (my laptop has an AMD) 15:02
<simon_sibl> I will try later with more input data
15:22 human-blip left 15:24 human-blip joined 16:35 stanrifkin joined 16:54 stanrifkin left 17:11 human-blip left 17:13 human-blip joined 19:50 stanrifkin joined 19:55 topnep left 19:56 topnep joined 21:59 topnep left 22:01 topnep joined