Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-08-29

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 Zoffix zoll: you could look through an archive: https://www.nntp.perl.org/group/perl.perl6.users/
00:04 mcmillhj joined #perl6
00:04 Zoffix Prolly not many under-the-hood discussions, 'cause I was never compelled to join it :)
00:04 zoll thanks; will do.
00:05 andreoss Zoffix: https://github.com/andreoss/nqp/commit/2ef0f8e039cd6932c04ecc7b3421e60f65579bc3
00:14 skids RT#130634 and RT#124749 can be combined, if someone has RT perms to do that.
00:14 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130634
00:14 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=124749
00:15 Sgeo_ joined #perl6
00:20 mcmillhj joined #perl6
00:21 Zoffix andreoss: looks good, though the check for `stdin().t()` can probably be moved into `elsif !@a`, so we only do it once, something like `elsif !@a { $result := stdin().t() ?? self.interactive(|%adverbs) !! self.evalfiles('-', |%adverbs) }`
00:21 Zoffix andreoss++
00:21 Zoffix skids: what's your RT email? I'll give yuo perms
00:27 grondilu joined #perl6
00:27 grondilu sub (--> 0|1) { 0 }() # I was expecting this to work for some reason
00:28 grondilu can't we use Junctions as return types?
00:28 Zoffix skids: I think you already have perms
00:28 raschipi joined #perl6
00:28 Zoffix grondilu: not as literals, no
00:29 skids Yeah RT's interface has it in for me... others have tried to fix my perms up for other stuff to no avail.
00:29 Zoffix m: subset Binary of Int where * === 0|1; sub (--> 0|1) { 0 }().say
00:29 camelia rakudo-moar ab69dc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Malformed return value?at <tmp>:1?------> 3inary of Int where * === 0|1; sub (--> 07?5|1) { 0 }().say?»
00:29 skids Though... maybe it's just hiding somewhere in the UI.
00:29 Zoffix m: subset Binary of Int where * === 0|1; sub (--> Binary) { 0 }().say
00:29 camelia rakudo-moar ab69dc: OUTPUT: «0?»
00:29 Zoffix m: subset Binary of Int where * === 0|1; sub (--> Binary) { 42 }().say
00:29 camelia rakudo-moar ab69dc: OUTPUT: «Type check failed for return value; expected Binary but got Int (42)?  in sub  at <tmp> line 1?  in block <unit> at <tmp> line 1??»
00:30 Zoffix skids: what happens if you go to this page https://rt.perl.org/Ticket/ModifyLinks.html?id=124749 and paste 130634 into "Merge into" and click "Save changes"?
00:31 skids I get redirected to SelfService
00:31 grondilu m: suset Bin of Int where { $_ ~~ 1|0 }; sub (--> Bin) { "foo" }()
00:31 camelia rakudo-moar ab69dc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Two terms in a row?at <tmp>:1?------> 3suset Bin of Int7?5 where { $_ ~~ 1|0 }; sub (--> Bin) { "f?    expecting any of:?        infix?        infix stopper?        postfix?        stat…»
00:31 grondilu m: subset Bin of Int where { $_ ~~ 1|0 }; sub (--> Bin) { "foo" }()
00:31 camelia rakudo-moar ab69dc: OUTPUT: «Type check failed for return value; expected Bin but got Str ("foo")?  in sub  at <tmp> line 1?  in block <unit> at <tmp> line 1??»
00:33 Zoffix skids: no idea. I see the email you gave me listed in the BugAdmin group. Try talking with [Coke], perhaps he would know more
00:33 skids I think [Coke] has tried to fix that before.
00:33 Zoffix :(
00:34 skids Maybe due to my bitcard id not being my email?
00:34 Zoffix I merged the tickets.
00:34 skids Thanks :-)
00:34 Zoffix skids: maybe. I'm totally unfamiliar with how this hole thing works, unfortunately :)
00:35 skids .oO(RT needs github OAUTH, it's all the rage :-)
00:38 raschipi Does anyone have an opinion on OAUTH 2?
00:39 skids I've been avoiding all web sso responsibilities by being the one willing to wrangle FreeRADIUS, to be honest.
00:42 Kyo91_ joined #perl6
00:45 Technaton joined #perl6
00:58 andreoss https://github.com/perl6/nqp/compare/master...andreoss:non-tty
00:59 andreoss Zoffix: for some reason i have commit-bit for nqp
01:00 andreoss so I could merge it myself
01:13 snarkyboojum joined #perl6
01:26 piojo joined #perl6
01:50 go|dfish joined #perl6
01:51 ilbot3 joined #perl6
01:51 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:09 Xliff_ Zoffy: Your "hole" is missing the 'w'
02:09 Xliff_ <- speling nazi
02:09 Xliff_ (pun intended)
02:14 mr_ron joined #perl6
02:22 AlexDaniel buggable: bugs
02:22 buggable AlexDaniel, Total: 1681; BUG: 1093; UNTAGGED: 398; LTA: 177; NYI: 94; REGEX: 65; RFC: 59; JVM: 58; CONC: 53; TESTNEEDED: 44; REGRESSION: 32; PERF: 28; UNI: 28; SEGV: 26; IO: 22; NATIVECALL: 22; @LARRY: 21; POD: 21; TODO: 18; PRECOMP: 14; OO: 12; BUILD: 11; TESTCOMMITTED: 11; OPTIMIZER: 10; STAR: 7; BOOTSTRAP: 5; PARSER: 5; REPL: 5; GLR: 4; MATH: 4; OSX: 4; WEIRD: 3; WINDOWS: 3; RT: 2; SPE
02:23 AlexDaniel hm, how often does it update? We should have >10 bugs less now
02:23 risou_awy joined #perl6
02:29 AlexDaniel buggable: bugs
02:29 buggable AlexDaniel, Total: 1681; BUG: 1093; UNTAGGED: 398; LTA: 177; NYI: 94; REGEX: 65; RFC: 59; JVM: 58; CONC: 53; TESTNEEDED: 44; REGRESSION: 32; PERF: 28; UNI: 28; SEGV: 26; IO: 22; NATIVECALL: 22; @LARRY: 21; POD: 21; TODO: 18; PRECOMP: 14; OO: 12; BUILD: 11; TESTCOMMITTED: 11; OPTIMIZER: 10; STAR: 7; BOOTSTRAP: 5; PARSER: 5; REPL: 5; GLR: 4; MATH: 4; OSX: 4; WEIRD: 3; WINDOWS: 3; RT: 2; SPE
02:29 noganex_ joined #perl6
02:42 Kyo91_ joined #perl6
02:45 yoleaux joined #perl6
02:55 samcv andreoss, does that PR for tty, have you run roast tests against it?
02:55 samcv i would think it would break our tests which test the response from the REPL
02:55 AlexDaniel I think these tests were already removed in https://github.com/perl6/roast/commit/4170c5db167d5909039312f72c9191ce501f0ffe
02:56 AlexDaniel actually, they were moved to https://github.com/rakudo/rakudo/commit/ffd87fe5f8d04e7b0aeccb897ec53eb6b29ab951
03:05 mcmillhj joined #perl6
03:21 mcmillhj joined #perl6
03:37 mcmillhj joined #perl6
03:53 mcmillhj joined #perl6
03:55 Cabanossi joined #perl6
03:58 skids joined #perl6
04:05 llfourn joined #perl6
04:08 mcmillhj joined #perl6
04:10 vendethiel- joined #perl6
04:14 snarkyboojum joined #perl6
04:19 mcmillhj joined #perl6
04:26 Cabanossi joined #perl6
04:38 piojo joined #perl6
04:39 cdg joined #perl6
04:43 Kyo91_ joined #perl6
05:02 census joined #perl6
05:05 nadim joined #perl6
05:15 firefish5000 joined #perl6
05:20 firefish5000 p6: say( 'apple'.match(/[ap||a] | [apples||apple]/) );   say( 'apple'.match(/[ap|a] | [apples|apple]/) );
05:20 camelia rakudo-moar ab69dc: OUTPUT: «?ap???apple??»
05:20 firefish5000 I expected apple to be printed both times. What am I missing?
05:23 firefish5000 From my current understanding, The first one should match 'ap' successfully. And then check ['apples' which fails, then 'apple' which should succeed]. Then 'ap' | 'apple' should be compared and the longest match 'apple' should be returned no?
05:35 firefish5000 probably bug #116893
05:35 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=116893
05:35 gdonald joined #perl6
05:38 firefish5000 Nope, not literal string specific.
05:39 firefish5000 p6: say( 'apple'.match(/ [..||.] | [......||.....]/) );
05:39 camelia rakudo-moar ab69dc: OUTPUT: «?ap??»
05:45 firefish5000 The condition to trigger this seems to be First side succeeds. And First option of second side fails.
05:48 firefish5000 p6: say( 'succeed'.match(/ suc | [fail||succeed]/) );
05:48 camelia rakudo-moar ab69dc: OUTPUT: «?suc??»
05:55 snarkyboojum joined #perl6
06:02 firefish5000 nqp: say( 'succeed' ~~ / suc | [fail||succeed]/);
06:02 camelia nqp-moarvm: OUTPUT: «suc?»
06:08 lowbro joined #perl6
06:08 lowbro joined #perl6
06:10 wamba joined #perl6
06:10 piojo m:  say "abcd5" ~~ / . | . | .. | ..\d /
06:10 camelia rakudo-moar ab69dc: OUTPUT: «?ab??»
06:11 piojo firefish5000: the original bug report is just wrong. I think it's the same bug, but it doesn't just apply to literal strings
06:14 firefish5000 Thanks piojo. Good to know, though unfortunate since it restricts the usefulness of the longest matching alternation.
06:15 mcmillhj joined #perl6
06:18 ParsonsNose joined #perl6
06:22 firefish5000 I think these still may be separate issues. Seems to me that the longest alternation, in your case, is preferring ones with the earliest match in the sting. This may be intended, depending on how you interpret #5 on https://design.perl6.org/S05.html#Overview
06:23 sena_kun joined #perl6
06:23 firefish5000 That is, since 'a', the first letter matched, it seems it is ignoring all matches after it that don't also match the first letter. Even if it is longer
06:24 mcmillhj joined #perl6
06:26 piojo firefish5000: I don't think #5 should have any effect, since that list is based on tie breaking--it should stop at #2 based on longest matched text
06:30 mcmillhj joined #perl6
06:30 firefish5000 True, but then again, when looking at a regex. I normally expect it to start at the first match. Consider the same regex with a quantifier (as it is in the bug). If it actually preferred the longest match over earliest matching char, then quantified regexes would have a lot more backtracking to do.
06:32 firefish5000 piojo, I think that that this is just a case of insufficient documentation, or perhaps we skipped something in the docs. But it conforms to my limited understanding of regexes
06:34 leont joined #perl6
06:35 piojo firefish5000: how are you reading it? To me, it looks like the way you sort a list of tuples:
06:36 piojo $a[0] ne $b[0] ?? $a[0] <=> $b[0] !! $a[1] ne $b[1] ?? $a[1] <=> $b[1] !! ...
06:36 piojo pardon my mix of perl5 and 6 syntax
06:36 piojo tie breaking logic will stop at the first obvious non-tie.
06:41 Cabanossi joined #perl6
06:43 Kyo91_ joined #perl6
06:47 mr-foobar joined #perl6
07:26 Cabanossi joined #perl6
07:30 trone joined #perl6
07:33 zakharyas joined #perl6
07:34 dakkar joined #perl6
07:42 leont joined #perl6
07:42 rindolf joined #perl6
07:46 ufobat joined #perl6
07:56 araraloren_ joined #perl6
08:01 cschwenz joined #perl6
08:03 jonas1 joined #perl6
08:11 snarkyboojum joined #perl6
08:15 wamba joined #perl6
08:16 ufobat joined #perl6
08:36 ParsonsNose joined #perl6
08:40 cdg joined #perl6
08:44 Kyo91_ joined #perl6
08:52 zakharyas joined #perl6
08:54 robertle_ joined #perl6
09:07 sena_kun joined #perl6
09:24 Sgeo joined #perl6
09:35 margeas joined #perl6
09:35 AlexDaniel ? Community Bug SQUASHathon http://blogs.perl.org/users/zoffix_znet/2017/08/youre-invited-community-bug-squashathon.html
09:42 piojo AlexDaniel: Nice! I've been wanting to file a couple perl doc bugs
09:43 Kyo91_ joined #perl6
09:43 Skarsnik joined #perl6
09:44 piojo Oh, is that project separate from where perl6 documentation bugs would be filed?
09:45 AlexDaniel piojo: no, it's the same repo
09:46 piojo I wanted to request that the doc maintainers mention what :my and :our do inside regexes. And the matching order for proto regexes would be nice--that's specified in the S05 design doc, but it would be helpful in the official documentation as well
09:46 AlexDaniel piojo: feel free to file some bug reports. And also come this Saturday, we have virtual pizza :)
09:46 piojo AlexDaniel: thanks. would that be filed with rakudobug or github?
09:47 AlexDaniel piojo: here: https://github.com/perl6/doc/issues
09:47 piojo thanks
09:48 Skarsnik helllo
09:49 Skarsnik virtual pizza? x)
09:49 piojo I am down for virtual pizza!
09:50 * lizmat clickbaits https://p6weekly.wordpress.com/2017/08/28/2017-35-serving-cro/
09:50 Skarsnik damn I clicked
10:00 timotimo ha-ha! we got you now!
10:01 AlexDaniel .oO( mmmm ???? )
10:01 sena_kun just as planned!
10:01 AlexDaniel .tell Zoffix I'll make a bot for the event
10:01 yoleaux AlexDaniel: I'll pass your message to Zoffix.
10:06 timotimo a bot that celebrates each closed bug on channel?
10:06 wamba joined #perl6
10:08 APic ?
10:09 stmuk_ joined #perl6
10:15 Zoffix .
10:15 yoleaux 10:01Z <AlexDaniel> Zoffix: I'll make a bot for the event
10:16 Zoffix AlexDaniel: great :) Can it have a .pizza (or similar) command that gives a random slice of pizza? The flyer promised free virtual pizza
10:19 Zoffix .ask risou \o is there any way you could disable your change-nick-on-away feature? It leaves quite a footprint in the channel: http://i.imgur.com/PXZtZF4.png
10:19 yoleaux Zoffix: I'll pass your message to risou.
10:21 Zoffix Xliff_: which hole?
10:23 snarkyboojum joined #perl6
10:26 Zoffix Xliff_: oh *phew* the one on IRC :) Glad I don't need to change anything
10:46 gdonald joined #perl6
10:48 * [Coke] comes back to scroll filled with risou changing their name.
10:48 Ulti just got this working locally https://github.com/bduggan/p6-jupyter-kernel
10:48 [Coke] risou: why do you keep renaming?
10:48 * [Coke] sees that the very last part of scroll deals with this. *sigh*. :)
10:51 Geth ¦ doc: 46516eb2d8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Programs/00-running.pod6
10:51 Geth ¦ doc: Remove `bare` RAKUDO_LINE_EDITOR
10:51 Geth ¦ doc:
10:51 Geth ¦ doc: It ended up being removed in favour of a better solution in:
10:51 Geth ¦ doc: https://github.com/perl6/nqp/commit/5bec212105
10:51 Geth ¦ doc: review: https://github.com/perl6/doc/commit/46516eb2d8
10:53 itaylor57 joined #perl6
10:54 ShalokShalom joined #perl6
10:58 risou joined #perl6
11:00 risou sorry, it seem that my tiarra's config something wrong...
11:00 yoleaux 10:19Z <Zoffix> risou: \o is there any way you could disable your change-nick-on-away feature? It leaves quite a footprint in the channel: http://i.imgur.com/PXZtZF4.png
11:01 Zoffix Thanks :)
11:02 andreoss joined #perl6
11:03 andreoss m: module Foo {module Bar is export {sub foo($) is export {1}}}; import Foo; say foo(1);
11:03 camelia rakudo-moar d8958f: OUTPUT: «1?»
11:03 risou I leave channels and check my config. I'm sorry for disturbing you.
11:03 risou left #perl6
11:06 andreoss m: module Foo {module Bar is export {sub foo($) is export {1}}}; import Foo::Bar; say foo(1);
11:06 camelia rakudo-moar d8958f: OUTPUT: «1?»
11:06 lizmat https://news.ycombinator.com/item?id=15123054 # mi.cro.services on HN
11:07 andreoss m: module Foo {module Bar {sub foo($) is export {1}}}; import Foo; say foo(1);
11:07 camelia rakudo-moar d8958f: OUTPUT: «1?»
11:07 andreoss should nested modules be imported like this?
11:19 pmurias joined #perl6
11:19 pmurias AlexDaniel: unicode operators being annoying to type is a valid argument for not using them
11:21 timotimo yup, { } being annoying to type is also a valid argument for trigraphs :)
11:23 pmurias s/is/was/ {} is easily typable nowdays
11:23 lizmat joined #perl6
11:24 Skarsnik easier on qwerty thou
11:26 Cabanossi joined #perl6
11:33 pmurias timotimo: EBCDIC seemed to be the reason for trigraphs, hopefully nobody is writing Perl 6 in that
11:36 AlexDaniel pmurias: that's not the point people are making. They say that if *they* can't type it, then we shouldn't even add unicode ops. https://www.reddit.com/r/programming/comments/6va32n/perl_6_going_atomic_with/
11:37 AlexDaniel and here too: https://www.reddit.com/r/perl6/comments/6v63wv/201734_going_weekly_changes_in_and_around_perl_6/
11:37 AlexDaniel (maybe even more prominently)
11:39 cdg joined #perl6
11:43 pmurias AlexDaniel: I guess most people assume that if they don't want to use something we shouldn't add it
11:43 snarkyboojum joined #perl6
11:43 El_Che pmurias: I don't think that's the point at all
11:48 gregf_ joined #perl6
11:48 yasu_ joined #perl6
11:49 andreoss m: module Foo {module Bar {my package EXPORT::DEFAULT { our sub foo($) {}}}}}; import Foo; import Bar; say foo(1);
11:49 camelia rakudo-moar 94fe65: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Unexpected closing bracket?at <tmp>:1?------> 3e EXPORT::DEFAULT { our sub foo($) {}}}}7?5}; import Foo; import Bar; say foo(1);?»
11:49 pmurias El_Che: giving the choice to the users if they want to use texas or unicode variants is a very perlish decision that I'm sure plenty of people find ridiclous
11:49 El_Che I think that the point some people make is that even if they decide not to use the asterisk (which renders unclearly on my Linux terminal and as an emoji on my mac terminal), people in their team will and they will have to deal with them anyways.
11:49 pmurias * ridiculous
11:49 andreoss m: module Foo {module Bar {my package EXPORT::DEFAULT { our sub foo($) { }}}}; import Foo; import Bar; say foo(1);
11:49 camelia rakudo-moar 94fe65: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Could not find module Bar to import symbols from?at <tmp>:1?------> 3ub foo($) { }}}}; import Foo; import Bar7?5; say foo(1);?»
11:49 El_Che in this case the ascii word around is very wordy
11:49 Ven`` joined #perl6
11:50 El_Che pmurias: I agree on that. The other side of the coin is exactly that gave Perl 5 a bad rep
11:51 andreoss `is export` seems to be applied to the upper module also
11:51 andreoss can modules be nested?
11:51 El_Che Slightly related, I am under the impression that discussions about Perl 6 tend to drift to utf8 coolness and less about the features many people care about (concurrency, sane OO, builtin kitchensink)
11:52 El_Che I have convinced some people to try rakudo because of the features above.
11:52 El_Che People I have convinced by utf8 operators: 0
11:53 El_Che (let me be clear that utf8 is not the same as the state-of-the-art utf8 handling in perl6)
11:53 El_Che lots of people like that a lot
11:55 El_Che illustrating my point is that zero comments in the discussion where about the cool stuff the atom-thingie does
11:55 census joined #perl6
11:56 MasterDuke joined #perl6
11:56 Cabanossi joined #perl6
12:01 raschipi joined #perl6
12:02 Zoffix andreoss: maybe not; I think sub EXPORT can only be on the other scope which is what `is export` is basically doing, innit? So there's only one point of export that exports everything
12:04 mr_ron joined #perl6
12:04 Zoffix El_Che: I think it's just the easiest thing to talk about as well as the most visibile (you don't even need to understand the code and you can comment). I know when I just started with Rakudo, custom Unicode ops is basically the only thing I talked about.
12:05 AlexDaniel El_Che: people naturally don't want to spend time on learning something. It is much easier to nitpick a feature that makes no sense to you and reject the whole language instead of looking deeper. Most reddit commentors are not Evan Miller. The weekly itself discussed the feature in more detail (even provided an example on how this feature can be used), it's the commentors who tunnel-visioned on the non-ascii symbol
12:05 Zoffix And perhaps a lot of the commenters on those threads simply aren't familiar with atomicity or Rakudo to comment on anything else other than give opinion on these crazy new emoji operators
12:06 Skarsnik why are still trying to argue/understand this? :)
12:06 Zoffix Slow day? :)
12:06 Zoffix Good point
12:06 andreoss so it means no nested modules
12:06 AlexDaniel Skarsnik: I brought it up, it's my mistake
12:06 * Zoffix goes to finish a new article
12:07 sumdoc joined #perl6
12:08 MasterDuke actually, i was wondering why the atomics were sponsored? if it was for some specific/concrete use case, it might be nice to get a blog post or something explaining how the need is now met
12:10 Skarsnik good point
12:11 TreyHarris joined #perl6
12:11 Skarsnik I am curious at how Perl 6 is used in the 'real world'
12:12 * Zoffix 's common real-world use is one-liners
12:12 Zoffix and IRC bots ^_^
12:14 Geth_ joined #perl6
12:15 Geth ¦ marketing: abbd912005 | (Zoffix Znet)++ | 10 files
12:15 Geth ¦ marketing: Add SQUASHathon InDesign source files
12:15 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/abbd912005
12:16 raschipi jnthn: Does Cro support Http/2 over non-tls connections?
12:17 lizmat raschipi: afaik, jnthn is enjoying some days of R&R on the way back from SPW, so it may be a while before he answers
12:17 raschipi .tell jnthn Does Cro support Http/2 over non-tls connections?
12:17 yoleaux raschipi: I'll pass your message to jnthn.
12:17 lizmat raschipi: doesn't the documentation not tell you that ?
12:18 sena_kun raschipi, no, it doesn't.
12:18 raschipi I'm reading the slides, but i'm not getting it. It just says it's activated by default in connections with TLS.
12:18 sena_kun ALPN.
12:19 sena_kun But since it's TLSy thing.
12:19 sena_kun It is possible that other ways to negotiate will be added in the future though.
12:19 raschipi Right, the only way to activate it is by ALPN. Does the presence of HTTP/2 change the pipeline?
12:19 sena_kun raschipi, sure.
12:20 sena_kun we decode/encode binary frames.
12:20 El_Che raschipi: maybe jnthn is from the second school of thought: b-netwerk
12:20 snarkyboojum joined #perl6
12:20 El_Che oops
12:20 El_Che https://http2.github.io/faq/#does-http2-require-encrypti
12:20 El_Che oh crap
12:20 El_Che https://http2.github.io/faq/#does-http2-require-encryption
12:21 El_Che "However, some implementations have stated that they will only support HTTP/2 when it is used over an encrypted connection, and currently no browser supports HTTP/2 unencrypted."
12:21 lowbro joined #perl6
12:21 lowbro joined #perl6
12:21 raschipi So what the pipeline will look like is only know after negotiating it, right? The documentation didn't make that clear to me, didn't read anywhere that it's a dynamic pipeline, that changes according to circunstances.
12:22 sena_kun The pipeline is not dynamic, to be precise. let me explain this thing a bit...
12:22 raschipi I'm familiar with how the http/2 over TLS situation looks like.
12:23 sena_kun basically, if https is present, VersionSelector https://github.com/croservices/cro-http/blob/master/lib/Cro/HTTP/VersionSelector.pm6 is used. It checks for alpn and if we're here: we emit to one supply, otherwise - to another. So there is basically a graph of supplies.
12:24 sumdoc I want to read html source from the web in perl 6. How can I do it?
12:24 sumdoc https://www.nytimes.com/2017/08/28/us/houston-flooding-harvey.html?action=click&amp;pgtype=Homepage&amp;clickSource=story-heading&amp;module=span-abc-region&amp;region=span-abc-region&amp;WT.nav=span-abc-region
12:24 Zoffix buggable: eco DOM::Tiny
12:24 buggable Zoffix, DOM::Tiny 'Very small, self-sufficient DOM parser manipulator': https://github.com/zostay/p6-DOM-Tiny
12:24 Zoffix sumdoc: ^ you can use that module to parse stuff
12:25 sumdoc Zoffix I want to read whole of the source
12:25 raschipi sena_kun: thanks for you help, I will keep studying it and if I have more questions I will ask you.
12:26 Zoffix sumdoc: what do you mean when you say "read"?
12:26 census Zoffix if I may please ask, when you helped so generously with the code for the website yesterday, you took advatnage of the API feature I'm guessing?
12:27 Zoffix sumdoc: this one liner prints the body of the article, for example: perl6 -MWWW -MDOM::Tiny -e 'DOM::Tiny.parse(get "https://www.nytimes.com/2017/08/28/us/houston-flooding-harvey.html").at(".story-body").all-text.say'
12:27 stmuk joined #perl6
12:27 census because i'm guessing that's where 'meta[name="ncbi_resultcount"]' comes from
12:27 sena_kun raschipi, no problem. I will be glad to provide explanations for almost everything, except for future project's decisions(tehse things up to jnthn) and some rare pieces I didn't touch.
12:27 sena_kun *these
12:27 Zoffix sumdoc: get() from WWW.pm6 module fetches the HTML code (is that what you mean by "read"?) and then DOM::Tiny parses it and using CSS selector, I tell it to print all text from a specific element
12:28 Zoffix census: if you look at the page's source there's <meta name="ncbi_resultcount" value="53"> or something like that, in <head>. `meta[name="ncbi_resultcount"]` is a CSS selector for that element and DOM::Tiny uses CSS selector to retrieve content of specific elements
12:28 sumdoc This gives me the desired output. I was wondering if I can do it from within core P6 Zoffix
12:28 sumdoc use LWP::Simple;  my $html = LWP::Simple.new.get("https://www.nytimes.com/2017/08/28/us/houston-flooding-harvey.html?action=click&amp;pgtype=Homepage&amp;clickSource=story-heading&amp;module=span-abc-region&amp;region=span-abc-region&amp;WT.nav=span-abc-region"); say $html;
12:29 Zoffix sumdoc: by core, do you mean Rakudo Star?
12:29 sumdoc Zoffix Yes
12:29 Zoffix Yeah, you could use LWP::Simple
12:29 census Zoffix okay i see. i'll see if i can find something like that for the google search i want to do
12:29 sumdoc Zoffix I mean without using external modules!!
12:30 Zoffix sumdoc: yeah, you could, but that involves a lot of code to implement SSL and HTTP. That's why we have modules, so you don't have to re-invent the wheel
12:30 sumdoc Zoffix OK
12:30 konsolebox joined #perl6
12:31 census Zoffix i tried the page source for a link like https://patents.google.com/?q=Babesiosis&amp;country=US&amp;before=20010101&amp;after=20011231  and i don't see the outcome. i did test it just now for the other website and i do see the 53 there
12:33 census is that becaus the other website had an API but google doesn't ?
12:34 Zoffix Nope. Just differently-made website
12:34 Skarsnik Zoffix, I wonder if I could/should make a way for dom::tiny to use like another html parser
12:35 census Zoffix will i need to do some sort of regex then?
12:35 epony joined #perl6
12:35 Skarsnik you basicly need to write new code for each new site
12:35 census to indicate find the word About or results and get the number in between ?
12:35 census Skarsnik yes i understand that
12:36 Zoffix census: regex just extracts text. If there's nothing to extract with HTML parser, what will you extract with a regex?
12:36 census do you have any suggestion then on how to get the number?
12:37 Zoffix census: look around the site to see a way to get the data you weant
12:37 Zoffix *want
12:38 araraloren joined #perl6
12:39 census Zoffix thank yoyu for your continued help. when i used to do this in perl5, i never had the fortunate of having something so straight forward like you found through the page source. i always did a regex type trick
12:41 AlexDaniel FWIW, I'm using perl6 for everything nowadays. One of the relatively big things I have here is web scraping, all of which is currently shelved because Gumbo segfaults with current rakudo
12:42 Zoffix census: think outside the box. There's a "download CSV" link. Look at the link: https://patents.google.com/xhr/query?url=q%3DBabesiosis%26country%3DUS%26before%3D20010101%26after%3D20011231&amp;exp=&amp;download=true It got your quiery in it. So that means you likely can directly construct links to CSV files. Download one of them, look at its structure: it got result-per-row + 2 rows for headings. That means to get
12:42 AlexDaniel one of projects is using python-gumbo through Inline::Python, which I don't like but at least it can parse 100 pages without segfaulting
12:42 Zoffix your results all you need to do is make a URL to csv to fetch the CSV data then  parse CSV and subtract 2 from total row count to get number of results
12:42 Zoffix census: perl6 -MWWW -MText::CSV -MURI::Encode -e 'my $term = uri_encode "Babesiosis"; "temp".IO.spurt: get "https://patents.google.com/xhr/query?url=q%3D$term%26country%3DUS%26before%3D20010101%26after%3D20011231&amp;exp=&amp;download=true"; say csv(:in<temp>).elems - 2'
12:42 Zoffix 172
12:42 AlexDaniel it does segfault anyway after a couple of thousands, but in these cases I just rerun it and hope for best
12:43 * Zoffix slightly dissapointed Text::CSV doesn't have documented way of giving CSV to parse from a Str variable
12:44 sena_kun >with %?RESOURCES{('web', 'js', |@path).join('/')}
12:44 sena_kun it works then the resource is here.
12:44 sena_kun but when it isn't. It should be any. Right?
12:44 sena_kun Instead I'm getting "Use of uninitialized value % of type Any in string context.". :S
12:45 sena_kun s/works then/works when/
12:45 Zoffix Some cases where I choose, say Perl over Rakudo, is mostly due to lack of Rakudo libraries that I like, something polished like Mojo::Pg or Mojolicious. I originally thought to yakshave those, but the amount of work to make stuff and then maintain it is beyond something I'd be able to comfortably handle
12:46 Zoffix m: dd %?RESOURCES{('web', 'js', |@path).join('/')}
12:46 camelia rakudo-moar 94fe65: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '@path' is not declared?at <tmp>:1?------> 3dd %?RESOURCES{('web', 'js', |7?5@path).join('/')}?»
12:46 Zoffix m: my @path = 42; dd %?RESOURCES{('web', 'js', |@path).join('/')}
12:46 camelia rakudo-moar 94fe65: OUTPUT: «Nil?»
12:47 sena_kun hmmmm.
12:49 zakharyas joined #perl6
12:50 * Zoffix &
12:54 perlpilot Zoffix: in those cases where you choose Perl over Rakudo, why not use Inline::Perl5 instead?
12:56 Zoffix perlpilot: most of the time it doesn't work
13:00 mcmillhj joined #perl6
13:00 pmurias 0z
13:00 pmurias sorry
13:01 pmurias Zoffix: did you consider reporting the stuff that doesn't work in Inline::Perl5? ;)
13:03 Zoffix perlpilot: or more specifically, the three times I tried to use it it didn't work. Awhile back I tried to use Mojolicious and struggled figuring out how to access data in templates. When I tried to use WWW::Mechanize, I saw no obvious way to give its methods Perl regex objects. When I tried to use Spreadsheet::XLSX, I could access its attributes, because it provides them by directly offering the blessed hash,
13:03 Zoffix rather than via methods.
13:04 Zoffix perlpilot: so I don't know... either I'm very unlucky or people overhype the usefulness of Inline::Perl5
13:05 Ulti so the jupyter integration of Rakudo is really nice
13:05 Zoffix pmurias: nope
13:06 Zoffix *couldn't access its attributes
13:07 perlpilot Zoffix: fair enough.   though, one of the first modules I used with Inline::Perl5 was Spreadsheet::XLSX and I don't remember having any problems.  But I just looked for the code and can't find it so ... recent experience trumps vague memories of code that may no longer exist  :)
13:08 cdg joined #perl6
13:10 perlpilot oh!  I used Spreadsheet::ParseExcel and Excel::Writer::XLSX
13:11 perlpilot https://irclog.perlgeek.de/perl6/2015-08-20#i_11087671
13:12 Zoffix But in the grand scheme of things, I don't *want* to use Inline::Perl5. I want to use modules designed for Rakudo. If I'm forced to build a frankenstein, I may as well just use Perl, instead of spending time, trying to figure out how to stitch the pieces together
13:14 Zoffix perlpilot: I actually made a wrapper module that I loaded with Inline::Perl5, but the compile time was like 5s on each change (I think Inline::Perl5 disables precompilation or something?), so I just went straight to Perl
13:14 Zoffix a warpper for the Excel module
13:15 itaipu joined #perl6
13:15 Zoffix Man, IRC sure is a time sink :)
13:15 * Zoffix goes to be productive
13:15 Zoffix left #perl6
13:16 census Do I have to initiate the package MText::CSV ?
13:16 census like do something in the cmd?
13:17 cdg_ joined #perl6
13:17 Zoffix joined #perl6
13:17 Skarsnik huggable, modules
13:17 huggable Skarsnik, 100 Most Popular (by github stars and recently updated) Modules:  perl6 -MWWW -e 'jget("http://modules.perl6.org/.json")<dists>.sort(-*<stars>).grep({Date.new(.<date_updated>) after Date.new: "2017-01-01"}).head(100)»<name>.grep(none |<p6doc panda v5>, /^ "Inline::"/).put'
13:17 Zoffix Oh wait, now I remember better: it's likely was 5s slow to parse the exel file I was loading, not precompilation
13:17 Skarsnik was ther a bot that link the help?
13:18 Zoffix Skarsnik: the help for what?
13:18 Zoffix Ah, no bot
13:18 census Skarsnik yes do I need to initiate the module in cmd?
13:18 Zoffix census: zef --/test install Text::CSV
13:18 Zoffix You need to install most modules.
13:18 Skarsnik like help: Str and link the Str section in doc.p6.o
13:18 Zoffix zef is module installer
13:18 Zoffix huggable: Str
13:18 huggable Zoffix, String of characters: https://docs.perl6.org/type/Str
13:18 Zoffix But only types are entered.
13:19 dogbert17 joined #perl6
13:19 Zoffix I think when docs system is changed to be SQL-driven, then we can offer a docs API the bot could use
13:19 * Zoffix &
13:19 Zoffix left #perl6
13:24 Guest69863 joined #perl6
13:27 mcmillhj joined #perl6
13:30 margeas joined #perl6
13:30 Skarsnik_ joined #perl6
13:32 Skarsnik__ joined #perl6
13:39 andreoss left #perl6
13:40 census Zoffix helped me with the following code but i didn't quite follow it: https://pastebin.com/Su4vaMTk
13:41 census What is the difference between MText::CSV and use Text::CSV;  ?
13:41 Ven`` census: `-M` is a command line flag that "use"s a module.
13:41 census Ven`` so in the program i implemented it correctly?
13:42 census also what does -e mean or is that also something for the command line in cmd?
13:42 raschipi -e in the commandline is for exacuting a script given as an argument
13:43 census raschipi so when i took that to write as a script in https://pastebin.com/Su4vaMTk  , it was correct that i dropped it ?
13:43 cschwenz (or any code in quotes after the given -e parameter)
13:44 Ven`` census: I believe so, yes :)
13:45 mcmillhj joined #perl6
13:49 moritz oh hai
13:50 moritz https://perltricks.com/article/plotting-with-perl-6/ # a chapter from my book re-printed on perltricks.com
13:50 perlpilot Isn't that more like "plotting with Python and Perl 6"?  :-)
13:51 census in my code https://pastebin.com/bc91yydY in the line "temp".IO.spurt: get .... how can i use the variable $year in the website address rather than the actual year. i want to do it that way because ultimately i want to write a loop
13:51 Ven`` o/ moritz
13:54 perlpilot census: you either want to use {$year} inside your double quoted string or use string concatenation like so:  "foo bar " ~ $year ~ " baz blat"
13:54 moritz perlpilot: yes
13:54 perlpilot census: for comparison, the first way would be like:  "foo bar {$year} baz blat"
13:55 census thanks perlpilot ! That worked
13:57 El_Che AlexDaniel: I agree with what you say, but there is an aspect of marketing as well to the story.
13:59 Ven`` moritz++
14:01 census in perl6, is there a way to change the agent in the code?
14:01 moritz census: who or what is "the agent"?
14:01 perlpilot moritz: I think he's asking about the "user agent" as in a browser request.
14:02 perlpilot s/browser/HTTP/
14:02 census yes perlpilot. i didn't know how to explain it well. it's something in perl5 i've used with the $mech
14:03 mcmillhj joined #perl6
14:04 Skarsnik__ look at the doc of the module you are using?
14:04 perlpilot census: that would be a function of the WWW module that you are using.  you'd have to check the docs for that module
14:06 census perlpilot on docs.perl6.org/language/modules ?
14:07 census or modules.perl6.org ?
14:08 census it says "module will use User-Agent header to set Rakudo WWW, unless you specify that header"  Is that the same thing?
14:09 FrDarryl joined #perl6
14:09 perlpilot census: looks like it
14:10 bwisti joined #perl6
14:11 census perlpilot https://github.com/sergot/http-useragent and i'm not seeing a way to change it
14:12 Skarsnik https://github.com/sergot/http-useragent/blob/master/lib/HTTP/UserAgent.pm6#L468
14:14 census thanks Skarsnik !
14:14 census i don't follow the syntax, however
14:14 census i should be looking at : =head2 method new     method new(HTTP::UserAgent:U: :$!useragent, Bool :$!throw-exceptions, :$!max-redirects = 5, :$!debug) returns HTTP::UserAgent  ?
14:15 perlpilot census: you should be able to do get $url, User-Agent => "Whatever"';
14:15 perlpilot er, but without the syntax error
14:16 census perlpilot like   $url, User-Agent => "Mozilla/4.0"; ?
14:16 perlpilot yep
14:18 perlpilot with a little more context from the code you posted:  "temp".IO.spurt: get "...", User-Agent => 'Mozilla/4.0';
14:21 census thanks perlpilot !  that seems to work . i hope so at least. the program is compiling at least
14:21 Kyo91_ joined #perl6
14:22 MilkmanD1n joined #perl6
14:25 census what is the command for random number generator? in perl5 it's rand(9) for example to do random from 0-8
14:26 Skarsnik m: say ^9.pick
14:26 perlpilot census: did you want integers?
14:26 camelia rakudo-moar 94fe65: OUTPUT: «Potential difficulties:?    Precedence of ^ is looser than method call; please parenthesize?    at <tmp>:1?    ------> 3say ^97?5.pick?^9?»
14:26 Skarsnik m: say (^9).pick
14:26 camelia rakudo-moar 94fe65: OUTPUT: «3?»
14:26 perlpilot m: say 9.rand;  # does the same as perl5's rand(9);
14:26 camelia rakudo-moar 94fe65: OUTPUT: «3.65081666642663?»
14:26 perlpilot census: use what Skarsnik said if you want integers
14:27 census perlpilot i actually don't care if it's integeres
14:27 census i just wanted random numbers but nothing too large
14:29 census thanks Skarsnik and perlpilot !
14:34 Ulti are there any icon sized optimisations of Camelia? 32 and 64 pixels?
14:35 census also i don't know if this would be feasible or a pain in the but, but i like to run my code in TOR. i've done it before in perl5 but i don't quite recall which lines in my old code did so. i have a line that's like my $proxy = "socks://localhost:9150" and another that's like $ENV{'HTTP_PROXY'} = `http://64.71.156.216:8181';
14:36 timotimo pmurias: we can support dup and dup2 on rakudo-js, right?
14:37 moritz .seen [ptc]
14:37 yoleaux I saw [ptc] 14 Jun 2017 10:50Z in #perl6: <[ptc]> zengargoyle: cheers.  Must be something at my end.  I keep getting 502s
14:37 skids joined #perl6
14:38 Ven`` timotimo: did you dup dup? :P
14:39 timotimo yeah, we'll have to dedup the dup2
14:43 Skarsnik_ joined #perl6
14:43 Khisanth joined #perl6
14:43 sena_kun m: my @int = (foo => 1, bar => 2); say @int.map({ {first => .key, second => .value} })[0].WHAT
14:43 camelia rakudo-moar 94fe65: OUTPUT: «(List)?»
14:44 sena_kun is there a way to return Hash from map, instead of list?
14:44 sena_kun m: my @int = (foo => 1, bar => 2); say @int.map({ %{first => .key, second => .value} })[0].WHAT
14:44 camelia rakudo-moar 94fe65: OUTPUT: «Odd number of elements found where hash initializer expected:?Only saw: -> ;; $_? is raw { #`(Block|74895184) ... }?  in block <unit> at <tmp> line 1??»
14:44 sena_kun Boom.
14:44 moritz add .hash at the end?
14:45 sena_kun m: my @int = (foo => 1, bar => 2); say @int.map({ (first => .key, second => .value).Hash })[0]
14:45 camelia rakudo-moar 94fe65: OUTPUT: «{first => foo, second => 1}?»
14:45 sena_kun it's better. thanks!
14:45 perigrin joined #perl6
14:48 sumdoc joined #perl6
14:48 sumdoc I want to substitute one word with another word. How to do that? Should I open in :append mode? Example: my $fh = open("file.txt",:a); Now how to substitute?
14:48 sumdoc When working with a file.
14:49 timotimo that will only work if both words have the same length
14:49 timotimo like, in general
14:51 timotimo i haven't actually tried to do this at all for the longest time, but i think all you need to do is use append mode so it doesn't truncate the file, seek to the position you want, then make sure to write exactly the same amount of bytes everywhere
14:51 timotimo i.e. it'd be a good idea to only do this in :bin mode
14:51 Zoffix joined #perl6
14:52 census Zoffix you'd be proud of me i hope. with 1 slight hint i took your suggestions and made them into working code
14:53 census https://pastebin.com/65ipCYPE
14:53 Geth ¦ marketing: 9ce3c2bf2f | (Zoffix Znet)++ | 2 files
14:53 Geth ¦ marketing: Add renders of 32px and 64px Camelia logos
14:53 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/9ce3c2bf2f
14:53 AlexDani` joined #perl6
14:53 sumdoc Zoffix https://wordpress.com/post/suman20blog.wordpress.com/21
14:54 Zoffix Util: I exported 32px and 64px rasters from Illustrator and added them to https://github.com/perl6/marketing/tree/master/LOGOs/Camelia  But if you meant specifically massaged SVGs to make smaller versions render better... I'm not aware of us having those
14:55 Zoffix Ulti: ^ I meant that for you :)
14:55 Zoffix sumdoc: that tells me to log in to wordpress
14:56 census how may i run my code in a proxy like with TOR? in perl 5 i did it but i don't quite remember which line in my old code set that up.i have a line that's my $proxy = "socks://localhost:9150" and another that's $ENV{'HTTP_PROXY'} = `http://64.71.156.216:8181';
14:56 Zoffix census: awesome! You should change "list.txt".IO.lines to "list.txt".IO.lines.map: &uri_encode though, so it escapes all special terms in the URL
14:57 Ven`` wow, Cro::Router looks so nice.
14:57 Ven`` amazing job :-)
14:58 perlpilot yeah, Cro looks pretty nice in general.
14:58 census thanks Zoffix ! that works
14:59 Ven`` wanted to write a WS discord lib, maybe I should use that
14:59 perlpilot I may stop playing with Bailador since Cro seems to fit more how I think things should work.
14:59 sumdoc Zoffix https://suman20blog.wordpress.com/2017/08/26/text-handling-in-perl-6/
15:00 cdg joined #perl6
15:00 Ven`` Yeah, I'm not too fond of Bailador either, Cro looks more fitting to my taste (I've always liked express/sinatra/...)
15:01 Ven`` The website is unreadable on mobile though :P.
15:01 Ven`` I should PR it to fix the highlighting maybe
15:01 El_Che Ven``: isn't Bailador a kind of port of Dancer, which on its turn is inspired by Sinatra?
15:01 cdg joined #perl6
15:03 mst ARGH
15:03 Zoffix .hug mst
15:03 * huggable hugs mst
15:03 mst I start reading the cro website, it autoscrolls to a different slide when I'm halfway through
15:03 Zoffix :D
15:03 Ven`` yup. try on mobile too :P.
15:03 cdg_ joined #perl6
15:04 mst hahahaha and using the left arrow button to go back doesn't stop the carousel
15:04 perlpilot mst: yeah, that was most annoying.
15:04 cdg__ joined #perl6
15:05 Ven`` El_Che: I know nothing about how Dancer compares to Sinatra. I just know Bailador doesn't seem to do middlewares like I expect it to, and has hacks like `noprefix`
15:05 El_Che Bailador had some nasty locking issues after a X number of concurrent sessions (although high: 200?)
15:05 El_Che Does cro has a similar issue?
15:06 sena_kun it is yet to be tested under such load, I guess.
15:07 sena_kun and as for now things are unoptimized performance-wise.
15:07 El_Che That was actually not a bailador issue, but the underlaying plack implementation iirc
15:08 ufobat Ven``, what is `noprefix` ?
15:08 raschipi sumdoc: why "$string.comb(/ \w /);" and not just "$string.comb;" ?
15:08 Ven`` ufobat: https://github.com/Bailador/Bailador/commit/1117277387a8f3ce2348226bdeaa869e6a3a4446
15:08 raschipi why ".say for" instead of ".join("\n").say ?
15:09 ufobat Ven``, and bailador can "return" a p6w app, which is psgi, so you can wrap middlewares around it
15:09 Ulti http://mattoates.co.uk/files/perl6/jupyter_perl6_plot_test.png \o/ looks like ZeroMQ needs to see something special in the Kernel protocol to actually render the SVG as an image :(
15:09 ufobat if you call my $psgi-app = baile('p6w'), it returns an app instead of running it on a server like http::tiny
15:09 perlpilot sumdoc: also, I wouldn't mention split("") in that last example unless you also explain why there's an extra element at the front.
15:09 sumdoc raschipi Points noted
15:10 raschipi sumdoc: "$string.comb(/ \w /);" and "$string.comb;" do different things on strings with whitespace. I'm not making any points, I'm just asking.
15:12 raschipi But I do think ".say for" is more difficult to understand than ".join('\n').say"
15:12 Ulti $string.words however does the same
15:12 Ven`` ufobat: that's not how middlewares are done on express, where you can mount apps on apps, middlewares around single routes or prefixes, etc
15:14 ufobat you can't mount apps inside of bailador, right, but you can mount a bailador app somewhere
15:14 ufobat it's psgi'ish
15:15 Ven`` it just comes down to what i'm used to do with express
15:15 Ven`` being able to mount app just inside a middleware doesn't interest me
15:15 Ulti Zoffix: thanks sorry I missed it ;_;
15:18 ufobat in psgi you mount apps in an app of its own, and you can wrap middlewars around that
15:19 ufobat https://metacpan.org/pod/Plack::Builder <- thats perl5 more or less the "same idea"
15:19 ufobat but it seems that express, which i dont know, is more flexible
15:21 mst Ven``: I'm not sure what you mean by that or what you'd want instead
15:21 Ven`` mst: ?
15:21 Ven`` context please
15:21 mst Ven``: express seemed ridiculously verbose to me and I can't write ruby because it has crippled scoping and worse-than-perl5 OO
15:21 mst Ven``: context? your last sentence
15:22 Ven`` ok, not the last time I mentioned you
15:22 raschipi Ven``: do you have a link to express?
15:23 Ven`` i'm not defending ruby (neither sinatra which apparently uses globals everywhere etc), I'm just saying I'm used to express. I don't think it's too verbose, you just use a few middlewares in pretty much any web app that deals with e.g. json
15:23 Ven`` raschipi: https://expressjs.com/
15:24 Zoffix .ask RabidGravy does HTTP::UserAgent support socks5 proxy? I see some mention of HTTP proxy in source and nothing in docs and nothing about socks proxies
15:24 yoleaux Zoffix: I'll pass your message to RabidGravy.
15:25 census Zoffix yes that's my question too, right?
15:26 Cabanossi joined #perl6
15:26 mst Ven``: ugh
15:26 mst Ven``: I'm not asking you to defend anything, I'm just trying to understand what you even want
15:27 Ven`` mst: i don't understand what you're trying to do
15:27 Zoffix perlpilot: on the theme of Inline::Perl5: right now I'm trying to use LWP::Simple's proxy method, which is used as $ua->proxy(['http', 'ftp'] => 'http://proxy.sn.no:8001/'); but while it works in Perl, in Rakudo the same style (2 positonals: Array and Str) dies with "Proxy must be specified as absolute URI". And I've no idea what I'm doign wrong
15:28 census perlpilot are you trying to do something similar to what i was saying before?
15:29 kannan joined #perl6
15:29 mst Ven``: ah, it looks like currently both Cro and Bailador are in the "reinvent ALL the wheels" phase so there's no concept of middlewares or other such reusable building blocks yet
15:30 mst Ven``: I assumed somebody would've attempted to at least vaguely follow one of the perl5 ecosystem examples, but alas no
15:30 mst well, not yet
15:30 Ven`` mst: the talk about Cro shows pretty nice examples of middlewares, but again, since it depends on signature introspection, I think you can't wrap any function and return a new one
15:30 mst Ven``: hm?
15:30 kannan hello all. i finally received the perl6 fundamentals book by moritz ! working on it :)
15:30 mst Ven``: I don't see anything involving middleware on the Cro site
15:31 Ven`` mst: I did say talk. Here: http://jnthn.net/papers/2017-spw-sockets-services.pdf
15:31 ruoso__ Is it  a known issue that Grammar::Tracer dies when you use proto rules?
15:31 perlpilot Ven: is the talk video available somewhere?
15:31 Ven`` perlpilot: I don't know.
15:31 perlpilot census: no.
15:31 Zoffix perlpilot: and even if I just shove the Perl version into Inline::Perl5.new.run(), it dies with "error while setting up ssl connection (SSL connect attempt failed error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac)"
15:32 perlpilot Zoffix: yeah, that does happen sometimes to me too (where I have no idea what went wrong)
15:32 Zoffix I must be the unluckiest Inline::Perl5 user, eh? :)
15:32 census perlpilot what are you trying to do exactly? i'm looking to run my code through a proxy, specifically TOR
15:32 sena_kun perlpilot, http://mi.cro.services/docs/reference/cro-http-server - see `Middleware` section.
15:32 perlpilot census: nothing. :-)
15:32 Skarsnik__ joined #perl6
15:33 go|dfish perlpilot: talk video: https://www.youtube.com/watch?v=6CsBDnTUJ3A
15:33 perlpilot go|dfish++ sena_kun++
15:33 sena_kun oh, the video is here, great.
15:33 Zoffix \o/
15:33 census oh ok perpilot I saw Zoffix talking to you about what semed to be proxy and perl5 so I'm curious because I want to do something like that. Do you know anything about how to do so?
15:34 perlpilot census: nope.
15:35 kannan i wanted to ask : using IO::Tailfile and a react{ block} i am creating another file with shared access lock which is read-written by another .pl6 script. In case i am able to make a duplicate log file which will also be written to continously, can we skip the access share bit and OPEn the file in perl6 instead and delete / edit lines? to be specific, asterisk pbx generates a security log. I...
15:35 kannan ...can create two similar files in its configurations. If one file thats being written into by logger.c with syslog in asterisk is opened in perl6 does that also pose similar access sharing problems.
15:35 Zoffix census: run in cmd:   cpanm LWP::UserAgent::socks
15:35 Skarsnik joined #perl6
15:36 perlpilot kannan: you're writing to a single file from two processes?
15:37 kannan perlpilot : yes
15:37 ShalokShalom joined #perl6
15:38 census thanks Zoffix. it updated the cpan and p6c mirrors, but it also says "no candidates found matching identity"
15:38 Zoffix census: then this is a code you can use to make a get request to a URL: my $url = ?https://www.expressvpn.com/what-is-my-ip?; say (run :out, "perl", "-e", ?use LWP::UserAgent; my $ua = LWP::UserAgent->new(timeout => 25); $ua->proxy([qw/http https/] => "socks://127.0.0.1:2225"); $ua->cookie_jar({}); print $ua->get(? ~ $url.perl ~ ?)->content?).out.slurp: :close
15:38 Zoffix census: you ran it with zef, but you need to just run        cpanm LWP::UserAgent::socks
15:38 Zoffix cpanm is Perl's module installer and that installs a Perl module
15:38 Zoffix And the code runs perl executable to make a request.
15:38 ChoHag joined #perl6
15:39 Zoffix Normally you'd be able to use it via Inline::Perl5 (but that doesn't work) or just use natively some module via Rakudo (but I don't know which ones support socks proxy)
15:39 timotimo sena_kun: there's a typo in the middlewares section in the http server section: it says ScriptTransportSecurity instead of StrictTransportSecurtiy
15:39 timotimo (and i just typo'd on top of that)
15:39 mst Ven``: yes, I *can* read. but, logically, since you're refusing to explain what you want, I went to try and find the source code to understand more :P
15:39 census Zoffix. What am I doing incorrectly? C:\Users\owner\Desktop>cpanm LWP::UserAgent::socks 'cpanm' is not recognized as an internal or external command, operable program or batch file.
15:39 Zoffix census: did you install Strawberry perl?
15:40 Zoffix sumdoc: says "the author has deleted this site"
15:40 census Zoffix not on this machine. i will now
15:40 Zoffix Yeah, you need it
15:41 sumdoc Zoffix I change the name of my site. Now it lives here https://sumdoc.wordpress.com/2017/08/26/text-handling-in-perl-6/
15:41 Skarsnik_ joined #perl6
15:41 sumdoc I am yet to edit
15:42 Zoffix sumdoc: if it's a Perl 6 blog, be sure to add it to https://github.com/stmuk/pl6anet.org/blob/master/perlanetrc#L83-L85 so it shows up on perl6.org "recent blogs" box
15:43 perlpilot kannan: sounds scary  :-)   I would think that adding new lines could be fine as long as you're careful about your writes though
15:43 Geth ¦ perl6.org: 298e5e3301 | (Zoffix Znet)++ (committed using GitHub Web editor) | source/index.html
15:43 Geth ¦ perl6.org: Fix incorrect use of alt="" attribute
15:43 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/298e5e3301
15:43 sena_kun timotimo, that's no good! Thanks for the reporting~
15:43 sumdoc Zoffix It will be a combination of R(https://www.r-project.org/) , Perl 6 and Python.
15:45 konsolebox joined #perl6
15:47 kannan perlpilot : i am brand new to perl6 and to programming itself. just trying it academically. the problem is already solved by good programmer, with a source code patch in asterisk :) . i can do the needful inside the IO::Tailfile react{block itself, but i thought it was better this was so the tail emulation does not miss any security events... in other words i do not know how fast it will...
15:47 kannan ...execute . i do not know any way to test that also , i guess write anoither program to generate logs at super speeds..
15:47 census Zoffix I just downloaded and installed strawberry Perl and am having the same error message. should i run it from the cmd still or from the Strawberry Perl client?
15:48 raschipi census: did you close and reopen cmd?
15:49 kannan basically i need a way to react to security events when some conditions are met, and not miss a single line from the security log.
15:49 kannan the above is just my try at doing that.
15:50 census yes raschipi just now and i didn't work.  different error though
15:50 census C:\Users\owner\Desktop>cpanm LWP::UserAgent::socks ! Finding LWP::UserAgent::socks on cpanmetadb failed. ! Finding LWP::UserAgent::socks () on mirror http://www.cpan.org failed. ! Couldn't find module or a distribution LWP::UserAgent::socks
15:52 Zoffix sumdoc++ great tutorial! Note .match('is') could be written as .contains('is') which is likely faster too. Also, .split('') and .comb(/\w/) are different things (split will add empty strings at start and end, unless :skip-empty named param is given as well as include non \w chars, while .comb would give only \w; to split string on characters, you can use .comb without any args. P.S.:
15:52 Zoffix $string.words.lc.unique.elems doesn't work because .lc combines the words back into a string, you can use hyper operator » to call it on each element: $string.words».lc.unique.elems
15:52 Zoffix sumdoc: I actually learned something: .tc doesn't touch other letters in the string and I thought it did :)  Now I remember we have .wordcase for that :)
15:53 Zoffix census: my bad, I gave you wrong module name. It should be LWP::Protocol::socks
15:53 Zoffix so run cpanm LWP::Protocol::socks
15:53 Zoffix sumdoc: mention your post to lizmat++ to see if she'd be able to include it in the next Weekly installment
15:54 census thanks Zoffix! okay it just installed
15:54 census i wouldn't have known to have tried that without you
15:56 raschipi sumdoc: "dd $a is basically short for note $a.perl plus some extra features" -> this sentence doesn't connect to anything in the post, I think. It's just lost there. I spent time looking for some code using dd in your post.
15:58 wamba joined #perl6
16:02 kannan i am not able to install Inline::Perl5 . Pl see for output -> https://paste.debian.net/983557/
16:04 Zoffix kannan: what system is that on?
16:05 kannan debian stretch
16:05 kannan 64 bit
16:05 Zoffix kannan: sudo apt-get install libperl-dev
16:05 Zoffix Then try again
16:06 mr-fooba_ joined #perl6
16:06 zakharyas joined #perl6
16:07 cdg joined #perl6
16:07 MilkmanDan joined #perl6
16:07 kannan Zoffix : gr8! worked.
16:08 Zoffix \o/
16:10 kannan about the moritz book - i suppose i was expecting a 'teach yourself php in 24 hours' style ... it is hard to get past a few lines at a time.
16:10 kannan but i love it!
16:11 Geth ¦ doc/molecules-patch-3: a2fb0bf7c1 | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
16:11 Geth ¦ doc/molecules-patch-3: Implied separator rule: focus on ending blocks
16:11 Geth ¦ doc/molecules-patch-3:
16:11 Geth ¦ doc/molecules-patch-3: I've modified the explanation to focus more on the ending blocks than on the ending semicolon. This is to make improvements toward resolving (or at least mitigating) concerns with issue #1471. Also included an example of implied separator rule with a colon method call.
16:11 Geth ¦ doc/molecules-patch-3: review: https://github.com/perl6/doc/commit/a2fb0bf7c1
16:11 Zoffix \o/
16:11 Zoffix moritz++
16:13 Geth ¦ doc: molecules++ created pull request #1476: Implied separator rule: focus on ending blocks (instead of the curly brace itself)
16:13 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1476
16:13 census Zoffix there's one thing i used to do in perl5 i'm not sure how to do in perl6
16:14 census i want to clear whatever is in the current output .txt file. in perl5 i did so through the command open(my $file1, '>', 'output.txt') or die "Can't open output file : $!"
16:16 Geth ¦ doc: 7bb1fec099 | (Christopher Bottoms)++ (committed by Zoffix Znet) | doc/Language/syntax.pod6
16:16 Geth ¦ doc: Implied separator rule: focus on ending blocks (#1476)
16:16 Geth ¦ doc:
16:16 Geth ¦ doc: I've modified the explanation to focus more on the ending blocks than on the ending semicolon. This is to make improvements toward resolving (or at least mitigating) concerns with issue #1471. Also included an example of implied separator rule with a colon method call.
16:16 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7bb1fec099
16:18 Zoffix census: outside your loops, open the file:   my $fh = open 'output.txt'; then inside (where you currently use the .spurt thing) change OUT_FILE.spurt: .... to $fh.spurt: ...
16:18 MilkmanDan joined #perl6
16:18 timotimo census: just opening the text file with :w and writing to it will truncate the file contents
16:18 timotimo actually
16:19 Zoffix The old way uses IO::Path.spurt to open the file and append to each on each loop iteration. The new way opens the file (clearing it) and gives you IO::Handle and you .spurt :append into the handle
16:19 timotimo just opening it for :w truncates the file contents
16:19 Zoffix census: oh right, I forgot the :w adverb timotimo++ mentioned
16:19 Zoffix my $fh = open :w, 'output.txt';
16:19 census oh so just add that line after constant OUT_FILE = 'results.txt'.IO; ?
16:20 mcmillhj joined #perl6
16:20 Zoffix census: yeah, somewhere there. my $fh = open :w, OUT_FILE
16:20 census oh it seems this other line first ?
16:20 * Zoffix reaches for "The Definitive IO Guide" and realizes it was never finished
16:20 Zoffix oops
16:20 census my $fh = open :w, 'output.txt'; constant OUT_FILE = 'results.txt'.IO;
16:21 Zoffix census: what's OUT_FILE?
16:21 kannan "my-file.txt".IO.spurt: "";  from https://docs.perl6.org/language/io-guide#Writing_into_files - will this also work?  just asking as i remember reading it.
16:21 census ultimately it writes the data there: OUT_FILE.spurt: :append, "$term,$year,$results-num\n";
16:22 Zoffix census: right, and you want to open that file to get a file handle for it. But right now you're opening a different file. OUT_FILE contains the path to the file you wanna open
16:22 mr-foobar joined #perl6
16:22 Zoffix kannan: yeah
16:23 kannan yes, worked alright.
16:24 cdg joined #perl6
16:25 Zoffix census: constant OUT_FILE = 'results.txt'.IO; just creates an OUT_FILE constant, so you keep the actual filename written down once and can refer to that constant when you want to refer to the file. The .IO method returns an IO::Path object
16:25 Zoffix huggable: IO::Path
16:25 huggable Zoffix, File or directory path: https://docs.perl6.org/type/IO::Path
16:26 census yea i realize that now .i spoke too quickly
16:26 census i'm still getting used to all the perl6 stuff
16:26 cdg joined #perl6
16:26 Zoffix census: after you create that constant, you want to open that IO::Path for writing, so you use open routine that takes that IO::Path and opens it and gives you back an IO::Handle object
16:26 andrzejku joined #perl6
16:26 Zoffix huggable: IO::Handle
16:26 huggable Zoffix, Opened file or stream: https://docs.perl6.org/type/IO::Handle
16:26 vytautas joined #perl6
16:27 census Zoffix however, i feel like i'm doing something wrong because nothing is saving now
16:27 raschipi show us the code
16:27 census https://pastebin.com/WJASWPHN
16:28 Zoffix census: and now the OUT_FILE.spurt: :append, "$term,$year,$results-num\n"; line needs to become $fh.spurt: :append, "$term,$year,$results-num\n"; so you write to the filehandle instead of the OUT_FILE (functionally, it won't make much difference really, but at least you're not opening the file on each iteration)
16:28 Zoffix census: also, stick $fh.close; after the loop
16:28 Zoffix To close the handle and write everything that's in a buffer (that I don't think we use yet by default) out
16:29 census yes that makes sense because in perl5 i had to close it too
16:29 Zoffix Do you? I thought .close would .flush for you and .close is done on scope leave
16:29 Zoffix In Perl, I mean. In Rakudo it doesn't
16:30 Zoffix census: if you look on your filesystem, you'll now find two files: results.txt and output.txt
16:30 census yea in perl5 i had to close the file name
16:30 Zoffix One has output the other doesn't
16:31 Zoffix You open the $fh filehandle, but not only you open it to the wrong file, but you also never make use of it.
16:31 mcmillhj joined #perl6
16:31 census haha true
16:31 census thanks for noticing that
16:31 Zoffix I hope all the lines I wrote above can answer what's happening and you can figure out how to fix that.
16:31 * Zoffix leaves to work &
16:32 cdg joined #perl6
16:32 census yes thanks Zoffix it is all good there !
16:38 vytautas Installing GTK::Simpler fails, "Cannot locate native library 'libgtk-3.so':..."
16:40 vytautas dpkg -S libgtk-3.so returns /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 and ...libgtk-3.so.0.2200.18
16:40 andrzejku hey
16:40 Skarsnik_ nneed to install the dev package
16:41 Skarsnik_ and make an issue to gtk::simpler to give the abi version x)
16:46 emeric joined #perl6
16:51 vytautas installed dev package, ran "zef install GTK::Simpler" again, now it fails when i close the popup window
16:51 mcmillhj joined #perl6
16:56 Cabanossi joined #perl6
16:56 MilkmanDan joined #perl6
16:57 mcmillhj joined #perl6
17:03 epony joined #perl6
17:10 Aaronepower joined #perl6
17:11 mcmillhj joined #perl6
17:15 kannan perlpilot : should it be safe to open a syslog file in read-only mode and then go on till End of File lazily (in small chunks)?
17:18 raschipi If someone is writing to it, you might get it in a half-written state at the end.
17:21 zakharyas joined #perl6
17:25 firefish5000 m: say( 'succeed'.match(/ suc | [ fail || succeed ]/) );
17:25 camelia rakudo-moar 94fe65: OUTPUT: «?suc??»
17:25 kannan raschipi , ty.
17:26 setty1 joined #perl6
17:26 firefish5000 Can anyone explain why longest alternation 'succeed' isn't used here?
17:27 Skarsnik__ joined #perl6
17:29 firefish5000 I am assuming its a bug, but I haven't thoroughly read the docs/spec in a couple of years.
17:30 Zoffix m: say( 'succeed'.match(/ suc | [ succeed || fail ]/) );
17:30 camelia rakudo-moar 94fe65: OUTPUT: «?succeed??»
17:30 Zoffix firefish5000: dunno, IIRC I seen some ticket on something related to this
17:31 Zoffix Oh, nm, it was this one: https://rt.perl.org/Ticket/Display.html?id=130612#ticket-history
17:31 Zoffix firefish5000: worth reporting it, I think
17:31 Zoffix huggable: rakudobug
17:31 huggable Zoffix, Report bugs by emailing to <rakudobug@perl.org>. See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
17:32 census Zoffix  I didn't mean to get sidetracked before with the $fh business. You were suggesting I install the LWP::Protocol::socks module next. Do you have any suggestions where to go from there?
17:32 firefish5000 Zoffix, Thanks, ill report it then
17:32 Zoffix census: around the same time I gave you a piece of code that performs the HTTP request using socks proxy
17:33 Zoffix census: https://irclog.perlgeek.de/perl6/2017-08-29#i_15085964
17:33 Ulti SVG Plot in Jupyter Notebook http://mattoates.co.uk/files/perl6/jupyter_perl6_plot_test_html.png
17:33 Zoffix bah, Unicode is busted in logs :(
17:34 Zoffix I say anti-Unicode crowd gets a point. My code got ruined and I have no super-easy to recreate it
17:35 census thanks for teching me about log!
17:35 census oh i just found it on my own but now i see the link
17:35 Zoffix census: my $url = ?https://www.expressvpn.com/what-is-my-ip?; say (run :out, "perl", "-e", ?use LWP::UserAgent; my $ua = LWP::UserAgent->new(timeout => 25); $ua->proxy([qw/http https/] => "socks://localhost:2225"); print $ua->get(? ~ $url.perl ~ ?)->content?).out.slurp: :close
17:35 koto joined #perl6
17:36 Zoffix Ulti: looks pretty \o/
17:38 Zoffix Ulti: you should graph (sqrt(cos(x))*cos(400*x)+sqrt (abs(x))-0.4)*(4-x*x)^0.1 next :)
17:39 Zoffix (sqrt(cos(x))*cos(400*x)+sqrt(abs(x))-0.4)*(4-x*x)^0.1 # no space after second sqrt, I think
17:47 Ulti is that the bat sin?
17:48 Ulti I'll save that one for when I've made a proper patch to handle mime types rather than just hack it
17:50 Ulti the quick hack I've done completely breaks the CLI version sadly, I think you have to do quite a bit of work to make the messages work nice for the online notebook and the cli
17:50 Zoffix Nah, it's a heart.
17:51 mst Zoffix: http://paste.scsys.co.uk/564997
17:51 mst (copy-paste from irssi into a unicode Bot;:PasteBot ftw)
17:51 Zoffix mst: :D nice
17:52 mst sometimes, my insistance on using the stupidest tools possible pays off because nothing has a chance to break anything
17:52 Zoffix :)
17:54 gfldex I found I can break pretty much anything even with very simple tools. :->
17:58 lucasb joined #perl6
18:01 robertle joined #perl6
18:05 jdoege joined #perl6
18:11 Ven`` joined #perl6
18:12 ChoHag joined #perl6
18:13 andreoss joined #perl6
18:14 TimToady Ulti: there are 16 and 32-sized Camelias in https://github.com/perl6/mu/tree/master/misc
18:18 Geth ¦ marketing: 51891c79e5 | (Zoffix Znet)++ | 3 files
18:18 Geth ¦ marketing: Add a couple more camelia logo variants
18:18 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/51891c79e5
18:29 yqt joined #perl6
18:32 lizmat Zoffix sumdoc noted for next P6W
18:36 Zoffix lizmat++ thanks
18:40 kannan ok, specific to my needs, instead of trying to emulate tail -f and reacting to a log file entry, i should write a listener to a socket where Asterisk core writes all the security events. Probably like this -> asterisk -> security event -> perl6-listener -> spawn a separate child script to do the reaction.
18:41 kannan this looks like a correct solution, better than patching asterisk logger source code even.
18:46 ShalokShalom joined #perl6
18:48 kannan i am seeing https://metacpan.org/pod/AnyEvent and https://metacpan.org/pod/Asterisk::AMI  (which used https://metacpan.org/pod/EV ) . So my project will restart from scratch , with trying to use inline perl5 and then maybe make new module myself.
18:49 lizmat kannan: perhaps mi.cro.services could be of help ?
18:49 lizmat (as in http://mi.cro.services )
18:50 timotimo if you have a IO::Socket::Async you can already get something good (if asterisk can send you log lines via tcp)
18:50 dogbert2 joined #perl6
18:50 kannan lizmat : i will see what that is, thanks for link!
18:51 El_Che (on the other hand, you really don't want to overengineer simple things: lots of places where stuff can break)
18:51 kannan the events are logged by syslog and also written by core to port 4038
18:51 timotimo then you can start tasks (with "start") to do stuff on the thread pool
18:54 kannan timotimo : i will read up, thanks.
18:56 Cabanossi joined #perl6
18:56 kannan timotimo : https://docs.perl6.org/type/IO::Socket::Async looks good at first glance. i have to try and understand it all.
18:59 census Zoffix I must have done something wrong
18:59 kannan its TCP/IP port 5038 where the events are written by asterisk. prev was wrong
19:00 census https://pastebin.com/VPTE8T8e
19:00 Zoffix m: await IO::Socket::Async.connect('irc.freenode.net', 6667 ).then({given .result {.print("NICK Camelia_\nUSER NotCamelia localhost irc.freenode.net :notCamelia\nJOIN #perl6\nPRIVMSG #perl6 :Sounds like a plan, kannan ^_^\n"); react {whenever .Supply {}}}})
19:00 Camelia_ joined #perl6
19:00 Camelia_ Sounds like a plan, kannan ^_^
19:00 * Zoffix giggles
19:00 camelia rakudo-moar 94fe65: OUTPUT: «(timeout)»
19:01 census am i supposed to fill this part in ?  print $ua->get(? ~ $url.perl ~ ?)->content?)
19:01 kannan let me log this view, last time i forgot to turn on loggin in the irc
19:01 kannan Zoffix thanks, ! !
19:02 Zoffix kannan: we also have channel logs: https://irclog.perlgeek.de/perl6/2017-08-29#i_15086708 (though Unicode in them is currently bustified a bit)
19:02 Zoffix census: what do you see here, question marks or square brackets: ?...?
19:02 kannan Zoffix , nice :)
19:03 Zoffix census: my $url = ?https://www.expressvpn.com/what-is-my-ip?; say (run :out, "perl", "-e", ?use LWP::UserAgent; my $ua = LWP::UserAgent->new(timeout => 25); $ua->proxy([qw/http https/] => "socks://localhost:2225"); print $ua->get(? ~ $url.perl ~ ?)->content?).out.slurp: :close
19:03 Zoffix census: ^ there are square brackets in the code where you have question marks. You probably copy-pasted off broken logs
19:04 dustinm` joined #perl6
19:04 Zoffix square brackets are "string with no interpolation inside". You can write them with ASCII-only symbols like Q/.../ too (just need a symbol that doesn't appear inside the string
19:04 nadim joined #perl6
19:04 maettu left #perl6
19:06 kannan Zoffix : Oh thats so very short and sweet , it looks incredible how we can do like it. i have yet to comprehend it fully and adapt it to my need, but still i can see this is where i will go towards.
19:10 Zoffix kannan: .connect returns a Promise that's kept when it connects, .then executes its block when that Promise is completed (so connected) and the first argument to the block is the promise (in that case, it gets assigned to the topical variable $_) and its .result is the sock. So inside that block, I take the sock (with `given .result` assigning it to $_ topical variable) and inside tell it to send stuff to the
19:10 Zoffix sock (with .print). After I do that, I start a dummy react { whenever {}} block that listens on the .Supply from the sock (so the bot doesn't disconnect right away)
19:10 FROGGS joined #perl6
19:11 Zoffix kannan: we have a concurrency tutorial with some of that stuff: https://docs.perl6.org/language/concurrency  There's also a mutli-server usage example in IRC::Client (not sure how helpful the code is: https://github.com/zoffixznet/perl6-IRC-Client/blob/master/lib/IRC/Client.pm6#L173-L225 )
19:11 Zoffix There's also a blog post for IRC::Client: https://rakudo.party/post/IRC-Client-Perl-6-Multi-Server-IRC-Module
19:11 Zoffix </shameless-selfpromotion> :)
19:13 kannan Zoffix : very good ! my only problem now is i am still struggling with basic concepts, but i think i may be able to get there. i am going thru the perl6 resoruces, rosetta code , thinkperl6 (free ed), and mortiz's perl6 fundamentals.
19:13 Zoffix And here's a filled out react block that reads the stuff: https://github.com/zoffixznet/perl6-IRC-Client/blob/master/lib/IRC/Client.pm6#L203-L214
19:14 Zoffix kannan: yeah, I know the feeling :) Well, good luck. You can always ask for help in this channel, if you're stuck with anything.
19:14 Ven joined #perl6
19:16 kannan Zoffix : thanks. no emoticons can express my appreciation (and i don't have any anyhow)
19:16 Zoffix :D
19:16 espadrine joined #perl6
19:20 kannan i nearly signed up for an online java course... heh.
19:21 firefish5000 Replying to perl6-bugs-followup doesn't seem to add anything to the ticket, nor am I getting any email confirmation. do I need to send it to rakudobug with subject [perl #TICKETNUM] instead?
19:21 mcmillhj joined #perl6
19:22 pecastro joined #perl6
19:24 Zoffix firefish5000: sometimes there's quite a delay while the email percolates through the spam filter (though there have been cases where the emails were totally blocked)
19:25 mr-foobar joined #perl6
19:26 Cabanossi joined #perl6
19:27 ufobat joined #perl6
19:28 Skarsnik_ joined #perl6
19:28 devmikey joined #perl6
19:28 * Zoffix opens email, gets shocked at number of bug emails, and closes the email client :)
19:29 Zoffix AlexDani`++ # handling tickets
19:29 Zoffix firefish5000: I can add your reply to the ticket, if you want. Which ticket and what's the reply?
19:32 firefish5000 Zoffix, Thanks, message is https://pastebin.com/Bp8YuD6t , Bug #131991 . Just corrected the scope, added another example and added platform/version information
19:32 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131991
19:34 wander4096 joined #perl6
19:34 Zoffix firefish5000: done: https://rt.perl.org/Ticket/Display.html?id=131991#txn-1485740
19:35 andreoss Data::Dump cannot handle lazy list
19:35 firefish5000 Zoffix, Thanks! I had been checking to see if it applied every 10 minutes for about an hour :P
19:36 Zoffix :D
19:37 Zoffix andreoss: dd can
19:37 Zoffix m: dd ^Inf .List
19:37 camelia rakudo-moar 94fe65: OUTPUT: «(0, 1, 2, 3, 4, 5, 6, 7, 8, 9... lazy list)?»
19:37 Zoffix m: ^Inf .is-lazy.say; ^5 .is-lazy.say
19:37 camelia rakudo-moar 94fe65: OUTPUT: «True?False?»
19:37 andreoss dd's output is misleding
19:38 andreoss m: my @d = lazy 1,2,3; say dd(@d);
19:38 camelia rakudo-moar 94fe65: OUTPUT: «Array @d = (1, 2, 3, Any, Any, Any, Any, Any, Any, Any... lazy list)?Nil?»
19:38 Zoffix hah
19:39 Zoffix I don't think it can do better than that, 'cause you can't find out .elems of a lazy list
19:40 Zoffix Oh wait, it can. Just pull and check if you got IteratioNEnd
19:40 Zoffix s: &dd
19:40 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/94fe65dbe/src/core/Any.pm#L598
19:40 Zoffix m: my @d = lazy 1,2,3; say @d[lazy ^10]
19:40 andreoss it seems you can dig into internal strtructure and check if the $!iterator value is just an Array
19:40 camelia rakudo-moar 94fe65: OUTPUT: «(1 2 3)?»
19:40 Zoffix Or do that
19:42 andreoss m: my @d = lazy 1,2,3; say @d[^10];
19:42 camelia rakudo-moar 94fe65: OUTPUT: «(1 2 3 (Any) (Any) (Any) (Any) (Any) (Any) (Any))?»
19:42 Zoffix Just need to stick `lazy ` before `^10` over here https://github.com/rakudo/rakudo/blob/94fe65dbe/src/core/Any.pm#L606 or do something smarter and fetch ^11 elems and if you got 10 or fewer in the result, report them as entire (lazy) array without the ... after the elems
19:43 Zoffix (&dd is not starndard feature, so we can change it much more freely than the rest of stuff)
19:45 andreoss m: my @d = lazy 1,2, fail; say @d[^2];
19:45 camelia rakudo-moar 94fe65: OUTPUT: «Failed?  in block <unit> at <tmp> line 1??»
19:46 andreoss is there any point of defining a lazy list of finite length like that?
19:46 andreoss all values will be evaluated before lazy anyway
19:46 MasterDuke joined #perl6
19:47 moritz a lazy list of only literals makes little sense
19:48 andreoss m: my @d := lazy 1,2,fail, fail, die; say @d[^2];
19:48 camelia rakudo-moar 94fe65: OUTPUT: «Failed?  in block <unit> at <tmp> line 1??»
19:48 Zoffix fail returns (or throws if it's in top space)
19:49 Zoffix m: my @d = lazy gather { take 1; take 2; fail }; say @d[^2];
19:49 camelia rakudo-moar 94fe65: OUTPUT: «(1 2)?»
19:49 Zoffix m: my @d = lazy gather { take 1; take 2; fail }; say @d[^5];
19:49 camelia rakudo-moar 94fe65: OUTPUT: «Failed?  in block <unit> at <tmp> line 1??»
19:49 andreoss m: sub foo() {fail}; my @d := lazy 1,2, foo(); say @d[^2];
19:49 camelia rakudo-moar 94fe65: OUTPUT: «Type check failed in binding; expected Positional but got Seq (?)?  in block <unit> at <tmp> line 1??»
19:49 andreoss m: sub foo() {fail}; my @d = lazy 1,2, foo(); say @d[^2];
19:49 camelia rakudo-moar 94fe65: OUTPUT: «(1 2)?»
19:50 andreoss nevertheless foo() is being called before lazy
19:52 Zoffix Yeah, it needs to be inside gather to be a continuation.
19:52 * Zoffix relocates
19:53 zakharyas joined #perl6
19:54 andreoss may be a warning should occur? 'Useless use of lazy in eager context'
19:59 Zoffix andreoss: nah, it gets evaluated before a lazy Seq is made. lazy is a sub and you're giving it args
19:59 andreoss why `lazy` doesnt act as a macro? i.e doesn't evaluate its arguments
20:00 Zoffix Dunno
20:02 TEttinger joined #perl6
20:02 andreoss s: &lazy
20:02 SourceBaby andreoss, Something's wrong: ?ERR: ===SORRY!=== Error while compiling -e?Undeclared routine:?    lazy used at line 6??
20:03 Zoffix Maybe I'm misremembering about it being just a sub =)
20:04 andrzejku joined #perl6
20:04 aindilis joined #perl6
20:06 Zoffix Yeah, it's a statement prefix actually
20:07 pecastro joined #perl6
20:07 Zoffix but close enough: it's a statement prefix that just calls method lazy
20:08 stux|RC-only joined #perl6
20:08 kannan joined #perl6
20:09 Zoffix code: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Actions.nqp#L2317
20:10 andreoss m: use experimental :macros; macro lazy(*@a) { quasi {  Seq.new: class :: does Iterator { state @b = @a; method pull-one { @b.shift || IterationEnd  } }.new  } }; my @x = lazy(1,2,fail(),die()); say @x[^2];
20:10 camelia rakudo-moar 94fe65: OUTPUT: «(AST.new AST.new)?»
20:10 Zoffix (with similarly named token in src/Perl6/Grammar.nqp to parse it)
20:11 andreoss how do i evaluate @b.shift?
20:12 Zoffix andreoss: we have a mechanism called thunking where we can delay code execution (like in `42.say and 70.say or 100.say`) dunno if it's exposed to be freely used in userspace tho
20:12 Zoffix andreoss: in normal code it would be evaluated. dunno what those asts are
20:13 * Zoffix calls it a day
20:13 Zoffix \o
20:18 raschipi o/
20:20 TimToady firefish5000: see S05:2895
20:20 synopsebot6 Link: http://design.perl6.org/S05.html#line_2895
20:20 pharv joined #perl6
20:20 nadim Hi, getting a character from the keyboard, not echoing characters, catching signals, examples somewhere? I want to make a terminal application with Terminal::Print to replace NCurses.
20:20 nadim all pointers welcome
20:22 raschipi nadim, start at the REPL code, also look at the line disciplines for it
20:22 mr-fooba_ joined #perl6
20:23 raschipi For catching signals, look here: https://docs.perl6.org/type/Supply#sub_signal
20:25 geekosaur Terminal::Print actually got that functionality recently, in a branch (raw_input)
20:34 Kyo91_ joined #perl6
20:36 rightfold m: SIGINT.WHAT.perl.say
20:36 camelia rakudo-moar 74ca5c: OUTPUT: «Signal?»
20:37 moritz m: say SIGINT.^name
20:37 camelia rakudo-moar 74ca5c: OUTPUT: «Signal?»
20:46 nadim joined #perl6
20:46 nadim thank you both
20:47 [Coke] AlexDaniel: I would clarify on #122004 not that we "don't care" but that it's an experimental feature. (I assume that was the intent?)
20:47 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=122004
20:50 firefish5000 TimToady, Thanks, just read it. Yep its a dup and that explains the behavior. Could you close #131991 for me.
20:50 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131991
20:51 khw joined #perl6
20:54 nadim geekosaur: I am already on branch no-more-auto-create of Terminal::Print. I'll have to wait for it to be merged to be able to use the other one but I will check it and the docs of it
20:56 Cabanossi joined #perl6
21:21 pilne joined #perl6
21:22 AlexDaniel [Coke]: IIRC we had it as a non-experimental feature, then it was put behind experimental pragma because before 2015.12 some serious issues were discovered. Now it does not look like a high priority feature because we at least have Memoize module in the ecosystem
21:22 AlexDaniel [Coke]: so in almost two years nothing was done about it, and I don't see discussions about it very often… maybe I was wrong to say that “we don't care”, but realistically there's some truth to it
21:27 * [Coke] printed the squashathon and camelia came out squashed.
21:27 * AlexDaniel laughs
21:28 Skarsnik hm, triaging/stating on old bug could be for the next squashathon x)
21:29 [Coke] AlexDaniel: just trying to use precise language. we're all busy folks, no one working on something only means it's not near the top of the list.
21:32 pecastro joined #perl6
21:33 AlexDaniel [Coke]: OK, left a comment in an attempt to redo my frivolous use of language :)
21:33 AlexDaniel that said, expect more stupid comments from me as I'm trying to push around some of the older tickets
21:34 Skarsnik good luck!
21:34 [Coke] Sure. I had some notes on queue maintenance back in the day, should dig those up for the SA.
21:35 * [Coke] hurls https://gist.github.com/coke/ac078396e8f216b83e9a
21:36 [Coke] please feel free to clean that up and use it or just link to it or ignore it or whatever.
21:37 [Coke] I am no longer the only bugadmin who can make other rt bugadmins, but I forgot who it was. zoffix, mebbe?
21:38 cognominal joined #perl6
21:39 AlexDaniel [Coke]: nice list. We can use some of that for another bug squashathon when perl6/roast or perl6/nqp repo will be involved
21:39 AlexDaniel [Coke]: maybe you have some ideas regarding the doc repo for this Saturday?
21:41 Cabanossi joined #perl6
21:44 pecastro joined #perl6
22:05 BooK sub MAIN ( :$arg! ) {}  does not seem to accept --arg klonk, but only --a=klonk
22:08 BooK oh, come on: my $split  := nqp::split("=",$arg);
22:09 BooK (and in my above example, I obviously meant --arg=klonk)
22:11 BooK I actually don't understand the code around that, so maybe I should work on that first :-)
22:12 BooK but, if I try to work my way to a patch to support --arg klonk in addition to --arg=klonk, would someone review it?
22:12 BooK or is there already a good reason not to support that?
22:12 Skarsnik hm
22:13 Skarsnik how to tell not to take a args?
22:14 AlexDaniel BooK: yes, that would be great
22:14 Skarsnik like : cmd --args=foo file.txt and cmd --args foo file.txt
22:14 AlexDaniel BooK: not sure if I'll be able to review it, but I'm definitely interested
22:14 R0b0t1_ joined #perl6
22:15 BooK Skarsnik: for that I need to read the code more :-)
22:15 Skarsnik I think it should you to type your param probably?
22:15 BooK AlexDaniel: sure thing
22:15 Skarsnik +force
22:15 Skarsnik to distinc Bool vs no Bool
22:16 AlexDaniel BooK: note that there are many things about arg handling that are less than awesome. It's simply that we had no MAIN hero yet.
22:16 Skarsnik maybe it written in the spec why?
22:16 mcmillhj joined #perl6
22:16 Skarsnik anyway time to sleep :)
22:16 BooK wow, MAIN hero is an awesome title to earn ;-)
22:19 AlexDaniel now that I think about it, what software supports “--foo 42” style?
22:19 BooK Skarsnik was talking about the spec. Where can I read about that?
22:19 BooK AlexDaniel: Getopt::Long
22:19 Sgeo joined #perl6
22:20 AlexDaniel perl6 --target parse -e 'say 42'
22:20 BooK https://metacpan.org/pod/Getopt::Long#Command-Line-Options,-an-Introduction
22:20 AlexDaniel okay, even perl6 executable itself supports it
22:20 BooK heh
22:21 BooK I tried with: perl6 -e 'sub MAIN(:$arg!) { say $arg }' --arg foo
22:21 cpage_ joined #perl6
22:21 BooK so perl6's MAIN is not your usual MAIN?
22:22 BooK maybe that's a place to look for inspiration
22:23 BooK sub MAIN(@ARGS)  # am I reading that right?
22:25 cdg joined #perl6
22:25 AlexDaniel BooK: I don't understand the question :) How do you read that?
22:25 dogbert2 joined #perl6
22:25 kyan joined #perl6
22:29 mcmillhj joined #perl6
22:34 BooK AlexDaniel: I read this as: perl6 does its own argument handling
22:34 BooK because it's flattening everying in @ARGS
22:34 BooK but I haven't read or written much Perl 6 yet
22:36 Kyo91_ joined #perl6
22:41 BooK the fact that I find myself reading docs/compiler_overview.pod probably means I went too far
22:42 ipatrol joined #perl6
22:44 ipatrol So now I can abuse my customizable Japanese IME to insert Unicode operators,?ufufufu?
22:47 mcmillhj joined #perl6
22:47 [Coke] AlexDaniel: (doc repo) I'll give it some thought.
22:57 cdg joined #perl6
22:58 BooK where should I report bugs? I've been looking on http://perl6.org and it didn't pop out
22:58 mcmillhj joined #perl6
22:58 ipatrol BooK: http://rakudo.org/tickets/
22:58 BooK (I found the perl6 queue on rt.perl.org, but not the link to it from perl6.org)
22:59 BooK ipatrol: thanks
22:59 ipatrol BooK: keep in mind that "Perl6" is itself a language, not a program, and therefore, strictly speaking, cannot have bugs. Rakudo, which is a Perl6 interpreter, on the other hand, can have bugs.
23:00 BenGoldberg joined #perl6
23:01 TEttinger languages can have bugs. they could have conflicts in the specification, for example
23:01 BooK what TEttinger said :-)
23:01 ipatrol TEttinger: I'd call those "flaws" or "defects" as opposed to bugs
23:01 BooK so the "perl6" queue in rt is for rakudo?
23:02 BooK I think if we start nitpicking we will end up picking nits :-)
23:02 TEttinger ipatrol: I'd strictly speaking only call a member of hemiptera a true bug
23:03 Geth ¦ doc: 0cdd8a22cd | (Will "Coke" Coleda)++ | doc/Language/syntax.pod6
23:03 Geth ¦ doc: remove duplicate word (xt/duplicates.t)
23:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/0cdd8a22cd
23:04 ipatrol BooK: A bug is a behavior of a computer program which is contrary to what is expected. Since the Perl6 language defines what "expected" means for Rakudo, the only bugs are behaviors of Rakudo that do not match the Perl6 design documents.
23:04 [Coke] BooK: yes, rt perl6 queue is rakudo
23:04 BooK anyways, I was just trying to figure out how to move forward with my disappointement about MAIN's handling of options
23:04 Kyo91_ joined #perl6
23:05 BooK I first looked at the code hoping I'd be able to produce a patch, but then wondered if my expecations were in line with the spec, so I thought what about a bug report
23:05 cpage__ joined #perl6
23:06 BooK I also eyed the roast test suite looking for tests for MAIN, but didn't find many of them (some of them pointed to the RT queue, this is actually how I found/remembered it)
23:06 BooK I'm basically a confused newbie :-)
23:07 [Coke] so, roast is really the spec - the SYN is a historical document (and I think there was a lot of spec ulative stuff that went in there about options processing which didn't end up getting adopted.)
23:08 BooK and since that spec is a program, it can have bugs ;-)
23:08 BooK [Coke]: more seriously, does that mean any untested behaviour is underspeced?
23:08 BooK underspecified, sorry
23:09 ipatrol BooK: in theory, yes
23:09 ipatrol m: my $patt = /spam|camel|butterfly/; 'camelfly spam' ~~ /$patt/ and say ~$/;
23:09 camelia rakudo-moar 9b43c8: OUTPUT: «camel?»
23:11 BooK but there is some text somewhere too? I mean code is great, and certainly less ambiguous that prose, but prose has its benefits too
23:14 AlexDaniel BooK: there are some historical documents on https://design.perl6.org/, but most of them are becoming outdated
23:14 BooK right, but that's not the right kind of prose :-)
23:14 AlexDaniel well, there's some prose on http://docs.perl6.org/ :)
23:15 AlexDaniel still not the right one :P
23:15 BooK heh
23:15 ipatrol Besides those two, there really isn't anything. If they're outdated or incomplete, that's something that needs to be fixed, but that requires manpower.
23:16 AlexDaniel and we'd much rather have this manpower writing tests or fixing bugs :)
23:16 skids joined #perl6
23:16 AlexDaniel it's less than awesome, but that's how it is
23:16 BooK I knew I should read the headers more closely:
23:16 BooK src/core/Main.pm has this in its TODO section at the top:
23:16 mcmillhj joined #perl6
23:17 BooK Allow both = and space before argument of double-dash args
23:17 BooK which is definitely what I wanted
23:17 BooK so at least now I know a patch in this direction would get some attention
23:17 BooK I just need to learn enough Perl6 to produce it :-)
23:19 ipatrol AlexDaniel: however, I would warn not to neglect the documentation either
23:19 ipatrol We'll never get any traction if no one can figure out how to use the blasted thing :-)
23:21 BooK a reasonable next step for me, I guess, would be to install roast and write a test for the thing I (and the TODO) want
23:25 AlexDaniel BooK: there's already a test for it: https://github.com/perl6/roast/blob/fca87f2030d5cab6fc8460e5b195aecd9b7765b2/S06-other/main-usage.t#L110-L116
23:26 AlexDaniel BooK: and notice that it links to this ticket: RT #124664
23:26 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=124664
23:34 mcmillhj joined #perl6
23:37 BooK AlexDaniel: ah thanks
23:37 BooK I got lost looking for the defintion of is_run
23:43 ipatrol m: my $name = 'exclaim'; sub $name ($phrase) { say "$phrase !!!";} exclaim('hello');
23:43 camelia rakudo-moar 9b43c8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Missing block?at <tmp>:1?------> 3my $name = 'exclaim'; sub7?5 $name ($phrase) { say "$phrase !!!";} e?    expecting any of:?        new name to be defined?»
23:44 ipatrol m: my $name = 'exclaim'; sub $name ($phrase) { say "$phrase !!!";} $name('hello');
23:44 camelia rakudo-moar 9b43c8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Missing block?at <tmp>:1?------> 3my $name = 'exclaim'; sub7?5 $name ($phrase) { say "$phrase !!!";} $?    expecting any of:?        new name to be defined?»
23:44 BooK sub $name ?
23:45 BooK ah ok, trying to do a symbolic reference?
23:45 ipatrol BooK: yes
23:45 ipatrol m: my $name = 'exclaim'; sub $name ($phrase) { say "$phrase !!!";} ${$name}('hello');
23:45 camelia rakudo-moar 9b43c8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Missing block?at <tmp>:1?------> 3my $name = 'exclaim'; sub7?5 $name ($phrase) { say "$phrase !!!";} $?    expecting any of:?        new name to be defined?»
23:46 firefish5000 Wow, the IRC conversation linked in that ticket took a surprising twist. Seems like some familiar developers were against adding the standard --arg val(s?) syntax, for a variety of reasons. I personalty have been parsing ARGS myself for more complex programs anyways (I don't like dashes, and only include them for --help -h)
23:47 ipatrol m: my $name = 'exclaim'; sub $name ($phrase) { say "$phrase !!!";} $($name)('hello');
23:47 camelia rakudo-moar 9b43c8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Missing block?at <tmp>:1?------> 3my $name = 'exclaim'; sub7?5 $name ($phrase) { say "$phrase !!!";} $?    expecting any of:?        new name to be defined?»
23:51 BooK firefish5000: it feels like some of the conversation there is about how it's too hard to implement
23:51 mcmillhj joined #perl6
23:52 ipatrol BooK: it should be implemented since it's part of the POSIX standard
23:52 ipatrol Either in-language, or as a stdlib
23:53 firefish5000 BooK, rather, hard to implement without adding ambiguity they believe doesn't currently exist.
23:54 teatime are long options even in posix
23:55 ipatrol teatime: come to think of it, they might not be. could be a GNU extension
23:55 teatime it is.
23:56 geekosaur long options are not in posix
23:57 ipatrol geekosaur: then they should be implemented as a stdlib like Python does, if the developers feel there is no good way to implement them using regular MAIN signatures
23:57 BooK https://irclog.perlgeek.de/perl6/2011-10-17#i_4578793 # many many programs have different CLI behaviour, so users have had to learn how their tools work for a long time
23:58 BooK I think VMS did option parsing with the same lib for every program, but that's definitely not the case with unix
23:58 BooK just think about tar, dd (whose options are in fact a reference to some other older program with crazy options)...
23:59 ipatrol BooK: I heard dd's syntax was originally meant as a joke
23:59 BooK ipatrol: yeah I read that too
23:59 ipatrol why no one has ever implemented at the very least an alternative syntax is beyond me

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo