»ö« 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 lol 00:01
00:14 markoong left, markoong joined 00:15 markoong left
Bowlslaw lol @ this one-liner `return 'rgb(' ~ (1..3).map({ (^256).pick }).join(',') ! ')';` 00:15
any advice for reading that thing...?
00:15 markoong joined, skids joined
Bowlslaw it concats rgb with 1 though 3 00:15
and a random number from 0 to 256 00:16
and then joins then with a comma
and then takcs on a )
why the 1..3?
00:20 markoong left 00:21 Bowlslaw left, Bowlslaw joined
tobs Bowlslaw: it maps the range 1..3 through a function producing a random value between 0 and 255. The 1..3 is just there to produce 3 random values. 00:22
and the last "!" should be a "~", no? 00:23
geekosaur m: 'rgb(' ~ (1..3).map({ (^256).pick }).join(',') ~ ')'
camelia WARNINGS for <tmp>:
Useless use of "~" in expression "~ (1..3).map({ (^256).pick }).join(',') ~ ')'" in sink context (line 1)
geekosaur whoops 00:24
m: say 'rgb(' ~ (1..3).map({ (^256).pick }).join(',') ~ ')'
camelia rgb(216,216,160)
geekosaur m: say 'rgb(' ~ ^3 .map({ (^256).pick }).join(',') ~ ')'
camelia rgb(82,203,147)
Bowlslaw er yeah, I miscopied it 00:25
tobs m: say 'rgb(' ~ (145..147).map({ (^256).pick }).join(',') ~ ')'
camelia rgb(234,74,127)
tobs it's just the length that matters
I think I'd prefer 00:27
m: say 'rgb(' ~ ((^256).pick xx 3).join(',') ~ ')'
camelia rgb(155,83,43)
00:27 mcmillhj joined
b2gills m: say "rgb({( ( ^256).pick xx 3 ).join(',') })" 00:28
camelia rgb(63,116,192)
b2gills m: say "rgb({ (^256).roll(3).join(',') })"
camelia rgb(107,84,63)
b2gills m: say "rgb({ uint8.Range.roll(3).join(',') })" 00:29
camelia rgb(178,28,110)
tobs hah, that's neat 00:30
m: say Int.Range 00:31
camelia -Inf^..^Inf
b2gills m: $_ = (uint8.Range) but role { method Str () { self.roll(3).join(',') }}␤say "rgb($_)" 00:32
camelia rgb(49,170,188)
00:32 mcmillhj left
b2gills m: $_ = (uint8.Range) but role { method Str () { self.roll(3).join(',') }}␤say "rgb($_)" xx 5 00:32
camelia (rgb(152,115,12) rgb(146,146,226) rgb(7,51,13) rgb(149,149,96) rgb(112,38,209))
00:33 _uzl left 00:36 kurahaupo joined
Bowlslaw Well, this is odd 00:37
I'm looking at CHapter 10: Generating a Tree Map in Moritz's Perl 6 Fundamentals, and when I try to run his code, I get: 00:39
Undeclared name: File used
and undeclared routine: tree
But I went over the code carefully and I copied it exactly
tobs Bowlslaw: start reading the chapter from the start. I just had a cursory glance but it seems File and tree are developed in there. 00:43
Bowlslaw really? 00:44
@_@
OH
yeah...
00:48 mr_ron joined 00:54 lookatme joined 00:59 mcmillhj joined 01:12 Kaiepi joined 01:15 zachk left
Bowlslaw Heh, thse SVG programs are pretty neat 01:24
01:40 molaf left 01:44 ChoHag left 01:45 mcmillhj left 01:47 mr_ron left
Juerd m: class Z does Iterable { method iterator (--> Iterator:D) { class :: does Iterator { method pull-one { die } } } }; my $z = Z.new; for $z { say $z } 01:47
camelia Z.new
Juerd Why does that not die (i.e. why is .iterator not called)? 01:48
Ah, have to "does Positional" apparently 01:49
And forgot a .new
01:49 mr_ron joined 01:50 webstrand joined
Juerd s/does Positional/does Iterable/ 01:51
Hm, no.
Juerd looks again at his working and non-working code, side by side.
Ah, one has "is List"
01:53 molaf joined 01:55 webstran- joined
lookatme :) 01:55
01:56 webstrand left, webstran- is now known as webstrand
Bowlslaw Can someone help me read this method definition? I do not understand the syntax 01:57
method parse(DOM::Tiny:U: Str $ml, Bool :$xml) returns DOM::Tiny:D
My guess is...
It accepts a DOM Tiny Object, and a string, and an optional bool? 01:58
and return a dom tiny object?
01:58 kalkin-- joined
geekosaur it requires a type object, not an instance 01:58
meaning it's a "class method" instead of an "instance method" 01:59
DOM::Tiny.parse(...)
lookatme Bool :$xml is an named argument 02:00
geekosaur so in this case, you might say DOM::Tiny.parse($doc, :xml) which presumably tells it to parse it as XML / XHTML instead of as HTML 02:01
MasterDuke the ':' at the end of the first parameter means it's the invocant when you use the typical 'something.somemethod' calling syntax
02:02 kalkin- left 02:04 _uzl joined 02:05 mcmillhj joined 02:08 subroot left
Bowlslaw thanks 02:08
02:09 mcmillhj left 02:18 _uzl left 02:29 Schepeers left 02:30 Schepeers joined
Bowlslaw When matching a regex, you want to use '~~' smartmatch? 02:34
02:34 Sgeo joined
Bowlslaw Haha, cool 02:36
I instinctively shied away from smartmatch. It's fixed in Perl 6 02:37
02:39 mr_ron left 02:46 mcmillhj joined 02:51 mcmillhj left 02:53 Bowlslaw left 02:54 ufobat___ joined
[Coke] cros and prawns. 02:54
geekosaur "and pawns" works better :p 02:55
02:57 ufobat_ left 02:58 xtreak joined, lizmat left 03:00 EuAndreh[m] joined 03:03 mcmillhj joined 03:07 BenGoldberg joined 03:08 mcmillhj left, Tison joined 03:11 xtreak left, mr_ron joined 03:12 Xliff joined
Tison \o 03:14
03:30 perlpilot left 03:31 mcmillhj joined 03:36 mcmillhj left, webstrand left 03:38 webstrand joined 03:45 mcmillhj joined 03:50 mcmillhj left 03:52 census joined 03:53 xtreak joined
census hi! anybody around? 03:53
03:56 mr_ron left
Xliff o/ 04:00
census: What's up?
04:02 xtreak left 04:03 mr_ron joined, Xliff left 04:06 kaare_ left 04:10 mcmillhj joined, mr_ron left 04:14 mcmillhj left 04:33 Tison left 04:40 mcmillhj joined 04:45 mcmillhj left 04:50 kaare_ joined 04:53 curan joined 05:00 Kaiepi left 05:04 jmerelo joined 05:06 Kaiepi joined 05:09 ufobat___ left, skids left
jmerelo o/ 05:10
Kaiepi \o
05:12 Actualeyes joined 05:13 mcmillhj joined 05:15 sauvin joined 05:17 lizmat joined 05:18 mcmillhj left
masak census: hi! 05:20
census hi masak !
masak long time no census! :D
census i know masak!
i wrote some perl6 code recently. it was wonderful 05:21
masak I know, right? :P
census perl6 has really evolved
masak oh, I thought you meant the constant background wonder of writing Perl 6
census: maybe it's you who evolved ;) 05:22
census yes hopefully :)
perl6 can now do so many features that a few years ago it didn't have libraries for
05:23 AlexDaniel left
masak oh, the libraries side. yes, that has definitely improved. 05:23
05:23 AlexDaniel joined
census masak if you have a quick second i'm in the help-census channel you once created 05:23
masak I'm there, buddy. 05:24
jmerelo masak: was the census published somewhere? 05:27
census haha jmerelo 05:28
05:28 mcmillhj joined
jmerelo census: OK, I get it. I really thought there was a #perl6 dev census :-) Don't know why I didn't see the nick. Too early, too little tea, maybe 05:29
AlexDaniel: Did you see my last comments to D#2124? 05:30
synopsebot D#2124 [open]: github.com/perl6/doc/issues/2124 [trap] Potential trap with concatenating Bufs/Blobs, [~] returns a Str
jmerelo BTW, there _is_ a perl6 dev survey, just in case you haven't filled it up yes docs.google.com/forms/d/e/1FAIpQLS...g/viewform 05:33
05:33 mcmillhj left, MasterDuke left 05:34 wamba joined 05:35 BenGoldberg left
Geth doc: 1f01f2924b | (JJ Merelo)++ | doc/Language/regexes.pod6
Adapts the example #2126

