»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 May 2018.
Bowlslaw AlexDaniel: As far as I can tell, it waits on a Supply, and...does the code you type whenever the stuff in the whenever block happens 00:00
AlexDaniel if I had to summarize it in one sentence, I'd say that it does sequential processing of asynchronous events
but I'm not sure if others understand what I try to say by that
and if it's the right way to explain it 00:01
Bowlslaw it's easier then typing out .tap and all that crap
which i don't really get at all
AlexDaniel well, more importantly it .taps do something completely different 00:02
s/it//
Bowlslaw o
ok, well
AlexDaniel m: Promise.in(1).tap: { sleep ∞ }; Promise.in(2).tap: { say ‘It taps!’; exit }
camelia No such method 'tap' for invocant of type 'Promise'. Did you mean any of these?
Map
map

in block <unit> at <tmp> line 1
Bowlslaw i don't know
AlexDaniel m: Promise.in(1).Supply.tap: { sleep ∞ }; Promise.in(2).Supply.tap: { say ‘It taps!’; exit } 00:03
camelia ( no output )
AlexDaniel m: Promise.in(1).Supply.tap: { sleep ∞ }; Promise.in(2).Supply.tap: { say ‘It taps!’; exit }; sleep ∞
camelia It taps!
AlexDaniel Bowlslaw: fwiw here's a cool react example: docs.perl6.org/type/Proc::Async 00:04
00:05 jrra joined
Bowlslaw moritz has a cool example in his Perl 6 Fundamentals book using Proc::Async 00:05
00:15 BenGoldberg joined
AlexDaniel Bowlslaw: I created this ticket D#2135 00:21
synopsebot D#2135 [open]: github.com/perl6/doc/issues/2135 [docs] So what the hell is react/whenever
Bowlslaw haahhaha 00:23
i 00:24
I didn't learn it from the docs, even though i've read them multiple times
jnthn showed me a piece of code as an example
00:28 MasterDuke joined
tobs re: react whenever. I found this while tracing the sources. It's reassuring: github.com/rakudo/rakudo/blob/mast....pm6#L2033 00:36
Bowlslaw lol 00:37
00:57 markoong left 00:58 markoong joined 00:59 Xliff left
Bowlslaw AlexDaniel: Can you tell me why this doesn't work? pastebin.com/0ExeaCZD 01:00
it gets the links on the initial page, but then it doesn't get any more
i forgot a line in that paste but it still doesn't work 01:02
AlexDaniel which line? :) 01:03
AlexDaniel is installing DOM::Tiny
01:03 markoong left
Bowlslaw hehe 01:03
return if $depth <= 0;
as the first line of the sub 01:04
it just keeps getting the initial link over and over
well, it grabs the initial link for whatever the $depth value is 01:05
AlexDaniel Bowlslaw: but that's because it finds a link to / on every page 01:06
right?
Bowlslaw: remove “while $depth ≥ 0 {” line 01:08
Bowlslaw: this works: gist.github.com/AlexDaniel/50fcc38...37ed89eb0e 01:09
I mean, it crawls
it does die a bit later because of something else in HTTP::UserAgent, but you can probably debug that separately
Bowlslaw hmmmmm 01:11
oh yeah...
I must've forgotten to remove that bit from earlier 01:12
@_@
thanks
oh i see what i did to make it die 01:13
@_@ 01:14
benjikun AlexDaniel: yeah, the doc page on concurrency could be better for newbies 01:17
Bowlslaw AlexDaniel: I suppose I should clear the @links array before I use it again... 01:42
hahahhahaha
AlexDaniel Bowlslaw: why?
it's always empty when crawl is entered 01:43
01:43 ChoHag left
Bowlslaw hmmmm 01:43
well it looks like it is starting from the beginning every time 01:44
LOL it crawls the entire github repo 01:45
oh wait, that's just me being silly 01:46
it looks like it works fine except for what you mentioned 01:47
hmm 01:51
01:51 ChoHag joined
AlexDaniel Bowlslaw: honestly, if I were you I'd just use run(:out, ‘curl’, …).out.slurp 01:54
instead of HTTP::UserAgent 01:55
Bowlslaw LOL
whaaaaat
AlexDaniel that's obviously not portable, but it's much faster and will work better
Bowlslaw hmmmmmmmm
AlexDaniel buggable: eco curl 01:56
buggable AlexDaniel, Found 2 results: LibCurl, Net::Curl. See modules.perl6.org/s/curl
AlexDaniel ↑ also something that can be considered
Bowlslaw cool 01:57
yet more rewrites, haha
AlexDaniel Bowlslaw: actually, I tried rewriting your script like this: gist.github.com/AlexDaniel/4b0f0ac...21a3e459b0 01:58
but I stumbled upon this regression: github.com/rakudo/rakudo/issues/2008
and I also don't know when to close the channel :)
Bowlslaw hmmm 02:00
this is much more difficult than i thought it would be
02:01 aborazmeh joined, aborazmeh left, aborazmeh joined
AlexDaniel Bowlslaw: actually, it's not, can you try this? gist.github.com/AlexDaniel/d268f43...bb854a1c76 02:03
you'd need to catch exceptions properly, but otherwise it crawls in multiple threads 02:04
Bowlslaw hmm 02:05
oh eah, i forgot about exceptions 02:06
i definately want to implement those properly
AlexDaniel hm… but again, the channel is never closed :)
Bowlslaw why does that matter? 02:07
AlexDaniel Bowlslaw: once the website is fully crawled, the program will just sleep forever
Bowlslaw hmmm
Geth doc: 8cefbeffb6 | (Will "Coke" Coleda)++ | doc/Language/glossary.pod6
whitespace
02:10
synopsebot Link: doc.perl6.org/language/glossary
Bowlslaw gotta learn about your code 02:11
some things i haven't seen, but you did keep the algorithm it seems
02:12 imcsk8_ joined 02:13 dogbert2 joined 02:15 imcsk8 left
Bowlslaw AlexDaniel: does my script run multi-threaded? 02:16
how can I verify myself?
AlexDaniel Bowlslaw: which one?
02:16 dogbert17 left
Bowlslaw github.com/Bowlslaw/webcrawler/blo...crawler.p6 02:18
AlexDaniel Bowlslaw: no 02:19
02:19 john_parr joined
Bowlslaw then what is the react/whenever doing? 02:20
02:20 nopl left
AlexDaniel Bowlslaw: in this case nothing important 02:20
Bowlslaw: you can also write my $response = await $ua.get($url); 02:21
ah actually, you don't even need that
just my $response = $ua.get($url); will do
02:21 nopl joined
AlexDaniel if you want workers you'll need to `start` some, or use hyper/race 02:22
Bowlslaw @_@ 02:26
this is not clear at all...
AlexDaniel Bowlslaw: `react` is just a way of processing events, it does not start new threads by itself 02:27
Bowlslaw hmm 02:33
AlexDaniel Bowlslaw: here's another crude example that does it using more than one thread: gist.github.com/AlexDaniel/521c27e...d3a528718a
note that all I did was `start crawl($link, $file, $depth - 1);`
semaphore stuff is in there to prevent hundrends of threads working at the same time 02:34
maybe someone more knowledgeable can propose an easier way to do that? 02:35
02:54 aborazmeh left 03:01 stmuk_ joined 03:04 stmuk left 03:18 Bowlslaw left 03:30 CoolGuy18 joined
CoolGuy18 hello 03:30
p6: say 3;
camelia 3
CoolGuy18 p6: say 'hello'; 03:31
camelia hello
CoolGuy18 p6: say 'hell\no';
camelia hell\no
CoolGuy18 p6: say "hell\no";
camelia hell
o
CoolGuy18 bye
03:31 CoolGuy18 left
AlexDaniel byyyyyyeee 03:32
:)
03:36 Khisanth left 03:49 kaare__ left 03:52 Khisanth joined 03:56 fatguy joined
AlexDaniel squashable6: next 04:02
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 4 days and ≈5 hours (2018-07-07 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
fatguy i've been running this sample script pastebin.com/8gwgjaB3 for more than 10 days on linux system with 4GB memory 04:16
it basically just write to file with it cpu and memory usage. memory usage increase 1% daily on average 04:18
AlexDaniel fatguy: is it linear?
fatguy: but anyway, can you create a ticket? 04:38
huggable: rakudobug
huggable AlexDaniel, Report bugs on github.com/rakudo/rakudo/issues/new If you don't have access to GitHub, you can email your report to [email@hidden.address] . See also: github.com/rakudo/rakudo/wiki/rt-introduction
fatguy AlexDaniel: not constantly, here are from 20 -30 June : 0.9 1.0 0.9 1.3 1.0 1.3 0.9 0.9 1.4 0.8 1.1 (on average 1.1%)
ok
04:43 xtreak joined 04:52 curan joined 04:54 sno left 04:56 lizmat left 05:01 kaare__ joined 05:05 jmerelo joined 05:20 BenGoldberg left 05:29 wamba joined
jmerelo m: say GLOBALish.WHO 05:36
camelia GLOBAL
jmerelo m: say GLOBALish.perl
camelia GLOBAL
jmerelo m: say $*REPO.^mro 05:37
camelia ((Installation) (Any) (Mu))
05:46 fatguy left
perlawhirl hi perlers 06:13
this seems inconsistent
m: <0000 0001>».comb.say
06:13 charsbar left
camelia (() (0 0 0 1)) 06:13
perlawhirl why is IntStr 0 special 06:14
jmerelo perlawhirl: hum
perlawhirl bisectable6: <0000 0001>».comb.say
bisectable6 perlawhirl, Bisecting by output (old=2015.12 new=4bdb978) because on both starting points the exit code is 0
perlawhirl, bisect log: gist.github.com/5d15691f2e5bef5d01...aed2305ffe
perlawhirl, (2017-03-11) github.com/rakudo/rakudo/commit/d4...26bc76be53
jmerelo m: <0000 0001>.map: .comb.say
AlexDaniel 6c: <0000 0001>».comb.say
camelia No such method 'comb' for invocant of type 'Any'
in block <unit> at <tmp> line 1
jmerelo m: <0000 0001>.map: *.comb.say 06:15
camelia ()
(0 0 0 1)
committable6 AlexDaniel, gist.github.com/a98a4d6ca940bf5a17...3690f66386
AlexDaniel c: d444f655^,d444f655 <0000 0001>».comb.say
committable6 AlexDaniel, ¦d444f655^: «((0 0 0 0) (0 0 0 1))␤» ¦d444f65: «(() (0 0 0 1))␤»
AlexDaniel perlawhirl: yeah, looks like regression to me 06:16
perlawhirl: can you file a ticket?
perlawhirl sure
the things you find when trying to solve a childrens puzzle, haha 06:17
06:26 sno joined 06:29 robertle joined 06:33 fake_space_whale left 06:41 damnlie left 06:43 damnlie joined
masak perlawhirl: what puzzle is that, ooc? 06:53
06:55 lookatme joined, lookatme_q joined
jmerelo m: my %hash = { foo => { bar => baz}}; say %hash 06:55
camelia 5===SORRY!5===
Undeclared routine:
baz used at line 1. Did you mean 'bag'?

Other potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my…
jmerelo m: my %hash = { foo => { bar => 'baz'}}; say %hash
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %hash = { foo => { bar => 'baz'}}7⏏5; say %hash
{foo => {bar => baz}}
jmerelo m: my %hash = { foo => { 'bar' => 'baz'}}; say %hash 06:56
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %hash = { foo => { 'bar' => 'baz'}}7⏏5; say %hash
{foo => {bar => baz}}
jmerelo m: my %hash = { foo => { 'bar' => 'baz'} }; say %hash
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %hash = { foo => { 'bar' => 'baz'} }7⏏5; say %hash
{foo => {bar => baz}}
jmerelo m: my %hash = { foo => 'bar' => 'baz' }; say %hash
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %hash = { foo => 'bar' => 'baz' }7⏏5; say %hash
{foo => bar => baz}
06:57 lookatme_q left
jmerelo m: my %hash = ( foo => 'bar' => 'baz' ); say %hash 06:59
camelia {foo => bar => baz}
lookatme m: my %hash = %{ foo => { 'bar' => 'baz' } }; say %hash 07:00
camelia {foo => {bar => baz}}
lookatme m: my %hash := { foo => { 'bar' => 'baz' } }; say %hash 07:01
camelia {foo => {bar => baz}}
lookatme m: my %hash = { foo => { 'bar' => 'baz' } }; say %hash
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %hash = { foo => { 'bar' => 'baz' } }7⏏5; say %hash
{foo => {bar => baz}}
lookatme :)
07:04 |oLa| joined 07:13 domidumont joined 07:18 domidumont left, domidumont joined 07:27 Xliff joined
Geth doc: 155cbd0ed6 | (JJ Merelo)++ | doc/Language/hashmap.pod6
Improves text on hash assignment
07:37
synopsebot Link: doc.perl6.org/language/hashmap
07:38 pmurias joined 07:40 xtreak left 07:42 wamba left, xtreak joined 07:46 xtreak left 07:47 spycrab0 left 07:48 kaare__ is now known as kaare_ 07:50 zakharyas joined 07:52 tphilipp joined, tphilipp is now known as disc0rd_ 07:53 tphilipp joined, tphilipp left 08:01 scimon joined 08:09 xtreak joined 08:10 domidumont left 08:12 wamba joined, domidumont joined, xtreak_ joined 08:15 xtreak left 08:18 disc0rd_ left 08:35 Ven` joined 08:39 sena_kun joined 08:47 hami joined 08:55 hami left 08:58 rindolf joined
Geth doc: 5465e22449 | (JJ Merelo)++ | doc/Language/hashmap.pod6
More clarifications on hash definition
09:05
synopsebot Link: doc.perl6.org/language/hashmap
09:11 Ven` left 09:20 Ven` joined 09:27 lizmat joined 09:51 xtreak_ left 09:54 xtreak joined 10:03 zakharyas left 10:05 zakharyas joined 10:09 aborazmeh joined, aborazmeh left, aborazmeh joined 10:16 DeepIO joined 10:29 aborazmeh left 10:48 ChoHag left 10:50 p6noob left 10:51 ChoHag joined 11:00 konsolebox joined
Geth doc: Scimon++ created pull request #2137:
Modify without example
11:06
11:15 Ven` left 11:23 n1ge joined, n1ge left
lizmat weekly: perlmonks.org/?node_id=1217692 11:28
notable6 lizmat, Noted!
11:30 zakharyas left 11:31 xtreak left 11:32 eliasr joined 11:33 xtreak joined 11:40 spycrab0 joined 11:44 markoong joined 11:48 benjikun2 joined 11:49 benjikun left 11:57 Altreus_ is now known as Altreus 12:09 Ven` joined 12:10 MasterDuke left 12:13 ChoHag left
Geth doc: f60f274bab | (Simon Proctor)++ (committed using GitHub Web editor) | doc/Language/control.pod6
Modify without example

The example given for without raises an error about stringifying which seems LTA. The update displays the type of `$answer` that seems more useful as an example.
12:14
synopsebot Link: doc.perl6.org/language/control
Geth doc: 086ed9226c | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/control.pod6
Merge pull request #2137 from Scimon/master

Modify without example Thanks!
12:16 xtreak left
scimon I was just playing about with without and noticed that. 12:16
jmerelo scimon: it's awesome. Thanks!
scimon: keep playing around :-)
scimon I'll do my best. 12:23
12:25 ChoHag joined 12:30 noganex joined 12:36 jmerelo left
Geth perl6.org: hankache++ created pull request #116:
perl6intro.com supports https
12:43
perl6.org: 883bbd6321 | (Naoum Hankache)++ | 2 files
perl6intro.com supports https
12:44
perl6.org: 5eceaf3eab | (Naoum Hankache)++ (committed using GitHub Web editor) | 2 files
Merge pull request #116 from hankache/master

  perl6intro.com supports https
jkramer How would I do this correctly?
m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> $a, $b { say "a should be 0 => foo, b should be 1 => bar, instead a is $a and b is $b" } 12:45
camelia a should be 0 => foo, b should be 1 => bar, instead a is 0 foo 1 bar and b is 1 bar 2 baz
Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
jkramer This doesn't work either:
m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> ($a, $b) { say "a should be 0 => foo, b should be 1 => bar, instead a is $a and b is $b" }
camelia Too few positionals passed to '<anon>'; expected 2 arguments but got 0 in sub-signature
in block <unit> at <tmp> line 1
jnthn for flat <foo bar baz lol>.pairs.rotor(2 => -1) -> $a, $b { say "a = $a, b = $b" } 12:46
evalable6 a = 0␉foo, b = 1␉bar
a = 1␉bar, b = 2␉baz
a = 2␉baz, b = 3␉lol
12:46 kaare_ left
jkramer Ah so you flatten the whole thing first and then have the for divide it in groups of two elements 12:47
jnthn Yes
m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> [$a, $b] { say "a = $a, b = $b" }
camelia Too few positionals passed to '<anon>'; expected 2 arguments but got 0 in sub-signature
in block <unit> at <tmp> line 1
jkramer Is there no syntax that allows me to disassemble a list into elements in the signature?
jnthn Hm, I thought might do it 12:48
Though it will probably be multiple times slower than the for flat approach
jkramer I thought I could probably do something with | or * in the signature but I guess not 12:49
Yup, using the flat one, thanks :)
jnthn m: for <foo bar baz lol>.pairs.rotor(2 => -1).skip(1) -> [$a, $b] { say "a = $a, b = $b" }
camelia Too few positionals passed to '<anon>'; expected 2 arguments but got 0 in sub-signature
in block <unit> at <tmp> line 1
jnthn huh, where's the 0 coming from
timotimo m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> @ [$a, $b] { say "a = $a, b = $b" }
camelia Too few positionals passed to '<anon>'; expected 2 arguments but got 0 in sub-signature
in block <unit> at <tmp> line 1
jnthn m: dd <foo bar baz lol>.pairs.rotor(2 => -1)
camelia ((0 => "foo", 1 => "bar"), (1 => "bar", 2 => "baz"), (2 => "baz", 3 => "lol")).Seq
timotimo it's not accidentally interpreting pairs as nameds?
jnthn oh, maybe it is 12:50
timotimo m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> *%x { dd %x }
camelia Too many positionals passed; expected 0 arguments but got 1
in block <unit> at <tmp> line 1
jnthn I didn't think List.Capture did that though :/
timotimo er, of course
m: for <foo bar baz lol>.pairs.rotor(2 => -1) -> $ (*%x) { dd %x }
camelia {"0" => "foo", "1" => "bar"}
{"1" => "bar", "2" => "baz"}
{"2" => "baz", "3" => "lol"}
timotimo yeah, it's doing that
jnthn Hm. I guess it often makes some sense, but not here
masak is utterly confused by the .rotor API 12:58
"it's simple! just send in your argument as a Pair!"
timotimo multiple pairs, actually
well, potentially
masak o.O
12:59 mcmillhj joined
timotimo m: .say for (^16).rotor(2 => -1, 3 => -2, 4 => 1) 12:59
camelia (0 1)
(1 2 3)
(2 3 4 5)
(7 8)
(8 9 10)
(9 10 11 12)
(14 15)
masak kind of falls into the same bucket for me as people abusing Complex instances as 2D coordinates 13:00
tadzik Euclidean space can be pretty Complex 13:02
timotimo masak: how would you design an API like rotor's? 13:03
13:04 yqt joined
masak timotimo: I wish I had an excellent answer for that prepared 13:05
timotimo that's okay, you can point out something's bad without having a better suggestion at the ready, IMO
masak yes, but in a way I don't like doing that
Ven` .oO( clearly a RotorBeanFactoryFactory is the answer )
masak I think what I feel I'm missing is a little more clarity in terms of named arguments or something 13:06
timotimo List.rotor(Ratchet.new(2, -1), Ratchet.new(3, -2))
Ven` if I had a ratchet it'd be yours to have~
masak timotimo: still doesn't quite answer what those two positionals to Ratchet.new are -- so, same problem 13:07
timotimo .rotor(take => [2, 3], offset => [-1, -1])
masak now things are wrongly grouped :P 13:08
masak .oO( I'm here to complain and chew gum, and I'm all out of gum )
jnthn I found "2 => -1" as "take 2 items, take 1 step back" quite pleasant :) 13:09
Ven` also reads it that way
masak fair enough
jnthn I grant it's terse if you don't know that's how to read it 13:10
masak I think it's possible to both find the syntax quite pleasant _once you know it_, and to admit that it's rather unclear by default
timotimo i like this rotor api more than the previous draft that, i think, just put the numbers as individual positionals
masak ugh, agreed 13:11
but the Pairs here are used neither as hash entries nor as named arguments, just as "useful structure"
cons pairs, essentially ;)
like, if Perl 6 had a `(2, 1)` tuple syntax, we'd use that here 13:13
(and that would be a lot less arbitrary)
lizmat and the difference between a Tuple and a List being ?
Ven` Fixed size 13:14
masak yeah, guess sp
so*
timotimo not lazy 13:15
lizmat I mean, supporting a syntax like List.rotor( (2,-1),(3,-2),(4,1) ) would be easily supportable
masak a Pair has the implied semantics of "key" and "value" which .rotor doesn't care about at all
Ven` (also the typed version of a tuple would have a type per elem :P)
masak Ven`: so would a Pair, I guess
Ven` a Pair is just a 2-elems tuple, methinks
masak I mean, per .key and .value
jnthn git cherry-pick mast 13:16
gah
wrong window, then realized and enter instead of backspace :P
Ven`
.oO( spoiler! )
masak in a Pair, you're allowed to change the .value but not the .key 13:17
lizmat in a Tuple you would not be allowed to change either, in my book :-)
masak right 13:18
my point is that it's an abuse of Pair in .rotor because Pair means a lot of things that .rotor doesn't use/need/want
...but, again, I'm not up in arms about this. I'm not revolting, just openly expressing my confusion ;) 13:20
jnthn I guess it's arguably establishing a mapping between the number of steps forward and the number of steps back 13:21
13:21 Ven` left 13:22 Ven` joined
jnthn At least, I'd guess that was the thinking (I didn't design it, but that's how I'd justify such a design :P) 13:22
masak jnthn: a mapping where the keys are non-unique, then... :P
timotimo even worse, an ordered mapping 13:23
Juerd I've abused => in Perl 5 for many things that were even less pairlike
masak Juerd: yeah, but... :P
Juerd system ssh => @args;
masak Juerd: I heard in Perl 5, the `=>` is pronounced "fat comma" :P
Juerd Yep. I will probably forever remember it with that tame 13:24
s/tame/name/
Just like $ is "string", because of a$ in basic.
masak well, yeah
I mean, abuses of types isn't the end of the world either 13:26
just, you know, a possible design smell
jnthn suspects the design was more visual thinking than type thinking :)
masak as a person who evolves macros to hijack the syntax of code to do exotic things, I guess I ought to be more in favor of that kind of thing... :P 13:27
jnthn Natural langauges seem to also do similar hacks, just with sounds rather than visually. :)
13:28 kaare_ joined
masak specifically, see github.com/masak/007/issues/294#is...-392330477 13:28
(probably one of the most useful 007 issue comments of late, and well worth exposing to #perl6)
'macros are for "offsetting computation"' 13:29
13:29 skids joined
Ven` The question asked there is easy to answer: What are objects=>Objects are a poor man's closure! 13:30
jnthn Me: Wait, what on earth happened there where we declined that guys name? Teacher: Oh, his name sounds like a plural word, so we just applied the plural declension rules. :P
Makes zero sense in terms of semantics, but sometimes the phonetics win, I gues. :) 13:31
masak Ven`: your colors are showing :P
Ven` (I (don't know) what (you mean)) 13:32
masak :P
13:32 zakharyas joined
masak .oO( Kirkegaard's LISP: everything is an expression of despair ) 13:32
masak .oO( sorry, your name was plural, so it has been declined ) 13:35
Ven` applying a declension rule in french is "decliner" :P.
masak we're inclined to decline 13:36
masak .oO( when the playing field is not even, you're inclined towards Lean methods ) 13:38
13:42 wamba left
jnthn
.oO( A methodology from Pisa... )
13:42
jkramer Is there a way to get a Capture of the arguments the current sub was called with in order to pass it on to another sub? 13:43
I basically want something like callwith, but I want to keep the arguments and change the sub/method/object instead :) 13:44
jnthn |c 13:45
In the signature
c will be a Capture
masak m: sub foo(|c) { say c.^name }; foo(1, 2, 3)
camelia Capture
jkramer jnthn: Yeah but I still want to use positional and named parameters in the sub :) 13:46
13:46 noganex left
jkramer More like: foo($x, $y, :$z) { say $x; bar(get-capture-somehow); } 13:47
13:47 noganex joined
jnthn No, there's not a way to do that 13:47
But you can write `sub foo(|c ($x, $y, :$z)) { say $x; bar(|c) }` 13:48
jkramer Ok, thanks :)
Oh ok that does the job :)
jnthn That is, take the caputre and unpack it too
The underlying issue here is that various important opts rely on us being able to opt the Capture away 13:49
We actually look for the use of callsame and friends to know that we can't do it
But otherwise, we require it to be made explicit that it's wanted 13:50
13:50 curan left 13:59 wamba joined
pmurias nblogs.perl.org/users/pawel_murias/2...pdate.html - truffle backend blog post 14:20
lizmat pmurias: already listed for the weekly :-) 14:21
14:21 Ven` left 14:30 Ven` joined 15:03 turdmonkey joined 15:05 turdmonkey is now known as Bowlslaw
Bowlslaw Good morning, everyone. 15:05
masak \o 15:06
15:07 noganex_ joined 15:08 Khisanth left 15:10 noganex left 15:13 zakharyas left 15:16 zakharyas joined 15:18 jmerelo joined 15:21 Khisanth joined
moritz o/ 15:27
jmerelo moritz: hi!
Ven` \o
15:32 yqt left 15:36 zakharyas left 15:39 damnlie left, damnlie joined
Xliff \o 15:40
yoleaux 09:09Z <jnthn> Xliff: Thanks, it's fixed now :)
15:42 psychoslave joined, reportable6 joined 15:45 benjikun joined
Xliff ===SORRY!=== 15:46
Probable version skew in pre-compiled 'site#sources/F726BBCA8E1B0C2F39831AD4BD03281DBAF878F2 (OpenSSL::Bio)' (cause: no object at index 2107)
^ Anyone know what might cause this?
15:46 benjikun2 left 15:48 SHODAN joined
jkramer Out of curiosity, is there a way to extract the values from a junction and use it as some kind of grep? 15:51
Probably not
15:52 sno left 15:53 psychoslave left
buggable New CPAN upload: FindBin-0.1.8.tar.gz by LEMBARK modules.perl6.org/dist/FindBin:cpan:LEMBARK 15:54
15:55 domidumont left 15:57 zakharyas joined 15:58 zakharyas left 16:01 psychoslave joined, zakharyas joined
moritz jkramer: there are workarounds, but it's designed to make it hard, because if you use a junction that way, you're misusing it 16:02
16:03 robertle left, MilkmanDan left
Ven` There's an item in the FAQ about that, if you *really really* want to. 16:04
16:05 MilkmanDan joined
Ven` I suppose it could be useful for e.g. a testing library... 16:05
lizmat so do we have an official page for the processed results of the perl 6 survey, or just the raw Google data one ?
16:07 scimon left
Ven` The page docs.perl6.org/features links to a "'features' method" which 404s. MMhh 16:08
Sounds like that page shouldn't even exist.. 16:09
16:11 psychoslave left 16:13 bwisti joined
Bowlslaw I'm learning how to implement Perl 6's multi-threaded capabilities by making a web crawler. Can anyone tell me why this version seems to sleep after going through just 1 iteration of the depth? gist.github.com/Bowlslaw/fb16404d5...3a23ebde86 16:20
I've been going over this for a while and I cannot find any reason
Maybe the channel isn't closed?
IF so, why isn't it iterating the correct depth?
jmerelo lizmat: not yet. 16:21
lizmat: I should prepare one, I guess.
Bowlslaw Hmm, actually, it is still going, but it sat for a around 10 mins with no feedback...
Wait a minute... 16:22
moritz Bowlslaw: I think you can scrap the react { whenever .. } thingy
just do 16:23
jkramer moritz: Ven` I don't really need/want to. :) I was just trying to think of a nice way to say "if any of $x, $y or $z equal 5, set them to 10" or something like that
moritz my $response = $ua.get(url)
jkramer I guess map will have to do, but it feels wrong to map over 2-3 values in seperate variables :)
moritz jkramer: for $x, $y, $z { $_ = 10 if $_ == 5 } 16:24
Bowlslaw: and you get parallel execution from having a worker pool
jkramer moritz: That's even worse than map :D 16:25
moritz Bowlslaw: but there is another problem: you never close the channel
jkramer: why? I like it :-)
jkramer m: my $x = 5; my $y = 10; ($x, $y).=map: { $_ == 10 ?? 15 !! $_ }
camelia ( no output )
jkramer m: my $x = 5; my $y = 10; ($x, $y).=map: { $_ == 10 ?? 15 !! $_ }; say $x; say $y:
camelia 5
15
jkramer There's probably even shorter ways 16:26
moritz m: my ($x, $y) = 5, 15; for $x, $y { when 5 { $_ = 10 } }; say [$x, $y]
camelia [10 15]
Bowlslaw moritz: Hm, yes, I think I can close the channel at the last line of the sub. I aso need to keep track of URLS which have been seen already 16:30
moritz Bowlslaw: which sub? 16:31
Bowlslaw crawl 16:32
moritz but crawl is called for each URL
Bowlslaw hmmm
moritz that would close the channel after the first URL has been processed 16:33
jnthn moritz: Thing is, crawling is primarily a concurrent, not a parallel problem.
moritz jnthn: using something asynchronous like Cro might be a better solution, yes :-)
jnthn Well yes, that'd get better throughput too in terms of doing async I/O rather than spawning a bunch of worker threads. 16:34
Bowlslaw I still have your example with Cro, jnthn
moritz but I think Bowlslaw is trying to learn working with Perl 6's primitives, so I'm trying to explain where this one breaks down
jnthn But a react-based solution helps solve the termination problem
moritz which is surprisingly nasty with the channel solution :-) 16:35
Xliff jnthn: Yes. Another Cro convert here, as you well know.
Although I am working on the Client side, atm.
jnthn moritz: Yes, I know 'cus I tried to write an example with Channel as a comparison while preparing a talk, got it wrong three times and then gave up :P
(Was on a bit of a time budget to prepare the talk, of course. :-)) 16:36
Bowlslaw jnthn: does Cro have a way to match urls without using a regex? For example, I like DOM::Tiny because I can write `for $dom.find('a[href]') -> $e` and have my links 16:37
timotimo personally, i'd consider that outside of cro's problem domain 16:38
jnthn Bowlslaw: No, parsing HTML is out of scope for Cro. No reason you can't use DOM::Tiny to do that though, just grab the body
I'll maybe re-work it to use that for the next time I do that talk :)
Bowlslaw cool, thanks
16:39 domidumont joined
Bowlslaw What is Cro's problem domain? Why is it better than HTTP::UserAgent for a crawler? 16:39
Xliff HTTP::UserAgent is fine, but it has issues. Also, it's not passing its tests. You have to force install.
Because that's what I am migrating from. The key to a crawler is you need a proper implementation of the protocol.
And HTTP::UserAgent has problems, atm. 16:40
Bowlslaw Yes, I did have to force the install...
Xliff Don't get me wrong... it works.
However, it's not consistent.
And that's exactly what you DON'T want in a crawler.
moritz Bowlslaw: HTTP::UserAgent is mostly a port of a Perl 5 library; Cro was designed from scratch for Perl 6, and uses Promises and react etc. to full advantage 16:41
jnthn I don't know HTTP::UserAgent's feature set, though for a crawler usually one wants to do the requests concurrently, and many are to the same server so you want persistent connections. I've no idea if HTTP::UserAgent can do those.
moritz Cro::HTTP that is
jnthn But my point wasn't so much "use Cro" as "use react" :)
timotimo cro was designed as a framework to build microservices, and the http client is in big part to communicate with other microservices, among other things with ones you made in cro to be part of your application, i think 16:42
16:42 mcmillhj left
timotimo i'm not involved in the cro design or development, though 16:42
so take it with a grain of salt
AlexDaniel jnthn: so in that web crawler example, is there anything preventing it from doing thousands of requests at the same time?
jnthn AlexDaniel: No; I already mentioned that when I originally posted it :)
timotimo communicating between microservices in HTML sounds like a bad idea; you'd rather use a data serialization format like json, or messagepack, or something 16:43
Xliff timotimo: HTTP is just used as the communication method
jnthn AlexDaniel: Though it'd not be too tricky to modify it to throttle, and I'm open to giving Cro's HTTP client a "maximum concurrent connections" setting so people don't have to repeatedly re-solve this problem :)
timotimo Xliff: i don't think i said anything against that? 16:44
16:46 Ven` left 16:48 mcmillhj joined
Bowlslaw jnthn: Well, I would definitely use that. 16:50
Does there exist a solution for it currently, though?
16:53 mcmillhj left
Bowlslaw `Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 64, uncaught_handler => Callable), 16:54
status => PromiseStatus::Planned)
can't i set max_threads to something less?
jnthn I'd probably do it by pushing new links into an array, keep a count of in-flight requests, and each time one completes see if we need to start crawling more 16:55
Gotta go cook/eat; bbl :) 16:56
jkramer moritz: I had something like this in mind :) dpaste.com/100PDT3.txt
Bowlslaw thanks for the help guys 16:57
17:00 mcmillhj joined 17:01 zakharyas left
Ulti naw tux isn't here, he could share in my misery of finding \r\r\n as the line terminator in this CSV 17:02
17:05 mcmillhj left 17:13 mcmillhj joined 17:26 rindolf left, MilkmanDan left 17:28 MilkmanDan joined 17:33 rindolf joined
Bowlslaw AlexDaniel: I really like your issue on the react/whenever docs, haha 17:51
I can't agree more.
Also, the current examples in the docs for concurrent and async seem somewhat contrived and unrealistic. 17:52
Geth rakudo.org: 5c806a7a55 | (Zoffix Znet)++ | assets/sass/main.scss
Add accordion collapse markers

