🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/07/02/sa...hem-apart/ 07:53
Voldenet >at tmp/2021-03-08.raku 08:29
it made me check the date twice 08:30
gfldex lolibloggedagain: gfldex.wordpress.com/2023/07/02/i-...ification/ 08:37
Voldenet: that file is around for quite some time indeed. I don't like to use a REPL because those refuse to keep good records.
Voldenet I hate repl too, prefer files, but I use dates with meaningful names instead 09:38
like `ttt.p6`, `x.raku` and so on 09:39
s/I use dates/I use files/
nemokosch files are inconvenient tbh 11:50
Voldenet depends on how you use them 11:54
i usually just do inotifywatch/run in loop and edit in separate window 11:55
tbrowder__ fyi i finally found a module test error while using "mi6 test". a binary file had not been "cmod ++". i never saw a clue to that while it was covered up by a bash script. i may try changing test "run 'exe'" to "run 'raku exe'" and see what happens. 12:50
timo gfldex: that $_ in add-index-entry is a little wild :D 14:24
m: sub test() { INIT { $_ = 123; say "inited" }; END { say "DU at end is $_" }; say "inc DU from $_ to {++$_}"; }; test() for ^10; 14:25
camelia inited
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 t…
timo m: sub test() { INIT { $_ = 123; say "inited" }; END { say "DU at end is $_" }; say "inc DU from $_ to {++$_}"; }; test() for ^4;
camelia inited
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
DU at end is 124
timo is this safe to rely upon? 14:26
timo m: sub test() { INIT { $_ = 123; say "inited" }; END { say "DU at end is $_" }; say "inc DU from $_ to $(++$_)"; }; test() for ^4; 14:27
camelia inited
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
inc DU from 123 to 124
DU at end is 124
tbrowder__ duh, the missing file cmd was "chmod +x" to make it executable. i usually do that first thing when creating such a file, but muscle memory failed me, again. 14:34
so this works in the lives-ok {} test without an exectable file: "run 'raku', 'script'" 14:50
but, if the script is to be installed, then it probably won't execute. i'll add a test to check executables for the x bit. no idea how to do that for Windows. 14:53
better yet, in the test file, chmod +x each just before running its first run test 14:59
guifa timo: that feels right. But assuming that you have a $_ outside the INIT and END blocks (it would feel off if it weren't that way since $_ I think would only be in the higher scope if it were so referenced, but I could be wrong on that) 15:20
ugexe you probably shouldn't modify other files inside tests 15:25
that is relying on the test to ensure a valid state of your distribution 15:26
that sentence is a bit ambiguous. rather, that is relying on the test to act as a sort of code-generation stage 15:27
checking for the +x bit in the test is the correct thing to do
gfldex timo: I wasn't even sure that works. Raku++ 16:27
timo gfldex: is there some issue to track regarding how you're saying that hyper and Proc::Async don't work well together? 16:36
afkbbl 16:37
gfldex timo: with a :degree highter 8 I get deadlocks. 16:51
timo does it get better if you increase the raku max threads env var? 16:55
i wonder what causes that 16:56
perf stat ~/raku/install/bin/rakudo -e '(^5000).hyper(:degree(32), :batch(4)).map({ my $p = run :in, :out, :!chomp, <xxd>; $p.in.put($_ xx 1000); $p.in.close; $p.out.slurp(:close) });' 17:06
this seems to lock up here as well
timo gfldex: i rewrote it to use Proc::Async and it no longer hangs 18:16
Geth ¦ problem-solving: finanalyst assigned to coke Issue POD6 to RakuDoc revision process github.com/Raku/problem-solving/issues/375 18:17
timo perf stat ~/raku/install/bin/rakudo -e 'use v6.e.PREVIEW; (^5000).hyper(:degree(32), :batch(4)).map({ my $p = Proc::Async.new("xxd", :w); my $out; $p.stdout.tap({ $out ~= $_ }); my $prom = $p.start; await $p.say($_ xx 100); $p.close-stdin; await $prom; $out });' 18:19
unfortunately for such simple cases it's a bit verbose. much verboser than the "run :out, :in" variant 18:20
:on-write(-> $blob { cur-promise .= then({ await $!proc.write($blob) }); }) # this is where the backtrace says the thread hangs, it goes straight into a sub await that first does my $*RAKUDO-AWAIT-BLOCKING := True; $*AWAITER.await($p) 18:24
that's from core.c/Proc.pm6 in line 33 18:25
tbrowder__ ugexe: good points, will do, thanks 22:53