🦋 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.
timotimo committable6: releases my SetHash[Int()] $a .= new; $a{"99"}++ 01:47
committable6 timotimo, gist.github.com/fff0ec9bf93f60d348...06a9d9f68c 01:48
rypervenche I was watching Damian's video on regexes. He refers to Raku's regex by "PSIX". What does that stand for? 02:13
timotimo "perl six"? 02:14
rypervenche Hahaha. Wow, I was thinking something with POSIX. Welp, I think I need more sleep. 02:15
timotimo perl six improved eXpressions 02:17
(just a wild guess)
jdv79 fooist: that file is most likely speculative 02:59
it might be deprecated and/or superceded 03:00
that includes all ?3? p6*gz files there 03:02
fooist /join telegram-foss 03:12
sry
xinming m: sub a { return \("a", "hello")}; my $t = a().clone; $t[0] = "b"; $t.raku.say; 05:02
camelia Cannot modify an immutable Str (a)
in block <unit> at <tmp> line 1
xinming sub a { my $x = "a"; return \($x, "hello")}; my $t = a(); $t[0] = "b"; $t.raku.say;
evalable6 \("b", "hello")
xinming The second version works fine. So, for the first version, how can we build a capture can be modified as wish? 05:03
m: sub a { return \($ = "a", "hello")}; my $t = a().clone; $t[0] = "b"; $t.raku.say;
camelia \("b", "hello")
xinming This version works too, But I don't want to add $ = to all capture args. 05:04
Geth doc: 8faec6b1b9 | stoned++ (committed using GitHub Web editor) | doc/Type/List.pod6
Uniformize examples' output (#3568)