Closes github.com/perl6/rakudo.org/issues/5
Bowlslaw It's difficult for me to take that and apply it to something pactical.
17:52 zakharyas joined
Bowlslaw Especially coming from 0 experience with that type of programming. 17:52
17:56 sno joined 17:58 obfusk joined
Geth rakudo.org: 145883ae7b | (Zoffix Znet)++ | 3 files
[REAPP] Add link to posts RSS feed

Fixes github.com/perl6/rakudo.org/issues/4
17:59
18:05 wamba left 18:06 zakharyas left 18:12 wamba joined 18:21 lizmat left 18:27 sauvin left 18:29 konsolebox left 18:38 |oLa| left 18:40 zachk joined, zachk left, zachk joined 18:45 ilogger2 joined, ChanServ sets mode: +v ilogger2 18:56 fake_space_whale joined 18:57 Zoffix joined
Zoffix Anyone on MacOS? What's the equivalent of `sudo apt-get install build-essential git` ? Need it for from-sauce rakudo installation instructions 18:57
18:57 lizmat joined 19:02 lizmat left
hobbs it involves signing a contract in blood to be allowed to install xcode, I believe. 19:05
jmerelo .tell lizmat I have updated the front page of the survey repo with links to all charts perl6.github.io/p6survey/ 19:08
yoleaux jmerelo: I'll pass your message to lizmat.
moritz hobbs: I think if you have homebrew installed, it's not so bad; but I have not much experience myself
mcmillhj Zoffix: xcode-select --install I think 19:13
Zoffix mcmillhj: xcode-select --install what? I presume here's no build-essential package 19:16
hobbs xcode is basically build-essential :) 19:17
mcmillhj Zoffix: pretty much, the xcode cli has a lot of the core stuff from build-essential. 19:29
homebrew has everything else
Zoffix Well, I need something I can write down for users to use. 19:31
19:31 Possum joined
Zoffix The exact commands. 19:32
SmokeMachine Zoffix: `xcode-select --install` is probably what you want... 19:35
Zoffix SmokeMachine: and that installs git? 19:36
SmokeMachine yes
Zoffix ok
Thanks. 19:37
geekosaur it installs over 2GB of crap, including compilers, git, dtrace toolkit, lots of other stuff
SmokeMachine you'll have to click in a alert window
geekosaur actually that one shouldn;t install the gui, I hope
moritz so about half as much as an "ng init" :-)
19:39 lizmat joined
Zoffix gesus 19:39
and `perl` too? Or is that comes pre-installed with it? 19:40
s/it/MacOS/;
geekosaur it's in the base system 19:41
Zoffix cool 19:43
lizmat B++ 19:52
Zoffix B?
lizmat Belgium
(soccer :-)
Zoffix Ah :) 19:53
sena_kun .seen hankache
yoleaux I saw hankache 27 Jun 2018 14:14Z in #perl6: <hankache> AlexDaniel thanks, I'll work on them asap
sena_kun .seen hankache_
yoleaux I saw hankache_ 17 Feb 2017 19:07Z in #perl6: <hankache_> IOninja ok i'll update it
Juerd lizmat: Cannot resolve caller postfix:<++>(Int); the following candidates match the type but require mutable arguments: (Mu:D $a is rw) (Int:D $a is rw) ... 19:54
lizmat weird, there are at least 11 candidates active :-) 19:55
Juerd lizmat: The following do not match for other reasons: ... :D
19:58 kjk joined
Geth rakudo.org: f172560a84 | (Zoffix Znet)++ | 3 files
[REAPP] Improve install instructions for WSL