Thanks to @mldevine and @pmichaud for suggestions
05:36
synopsebot Link: doc.perl6.org/language/regexes
05:38 xtreak joined 05:47 mcmillhj joined 05:50 molaf left 05:51 mcmillhj left 05:56 profan joined 06:00 nightfrog joined 06:02 psychoslave joined, damnlie joined 06:03 mahafyi left 06:10 mahafyi joined 06:12 pmurias joined
Geth doc: 41a6409937 | (JJ Merelo)++ | doc/Type/Proc.pod6
Adding example of stream (not dynamic stream variable) inheritance

I've adapted @bdfoy's example, included a bit of @jnthn explanation, and kinda managed to make some sense. This would close #1226 if everyone is satisfied with it.
This might be a trap instead of a part of the documentation. If needed, a trap can be added and linked to this explanation.
06:13
synopsebot Link: doc.perl6.org/type/Proc
06:16 sno left 06:18 espadrine left 06:24 mcmillhj joined 06:27 mahafyi left 06:29 mcmillhj left 06:30 xtreak_ joined 06:33 xtreak left 06:35 xtreak_ left 06:41 mcmillhj joined 06:44 darutoko joined 06:46 mcmillhj left 06:51 mr_ron joined 07:03 mr_ron left 07:06 HaraldJoerg joined 07:07 xtreak joined 07:08 xtreak left 07:15 mcmillhj joined 07:20 mcmillhj left 07:24 sno joined 07:28 ufobat joined 07:36 domidumont joined 07:41 domidumont left, robertle_ joined, domidumont joined 07:44 sena_kun joined 07:53 mcmillhj joined 07:58 mcmillhj left
ecocode weird that pandoc doesn't detect h1,2,3 tags in docs.perl6.org/perl6.html when generating a toc 07:59
08:02 xinming joined, lizmat left 08:07 dakkar joined 08:09 AlexDaniel left, Ven` joined, zakharyas joined 08:16 xinming left 08:18 mcmillhj joined 08:20 lizmat joined 08:22 [Sno] joined, mcmillhj left 08:23 zakharyas left, sno left 08:30 [Sno] left 08:33 rindolf joined, scimon joined 08:34 domidumont left 08:37 mcmillhj joined, [Sno] joined 08:42 mcmillhj left 08:43 domidumont joined
lookatme m: qx{ ls } 08:45
camelia qx, qqx is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in sub QX at src/RESTRICTED.setting line 11
in block <unit> at <tmp> line 1
08:45 zakharyas joined
lookatme evalable6: qx { ls } 08:45
evalable6
lookatme evalable6: qx { ls . }
evalable6
lookatme evalable6: qx { ls / }
evalable6
lookatme hmm, why the qx/QX add new line to the result of `ls` 08:46
and the shell doesn't
dd qx("ls") # output "foo\nbar\n" 08:47
dd shell("ls") # output "foo bar"
evalable6 3rdparty
bin
config-default.json
config.json
CONTRIBUTING.md
data
irc-backup.tar.gz
junk
l…
lookatme, Full output: gist.github.com/7fa4e8f3cb72b3119e...9335f22d5a
timotimo jmerelo: is it okay to publish the free-text-responses verbatim in the user survey response like that? i don't seem to recall the form saying they'd be publically visible, though perhaps that should just be assumed? 08:56
jmerelo timotimo: GDPR strikes back...
08:56 mcmillhj joined
jmerelo timotimo: I think it's OK. It does not include practical information, right? 08:56
I mean personal information.
timotimo: we can delete some response or change it if it does. 08:57
El_Che it looks ok to me
09:01 mcmillhj left
timotimo it doesn't seem possible to read the responses that have only 1 vote in the analytics that have bar charts 09:02
you can only get them displayed partially if you hit the exact pixels, which is difficult for me :|
jmerelo timotimo: unfortunately, with this display there's no other way, and we're wary of sharing the full CSV right now. We'll do it eventually... 09:03
timotimo: and we can share privately with you if you want, of course.
09:31 mcmillhj joined 09:32 jeromelanteri joined 09:36 labster left, mcmillhj left 09:40 markoong joined, labster joined 09:50 mcmillhj joined
tyil tadzik: in Terminal::ANSIColor, %attrs doesn't contain italic, but it does contain bold and underline, is this a bug or intended? 09:53
tadzik tyil: oh, there's italics in the terminal? :) 09:54
tyil you do have ITALIC as a constant
tadzik oh hm
tyil (and that one works on my term)
tadzik lemme see
oh indeed 09:55
09:55 [Sno] left
tyil some terminals apparently even support blinking text 09:55
tadzik it looks like an omission
tyil but please dont support that
09:55 mcmillhj left
jmerelo tyil: I was writing the same :-) 09:55
tadzik :D
hey, we're not python! If somebody wants to hang themselves.... 09:56
tyil hehe
jmerelo tadzik: there should be more than one way to hang ourselve...
tadzik I think it should be there, but I'm going to tactfully sit here and wait for patches rather than adding it in :P
tyil I just noticed this particular thing missing as I'm redoing Pod::To::Pager to clean up the codebase a little, and to improve the footnote rendering
tadzik jmerelo: and one of them could be by blinking text :P
jmerelo tadzik: :-)
tadzik in general, all my modules should be considered community modules and are up for adoption :) 09:57
tyil I can put in a PR to add the italic line if you want :p 09:58
tadzik sure :) But do pester me to merge it, or I'll forget as always
tyil I know that feeling 09:59
tadzik: pester pester github.com/tadzik/Terminal-ANSIColor/pull/15 10:03
it worked on my machine(tm), but feel free to do some more testing
I like how there's a 3 year old issue to add tests :p 10:04
also, I did not bump the version in META6.json yet 10:05
10:05 domidumont left
tadzik oh, I guess that'd be nice 10:06
tyil the version bump, or the tests? 10:07
tadzik the version bump :)
10:07 mcmillhj joined
tyil I'll add that 10:07
tadzik thanks
most of my module work was done before version were really a thing :P 10:08
10:08 xinming joined
tyil done there 10:08
I would recommend semver for pretty much everything ever
and a CHANGELOG to indicate what exactly changes, and have each PR submitter update the CHANGELOG themselves, so you dont have to worry about it 10:09
10:11 Actualeyes left, Khisanth left 10:12 mcmillhj left 10:27 Kaypie joined, Kaiepi left
sjn o/ 10:29
10:29 jeromelanteri left
jmerelo sjn: hi! 10:29
sjn quick question; why does Str.split("") add a empty strings to the beginning and end of it's result? 10:30
m: dd "abc".split("") 10:31
camelia ("", "a", "b", "c", "").Seq
tyil because there's an empty string before and after the string you're splitting as well
m: dd "abc".comb();
camelia ("a", "b", "c").Seq
tadzik sjn: try .comb()
ah :)
timotimo split also has :skip-empty 10:32
jmerelo sjn: probably splits on start-letter or end-letter
sjn yeah, found :skip-empty; I just found it curious that the default was to add those empty strings
jmerelo dd "abc…þ".split("") 10:33
evalable6 ("", "a", "b", "c", "…", "þ", "").Seq
10:33 HaraldJoerg left
sjn tadzik: yeah, comb is better :) 10:33
timotimo it splits where-ever the empty string matches. unlike length-one strings it also matches on positions 0 and $t.chars
10:34 HaraldJoerg joined
sjn thinks .comb should be mentioned in a "see also" section in the .split docs :) 10:34
tadzik that's a good idea 10:35
sjn ...which it appatently does!
apparently*
jmerelo sjn: create an issue :-)
sjn it's just "invisible" 10:36
10:41 Kaypie left, Merfont joined
tadzik tyil: merged, thanks :) 10:43
tyil tadzik: thanks :>
now I can make my codebase more consistent again 10:46
10:55 ilogger2 joined, ChanServ sets mode: +v ilogger2, mcmillhj joined
masak sjn: maybe the fact that your separator argument is the empty string is obscuring from how sensible it is to include empty strings in the returned list 10:57
m: say ",,,1,2,,3,,".split(",")
camelia ( 1 2 3 )
masak m: say ",,,1,2,,3,,".split(",").perl
camelia ("", "", "", "1", "2", "", "3", "", "").Seq
masak sjn: there are three empty strings in the beginning here because there are three separators without any elements before the first element 10:58
sjn: the same argument can be extended to when the separator is ""
sjn yep, got that :) 10:59
makes sense when thinking about it; just a little confusing when bumping into it the first time 11:00
11:00 mcmillhj left
masak agreed :) 11:14
11:15 mcmillhj joined
masak sjn: I think Perl 5 mostly has the inconsistency put in because .split("") is often used as .comb(/./) 11:15
and then an initial empty string is surprising 11:16
Geth doc: 0173be5d4a | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Cool.pod6
Make `comb` a more obvious suggestion in `split` docs
synopsebot Link: doc.perl6.org/type/Cool
masak once you know about .comb, though, using .split in that way feels like a misuse
timotimo agreed
11:18 Zoffix joined
Zoffix lookatme: I think you're measuring incorrectly. `dd shell("ls")` would not dump the output of `shell`, as that would just be put directly into STDOUT. You need to use `dd (shell :out, "ls").out.slurp` in which case I get the trailing newline for both qx// and shell() 11:19
11:20 mcmillhj left
Zoffix lookatme: in fact, Rakudo's implementation of qx// uses shell() under the hood: github.com/rakudo/rakudo/blob/e6e9...#L247-L251 11:21
.tell Bowlslaw smartmatch was never broken in Perl 6 :) Perl 5 borrowed the concept, but it failed there because of lack of types. There are also several methods to do the regex stuff that in Perl 5 is done with ops: .match(), .subst(), .= subst(), .trans() 11:27
yoleaux Zoffix: I'll pass your message to Bowlslaw.
11:28 pmurias joined 11:29 mahafyi joined, Zoffix left 11:31 sno joined 11:34 mcmillhj joined 11:36 dct joined, psychoslave joined 11:40 mcmillhj left 11:41 Ven` joined 11:50 dct left 11:52 mrdside joined 11:53 mrdside left 11:54 mcmillhj joined 11:57 xinming joined 11:59 mcmillhj left 12:04 pmurias left 12:09 pmurias joined, mr_ron joined 12:14 mr_ron left
jmerelo squashable6: status 12:24
squashable6 jmerelo, Next SQUASHathon in 8 days and ≈21 hours (2018-07-07 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
12:24 pmurias left 12:31 pmurias joined 12:42 sno left 12:46 psychoslave left, mcmillhj joined 12:47 mcmillhj left 12:48 brrt joined 12:51 mcmillhj joined 12:53 jeromelanteri joined 12:54 kanbas joined 12:59 zakharyas joined 13:06 psychoslave joined 13:07 sno joined 13:12 hankache joined 13:36 AlexDaniel joined 13:41 brrt left
hankache Hello #perl6 13:42
I made a nanorc file for Perl 6. Anyone using nano as his/her text editor would be able to use it to get syntax highlighting for Perl 6: github.com/hankache/perl6.nanorc 13:45
I hope you'll find it useful
Feedback welcomed. 13:47
13:57 skids joined
AlexDaniel .tell melezhik colabti.org/irclogger/irclogger_log...06-27#l448 13:58
yoleaux AlexDaniel: I'll pass your message to melezhik.
AlexDaniel hankache: also added it to the list on github.com/perl6/user-experience/issues/19 13:59
hankache AlexDaniel thanks 14:00
AlexDaniel hankache: have you considered submitting a patch to nano? It seems to be actively maintained 14:04
hankache AlexDaniel yes I do. I just want to get some feedback before submitting it. 14:05
AlexDaniel maybe there's room for improvement 14:06
AlexDaniel hankache: there is, I think it doesn't pick up perl6 shebang currently 14:07
hankache: and note that you'll probably have to modify the perl5 syntax file if so that it stops matching
hankache: unicode quotes and operators are not supported, is that intended? 14:08
hankache: should I file a ticket for each one of these? ↑ 14:09
hankache AlexDaniel yes please
AlexDaniel done, I think 14:13
hankache AlexDaniel thanks, I'll work on them asap 14:14
AlexDaniel weekly: Perl 6 syntax highlighting in nano: colabti.org/irclogger/irclogger_log...06-27#l448 14:16
notable6 AlexDaniel, Noted!
14:17 turdmonkey joined, turdmonkey is now known as Bowlslaw
Bowlslaw Good morning! 14:17
yoleaux 11:27Z <Zoffix> Bowlslaw: smartmatch was never broken in Perl 6 :) Perl 5 borrowed the concept, but it failed there because of lack of types. There are also several methods to do the regex stuff that in Perl 5 is done with ops: .match(), .subst(), .= subst(), .trans()
14:19 kaare_ joined
Bowlslaw Ah, so Perl 5 got it from Perl 6. 14:20
That's something I like about Perl 6 the type system.
It gives me a very Haskell-y feeling
The ability to write subs almost exactly like in Perl 5, but if I want/need extra clarity or restrictions, it lets you write LESS code 14:21
don't need to manually write error checks and such in Perl 6 if you make a type parameterized sub definition
14:33 Khisanth joined 14:38 hankache left 14:55 domidumont joined 14:58 mcmillhj left, mcmillhj joined 14:59 molaf joined 15:01 brrt joined 15:03 domidumont left 15:07 jmerelo joined
tbrowder_ .tell tyil The pod input/output block problem should be fixed on the rakudo master branch, please check it out when you get a chance. 15:18
yoleaux tbrowder_: I'll pass your message to tyil.
15:25 brrt left 15:26 fake_space_whale joined
tbrowder_ ref class instances: is there any way to get the name of the class (type) of a class instance? 15:27
i know i can do a smart match if i know the class name, but what if i don’t know the name? 15:28
15:28 sno left
jmerelo tbrowder_: ^mro returns the class hierarchy, including the class name, I think. 15:30
m: say Hash.^mro
camelia ((Hash) (Map) (Cool) (Any) (Mu))
jmerelo m: my $foo = 3; say $foo.^mro
camelia ((Int) (Cool) (Any) (Mu))
jmerelo m: my $foo = 3; say $foo.^mro.first
camelia (Int) 15:31
Geth perl6.org: b2c7fd95f2 | (Rafael Schipiura)++ (committed using GitHub Web editor) | source/whatever/index.html
Add nanorc from @hankache
15:32
tbrowder_ m: class foo {}; my $c = foo.new; say $c.^mro 15:33
camelia ((foo) (Any) (Mu))
lucs m: class foo {}; my $c = foo.new; print $c.^name 15:35
camelia foo
jmerelo lucs: of course :-) 15:36
lucs Makes sense, eh :)
tbrowder_ jmerelo: thanks! i’ve been trying to find how to do that in the docs but no luck so far. that’s not very intuitive, and i want to make sure it’s in the introspection section (i didn’t notice it when searching).
AlexDaniel jmerelo: I don't understand the question on D#2124
synopsebot D#2124 [open]: github.com/perl6/doc/issues/2124 [trap] Potential trap with concatenating Bufs/Blobs, [~] returns a Str
jmerelo tbrowder_: feel free to create an issue :-)
AlexDaniel jmerelo: it's quite simple – `my $x = [~] @bufs` is OK unless @bufs is empty, because the identity object for ~ is "" 15:37
jmerelo AlexDaniel: correct
AlexDaniel jmerelo: and this hidden (or at least not very visible) special casing makes it a trap, that's it 15:38
jmerelo AlexDaniel: it's OK as long as @buffs contains only Bufs also.
AlexDaniel m: my Buf @bufs; say [~] @bufs
camelia
AlexDaniel m: my Buf @bufs; say ([~] @bufs).perl
camelia ""
tbrowder_ i also didn’t have any luck with the ^name, but i probably fumbled it. i was trying to find the class name of a $=pod object. 15:39
jmerelo AlexDaniel: anyway, that's what I was trying to say.
AlexDaniel jmerelo: here you can even say that @bufs can only contain Bufs
jmerelo: or, in most cases, you just “know” that it will only have Bufs or Blobs
jmerelo AlexDaniel: but that's what I say in the trap text
tbrowder_ lucs: thanks!
lucs You're welcome 15:40
jmerelo tbrowder_: Pod documentation is not great. But feel free to create an issue too.
lucs: :-)
AlexDaniel: even if you declare it as Buf Array, same problem, I think. 15:41
m: my Buf @buffs; say [~] @buffs;
camelia
jmerelo m: my Buf @buffs= Buf.new; say [~] @buffs;
camelia Buf:0x<>
Bowlslaw woah
does that stringify everything in the bufs array? 15:42
jmerelo Bowlslaw: no, Bufs can't be stringified. ~ will concatenate bufs.
m: my Buf @buffs= Buf.new, 'not-a-buf'; say [~] @buffs; 15:43
camelia Type check failed in assignment to @buffs; expected Buf but got Str ("not-a-buf")
in block <unit> at <tmp> line 1
jmerelo AlexDaniel: do you want to write something in that issue or you want me to try again? Reassign the issue if so...
El_Che I know pod is a perl 5 inheritince of the early days. But do people in 2018 still like it over markdown and other more popular alternatives? I always cringe when I need to write pod (5 or 6).
Bowlslaw ah, i see
jmerelo El_Che: you haven't tried DocBook... 15:44
El_Che (and specially thinking of modules with the doc in the code that's not rendered on github)
jmerelo El_Che: it will be
El_Che jmerelo: pretty much standerized with md
blame github :)
AlexDaniel jmerelo: that's not what it says in the docs…
Bowlslaw p6: my @array = <1 2 3 4 5>; say [+] @array;
camelia 15
Bowlslaw p6: my @array = <1 2 3 4 5>; say [~] @array; 15:45
camelia 12345
Bowlslaw :-O
AlexDaniel jmerelo: in the docs it says that you can't concat Blob/Buf with other objects
El_Che jmerelo: standalone pod, sure, but pod withing code files? Not very likely/desireble
AlexDaniel jmerelo: which is obvious, really
Bowlslaw ok i am in love with reduction operators now
jmerelo AlexDaniel: so not false :-)
Bowlslaw: they are great as long as you don't fall into a trap
AlexDaniel jmerelo: it also talks about concatting Blobs with Arrays, which is even more obvious
Bowlslaw p6: my @array = <1 2 3 4 5>; say [-] @array;
camelia -13
jmerelo El_Che: literate programming!
Bowlslaw What trap, jmerelo? 15:46
AlexDaniel jmerelo: and I have never seen anyone even assume that concatting a Blob with an Array is going to give any meaningful result
El_Che jmerelo: you're a mini-Knuth
jmerelo Bowlslaw: D#2124
El_Che :)
AlexDaniel jmerelo: and it never mentions the identity element of ~ and how reducing an array has a special case when it's empty
jmerelo El_Che: he's an academician, and we are all a big broterhood united by our love of tenure and the H number.
AlexDaniel jmerelo: IMO the right section for it is “Unfortunate generalization”, right next to docs.perl6.org/language/traps#Usin...t_of_lists 15:47
El_Che jmerelo: yeah, I have been a member of faculty councils before
jmerelo: saw a lot of fraterny there :)
jmerelo AlexDaniel: right. Do you want to have a go, or you want me to give it a try? You are right...
AlexDaniel: OK.
Bowlslaw jmerelo: ??? 15:48
El_Che jmerelo: the Cain and Abel kind
jmerelo Bowlslaw: github.com/perl6/doc/issues/2124
El_Che: :-)
Bowlslaw lol
jmerelo Bowlslaw: that's what AlexDaniel and me are talking about now.
AlexDaniel jmerelo: I don't mind if you give it another try, but I did assign myself because I'm ready to work on it :) 15:49
maybe during the squashathon, not today for sure
jmerelo AlexDaniel: let me give it a try. Pleeeeez
AlexDaniel go for it :)
jmerelo AlexDaniel: :-)
Geth doc: JJ unassigned from AlexDaniel Issue Potential trap with concatenating Bufs/Blobs, [~] returns a Str github.com/perl6/doc/issues/2124
JJ self-assigned Potential trap with concatenating Bufs/Blobs, [~] returns a Str github.com/perl6/doc/issues/2124

