🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
jdv79 melezhik: it seems likes its pretty deep - moarvm maybe 01:55
jdv79 melezhik: nevermind. its zef. setting out-buffer on $*OUT and $*ERR fixes it. 02:41
jdv79 tell melezhik nevermind. its zef. setting out-buffer on $*OUT and $*ERR fixes it. 02:41
jdv79 tell melezhik nevermind. its zef. setting out-buffer on $*OUT and $*ERR fixes it. 02:41
.tell melezhik nevermind. its zef. setting out-buffer on $*OUT and $*ERR fixes it. 02:42
tellable6 jdv79, I'll pass your message to melezhik
abraxxa how can I prevent uninitialized warnings in raku? 08:02
my current case is a $var > 10 which might be not defined 08:03
$var.defined && $var > 10 is what I did coming from Perl 5
docs.raku.org/routine/defined is where my search lead to
ShimmerFairy That should also work in Raku. You could also do something like ($var // 0) > 10 if you want to treat $var as having a default value and you can't give it one for some reason. 08:17
lizmat abraxxa: if $var can be a native int, it would default to 0 08:33
m: my int $a; say $a > 10 08:34
camelia False
lizmat m: my $a; say $a > 10
camelia Use of uninitialized value of type Any in numeric context
False
in block <unit> at <tmp> line 1
lizmat alternately, you can use "is default" to give the variable a default value
m: my $a is default(0); say $a > 10
camelia False
lizmat m: my $a is default(42); say $a > 10
camelia True
abraxxa $var has no type 08:35
lizmat abraxxa: if you cannot influence the definition of $var, then either: 08:40
($a // 0) > 10 08:41
or:
if quietly $a > 0 { say "foo" }
abraxxa lizmat: what's the difference between my $var = 0; and my $var is default(0);?
lizmat the quietly will prevent the warning from being output
a variable has a default state, by default that its Any 08:42
lizmat so you could argue that if you say: "my $var" you're saying really "my $a is default(Any)" 08:43
lizmat m: my $a = 42; say $a; $a = Nil; say $a 08:44
camelia 42
(Any)
lizmat by assigning Nil to a variable, you revert it to its default value
abraxxa and what is the difference?
in both cases it will get assigned '0'
lizmat well, you could argue that effectively for scalars 08:45
but for arrays:
m: my @arr is default(42); say @arr[100000]
camelia 42
lizmat you never assigned element 10000, but still it has the default value 08:46
if you consider a variable to be a box that can contain a value 08:47
the default value is what the box is worth if there isn't any value in it
lizmat clickbaits rakudoweekly.blog/2020/06/01/2020-...by-wenzel/ 08:51
and goes afk for a few hours&
moritz lizmat++ 12:07
JJMerelo Something that has happened and I can't quite figure out. 12:14
It's this thing with DBIish. It's got a library, NativeLibs, that was pegged at version 0.0.3. 12:15
That same module, NativeLibs, was spun off as its own library and published to the ecosystem, bumping it up to version 0.0.7
NativeLibs is NOT listed as a dependency of DBIish. It's just there, in the "provides" section. 12:16
Now, the thing is apparently zef is fetching the external NativeLibs, testing it, and it fails github.com/JJ/perl6-recipes-apress...step:6:128 12:17
(BTW, that's a GitHub action that detects changes in the META6.json and builds a specific Docker container when that happens; the container is used in subsequent tests) 12:18
So, is that even possible? Will zef check if there's a version of a module in the ecosystem whose version is higher than the one we've got locally and automatically add it to dependencies? 12:19
ctilmes It's not the version of NativeLibs. It is the version of the distribution that provides NativeLibs. 12:22
tellable6 2020-05-30T19:42:40Z #raku <holli__> ctilmes: ty
ctilmes Two distributions provide it, one has version 0.0.7, one has version 0.5.19, so it gets the later one, DBIish
You can test the resolution with 'zef info NativeLibs' -- it will show you the one that will get chosen 12:23
JJMerelo ctilmes thanks 12:33
Now I'm trying to figure out which distribution needs that...
ctilmes It's a weird situation -- I think it would be better if NativeLibs was removed from DBIish entirely
melezhik jdv79 thanks, could you please share an example how to set out-buffer ? 12:36
tellable6 2020-06-02T02:42:02Z #raku <jdv79> melezhik nevermind. its zef. setting out-buffer on $*OUT and $*ERR fixes it.
JJMerelo ctilmes but it's newer than the one published, that's the thing. 12:38
JJMerelo I've found it's actually UUID which is a upstream dependency of several libraries the one that includes NativeLibs github.com/CurtTilmes/perl6-libuuid 12:39
So it's not really a problem with it searching the library, it's a genuine problem with the published version I guess will have to be patched...
ctilmes I'll try to update LibUUID to use the separate one instead of the DBIish one 12:40
ctilmes In my more recent mods I've fully qualified the use NativeLibs 12:40
JJMerelo ctilmes UUID is fine 12:42
JJMerelo and NativeLibs also passes tests. 12:42
I think that the problem is that it's testing with external tests using DBIish library
ctilmes ok. thanks
JJMerelo It probably makes sense to backport whatever has been changed in DBIish to the external library and eliminate it from DBIish 12:43
Is that possible?
I mean, is it possible that zef is testing some library with another, installed version of the library? 12:44
ctilmes I don't know what differences they have
melezhik jdv79 do you mean I have to open STDOUT and STDERR and set .out-buffer within code block, like explained here - docs.raku.org/routine/out-buffer 12:52
?
rbt JJMerelo: I deleted the DBIish NativeLibs, installed the separate package, and Mysql, sqlite, and Pg tests all pass. 13:09
tellable6 rbt, I'll pass your message to JJMerelo
rbt I don't have an Oracle system to try
jdv79 melezhik: i mean i basically added "($*OUT,$*ERR)>>.out-buffer(0);" to the zef script and that seemed to fix it 13:27
jdv79 if that code snippet worked:) 13:29
jdv79 you get the idea - it seems to be buffering in the zef proc 13:29
Geth doc: uzluisf++ created pull request #3457:
Revise 'Raku by example 101' page
14:01
melezhik jdv79, yeah. all external commands get called by Proc::Async, see github.com/melezhik/Sparrow6/blob/...on.pm6#L90 14:17
so should I just insert `($*OUT,$*ERR)>>.out-buffer(0);` inside this method? does it work "globally" ?
jdv79 basically - maybe ($*OUT,$*ERR).map: {.out-buffer = 0} would actually work 14:22
well, $*OUT and $*ERR are dynamic and declared "above/outside" the main scope so kinda "global" 14:23
melezhik I will try and let's see if it fixes the issue of stdout buffering in RakuDist
jdv79 maybe nopaste.linux-dev.org/?1318839 illustrates it well enough:) 14:29
melezhik jdv79 log rakudist.raku.org/sparky/report/debian/158 still appears "frozen" right after zef start 15:00
so that commit looks like does not help - github.com/melezhik/Sparrow6/commi...8a8ebbdffe 15:01
your examples implies modification of zef itself, not the client code
jdv79 that's because zef is buffering - there is no way to fix it outside of zef 15:22
zef itself has to be unbuffered
timotimo well, there is "a" way, but it's not a sensible thing to do 15:23
jdv79 did you see my paste above ^. I unbuffered in the actual zef file
timotimo: pray tell
timotimo attach a debugger to the zef process and manually force unbuffering on the file descriptors that way
jdv79 haha
melezhik: yeah - do what timotimo says:) 15:24
jdv79 i would reopen the ticket on zef and ask output unbuffering support or do it yourself in any of myriad of ways: fork, munge,etc... 15:24
melezhik jdv79 timotimo thanks guys. I'll try to patch zef script itself first, not that difficult in Sparrow 15:25
timotimo oh, there's a tool called, i think, fdinfo? it could be possible that using that can get to buffering issues more quickly, but i'm not actually sure how it's used; i think you want to exec it from the process that has the FDs?
hm, no, that's not what it's called
jdv79 melezhik: thanks for bringing it up - at least i now know why some docker builds stall on zef commands for long stretches of time 15:27
melezhik yeah, this ticket could be of interests too - github.com/ugexe/zef/issues/353 . though as you can see there is no confidence what cause a buffering, so I am investigating 15:28
melezhik after apply the patch jdv79 suggested I'd hopefully get more details 15:29
timotimo i can not find that tool again :( 15:36
timotimo the tool is called "filan" 15:43
melezhik jdv79 timotimo - here is my feedback on patch suggested by jdv79 - github.com/ugexe/zef/issues/353#is...-637678552 16:54
jdv79 melezhik: cool 16:56
JJMerelo raku.org is down... 17:21
tellable6 2020-06-02T13:09:44Z #raku <rbt> JJMerelo: I deleted the DBIish NativeLibs, installed the separate package, and Mysql, sqlite, and Pg tests all pass.
JJMerelo rbt thanks... In fact, it contains the same functionality...
rba But I'm not sure it's the best, since there are implementation details that are somewhat different 17:23
melezhik interesting, installing LibXML ( tests and dependencies are not included ) takes almost 3 minutes - rakudist.raku.org/sparky/report/debian/161 17:28
melezhik 17:16:35 06/02/2020 [bash: zef install CSS] ===> Installing: LibXML:ver<0.4.0>:auth<cpan:WARRINGD> 17:28
I wonder what's happening here? is it not just coping files ? or maybe there is some compilation phase ? 17:30
lizmat JJMerelo: not down for me? 17:31
JJMerelo lizmat I'll try again 17:32
melezhik it's alive now 17:32
JJMerelo right, back up. rba++
melezhik appeared down few minutes ago
lizmat I understand some maintenance was planned
cpan-raku New module released to CPAN! Math::Libgsl::QuasiRandom (0.0.1) by 03FRITH 17:38
melezhik I started to promote Sparrow on reddit/devops and Raku as well - www.reddit.com/r/devops/comments/g...dium=web2x 20:27
maybe one more guy would interested in the langauge 20:28
rba JJMerelo et al: I'm sorry, yet I have missed to inform you all about todays planned maintenance. So kudos go to nine++ and his team, e.g. m_athias++. For those who like to check the service monitoring: stats.raku.org/
Geth doc/link-bind-key: d277c89f67 | (Stoned Elipot)++ | doc/Language/containers.pod6
xref BIND-KEY method
20:41
doc: stoned++ created pull request #3459:
xref BIND-KEY method
Geth doc: d277c89f67 | (Stoned Elipot)++ | doc/Language/containers.pod6
xref BIND-KEY method
21:06
doc: 5bdc659acd | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/containers.pod6
Merge pull request #3459 from Raku/link-bind-key

xref BIND-KEY method
linkable6 Link: docs.raku.org/language/containers
konvertex Does anyone have a minute to explain why I need a slip here? Still don't get it. Works fine for summing, for example. 22:12
m: <3 5 -2>.combinations.max({[*] $_}).say
camelia (3 5 -2)
konvertex m: <3 5 -2>.combinations.max({[*] |$_}).say
camelia (3 5)
konvertex Is that some IntStr issue? 22:13
m: <3 5 -2>.combinations.max({[+] $_}).say
camelia (3 5)
konvertex m: <3 5 -2>.combinations.max({[+] |$_}).say
camelia (3 5)
chloekek Because $_ is in a scalar container. 22:15
m: <3 5 -2>.combinations.max({[+] @^a}).say
camelia (3 5)
chloekek m: <3 5 -2>.combinations.max({[*] @^a}).say 22:16
camelia (3 5)
konvertex Hm, but why is [+] behaving differently than [*] in this case? 22:17
chloekek m: <3 5 -2>.combinations.max({say $_; [*] $_}).say 22:18
camelia (3)
()
(5)
(3)
(-2)
(3)
(3 5)
(3)
(3 -2)
(3 5)
(5 -2)
(3 5)
(3 5 -2)
(3 5)
(3 5 -2)
chloekek p6: say [+] $(1, 2, 3)
camelia 6 22:18
chloekek p6: say [*] $(1, 2, 3)
camelia 3
chloekek For some reason, [*] converts the list into a number, thereby taking its length.
I don’t know why [+] differs in this behavior. 22:19
konvertex Alright, thanks for the input, appreciated! Will dig some more in the docs. 22:20