Couldn't figure out how to work in the `execstack` business while keeping the `--gen-more` configure option, so I split up the instructions to clone/build nqp/MoarVM manually
19:58
rakudo.org: 4dbdd3c8ad | (Zoffix Znet)++ | templates/_from-source-prereqs.html.ep
[REAPP] List MacOS stuff in prereqs
20:04
20:04 Zoffix left
kjk is there anything I can do about some methods showing up as <anon> in .^methods? I really want to know their names. If it's just a chore of filling in the names somewhere in perl6, I'll volunteer it! I just need someone to show me how... 20:06
20:07 |oLa| joined 20:09 psychoslave joined, Zoffix joined
Zoffix kjk: a lost of the `anon` stuff are the methods from BOOTSTRAP.nqp (you can call .file/.line on the Method objects to find where they are). A wild guess is the names will become proper names if you add them to subs that are being added, like here: /src/Perl6/Metamodel/BOOTSTRAP.nqp 20:11
like instead of `sub ($self) {` in `Attribute.HOW.add_method(Attribute, 'has_accessor', nqp::getstaticcode(sub ($self) {`, you'd write `sub has_accessor ($self) {`
I guess I can try if that fixes the problem right now 20:12
hm, now that I think of it, that's probably ain't gonna fix anything :) 20:13
"Serialization Error: missing static code ref for closure 'has_accessor'" :D 20:14
kjk also it seems those <anon> that are ForeignCode don't have .file and .line
Zoffix m: my $m := Attribute.^methods.head; use nqp; nqp::setcodename(nqp::getattr($m, ForeignCode, '$!do'), 'meows'); dd $m.name 20:19
camelia "meows"
kjk hmm, so it looks like when "add_method" is used to add a method, it's already provided with the name of the method as a string..., in theory, there should be a way to add that information as the method name, right?
Zoffix m: my $m := Attribute.^methods.head; use nqp; nqp::setcodename(nqp::getattr($m, ForeignCode, '$!do'), 'meows'); Attribute.^methods.head.say
camelia meows
Zoffix kjk: yeah, maybe try doing something with ^ that inside github.com/rakudo/rakudo/blob/mast...qp#L16-L42 ? 20:20
20:21 |oLa| left
kjk Zoffix: thanks, I'll need to learn nqp first..., is there a guide on how to get started on hacking perl6 with nqp? 20:25
Zoffix huggable: internals course 20:26
huggable Zoffix, Rakudo/NQP Internals Course: github.com/edumentab/rakudo-and-nq...s-workshop
Zoffix kjk: there's that ^
kjk: there are also a couple tutorials on rakudo.party/ Just search the home page for "Core hacking" and should find all the articles 20:27
kjk Zoffix: good stuffs! thanks 20:29
20:34 charsbar joined 20:44 pmurias joined 20:45 dct joined
Zoffix kjk: well, I tried plugin nqp::setcodename but it's not doing the trick. Looks like a lot of these objects are BOOTCode and not ForeignCode when they're passing through .add_method. I tried sticking nqp::hllizefor($code_obj, 'perl6'), but that still didn't help it. Out of ideas now. You may want to catch jnthn and ask him for some tips :) 20:45
\o
20:45 Zoffix left
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/07/02/...-surveyed/ 20:51
sena_kun lizmat++ 20:52
sjn nice! 20:59
sjn reads
AlexDaniel squashable6: next 21:00
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 3 days and ≈12 hours (2018-07-07 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
AlexDaniel lizmat: oh, forgot to mention that Saturday is squashathon time again
lizmat AlexDaniel: what is the theme this time ?
AlexDaniel lizmat: perl6 docs 21:01
so github.com/perl6/doc/issues
lizmat AlexDaniel: added 21:04
AlexDaniel lizmat: thanks! ♥
El_Che oh, lizmat 21:06
you fell into the reddit trap again :)
with the usal suspects
lizmat what did I do now ?
El_Che you got into a discussion with chromatic 21:07
lizmat and I apologised and he accepted my apology
El_Che not "a" discussion, but the same as always :)
lizmat end of discussion
El_Che not there yet in the thread
skimming
21:08 |oLa| joined
lizmat it references another thread 21:08
AlexDaniel A citation index is calculated for each module in the Perl6 Ecosystem, numbering 1111 as of 2018-07-01. 21:09
( finanalyst.github.io/ModuleCitation/ )
1111 modules? :)
21:10 MasterDuke joined
lizmat it's from a little while ago, afaik 21:10
21:16 sauvin joined 21:33 pmurias left 21:34 Zoffix joined
Zoffix lizmat: FWIW, the Squashathon will be in July, not August :) 21:34
and 7ths, noth 6ths 21:35
AlexDaniel also it's -12…+14 so maybe just saying July 7th is enough 21:37
Zoffix refers to that period as "Saturday, all timezones" :) 21:39
lizmat++ # good weekly. Lots of conf talks!
21:40 Zoffix left 21:52 mcmillhj joined 21:53 raschipi joined 21:56 dct left 21:57 psychoslave left 22:06 mcmillhj left
lizmat Zoffix: fixed 22:10
22:10 stee3 joined 22:21 mcmillhj joined 22:26 mcmillhj left 22:46 |oLa| left 22:51 skids joined 22:52 mcmillhj joined 22:56 mcmillhj left 23:09 mcmillhj joined 23:13 mcmillhj left 23:16 turdmonkey joined 23:17 turdmonkey is now known as Bowlslaw 23:21 benjikun2 joined 23:32 Xliff joined 23:39 mcmillhj joined 23:40 benjikun2 is now known as benjikun 23:44 mcmillhj left
Xliff I am so glad I use Chromium when I am on Linux. Most reddit links do not work for me. 23:45
23:57 mcmillhj joined