Moves answer to a new section and reflows; refs #2124
15:51 psychoslave left
Bowlslaw push @links, $link or @links.push($link) 16:06
is there any significant difference?
16:08 sno joined
moritz no, both work 16:08
16:10 Zoffix joined
Zoffix Bowlslaw: on current Rakudo, the method form is much more beneficial, performance-wise 16:11
m: for ^30000 { push [], 42; Nil }; say now - ENTER now 16:12
camelia 0.2650614
Zoffix m: for ^30000 { [].push: 42; Nil }; say now - ENTER now
camelia 0.04407065
Zoffix like 7x faster
Bowlslaw wow 16:15
Well, that makes sense, considering what I read about sub vs methods the other day
subs check globally, while methods only check within their object's scope, right?
Zoffix Bowlslaw: it's not about sub vs. method, it's about slurpies dispatch caching. This perf difference doesn't apply to all sub-vs-method calls
classes aren't closures, right. 16:16
D#2124
synopsebot D#2124 [open]: github.com/perl6/doc/issues/2124 [trap] Potential trap with concatenating Bufs/Blobs, [~] returns a Str
Zoffix wonder why the bot didn't reply in colabti.org/irclogger/irclogger_log...06-27#l569 16:17
Ah, 'cause it was within the cooldown period of it already being mentioned a few lines up 16:18
AlexDaniel maybe the cooldown should be reduced
I think it's ok if the bot is just a bit more noisy 16:19
Zoffix synopsebot: source
synopsebot Zoffix, See: github.com/perl6/synopsebot
Zoffix Just change the 10*60 to lower value and pull and restart the bot: github.com/perl6/synopsebot/blob/m...ner.pm6#L4
hm 16:20
nm, I'll do it. I see a memory leak bug in that code
kalkin-- Zoffix: @source-url Thank you for your clarification 16:22
I will implement an algorithm which looks up if url ends with some archive, if not it is a repository, if not download archive open-it look in to META6.json
16:23 synopsebot joined, ChanServ sets mode: +v synopsebot
Bowlslaw Is there documentation on passing arrays to subs? 16:23
Zoffix Bowlslaw: dunno, maybe these? docs.perl6.org/type/Signature#Slur...Parameters 16:24
kalkin-- Where can I find documentation on modules.perl6.org API? 16:25
or did I misunderstood you Zoffix? 16:26
16:27 fake_space_whale left
Zoffix kalkin--: kinda, I guess. There's no well-defined API, it's just on some pages (like search) if you ask for JSON by appending `.json` or `/.json` to URL, you'll get the stash variables used by the page as JSON. 16:27
So, like, there are no tests and it might change
There are some general site use docs: modules.perl6.org/help 16:28
Like documenting what you can put into search
eco: from:cpan
buggable Zoffix, Found 274 results: Bailador, zef, Inline::Perl5, JSON::Tiny, App::Mi6. See modules.perl6.org/s/from%3Acpan
Zoffix eco: author:zoffix
buggable Zoffix, Found 47 results: Acme::Anguish, IRC::Client, WWW, CoreHackers::Sourcery, GlotIO. See modules.perl6.org/s/author%3Azoffix
kalkin-- Zoffix: what did you mean by getting repo-url from modules.perl6.org?
doc: 2856dd3b9e | (JJ Merelo)++ | doc/Language/traps.pod6
Proposes a new formulation for empty buffer array trap