And while here, if we would like an example to produce an output, we might as well call `say` :)
06:06
linkable6 Link: docs.raku.org/type/List 06:07
DOC#3568 [closed]: github.com/Raku/doc/pull/3568 Uniformize examples' output
Geth doc: be0a68318f | stoned++ (committed using GitHub Web editor) | doc/Type/List.pod6
Rework List.join examples and description (#3570)

  - Remove duplicate note about the optional separator for the method form
  - It's the subroutine form that is slurpy and flattening
  - Group related examples
  - Correct a typo
06:08
linkable6 DOC#3570 [closed]: github.com/Raku/doc/pull/3570 Rework List.join examples and description
jjatria Hi~ Does anybody have any ideas re. stackoverflow.com/q/63486337/807650? It's about intercepting the output stream of a Proc::Async, and I haven't been able to figure out how to do it 10:07
jjatria I feel like I'm probably missing something, or getting something wrong, since I expected this to be the simpler part of what I'm working on 10:08
tobs jjatria: it seems that the producer is buffering its output and that it involuntarily dies (by your $p.kill) before it can flush the buffers. Under these circumstances, I see no way to get at the output. 10:19
jjatria I'm happy to hold off on the `$p.kill`, but it doesn't actually seem to flush the buffers. Or is there any way to tell it to flush more often? 10:22
jjatria On the docs it says that you can use `$p.stdout` to get "chunks", which I expected to be a relatively more raw access to the output stream of the process, but that also looks like it's buffering for too long for what I want 10:25
tobs I don't even know how's doing the buffering: the raku standard library, moarvm, the C library or each of them at their respective layer? 10:26
Geth doc: codesections self-assigned Map.roll and Map.pick are not documented github.com/Raku/doc/issues/3563
d0c2c09e4d | (Daniel Sockwell)++ (committed using GitHub Web editor) | 2 files

  * Use full path for module name
Previously, modules were referred to just by their base name (e.g., Pod::Block::Code was Code). This could cause modules to be misidentified (e.g., for ForeignCode). This commit uses the full path ... (304 more lines)
10:27
tobs In my limited experience with buffering issues, the problem was usually not that the low-level reader is holding back data from your program, it's that the producer doesn't even send it to you until it decides that it has accumulated enough data. Kill it before that and it all is lost. 10:28
jjatria Right, but what I think I'm trying to figure out (I may be wrong) is how to suggest to the process how much data is enough data (in my case: "as little data as you have") 10:30
The `$p.kill` there is just because I don't want the test script to run forever. I have the same problem if I remove it entirely 10:32
tobs no, when I lower the print interval to 0.01, I get a gush of data after a few seconds 10:35
tobs I mean, yes you have the same problem, but it's not that the data won't arrive at all, just very late. And I have no idea which gear to talk to to make it come out faster, sorry. Also, this will most likely depend on the program you invoke from your run script, whether it has any additional buffering layers and whether you can influence them from the outside. 10:38
jjatria What I'm trying to say is that for what I'm trying to do, waiting a couple of seconds to get ~2000 lines of output won't work
I mean, there must be a way to specify what buffer size is appropriate for a spawned process... Or am I making a wrong assumption somewhere? 10:39
tobs There is an stdbuf(1) utility that you could look into. But I bet that this will only influence the buffering in the C standard library. Certainly worth a shot, but if Rakudo/MoarVM has its own buffering, you have to look elsewhere for how to disable that, too. 10:41
tobs So, what I want to say is that I am not convinced that this is a Raku problem on the reader side. I think it's a generic problem of the writer side not pushing data early enough (which may happen with writers not written in Raku as well). 10:43
jjatria But it does work if I do `$p.bind-stdout: $*OUT` on my side, which makes me think that if the Proc::Async has bin bound to an unbuffered output, it will DTRT. I just haven't been able to get that to work with any handles that are not $*OUT and friends, and certainly not ones that I can tap into to pre-process 10:46
tobs anyway, buffering problems are annoying and I might as well be the one overlooking something
jjatria: that is interesting. It could also mean that the writer, when bound to a TTY, is going into line buffering mode, so you get entire lines at once on the screen. 10:49
now if there was a way to make Proc::Async bind stdout to a PTY inside the run script, we could test this hypothesis... 10:50
linkable6 DOC#3571 [closed]: github.com/Raku/doc/pull/3571 Overhaul the list-missing-methods.p6 script
jjatria Seems like this is the same issue: www.reddit.com/r/rakulang/comments...buffering/ 10:56
tobs lunch 10:58
rypervenche Is there any place like the Most Wanted lists for getting Raku into syntax highlighting programs like highlight-js and rouge (although there's a stagnant PR for this one) 14:00
I feel like getting Raku into highlight-js would be very useful since a lot of places (e.g., Discord) use it.
codesections When you say "like the Most Wanted lists", is there a reason that couldn't go on that list? 14:04
rypervenche No reason. I just didn't know if anything not written in Raku would go there. I'll submit an Issue. 14:07
[Coke] rypervenche++ 14:09
kawaii came across this yesterday, wasn't sure if the behaviour was correct or not. when declaring a SetHash like this `my SetHash[Int()] $monitored-channels .= new();` it seems I'm unable to coerce values which should have no problem `Type check failed in binding; expected Int but got Str ("727594541955416185")` 14:20
codesections m: my Array[Int()] $a; $a.push('1') 14:24
camelia Type check failed in assignment to ; expected Int(Any) but got Str ("1")
in block <unit> at <tmp> line 1
codesections kawaii: looks like that's true in general with mutable types. Interesting 14:25
tobs m: my Int() @a 14:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Coercion 'Int(Any)' is insufficiently type-like to qualify a variable.
Did you mean 'class'?
at <tmp>:1
------> 3my Int() @a7⏏5<EOL>
expecting any of:
constraint
tobs m: my @a of Int() 14:27
camelia ( no output )
tobs one of these is more telling than the other
codesections So, you're saying that Array[Int()] just isn't valid, and should be throwing an error? 14:28
tobs That's my reading of one of the error messages, at least in rakudo. 14:29
codesections kawaii: looks like it's a real bug :) One workaround is to move the coercion to the caller:
m: my Array[Int] $a; $a.push(+'1'); $a.push('2'.Int)
camelia ( no output )
lizmat well, I'm not sure whether this is a NYI or just something that will not be implemented 14:30
codesections m: my Array[Int] $a; $a.push(+'1'); $a.push('2'.Int); say $a
camelia [1 2]
kawaii codesections 🎉
lizmat m: my Int(Str) $a = "42" 14:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Coercion 'Int(Str)' is insufficiently type-like to qualify a variable.
Did you mean 'class'?
at <tmp>:1
------> 3my Int(Str) $a7⏏5 = "42"
expecting any of:
constraint
tobs I don't know where coercions happen. Like, if a scalar container coerces, then arrays have them and could do it.
lizmat is not 100% sure either 14:31
guifa Coercion on types outside of signatures was explained to me as NYI when I asked a while back about it 14:32
But for the arrays… no go for parameterized stuff: 14:36
m: sub foo ( Array[Int()]() $a ) { say $a }; my Str @a = <a b c d>; foo @a 14:37
camelia No such method 'Array[Int(Any)]' for invocant of type 'Array[Str]'
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
guifa wonders even what a coercion method would look like for that
method Array ($paramaterized-type) {  …  } maybe? 14:39
tobs oh yeah, that's a hairy situation because Array[X] and Array[Y] do not match even if X is a subclass of Y or X does role Y or (hypothetically) X is a coercion that accepts Y. I think C++ people would call this covariance(?) and afaik this doesn't work with parameterized classes/roles in Raku. 14:40
moritz m: say Array[Int] ~~ Array[Cool] 14:42
camelia False
guifa Oof, yeah. I would have thought that X being a subclass of Y would work, but it does fail type checks
moritz m: say Positional[Int] ~~ Positional[Cool]
camelia True
tobs :O
is the difference in role vs. class? 14:43
guifa Oh wait
That might be it
There’s something funky about parameterizing classes, they’re not really designed for it
m: class A { }; class B is A { }; sub foo ( Array[A] $x ) { $x.say }; my Array[B] $b = B, B, B; foo $b 14:44
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo(Array[B]) will never work with declared signature (Array[A] $x)
at <tmp>:1
------> 3) { $x.say }; my Array[B] $b = B, B, B; 7⏏5foo $b
guifa m: class A { }; class B is A { }; sub foo ( A @x ) { @x.say }; my B @b = B, B, B; foo @b 14:45
camelia [(B) (B) (B)]
guifa o.O
m: class A { }; class B is A { }; sub foo ( A @x ) { @x.WHAT.say }; my B @b = B, B, B; foo @b; say @b.WHAT; 14:46
camelia (Array[B])
(Array[B])
xinming SmokeMachine: Do you plan to have view support in Red? 14:50
SmokeMachine Yes, I do. Any suggestions for the syntax for that? 14:52
codesections has anyone else run into an issue where the docs generated by `documentable --update` stay one change behind where the file is? It's not a big deal; I've just been `touch`ing the file and updating again, which fixes it. But it is a bit odd 14:57
xinming_ SmokeMachine: I don't have suggestions yet. I read the Red doc again, and found no doc about VIEW. :-) 15:01
SmokeMachine xinming_: that’s not what you want, but I plan to use Red::AST::Chained to run “WITH” queries (I forgot the name, sorry) 15:03
rypervenche Is there a difference between .list and .List? I saw in the documentation "Method List: Coerces the invocant to List, using the list method." 15:05
And if they're the same, is there a preferred one to use?
xinming_ rypervenche: I think they are the same. List is just a convention, which is like Str method for various class, so the object can be converted to Str. 15:21
rypervenche: while list is a method which maybe called intentionally. :-)
But I'm not sure.
Geth doc: codesections++ created pull request #3572:
Add undocumented SetHash methods
15:25
Mawile So, when installing p6doc, the docs suggest to just grab it with zef--but since zef builds things in my home folder, and because most installs don't require root, I was wondering if it's a good idea to run that particular install with sudo since it seems to want to place things in /usr/share/perl6/site/doc 16:40
The reason for my hesitation is because of how running some installs with other package managers with root can cause a number of things in the home folder cache to be owned by root, causing random permission issues later 16:41
[Coke] where are you getting p6doc from? 16:45
(it's moving to a new repo, just want to make sure you're in the right place.)
Mawile Oh! I was following docs.raku.org/programs/02-reading-...TRODUCTION
And it wanted me to install zef with the package manager, but Iafter doing quite a lot of searching, I didn't find many hints about whether or not it was a good idea to run it as root 16:46
after, even
[Coke] so is the question about installing the 'p6doc' binary, or zef? 16:47
(sorry, just trying to clarify)
Mawile zef, mostly!
I've been running it without root as much as I could
But I don't know if that's a thing I even need to worry about
rypervenche Yeah, I was never able to get p6doc to install as my user because it needs to be able to create a directory as root. 16:48
[Coke] p6doc install has been broken for years, there's a ticket on it. 16:48
Mawile Ahh!
[Coke] regarding zef.. I never do it as root, but I don't share my raku with anyone. Not sure what state of the art is there.
Mawile I gotcha! 16:49
Because like, with Ruby, you can run gem as root, but if your system package manager updates your ruby install, sometimes you have to do a little bit of FS surgery
[Coke] hurls github.com/Raku/doc/issues/2896
Mawile Heck, I'm not sure how I missed that issue 16:50
Mawile Thanks for the link! 16:50
[Coke] re: p6doc; we never updated to follow the correct method of installing non-code files.
basically: you can't install it right now. Sorry.
Mawile That's okay! I can just use the doc site instead for now. 16:51
Thanks for pointing me in the right direction~ ^^ 16:52
[Coke] sure, apologies it's still borked. 16:53
Mawile That's okay! I mean, WIPs are WIPs. I'm not about to bug anyone about taking things at their own pace 16:56
I just had a fun time finding if my gut instinct of not running zef as root had any actual grounds 16:57
kawaii Is it possible to use zef to install modules from private ecosystems? We have a private cpan server at work which our perl5 guys use for proprietary stuff, does anything similar exist for raku? 17:13
[Coke] I don't know if you can have your own ecosystem, but you can definitely install directly from a URL 17:43
moritz the repository URLs are in zef's resources/config.json file. Injecting something there is likely possible 17:56
caveat: I don't know how well the data format there is documented
but it looks pretty obvious :D 17:57
curl raw.githubusercontent.com/ugexe/Pe...cpan1.json | jq . |less
[Coke] what is "jq" ? 18:54
El_Che json parser for the cli
he's pretty printing the output 18:55
codesections Woo first PR to Rakudo :D Admittedly, I added under 10 characters in two lines, but still 20:41
El_Che \o/
guifa codesections: managed it before I did :-) 20:47
codesections well, oops, not really. Looks like I managed to duplicate a small piece of something lizmat had already submitted a PR for. So much for that... 20:48
lizmat codesections++ nonetheless! 20:49
codesections But at least I have the dev environment set up now!
lizmat :-)
melezhik .tell kawaii "Is it possible to use zef to install modules from private ecosystems? We have a private cpan server at work which our perl5 guys use for proprietary stuff, does anything similar exist for raku?" I believe you might ask tony-o about that 20:51
tellable6 melezhik, I'll pass your message to kawaii
melezhik he's been doing something in this area
though I am not positive
terminatorul Hello 21:35
Is there a way please to check if a shared library is exporting some expected function name ?
The AdHoc exception thrown by NativeCall is unspecific, could mean anything, so I would like to check in adavance if the library function is there 21:38
I would use native dlopen(), but the flags argument is required and the possible values are system-specific ... so in the end I still need an XS module 21:40
timotimo if you're on moarvm as the backend, you can rely on one of libffi and dyncall being linked in, which isn't much better, but should at least not suck as much 21:41
guifa Wow. I knew refactoring CLDR would result in speed improvements but … dang. Used to take about 2 seconds to load a language. Now it’s down to about .1s 21:44
rypervenche Nice! 21:49
guifa I’ve got some ideas on how to improve it more but those are even more hideous refactors lol 21:58
sena_kun releasable6, status 23:56
releasable6 sena_kun, Next release in ≈1 day and ≈19 hours. 1 blocker. Changelog for this release was not started yet
sena_kun, Details: gist.github.com/e577708edfa3a145e5...d50694bb86