Which would, just maybe, close #2124 if everyone is happy with it.
synopsebot Link: doc.perl6.org/language/traps
kalkin-- some people even put the git url in to support: { source: "git://…" } 16:30
16:30 n1ge joined
Zoffix kalkin--: yeah, that's the way the Perl 6 Speculations have it. The `source-url` is an ecosystem extension. 16:31
kalkin-- bioperl6 has source-type field set to git and source-url to git url 16:32
can't we just standartize that META6.json SHOULD have a repo-url? 16:33
Geth ¦ doc: AlexDaniel unassigned from JJ Issue Potential trap with concatenating Bufs/Blobs, [~] returns a Str github.com/perl6/doc/issues/2124
¦ doc: AlexDaniel self-assigned Potential trap with concatenating Bufs/Blobs, [~] returns a Str github.com/perl6/doc/issues/2124
jmerelo AlexDaniel: no, really...
Zoffix kalkin--: as for repo-url, yeah, I meant use the "api". If you take modules.perl6.org/s/author%3Azoffix you can slap `/.json` on it to get the data in JSON format, and each dist has repo-url that should point to the repo, if one was provided: perl6 -MWWW -e 'jget("modules.perl6.org/s/author%3Azoffi...>».say' 16:34
jmerelo AlexDaniel: What's the problem now?
Zoffix kalkin--: and modules.perl6.org/repo/IRC::Client will redirect to the repo
AlexDaniel jmerelo: it's actually pretty good! Just not perfect
jmerelo AlexDaniel: not perfect is my thing. 16:35
AlexDaniel: so thanks!
Zoffix kalkin--: are you volunteering to spec the META6.json file? :)
AlexDaniel jmerelo: “identity elemnt” can link to wikipedia for example, and I think we can also have a section about that in our docs too
jmerelo AlexDaniel: I thought first to link the long discussion, but then, well, it's long.
AlexDaniel jmerelo: it's an important concept I think, especially in context of reduce op […] 16:36
kalkin-- Zoffix: I actually wouldn't mind doing that, but I'm not sure if I'm proficient enough in Perl6 infrastructure
Zoffix kalkin--: 'cause currently it's just a speculation. There's no spec at all IIRC. There's #perl6-toolchain channel for this part of the language; I don't know to what state there's an agreement vis-a-vis spec.
jmerelo AlexDaniel: maybe glossary?
Zoffix kalkin--: you could talk to ugexe IIRC they did a lot of thinking on what META6.json should have
AlexDaniel jmerelo: no, a whole section, with a table for perl 6 ops
jmerelo: hold on… 16:37
kalkin-- Zoffix: What about S22? Is it completely obsolete?
16:37 domidumont joined
jmerelo AlexDaniel: in language/operators? 16:37
Zoffix kalkin--: S22 is the speculation. AFAIK it's more or less current, but it's not encoded in the language specification.
(which is github.com/perl6/roast/ ) 16:38
(well, as far as I know. There are some module loading tests, but I don't know how well they cover META6.json stuff) 16:39
kalkin-- ok, so specifying META6.json format would also consist of writing tests for the language specification. 16:40
Zoffix Yeah
kalkin-- Zoffix: from a glance it doesn't cover much of META6.json
AlexDaniel jmerelo: there D#2129
synopsebot D#2129 [open]: github.com/perl6/doc/issues/2129 “Identity element” section with an explanation and a table of perl 6 ops
jmerelo AlexDaniel: I'm going to ban you from opening new issues until you close D#2124. Or someone closes it. 16:41
synopsebot D#2124 [open]: github.com/perl6/doc/issues/2124 [trap] Potential trap with concatenating Bufs/Blobs, [~] returns a Str
AlexDaniel jmerelo: haha. Well, I said I'll fix it
Zoffix kalkin--: though it's possible the toolchain group decided to have the META6.json spec separate from main language spec. I dunno. I'm not familiar at all with that part of the language
AlexDaniel jmerelo: then, `[~] @buffs` where @buffs was pre-filled with an empty blob, is an interesting idea
jmerelo: but I don't know how good it is performance-wise 16:42
jmerelo: I'd guess it's shit
jmerelo AlexDaniel: well, it prevents you from falling into the trap and since it's an empty buffer, it disappears as soon as it's merged.
AlexDaniel jmerelo: in the ticket I listed `Blob.new: |«@chunks` as an option, maybe it is faster… I haven't timed it
Zoffix m: my Blob:D $x = ([~] @buffs) || Blob.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@buffs' is not declared
at <tmp>:1
------> 3my Blob:D $x = ([~] 7⏏5@buffs) || Blob.new
Zoffix your mom is undeclared, robot 16:43
m: my Blob:D $x = [~] [] || Blob.new
camelia ( no output )
AlexDaniel jmerelo: ↑ or that, even
jmerelo AlexDaniel: that's cute.
AlexDaniel similar to what you suggest performance-wise, but less hacky
16:44 Kaiepi joined
jmerelo AlexDaniel: you calling me hacky? 16:44
AlexDaniel jmerelo: and then, as I said, I think the best place for it is right next to docs.perl6.org/language/traps#Usin...t_of_lists 16:45
ah, it's there
jmerelo AlexDaniel: :-)
AlexDaniel is blind
jmerelo is hacky
AlexDaniel jmerelo: I do care about performance in this case though, gluing blobs is very likely to be in a path where performance matters 16:46
jmerelo AlexDaniel: I hadn't thought about that... 16:47
jmerelo clickbaits lizmat's TPC talk: www.youtube.com/watch?v=EjE-weTVKV...p;index=67 Really worth the while.
AlexDaniel now yeah, docs should not document implementation-specific performance details, but if there's an easy way to recommend an approach that is many times faster (especially Blob-related), we probably should
jmerelo AlexDaniel: yep
AlexDaniel but still, I haven't timed it, I don't know :) 16:48
Bowlslaw wait..do I not need a semi-colon?? 16:50
say @links.join("\n") works just fine, without a ';'
16:50 pmurias left
AlexDaniel Bowlslaw: last statement of any block doesn't need a ; 16:51
Bowlslaw aaaa
Zoffix Bowlslaw: semicolon is like a statement separator, if you ain't got any stuff to separate it from, you ain't need it
Bowlslaw puts semi-colon anyway
16:51 Ven` left
Bowlslaw ;p 16:52
AlexDaniel weekly: over 200 responses for the survey!
notable6 AlexDaniel, Noted!
Zoffix Bowlslaw: some coders follow the convention that if the statement is used as a return value, to omit the semicolon, otherwise to use it... so `sub foo { if $foo { bar } else { ber } }` but `sub foo { if $foo { bar; } else { ber; }; meows }` 16:54
jmerelo AlexDaniel: I'm still surprised how many people have answered "Unsure". As in someone whispered it to them in a dark alley or something... 16:55
AlexDaniel: or showed up in their dreams.
AlexDaniel jmerelo: I answered that
16:55 Ven` joined
AlexDaniel in fact I probably added that option to the survey 16:55
Zoffix jmerelo: I answered that. It's been like 15 years ago that I found out about it. I don't remember how
AlexDaniel same, it was that long ago, but I still don't remember 16:56
wasn't***
jmerelo AlexDaniel: So maybe the right answer is "So long ago I don't remember"
But anyway, not that many options. Either in a conference, or maybe in Slashdot (remember Slashdot?), or in Perlmonks... 16:57
AlexDaniel nah 4-5 years ago is not that long ago…
jmerelo Zoffix: to be sure, I'm also unsure. But there weren't that many options, so I chose the most sensible one...
AlexDaniel I'm pretty sure it was something related to perl5, but not a conference, and not perlmonks
jmerelo It's surprising also the second language behind Perl is C/C++. So it's appealing for people who are not into scripting... Also Python, but Python is popular anyway. 16:59
Zoffix m: $/={.substr-rw: ٦+١,١}; $/($_)=$/($_)x ٢ with $!=" ".uniname;$!.say 17:02
camelia Start argument to substr out of range. Is: 7, should be in 0..5; use *-7 if you want to index relative to the end
in block <unit> at <tmp> line 1
Zoffix huh
17:02 n1ge left
Zoffix m: $/={.substr-rw: ٦+١,١}; $/($_)=$/($_)x ٢ with $!=" ".uniname;$!.say 17:02
camelia Start argument to substr out of range. Is: 7, should be in 0..5; use *-7 if you want to index relative to the end
in block <unit> at <tmp> line 1
17:02 user2 joined
Zoffix this is trippy 17:02
17:02 n1ge joined
Zoffix 'cause this code works fine in #zofbot 17:02
Ah
17:02 user2 left
Zoffix stupid terminal 17:02
Bowlslaw Zoffix: I think that omitting return and semi-colons is great when you have a smaller script, but I think I will stil use them in larger programs, where readability is more important
Zoffix m: $/={.substr-rw: ٦+١,١}; $/($_)=$/($_)x ٢ with $!="🎉".uniname;$!.say 17:03
camelia PARTY POOPPER
Zoffix Bowlslaw: return makes stuff slower
Bowlslaw: also, that doesn't make sense. The subs in smaller and larger programs would normally be around the same size.
m: sub foo { rand }; for ^1000_000 { foo; Nil }; say now - ENTER now 17:04
camelia 0.1279784
Bowlslaw hmm
Zoffix m: sub foo { return rand }; for ^1000_000 { foo; Nil }; say now - ENTER now
camelia 0.287086
Bowlslaw what the
Zoffix :)(
'cause it installs a control exception handler or whatever
Bowlslaw why use return 17:05
skids It's an implementation quirk... return uses exceptions.
Zoffix Well, it's *currently* slower, I guess I should say
Bowlslaw o
skids Yeah it could be optimized out someday.
I would not avoid it if you are returning in the middle of a sub conditionally just for that, unless it's a really performance senstive area. 17:06
AlexDaniel Bowlslaw: well, if you're not writing “return”, then leaving out a semicolon for the last statement is potentially useful 17:07
Bowlslaw: makes sure that no one (including yourself :) ) will write another line after that, without touching it of course
Zoffix Hm. Maybe even soon-day? It can be done in the static optimizer even, right? If the `Op (callstatic &return)` is the last thing, then toss it? 17:08
It sounds so simple, that it makes me think it would've been done already long ago.
skids Can you catch control exceptions?
Zoffix What do you mean? 17:09
skids If you can catch a return somehow, then there's a semantic difference.
Zoffix ah, right
AlexDaniel m: sub foo() { my &return = { say ‘haha’ }; return 42 }; say foo
camelia haha
True
AlexDaniel Zoffix: what about this? ↑ 17:10
Zoffix AlexDaniel: you can see if the symbol is from core in the static optimizer
AlexDaniel right
Zoffix m: sub foo() { CONTROL { default { say "meow" } }; return 42 }; say foo
camelia meow
Nil
Zoffix m: sub foo() { CONTROL { default { say "meow" } }; 42 }; say foo
camelia 42
AlexDaniel can you check that there's no CONTROL block? 17:11
greppable6: CONTROL
greppable6 AlexDaniel, 250 lines, 35 modules: gist.github.com/7ff39ad359895a1ec8...009bbc083e
Zoffix skids: looks like it's still fairly easy. Just keep an eye out for `handle` op 17:12
|3d see if `return` as last statement can be optimized colabti.org/irclogger/irclogger_log...06-27#l771
ZofBot Zoffix, Will remind you on 2018-06-30T13:12:50.268537-04:00 about see if `return` as last statement can be optimized colabti.org/irclogger/irclogger_log...06-27#l771
skids m: sub bar { return 42 }; sub foo() { CONTROL { default { say "meow" } }; bar() }; say foo
camelia 42
skids yeah cause CONTROL doesn;t have scoping issues, (I think?) 17:13
Zoffix hm
m: constant &bar = { return 42 }; sub foo() { CONTROL { default { say "meow" } }; bar() }; say foo
camelia Attempt to return outside of any Routine
in block at <tmp> line 1
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix *phew* :)
I forget the rule. It has to be dynamically visible to the sub? 17:14
m: sub foo() { constant &bar = { return 42 }; CONTROL { default { say "meow" } }; bar() }; say foo
camelia Attempt to return outside of any Routine
in block at <tmp> line 1
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
17:14 zakharyas left
Zoffix oh but still, this can be detected, because we'd be looking for `handlepayload` op in the same QAST::Block 17:15
skids I seem to remember exceptions being much slower than in that above test at one point... good to see that speedup.
Zoffix Yeah, IIRC jnthn++ did work on improving the `return` use, which makes me think he probably would've already optimized it away if it were possible 17:16
Actually, I'm not gonna work on this this weekend, I gotta do other stuff. 17:18
|31d see if `return` as last statement can be optimized colabti.org/irclogger/irclogger_log...06-27#l771
ZofBot Zoffix, Will remind you on 2018-07-28T13:18:31.740296-04:00 about see if `return` as last statement can be optimized colabti.org/irclogger/irclogger_log...06-27#l771
Zoffix So if anyone else wanna have a go, go for it :)
sena_kun some quite black magic goes here: 1)I can get package in scope by runtime value as `::($foo)`. 2)I can work with things inside of package using e.g. `Package::Foo::.kv`. 3)But I cannot combine 1 and 2, the package I'm getting from runtime resolution ends up being empty. My thought is like `my $a = 'Foo::Bar'; my $p = ::($a); say $p::.kv` does not work.` Is it a dead end?
Zoffix sena_kun: but you're missing the `::` 17:19
should be ::($a)::
m: use Test; say Test::.kv
camelia (&todo_output sub todo_output () { #`(Sub|74086320) ... } &output sub output () { #`(Sub|74086472) ... } &failure_output sub failure_output () { #`(Sub|74086624) ... } EXPORT (EXPORT))
Zoffix m: use Test; my $a := 'Test'; say ::($a)::.kv 17:20
camelia ()
Zoffix oh, *shrug*
sena_kun Zoffix, it's the same with `::($a)::`, yup.
I've tried that, but thought maybe with variable it'd be better - no luck.
Zoffix m: use Test; my $a := 'Test'; say ::($a).WHO.kv 17:21
camelia (&output sub output () { #`(Sub|71934408) ... } EXPORT (EXPORT) &todo_output sub todo_output () { #`(Sub|71934560) ... } &failure_output sub failure_output () { #`(Sub|71934712) ... })
sena_kun Oh, that's brilliant. Zoffix++
Thanks a lot! 17:22
Zoffix nm
Zoffix &
17:22 Zoffix left
Bowlslaw what the 17:23
17:27 psychoslave joined
rindolf hi all! I added a new benchmark and it doesnt look good again - github.com/shlomif/perl6-benchmark...its/master 17:29
17:33 ambs joined, psychoslave left
rindolf I get a build error - paste.debian.net/1031015/ 17:35
17:37 zachk joined, zachk left, zachk joined
jmerelo m: my $name = 'foo'; my %foo = bar => baz; say %::($foo) 17:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$foo' is not declared. Did you mean '%foo'?
at <tmp>:1
------> 3 = 'foo'; my %foo = bar => baz; say %::(7⏏5$foo)
jmerelo m: my $name = 'foo'; my %foo = bar => baz; say %::($name)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
baz used at line 1. Did you mean 'bag'?
jmerelo m: my $name = 'foo'; my %foo = { bar => baz }; say %::($name)
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
------> 3 $…
jmerelo m: my $name = 'foo'; my %foo = bar => 'baz'; say %::($name)
camelia {bar => baz}
jmerelo m: my $name = 'foo'; my %foo = bar => 'baz'; say %::($name)::
camelia {bar => baz}
jmerelo m: my $name = 'foo'; my %foo = bar => 'baz'; say :%::($name):: 17:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%::($name)::' is not declared
at <tmp>:1
------> 3e = 'foo'; my %foo = bar => 'baz'; say :7⏏5%::($name)::
jmerelo I was revisiting this stackoverflow.com/questions/442126...-together, but same thing...
Bowlslaw github.com/sergot/http-useragent/issues/206 17:51
AlexDaniel:
AlexDaniel Bowlslaw: yes? 17:55
tyil tbrowder_: I'll check it out tomorrow probably 17:56
yoleaux 15:18Z <tbrowder_> tyil: The pod input/output block problem should be fixed on the rakudo master branch, please check it out when you get a chance.
Bowlslaw AlexDaniel: he fixed it? 17:57
17:58 perlpilot joined
AlexDaniel Bowlslaw: no, but it should be easy if you change BUILD to TWEAK 18:01
tyil daxim: poke
18:01 Ven` left 18:02 Kaiepi left, Kaiepi joined
Bowlslaw O_o 18:06
Why?
AlexDaniel Bowlslaw: well, nothing was committed, so it's not fixed 18:07
Bowlslaw: it's possible to fix either by adding :timeout named param to the BUILD method, or by removing the BUILD method altogether 18:09
Bowlslaw: see this part for more info: docs.perl6.org/language/objects#Ob...nstruction 18:10
it does explain BUILD and TWEAK a bit, even if poorly
daxim tyil: I'm here 18:11
Bowlslaw hmm, ok
i don't know anything about those so i'll have to check it out
I'd like to give him something to fix it
tyil daxim: hi
can you pull the fix-shitty-blocks branch again and retry (for Pod::To::Pager) 18:12
daxim works well, I'm happy with the output from test-program.pl 18:13
tyil sweet 18:14
I'll finish up some rough edges and merge it into master soon-ish
18:14 Kaiepi left 18:15 Kaiepi joined
jmerelo goes AFK 18:18
18:18 jmerelo left
AlexDaniel Bowlslaw: the information is there, and it's easy to fix 18:18
Bowlslaw: perhaps clone the git repo and play with it?
Bowlslaw cool, i'll check it out when I get time, thanks
18:26 wamba joined
timotimo bench: compare HEAD my $a = "hello there"; for ^2_000_000 { $a.chop } ||| my $a = "hello there"; for ^2_000_000 { $a.substr(0,*-1) } 18:26
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, No new data found
timotimo hum?
bench: compare 2018.05 my $a = "hello there"; for ^2_000_000 { $a.chop } ||| my $a = "hello there"; for ^2_000_000 { $a.substr(0,*-1) } 18:27
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, No new data found
timotimo what's happening?
rindolf: looks like your code is spending a whole lot of time with the //= metaop stuff 18:30
rindolf timotimo: rakudobrew fails here
AlexDaniel .tell MasterDuke colabti.org/irclogger/irclogger_log...06-27#l884
yoleaux AlexDaniel: I'll pass your message to MasterDuke.
timotimo maybe a version bump was missing or something 18:31
rindolf: /home/shlomif/Download/unpack/perl/p6/rakudobrew/moar-master/install/bin/moar --version
please
rindolf timotimo: This is MoarVM version 2018.06 built with JIT support 18:32
timotimo and what nqp did it try to build?
tyil perl6-tidy throws an exception when I try to run it 18:33
does this mean my code is so bad that not even automated services want to deal with it :(
rindolf timotimo: how do i tell? 18:34
timotimo cd in there and "git describe --tags" for example
18:36 HaraldJoerg joined
rindolf timotimo: HEAD detached at 2018.06 18:36
18:36 perlpilot left
timotimo hum. so at least they match up 18:37
Bowlslaw p6: say (^10**3).race.map(**.is-prime).sum
camelia 1000
Bowlslaw p6: say (^10**3).map(**.is-prime).sum 18:38
camelia 1000
Bowlslaw is race faster?
timotimo p6: say (^10**3).map(*.is-prime).sum
camelia 168
timotimo you were getting a wrong result, though
Bowlslaw O_o
oops
p6: say (^10**3).map(*.is-prime).sum
camelia 168
timotimo for such a small input race won't win you anything, i don't think
Bowlslaw p6: say (^10**5).map(*.is-prime).sum 18:39
p6: say (^10**5).race.map(*.is-prime).sum
camelia 9592
(signal XCPU)
moritz m: say (^1e5).grep(&is-prime).elems 18:40
camelia (timeout)
moritz m: say (^1e5).race.grep(&is-prime).elems
camelia (signal XCPU)
Bowlslaw I ran those two sums on my machine and the time was almost exactly the same 18:42
without race was about 28 seconds, with race was about 26
not sure what that means
18:42 pmurias joined
moritz might need a larger batch size to make it actually faster 18:43
with .race(:batch(10_000)) I get 12.6s vs. 19.5s serial 18:45
18:45 epony joined
Bowlslaw www.youtube.com/watch?v=moaGidO3eA4 at 7:23 18:45
he says without race it takes 28 seconds, but with race it was 8
18:46 pmurias left
timotimo probably .elems vs .sum? 18:46
i get 8.2s vs 24s 18:47
Bowlslaw O_o 18:48
he also has **.is-prime
instead of *.is-prime
timotimo hopefully just a typo
Bowlslaw he also has .sum for both
timotimo that's 10 vs 24.5 on my machine 18:50
with .sum
skids 15 vs 24 here.
with .elems
Bowlslaw with the interpreter?
skids you mean the REPL?
Bowlslaw yes, repl
skids no, just cli 18:51
timotimo no, individual calls to perl6 itself
Bowlslaw maybe it's because i'm using the repl
timotimo perhaps
skids Maybe you have a different number of cores?
timotimo it'll keep the worker threads alive in between
Bowlslaw it's not a performance issue with my machine unless something is really wrong 18:52
i'll try without the repl
eh? 18:54
now it's working fine in the repl
maybe I screwed something up with the syntax...
skids wonders whether benches with various sepctre/meltdown/tlbleed patches are kicking around somewhere.
Bowlslaw hehe 18:55
Juerd Is there a ready-to-use script available to benchmark some script against numerous different versions of rakudo?
timotimo yes, japhb's perl6-bench
Juerd Thanks, I'll look into that
timotimo it even builds all the rakudo versions for you 18:56
Bowlslaw ok, now i'm getting 23 seconds without race and 6 seconds with
timotimo though actually, you can also use benchable6
Bowlslaw I wonder what happened
Juerd timotimo: Something that builds the rakudos is exactly what I was looking for :) 18:58
timotimo well, benchable6 already has all the rakudos built ;)
Juerd But I can't give that a module and a script, I assume
timotimo only a script 18:59
with a bit of hacking, a module, too.
but benchable6 behaved strangely a few minutes ago when i last tried it
19:02 Zoffix joined 19:03 lizmat joined
Zoffix timotimo: "code is spending a whole lot of time with the //= metaop stuff" is that the actual metaop or the `defor` op? 19:03
timotimo: also, what's the code, if you still have it?
timotimo it's the pointy block inside METAOP_ASSIGN
raw.githubusercontent.com/shlomif/...r_189-2.p6 19:04
Zoffix hm.... my bot told reminded me about irclog.perlgeek.de/perl6-dev/2018-...#i_1578696 but that log is not available in the map :( 19:05
AlexDaniel Zoffix: I've seen that also
Zoffix: my guess is that whitespace is preserved on colabti
but ilbot used to strip it 19:06
so if you have a message that ended with whitespace… that's probably causing the problem?
Zoffix That euler_189-2.p6 has wrong shebang 19:07
AlexDaniel I can generate another mapping with an extra whitespace at the end… or we can implement a fallback based on timestamps 19:08
rindolf Zoffix: will fix 19:13
Zoffix rindolf: I sent a PR
timotimo: looks like it's this construct: `($a{$b} //= 0) += $c` 19:14
rindolf Zoffix: ok
Zoffix I wonder if the reason it doesn't get optimized is 'cause we don't double-pass over it? So it optimizes one meta but not the other? 19:15
19:15 eliasr joined
Zoffix Filed as R#1981 19:19
synopsebot R#1981 [open]: github.com/rakudo/rakudo/issues/1981 [perf] Stacked metaops in the same statement don't get fully optimized
19:19 Zoffix left
rindolf thx 19:23
19:35 domidumont left 19:40 smls joined
smls Quick question, just to make sure: With sigilless variable declarations, assignment and binding is identical, right? 19:42
i.e. «my \a = ...;» vs «my \a := ...;» 19:43
moritz I think so, but I'm not entirely sure
both create a QAST::Op(bind) with --target=ast 19:44
19:44 Bowlslaw left
moritz yes, even with a more complex RHS like (my $ = 42), both create a QAST::Op(bind) 19:45
smls Ok, thanks. 19:46
19:54 comborico1611 joined 20:04 g- joined
buggable New CPAN upload: Sparrowdo-Azure-Web-Cert-0.0.1.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::A...n:MELEZHIK 20:24
20:28 Xliff joined, smls left
Xliff \o 20:28
Is there an easy way to determine if the current iteration is the last or the first in perl6? 20:31
timotimo $++ == 0 and maybe using rotor(2 => 1) -> $a, $b? and see if $b is undefined 20:32
geekosaur phasers? 20:35
timotimo right, FIRST is one that works 20:37
the problem with the LAST phaser is that it runs after the last iteration
20:37 espadrine joined
timotimo rather than telling you "this will be the last iteration" 20:37
20:41 AndChat549236 joined
Xliff m: my @a = ( 'a'..'g' ); my $f := @a[0]; my $l := @a[*-1]; for @a - >$a { say "FIRST!" if $f =:= $a; .say; say "LAST!" if $l =:= $_a }; 20:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix > instead.
at <tmp>:1
------> 3f := @a[0]; my $l := @a[*-1]; for @a - >7⏏5$a { say "FIRST!" if $f =:= $a; .say; sa
Xliff m: my @a = ( 'a'..'g' ); my $f := @a[0]; my $l := @a[*-1]; for @a -> $a { say "FIRST!" if $f =:= $a; .say; say "LAST!" if $l =:= $a }; 20:42
camelia (Any)
(Any)
(Any)
(Any)
(Any)
(Any)
(Any)
Xliff m: my @a = ( 'a'..'g' ); my $f := @a[0]; my $l := @a[*-1]; for @a -> $a { say "FIRST!" if $f =:= $a; $_.say; say "LAST!" if $l =:= $a };
camelia (Any)
(Any)
(Any)
(Any)
(Any)
(Any)
(Any)
timotimo you get a new scalar container by the for loop
you'll want \a there probably
Xliff m: my @a = ( 'a'..'g' ); my $f := @a[0]; my $l := @a[*-1]; for @a -> \a { say "FIRST!" if $f =:= \a; \a.say; say "LAST!" if $l =:= \a };
camelia ( no output )
20:42 AndChat549236 left
timotimo only put the \ where you define it 20:42
m: my \a = 9; say (\a).perl 20:43
camelia \(9)
skids The problem is not all loops *know* they are running the last iteration until *after* they finish the last iteration.
timotimo you're getting a Capture there
Xliff m: my @a = ( 'a'..'g' ); my $f := @a[0]; my $l := @a[*-1]; for @a -> \a { say "FIRST!" if $f =:= a; a.say; say "LAST!" if $l =:= a };
camelia FIRST!
a
b
c
d
e
f
g
LAST!
Xliff HA!
For lists where the endpoints are known, that should work. 20:44
m: my @a = ( 'a'..'g' ); my @b = ', ' xx @a.elems; @b[*-1] = ' or '; (@a [Z] @b).join('').say 20:46
camelia a , b , c , d , e , f , g or
Xliff m: my @a = ( 'a'..'g' ); my @b = ', ' xx @a.elems-1; @b[*-1] = ' or '; (@a [Z] @b).join('').say 20:47
camelia a , b , c , d , e , f or
Xliff m: my @a = ( 'a'..'g' ); my @b = ', ' xx @a.elems-1; @b[*-1] = ' or '; (@a [Z] @b).join('').put
camelia a , b , c , d , e , f or
Xliff m: my @a = ( 'a'..'g' ); my @b = ', ' xx @a.elems; @b[*-1] = ' or '; (@a [Z] @b).join('').put
camelia a , b , c , d , e , f , g or
Xliff m: my @a = ( 'a'..'g' ); my @b = ', ' xx @a.elems; @b[*-2] = ' or '; (@a [Z] @b).join('').put 20:48
camelia a , b , c , d , e , f or g ,
buggable New CPAN upload: Sparrowdo-Azure-Web-Cert-0.0.2.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::A...n:MELEZHIK 20:54
20:54 perlpilot joined 20:55 mcmillhj left, comborico1611 left 20:56 comborico1611 joined
skids The rotor solution comes out pretty clean, as long as you know you won;thave any naturally occuring Mu in your data: 20:56
20:56 comborico1611 left
skids m: for (1,2,3,4,5).rotor(2 => -1, :partial) -> ($a, $b?) { "LAST".say unless $b.DEFINITE; $a.say } 20:56
camelia 1
2
3
4
LAST
5
timotimo hm, that's also susceptible to undefined values and Nil 20:57
skids Well, maybe a better test on Mu
timotimo i know something even better
skids Or some test on $b.VAR
timotimo hm. actually. if you put a capture var in there, it'll probably up the arity or count to infinity 20:58
so you can't just do that :(
with a proto and a multi, that could work, but ugh
skids Some where clause on the $b? ? 20:59
timotimo oh, wait, rotor gives you tuples anyway!
so, problem solved
m: for (1,2,3,4,5).rotor(2 => -1, :partial) -> @a ($a, $b?) { "LAST".say unless @a == 2; $a.say }
camelia 1
2
3
4
LAST
5
timotimo m: for (1,Any,3,Nil,5,Mu,6).rotor(2 => -1, :partial) -> @a ($a, $b?) { "LAST".say unless @a == 2; $a.say }
camelia 1
(Any)
3
Nil
5
(Mu)
LAST
6
skids ++ 21:00
a new idiom is born
m: for (1,Any,3,Nil,5,Mu,6).rotor(2 => -1, :partial) -> @a ($a, $?) { "LAST".say unless @a == 2; $a.say } # can lose the $b 21:02
camelia 1
(Any)
3
Nil
5
(Mu)
LAST
6
skids Of course the problem is if you have side effects on testing for the next element which you don't want triggered at the wrong time. 21:03
But I guess that's beside the point. 21:04
anyhow, maybe Ill leave work on time today... what a treat. 21:05
21:05 Xliff left, mcmillhj joined
timotimo yeah, rotor will also pull-one the next element before you're done with this one 21:05
21:09 mcmillhj left, skids left 21:28 mahafyi left 21:31 mikejw joined
mikejw hey guys 21:31
21:35 mcmillhj joined
mikejw is there a special way I need to escape empty strings when passing a command to Proc::Async? 21:37
timotimo should be enough to just have an empty string in your list of arguments 21:38
perlpilot mikejw, I wouldn't think so.
mikejw cool ok 21:39
21:40 mcmillhj left 21:42 Zoffix joined
Zoffix mikejw: it depends. If you're running a batch file on Windows (which is what $*EXECUTABLE on windows is, for example), then you need to do cmd.exe's special quoting 21:42
(which might not be needed for empty args, but the rest of the stuff it don't like, yes) 21:43
mikejw haha ok 21:46
I think I found the issue.. just needed to use chdir again because of the probably quite zany use of promises 21:47
21:53 mcmillhj joined 21:58 mcmillhj left
mikejw thanks to learning Perl6, I can now build and deploy multiple PHP webapps and a jenkins instance to docker machine running on a local vagrant vm or potentially to a production server 21:58
and now I can finally figure out how I want to manage backups :) 21:59
s/learning Perl6/wanting to learn
I forgot to say with a few keystrokes :) 22:00
Zoffix awesome \o/
mikejw thanks mayne
it's been a fun ride 22:01
...so far
Zoffix :) 22:05
22:11 mcmillhj joined 22:15 wamba left 22:16 mcmillhj left 22:18 mikejw left, HaraldJoerg1 joined 22:21 HaraldJoerg left 22:23 Zoffix left 22:31 Ven` joined 22:35 Ven` left 22:41 MasterDuke joined 22:43 skids joined 22:49 mcmillhj joined 22:51 benjikun joined 22:54 HaraldJoerg1 left, mcmillhj left 22:56 proc joined
proc Hey guys. Newbie to p6 and got a 'q'. I having trouble with loading a classes parent at _runtime_. While I'm able to load a child at _runtime_, once I introduce a `also is parent`, I get failures. If someone would be kind enough to show where how/where in the documentation to load a child's parent at runtime that'd be great. 22:59
jnthn A class is a compile-time declaration, and `also is parent` also operates at compile time. 23:02
So runtime is too late.
proc Then how is it possible that `require ::($class);` works if it's only compile time? 23:03
where $class get be passed in from stdin?
I guess I'm just missing it.... if I can load a child as in `require ::($child);` at runtime, then how can I load that childs' parent ..... at runtime .... if at all? 23:06
23:06 mcmillhj joined
jnthn I'm a bit confused what you're wanting to do. If you're loading the child via `require` (noting that there's no 1:1 relationship between modules and classes, and `require` is about modules) and then want to find what it inherits from, do .^parents on the loaded class. 23:09
MasterDuke proc: i assume you mean if you don't already know what its parent is? i.e., otherwise you'd just require `::($parent)` also?
yoleaux 18:30Z <AlexDaniel> MasterDuke: colabti.org/irclogger/irclogger_log...06-27#l884
23:11 mcmillhj left
proc MasterDuke: That's right. The parent is unknown. 23:13
MasterDuke proc: then jnthn++ got to where i was going faster
proc ok 23:14
My misunderstanding then seems to be modules vs classes. 23:15
much apprecaited.
23:19 mcmillhj joined 23:24 mcmillhj left 23:34 subroot joined 23:35 mcmillhj joined, perlpilot left 23:39 mcmillhj left 23:42 benjikun2 joined 23:44 turdmonkey joined 23:45 turdmonkey is now known as Bowlslaw, sena_kun joined
benjikun2 Bowlslaw: welcome back 23:46
how are you
23:46 benjikun left, benjikun2 is now known as benjikun 23:47 kurahaupo joined
Bowlslaw Thanks, benjikun. Things are going well. I'm developing my web crawler to help me learn about Perl 6's concurrency 23:48
benjikun Sweet
Bowlslaw github.com/Bowlslaw/webcrawler/blo...crawler.p6 23:49
print-urls isn't used at the moment 23:50
I just figured out how to normalize the urls into a common form which can be used predictably later 23:51
23:51 Ven` joined 23:54 mcmillhj joined 23:56 Ven` left, perlpilot joined 23:58 mcmillhj left 23:59 lizmat left