Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-24

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:00 MilkmanDan joined #perl6
00:05 johnjohn101 joined #perl6
00:05 johnjohn101 hi perl 6
00:05 timotimo greetings
00:06 johnjohn101 perl 6 will have it's own cpan?
00:06 johnjohn101 its
00:07 timotimo we currently have modules.perl6.org, but we've got someone working on making metacpan work with perl6's modules, and some efforts going on in that general cpan-y area in general
00:12 zacts joined #perl6
00:16 mcmillhj joined #perl6
00:23 avuserow_ bisect: say DateTime.now.Str.chars
00:23 bisectable6 avuserow_, On both starting points (good=2015.12 bad=6e84a5e) the exit code is 0 and the output is identical as well
00:23 bisectable6 avuserow_, Output on both points: 32
00:25 avar timotimo: who's working on the metacpan thing?
00:26 timotimo i seem to recall it's jdv79
00:27 avuserow_ does DateTime format timestamps without microseconds on some OSes?
00:28 avuserow_ I'm investigating test failures when trying to install Log::Minimal and the timestamp pattern expected in the tests doesn't have them, so trying to figure out why that might be
00:32 * timotimo heads towards bed
00:33 BenGoldberg joined #perl6
00:36 n1lp7r joined #perl6
00:43 BillSussman joined #perl6
01:01 pierre_ joined #perl6
01:01 sufrostico joined #perl6
01:02 bioduds guys, anyone meta-programming with perl6?
01:04 bioduds I could not interpolate an array
01:04 bioduds in heredocs
01:06 bioduds is TimToady there?
01:08 perlawhirl joined #perl6
01:08 bioduds joined #perl6
01:08 perlawhirl hi bioduds
01:08 bioduds hi perlawhirl
01:08 perlawhirl how are you interpolating... try @arr[]
01:09 perlawhirl inside double-quotes, @var is not automatically interpolated
01:09 perlawhirl this is so things like email address just work
01:09 cognominal joined #perl6
01:09 bioduds I tried to simply output its value   my \$.names = set < System @.cur-tables >;
01:09 perlawhirl the work around is to use the zen slice: @arr[]
01:09 pisa joined #perl6
01:09 bioduds oh, I'll do that
01:10 bioduds so it should say   my \$.names = set < System @.cur-tables[] >;
01:11 perlawhirl well.. i'm not sure about the meta-programming stuff... just talking about heredocs and double-quotes in general. give it a shot
01:11 bioduds sure will
01:12 bioduds im meta-programming with heredocs so I may write indented code
01:12 BenGoldberg I thought meta-programming was writing a program which writes a program?
01:14 perlawhirl that's also my interpretation.
01:15 perlawhirl bioduds: if it's still not working,  provide a gist of what your trying to do and what's not working
01:16 timotimo < and > don't interpolate at all, do they?
01:16 timotimo m: say < $foo @bar[] >
01:16 camelia rakudo-moar 998e2b: OUTPUT«($foo @bar[])␤»
01:16 timotimo m: say << $foo @bar[] >>
01:16 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$foo' is not declared␤at <tmp>:1␤------> 3say << 7⏏5$foo @bar[] >>␤»
01:16 timotimo << and >> do interpolate
01:17 rkazak joined #perl6
01:19 kashyap_ joined #perl6
01:25 TEttinger joined #perl6
01:33 cpage_ joined #perl6
01:33 Actualeyes joined #perl6
01:35 cpage_ joined #perl6
01:37 parabolize joined #perl6
01:38 benjikins What do I do about malformed utf-8
01:41 BenGoldberg Throw an exception, usually.
01:41 BenGoldberg Or return a Failure.
01:46 benjikins could I remove all malformed characters possible?
01:46 benjikins possibly*
01:46 araujo_ joined #perl6
01:47 ilbot3 joined #perl6
01:47 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!
01:47 bob777 joined #perl6
02:03 mcmillhj joined #perl6
02:06 noganex_ joined #perl6
02:10 awwaiid joined #perl6
02:12 zacts joined #perl6
02:14 bioduds BenGoldberg meta-programming is writing a program that writes a program
02:14 bioduds exactly
02:15 bioduds and the program you write may be in perl6 writing another perl6
02:15 bioduds in this case
02:16 SmokeMachine____ Hi! Im having trouble with trusts...
02:16 bioduds worked perlawhirl, thanks a lot
02:16 SmokeMachine____ m: class Bla {...}; class Ble {trusts Bla; has $!private = "priv"}; class Bla {has Bla $.ble .= new; method say-ble-priv{$!ble.private.say}}; Bla.new.say-ble-priv
02:16 camelia rakudo-moar 998e2b: OUTPUT«Memory allocation failed; could not allocate 1016 bytes␤»
02:16 BenGoldberg That looks like a bug.
02:17 mcmillhj joined #perl6
02:18 SmokeMachine____ and I have a question: How could I do that in 2 different files?
02:19 SmokeMachine____ if I write the Ble class on a file (with the Ble stub) and the Ble in another file it dies with "The following packages were stubbed but not defined:"
02:21 SmokeMachine____ is there any way to simulate 2 different files here with camelia?
02:24 SmokeMachine____ problem with 2 files https://www.irccloud.com/past​ebin/E75Qqzdi/Bla%20and%20Ble
02:29 SmokeMachine____ BenGoldberg: should I open a bug report?
02:29 SmokeMachine____ how can I do that?
02:34 MasterDuke huggable: bug report
02:34 huggable MasterDuke, nothing found
02:34 MasterDuke huggable: bug
02:34 huggable MasterDuke, nothing found
02:34 MasterDuke huggable: RT
02:34 huggable MasterDuke, nothing found
02:34 MasterDuke huggable: report a bug
02:34 huggable MasterDuke, nothing found
02:35 MasterDuke SmokeMachine___: send an email to rakudobug@perl.org
02:36 wamba joined #perl6
02:39 Actualeyes joined #perl6
02:41 SmokeMachine____ m: class Bla {...}; class Ble {has $.public = "pub"}; class Bla {has Bla $.ble .= new; method say-ble-priv{$.ble.public.say}}; Bla.new.say-ble-priv
02:41 camelia rakudo-moar 998e2b: OUTPUT«Memory allocation failed; could not allocate 1016 bytes␤»
02:41 SmokeMachine____ that's not a "trusts" problem...
02:45 mcmillhj joined #perl6
02:53 TEttinger joined #perl6
02:55 BenGoldberg m: class Bla {has Bla $.ble .= new}; Bla.new;
02:55 camelia rakudo-moar 998e2b: OUTPUT«Memory allocation failed; could not allocate 14464 bytes␤»
02:55 Girafferson joined #perl6
02:55 BenGoldberg SmokeMachine____, ^
02:56 SmokeMachine____ BenGoldberg: :(
02:57 bioduds do roles have constructors?
02:58 BenGoldberg Well, it's not a rakudo bug... You're saying that any time a new Bla object is made, initialize the $.ble field it with a new Bla object.
02:58 BenGoldberg Every Bla has a Bla, in an infinite linked list.
03:00 SmokeMachine____ BenGoldberg: but on my code, Bla has Ble, but Ble doesn't have Bla... It shouldn't be a loop...
03:01 SmokeMachine____ m:  class Bla {has Bla $.ble .= new; method say-ble-priv{$.ble.public.say}}; class Ble {has $.public = "pub"}; Bla.new.say-ble-priv
03:01 camelia rakudo-moar 998e2b: OUTPUT«Memory allocation failed; could not allocate 131072 bytes␤»
03:02 BenGoldberg The very first part of your code, right there, is "class Bla {has Bla $.ble .= new;"
03:02 SmokeMachine____ hum!!! misspelled!
03:02 SmokeMachine____ m:  class Bla {has Ble $.ble .= new; method say-ble-priv{$.ble.public.say}}; class Ble {has $.public = "pub"}; Bla.new.say-ble-priv
03:02 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5===␤Type 'Ble' is not declared. Did you mean 'Bla'?␤at <tmp>:1␤------> 3class Bla {has Ble7⏏5 $.ble .= new; method say-ble-priv{$.ble␤Malformed has␤at <tmp>:1␤------> 3class Bla {has7⏏5 Ble $.ble .= new; method say-ble…»
03:03 SmokeMachine____ m: class Bla {...}; class Ble {has $.public = "pub"}; class Bla {has Ble $.ble .= new; method say-ble-priv{$.ble.public.say}}; Bla.new.say-ble-priv
03:03 camelia rakudo-moar 998e2b: OUTPUT«pub␤»
03:03 SmokeMachine____ that's working!
03:03 BenGoldberg This is one reason why so many people use "foo"  and "bar"
03:03 BenGoldberg It's a touch harder to mispell one as the other.
03:04 SmokeMachine____ m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"}; class Foo {has Bar $.bar .= new; method say-bar-priv{$!bar.private.say}}; Foo.new.say-ble-priv
03:04 camelia rakudo-moar 998e2b: OUTPUT«Method 'say-ble-priv' not found for invocant of class 'Foo'␤  in block <unit> at <tmp> line 1␤␤»
03:04 SmokeMachine____ m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"}; class Foo {has Bar $.bar .= new; method say-bar-priv{$!bar.private.say}}; Foo.new.say-bar-priv
03:04 camelia rakudo-moar 998e2b: OUTPUT«Method 'private' not found for invocant of class 'Bar'␤  in method say-bar-priv at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
03:05 SmokeMachine____ m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"}; class Foo {has Bar $.bar .= new; method say-bar-prig{$!bar!private.say}}; Foo.new.say-bar-priv
03:05 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No such private method 'private' for invocant of type 'Foo'␤at <tmp>:1␤------> 3$.bar .= new; method say-bar-prig{$!bar!7⏏5private.say}}; Foo.new.say-bar-priv␤»
03:07 BenGoldberg m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"; method !private { return-rw $!private }}; class Foo {has Bar $.bar .= new; method say-bar-prig{$!bar!private.say}}; Foo.new.say-bar-priv
03:07 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No such private method 'private' for invocant of type 'Foo'␤at <tmp>:1␤------> 3$.bar .= new; method say-bar-prig{$!bar!7⏏5private.say}}; Foo.new.say-bar-priv␤»
03:08 BenGoldberg m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"; method !private { return-rw $!private }}; class Foo {has Bar $.bar .= new; method bar-priv{$!bar!private}}; Foo.new.bar-priv.say
03:08 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No such private method 'private' for invocant of type 'Foo'␤at <tmp>:1␤------> 3Bar $.bar .= new; method bar-priv{$!bar!7⏏5private}}; Foo.new.bar-priv.say␤»
03:08 BenGoldberg m: class Foo {...}; class Bar {trusts Foo; has $!private = "priv"; method !private { return-rw $!private }}; class Foo {has Bar $.bar .= new; method bar-priv{$!bar::private}}; Foo.new.bar-priv.say
03:08 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute $!private not declared in class Foo␤at <tmp>:1␤------> 3.= new; method bar-priv{$!bar::private}}7⏏5; Foo.new.bar-priv.say␤    expecting any of:␤        horizontal whitespace␤       …»
03:11 BenGoldberg m: https://gist.github.com/BenGoldberg​1/20888ffacad74d4707ab1cfa7c6d32aa
03:11 camelia rakudo-moar 998e2b: OUTPUT«B.new(a => A.new(foo => 42))␤»
03:11 BenGoldberg On the one hand, the example from the doc does do what it says it should.
03:12 mcmillhj joined #perl6
03:13 BenGoldberg On the other hand, I'm suffering from sleepyness :P
03:17 zacts joined #perl6
03:20 pierre_ joined #perl6
03:31 bioduds you can't have more than one named parameter in method?
03:31 bioduds multi method insert-item( :$timestamp, :$item, :$value, :$table ) { ...
03:32 bioduds $control.insert-item( :timestamp( "478637690765641" ), :item( "Name" ), :value( "Eduardo" ), :table( "Users" ) );
03:32 bioduds what is wrong here?
03:32 bioduds Too many positionals passed; expected 1 argument but got 2 is interpreter error
03:33 geekosaur that error doesn't look like it goes with that signature
03:39 bioduds correct
03:39 bioduds it was telling me something else
03:39 bioduds thanks
03:40 raiph joined #perl6
03:40 bioduds problem was here my $fh = open "files/e87d72f672a22a.pl", :w;
03:40 bioduds dont know why
03:41 bioduds got why
03:41 bioduds directory didn't exist
03:41 bioduds :D
03:41 bioduds good
03:41 bioduds newbie thing
03:44 mcmillhj joined #perl6
04:00 bjz joined #perl6
04:05 labster joined #perl6
04:06 mcmillhj joined #perl6
04:12 araujo__ joined #perl6
04:14 Cabanossi joined #perl6
04:24 bjz joined #perl6
04:29 cognominal joined #perl6
04:30 zacts joined #perl6
04:31 bjz joined #perl6
04:44 woolfy left #perl6
04:44 mcmillhj joined #perl6
04:47 cyphase_eviltwin joined #perl6
04:48 leont joined #perl6
04:48 lizmat avuserow_: the @a solution allows you to go back to element 0, so it need to keep the elements around
04:50 lizmat avuserow_: whereas "for |(1..3) xx * { .say }" would just iterate over the values, and not grow in memory usage
04:50 lizmat afk&
05:09 brrt joined #perl6
05:19 TEttinger joined #perl6
05:25 mcmillhj joined #perl6
05:38 rindolf joined #perl6
05:56 mcmillhj joined #perl6
05:57 ItayAlmog joined #perl6
06:02 brrt joined #perl6
06:04 brrt would like to wish the attendees of YAPC::EU a lot of fun
06:04 brrt and i'd be very, very, very happy if any of the recordings were put live
06:04 brrt or online, at least
06:06 bjz joined #perl6
06:12 canopus joined #perl6
06:14 nadim joined #perl6
06:14 nadim morning
06:15 nadim masak: not in Cluj?
06:15 danaj joined #perl6
06:21 zacts joined #perl6
06:23 mcmillhj joined #perl6
06:27 brrt joined #perl6
06:36 CIAvash joined #perl6
06:37 El_Che https://www.youtube.com/watch?v=A3ZSt5QKEAg <--- yapce live streaming!
06:37 brrt aw yeah
06:37 brrt El_Che++
06:38 chienjo joined #perl6
06:40 El_Che you can see liz's head!
06:43 danaj joined #perl6
06:44 mcmillhj joined #perl6
06:46 dalek whateverable: 4997423 | (Aleks-Daniel Jakimenko-Aleksejev)++ | build.p6:
06:46 dalek whateverable: build.p6 is executable
06:46 dalek whateverable:
06:46 dalek whateverable: Obviously.
06:46 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/4997423b87
06:47 dalek joined #perl6
06:47 AlexDaniel dalek: we don't get along very well, right?
06:54 dj_goku joined #perl6
06:56 darutoko joined #perl6
06:56 nadim joined #perl6
06:57 mcmillhj joined #perl6
07:02 danaj joined #perl6
07:07 labster joined #perl6
07:10 domidumont joined #perl6
07:10 lizmat joined #perl6
07:11 woodruffw joined #perl6
07:11 woodruffw joined #perl6
07:12 woodruffw joined #perl6
07:12 woodruffw joined #perl6
07:12 lizmat joined #perl6
07:13 woodruffw joined #perl6
07:14 domidumont joined #perl6
07:22 dalek whateverable: 67ba201 | (Aleks-Daniel Jakimenko-Aleksejev)++ | README.md:
07:22 dalek whateverable: Update README
07:22 dalek whateverable:
07:22 dalek whateverable: It is really hard to keep README up to date. Let's see if it
07:22 dalek whateverable: becomes easier with the wiki.
07:22 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/67ba201988
07:23 zakharyas joined #perl6
07:27 mcmillhj joined #perl6
07:31 leont joined #perl6
07:38 RabidGravy joined #perl6
07:39 masak morning, #perl6
07:39 masak nadim: no, I'm at Bond-con this year :/
07:40 masak let me second brrt and wish everyone at YAP::Europe a wonderful conference
07:41 masak ooh, a live stream. https://www.youtube.com/watch?v=A3ZSt5QKEAg -- El_Che++
07:41 * masak stops procrastinating and works on his talk
07:43 masak hehe, watching the live stream while tinkering with slides feels like an approximation of being at YAPC::Europe, sitting in the back room huddled over the laptop in controlled semi-panic
07:49 cognominal joined #perl6
07:50 cpage_ joined #perl6
07:51 leont joined #perl6
08:05 danaj joined #perl6
08:09 Xliff m: "#708090".substr(1).comb(2).say
08:09 camelia rakudo-moar 998e2b: OUTPUT«(70 80 90)␤»
08:09 petercommand joined #perl6
08:10 pierre_ joined #perl6
08:10 Xliff m: hex("10")
08:10 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    hex used at line 1␤␤»
08:14 Xliff m: '0x70'.fmt('Decimal %d').say
08:14 camelia rakudo-moar 998e2b: OUTPUT«Decimal 112␤»
08:14 Xliff m: '0x70'.fmt('%d').say
08:14 camelia rakudo-moar 998e2b: OUTPUT«112␤»
08:14 Xliff m: '0x10'.fmt('%d').say
08:14 camelia rakudo-moar 998e2b: OUTPUT«16␤»
08:14 Xliff m: '10'.fmt('%d').say
08:14 camelia rakudo-moar 998e2b: OUTPUT«10␤»
08:15 Xliff m: "#708090".substr(1).comb(2).map({ $_ = "0x$_".fmt($d) }).say
08:15 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$d' is not declared␤at <tmp>:1␤------> 3substr(1).comb(2).map({ $_ = "0x$_".fmt(7⏏5$d) }).say␤»
08:15 Xliff m: "#708090".substr(1).comb(2).map({ $_ = "0x$_".fmt('%d') }).say
08:15 camelia rakudo-moar 998e2b: OUTPUT«Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
08:15 Xliff m: "#708090".substr(1).comb(2).map({ "0x$_".fmt('%d') }).say
08:15 camelia rakudo-moar 998e2b: OUTPUT«(112 128 144)␤»
08:16 Xliff \o/
08:16 lizmat joined #perl6
08:19 rba_ joined #perl6
08:24 TEttinger joined #perl6
08:25 TimToady m: "#708090".substr(1).comb(2).map({ :16($_) }).say
08:25 camelia rakudo-moar 998e2b: OUTPUT«(112 128 144)␤»
08:25 bjz joined #perl6
08:27 TimToady m: :16("#708090".substr(1)).polymod(256 xx *).reverse.say
08:27 camelia rakudo-moar 998e2b: OUTPUT«(112 128 144)␤»
08:28 TimToady m: "#708090".comb(/\w\w/).map({ :16($_) }).say
08:28 camelia rakudo-moar 998e2b: OUTPUT«(112 128 144)␤»
08:29 lizmat is the backlog: http://irclog.perlgeek.de/perl6/today just not working for me, or is there a more general issue ?
08:29 TimToady working for me
08:30 moritz lizmat: how is it not working for you?
08:30 noganex joined #perl6
08:30 lizmat moritz: like not at all
08:30 moritz lizmat: what does that mean?
08:30 moritz lizmat: timeout? any HTTP error code? empty page?
08:31 lizmat well assuming TimToady is on the same Wifi as I am, I guess the problem is mine
08:31 lizmat moritz: no timeout, but no page either
08:31 moritz lizmat: does http://irclog.perlgeek.de/perl6/2016-08-24 work?
08:31 moritz and you can also try the https:// URL
08:32 lizmat I fear it's a Wifi proxy malfunction or so
08:32 El_Che wifi proxy brr
08:32 El_Che lizmat: tunnel your webtraffic through ssh?
08:32 moritz try HTTPS, it can't proxy it so easily
08:33 * TimToady is on the speaker wifi, which did freeze up about 10 minutes ago, unless it was my computer, but reattaching fixed it
08:34 * lizmat tries that
08:35 El_Che the speaker on the livestream also seems to be having network problems
08:35 El_Che and it looks like he counted on it
08:36 dalek doc: 3990324 | moritz++ | doc/Language/ (2 files):
08:36 dalek doc: Use HTTPS URLs to irclog.perlgeek.de
08:36 dalek doc:
08:36 dalek doc: because we can. letsencrypt++
08:36 dalek doc: review: https://github.com/perl6/doc/commit/3990324125
08:38 DrForr letsencrypt++ # using it for .. anupcoming project :)
08:40 lizmat joined #perl6
08:41 El_Che lizmat: I sent you a msg in case it didn't work
08:41 moritz I quite like that fact that there are quite some letsencrypt clients to chose from
08:41 DrForr I'm ssh'd into my home server via the speake wifi.
08:41 moritz I tend to use simp_le, which is non-interactive and well suited for cron jobs
08:42 masak heh, Markdown has corrupted my ability to type LaTeX
08:43 moritz writing large bodies of text in latex is really painful when you're used to a simpler markup format :-)
08:46 kurahaupo joined #perl6
08:47 lizmat_ joined #perl6
08:51 g4 joined #perl6
08:54 lizmat joined #perl6
08:58 labster joined #perl6
08:59 lizmat El_Che: thanks for the tip, now using proxy
08:59 El_Che good to hear
09:01 jonas1 joined #perl6
09:04 zakharyas1 joined #perl6
09:10 bjz joined #perl6
09:11 domidumont joined #perl6
09:15 konobi moritz: isn't there simon's typeset stuff?
09:19 moritz konobi: there's lots of typset stuff out there, but I'm not familiar with simon's, specifically
09:22 smls joined #perl6
09:24 danaj joined #perl6
09:24 kaare_ joined #perl6
09:28 konobi moritz: sile
09:33 moritz so far I'm just writing my stuff in markdown, and when the time comes that I'll have to worry about formatting, I'll throw in some pandoc and latex templates, or something
09:39 El_Che newsflash from the yapce livestream: booking is looking for developers :)
09:42 kaare_ El_Che: That must be a first!
09:42 mvorg joined #perl6
09:48 CIAvash joined #perl6
09:59 melezhik joined #perl6
09:59 melezhik Hi all!
10:00 melezhik I look if perl6/panda/zef has possibility to install a "share" files so that I could use them in my code , in way of File::ShareDir
10:01 melezhik something like proposed here - http://perltricks.com/article/66/2014/2/7/3-way​s-to-include-data-with-your-Perl-distribution/
10:02 melezhik any ideas?
10:08 araujo joined #perl6
10:08 araujo joined #perl6
10:15 araujo joined #perl6
10:16 TheLemonMan joined #perl6
10:31 edehont joined #perl6
10:31 zakharyas joined #perl6
10:32 leont joined #perl6
10:38 grondilu joined #perl6
10:42 moritz melezhik: I'm pretty sure some of the modules do that already
10:42 moritz melezhik: iirc you have to specify them in the meta file
10:43 jnthn You use %?RESOURCES to get at them iirc
10:44 moritz melezhik: example: https://github.com/awwaiid/p6-Inli​ne-Ruby/blob/master/META.info#L14 and https://github.com/awwaiid/p6-Inline-Ru​by/blob/master/lib/Inline/Ruby.pm6#L33
10:45 nadim joined #perl6
10:46 canopus joined #perl6
10:48 melezhik mortiz: thanks a lot will take a look ...
10:54 lizmat joined #perl6
10:56 zakharyas joined #perl6
10:57 leont joined #perl6
11:03 bioduds joined #perl6
11:04 canopus joined #perl6
11:06 kurahaupo joined #perl6
11:09 cognominal joined #perl6
11:15 telex joined #perl6
11:24 melezhik mortiz: hm, looks like I succeeded in installing resources via META.info , but I can't get them in my code, %?RESOURCES looks obscure  for me , where can I get a perl6doc on %?RESOURCES ?
11:25 ChoHag moar dumps core on openbsd when using zef or panda.
11:26 ChoHag I guess since it didn't last year and I've not been able to use perl6 this year, I must be its only openbsd user.
11:32 lizmat melezhik: nine might know how much of %?RESOURCES is implemented
11:35 moritz melezhik: pro tip: if you want to hilight me, try spelling my name right :-) Most IRC clients offer tab completion for nick names
11:35 pierre_ joined #perl6
11:36 huf irc clients should support hilighting by similarity :)
11:36 huf maurice, moric, mr ortiz, etz
11:36 moritz melezhik: https://docs.perl6.org/language/modules has some docs
11:37 moritz huf: well, irssi does support hilighting by regex
11:37 moritz but I don't care enough right now to actually use it
11:39 rba_ joined #perl6
11:39 melezhik mortiz: will take a look, thanks
11:41 moritz .oO( the appropriate German word here is "beratungsresistent" )
11:41 melezhik ahh, this is probably what I did wrong - "The resources section is optional, but, if present, should contain a list of the files in your resources directory"
11:42 melezhik I had a directory names for resources  arrays
11:42 melezhik but I had to a file names
11:42 melezhik )))
11:43 rba_ joined #perl6
11:46 El_Che watching SawyerX's talk on XS. I must say I prefer NativeCall :)
11:46 huf shocking
11:46 huf i dont think even its mother can love XS :)
11:47 El_Che Well, the X makes it sound cool
11:47 rba_ joined #perl6
11:51 tadzik Extra Swag!
11:54 melezhik propbably this is something I do wrong:
11:54 pierre_ joined #perl6
11:54 melezhik melezhik@melezhik-pc:~/projects/sparrowdo-nginx$ cat resources/foo.txt  OK
11:54 melezhik "resources" : [ "foo.txt" ],
11:54 melezhik pand install works fine
11:54 melezhik but ...
11:55 * leont has gotten a little too comfortable with XS for his own good
11:55 smls joined #perl6
11:55 melezhik perl6 -MSparrowdo::Nginx -e 'say %?RESOURCES<foo.txt>;'  ==> Nil
11:55 leont It's a camel, it's ugly but it will get you there
11:56 moritz melezhik: you might need to use %?RESOURCES inside the package that you've installed
11:57 melezhik moritz  - will try, thanks
11:57 melezhik just line "use %?RESOURCES;" ?
11:58 melezhik it's not compiled ... (((
11:58 edehont joined #perl6
12:00 melezhik ok, looks like "say %?RESOURCES<foo.txt>.Str;"
12:00 melezhik in my module code make it resource initialized ...
12:00 melezhik kind lazy initialzation?
12:00 melezhik abit tricky ...
12:01 melezhik ahh, it is only accessible in my module scope
12:01 melezhik it is not lazy initilaztion ...
12:07 kjs_ joined #perl6
12:12 nine melezhik: %?RESOURCES is for modules. It also assumes that the directory you are working in looks like lib/Foo.pm resources/foo.txt
12:13 nine melezhik: so in Foo.pm you can access foo.txt by %?RESOURCES<foo.txt>
12:14 melezhik yeah, that is it
12:14 melezhik now I know
12:15 melezhik I assumed that I can access a resource outside of module, but this is not true. anyway it is ok for me as I intended to use resources in modules
12:15 nine It's for resources that are bundled with modules
12:16 bioduds I am astonished with subsets
12:16 iH2O joined #perl6
12:16 nine bioduds: they are awesome :)
12:17 melezhik nine, got it, it is ok
12:21 tbrowder [Coke]: I do see the "whitespace" problem but it's a false positive: line 1580, doc/Language/5to6-nutshell.pod6 in the comment line for vim.  I didn't mod that file on my last merge so I didn't pick up on it in my xtest.  Looks like the whitespace test needs a tweak, but I leave that to doc decision makers as to how to fix it.
12:22 bioduds yep nine
12:23 bioduds they reminded me of objective-c categories which I found very cool
12:23 iH2O isnt objective C as obsolete as smalltak?
12:23 bioduds now, if anyone could help me, I'd like a subset that avoids spaces
12:24 tbrowder [Coke]: I meant the non-breaking whitespace test needs a tweak.
12:24 bioduds something like subset NoSpaces of Str where !/\S/
12:26 jnthn where /^\S*$/ would be one way to do it
12:26 moritz might need to be subset NoSpace of Str where { ! /\S/ }
12:26 moritz or does "where" autothunk?
12:27 iH2O left #perl6
12:27 jnthn Yes
12:27 jnthn m: subset NoSapce of Str where !/\s/; my NoSpace $str = 'ok';
12:27 camelia rakudo-moar 2153bf: OUTPUT«5===SORRY!5===␤Type 'NoSpace' is not declared. Did you mean 'NoSapce'?␤at <tmp>:1␤------> 3t NoSapce of Str where !/\s/; my NoSpace7⏏5 $str = 'ok';␤Malformed my␤at <tmp>:1␤------> 3subset NoSapce of Str where !/\s/; my7⏏5 NoSpace…»
12:28 jnthn m: subset NoSpace of Str where !/\s/; my NoSpace $str = 'ok';
12:28 camelia rakudo-moar 2153bf: ( no output )
12:28 jnthn m: subset NoSpace of Str where !/\s/; my NoSpace $str = 'o k';
12:28 camelia rakudo-moar 2153bf: OUTPUT«Type check failed in assignment to $str; expected NoSpace but got Str ("o k")␤  in block <unit> at <tmp> line 1␤␤»
12:28 bioduds thanks jnthn
12:28 n1lp7r joined #perl6
12:31 rkazak joined #perl6
12:31 domidumont joined #perl6
12:37 [Coke] tbrowder: no, it didn't need a tweak. I fixed it?
12:38 [Coke] I'm not sure why you think the test was over-eager.
12:38 * [Coke] digs through some git history...
12:40 [Coke] Or do you mean there's a -current- failure?
12:40 [Coke] no, no current failure...
12:40 wamba joined #perl6
12:41 [Coke] the change in https://github.com/perl6/doc/commit/2f​f9fbc26494bb131abe9d40cd79153beb2127e1 isn't in a comment. So, I'm confused.
12:42 timotimo o/
12:49 melezhik_ joined #perl6
12:50 pmurias joined #perl6
12:52 pmurias masak: when will bond conf be streamed?
12:53 timotimo the screen they're using for slides is ... pretty terrible
12:53 espadrine joined #perl6
12:55 bioduds subset NoSpace of Str where !/\s/;
12:55 bioduds works fine
12:56 timotimo oh?
12:56 bioduds exactly what I needed! declaratively
12:56 bioduds im shocked. 4th gen is here
12:56 bioduds that's why it took 15 years :)
12:57 timotimo m: subset NoSpace of Str where !/\s/; my NoSpace $a = "hey"; $a = "hey ";
12:57 camelia rakudo-moar 2153bf: OUTPUT«Type check failed in assignment to $a; expected NoSpace but got Str ("hey ")␤  in block <unit> at <tmp> line 1␤␤»
12:57 timotimo hm, ok
12:57 bioduds exactly
12:58 timotimo perlsec person says he hasn't looked at perl6 at all yet; maybe he will at some point. that'd be pretty interesting
12:58 timotimo what are the beep beep noises for? :\
13:00 mcmillhj joined #perl6
13:03 pmurias can I create a NQP level list from Perl 6?
13:03 jnthn nqp::list(...)
13:04 jnthn Depending on exactly what you want to do
13:04 jnthn also class MySimpleListThingy is repr('VMArray') { } gives you a Perl 6 type with the low-level list REPR
13:14 pmurias hmm, if I return nqp::list from a method I can't pass it to NQP land
13:15 pmurias I get a "This type (List) does not support elems"
13:15 timotimo it'll get hllized
13:15 timotimo you need to be careful about how you invoke the method
13:16 timotimo if you don't use nqp:: ops to find and invoke it, it'll probably try to be "helpful"
13:16 bioduds would that be a regex to express identifiers in perl6?
13:17 bioduds must start with an alphabetic character (or an underscore), followed by zero or more word characters (alphabetic, underscore or number)
13:17 TheLemonMan the new harness for custom exception handlers is so much useful! https://ptpb.pw/6HgS
13:17 timotimo bioduds: you can use <ident> from your own regexes
13:18 bioduds can i use it to set a subset?
13:18 bioduds something like: subset StrIdent of Str where <ident> ?
13:19 bioduds im metaprogramming and some params are becoming var names
13:19 bioduds therefore a subset that allows only identifiers would be perfect
13:20 pmurias timotimo: what's doing the hllization of the list?
13:21 cdg joined #perl6
13:22 ptolemarch joined #perl6
13:22 cdg joined #perl6
13:22 timotimo rakudo's codegen inserts a nqp::hllize
13:24 [Coke] I cannot tell you how broken https://ptpb.pw/ inside $dayjob.
13:24 bioduds timotimo, how do I use <ident> ?
13:24 bioduds *.ident ?
13:24 CIAvash bioduds: where /^<.ident>$/
13:25 bioduds man, that is freaking awesome
13:25 * [Coke] finds a header that makes it look like https://stackoverflow.com/questions/31950470/wh​at-is-the-upgrade-insecure-requests-http-header is responsible.
13:25 bioduds I am enjoying P6 so much
13:25 nadim joined #perl6
13:26 kjs_ joined #perl6
13:27 jnthn TheLemonMan: Hahaha...that's great :D
13:28 leont joined #perl6
13:29 timotimo very good!
13:31 zakharyas joined #perl6
13:32 jcallen joined #perl6
13:32 sufrostico joined #perl6
13:35 hahainternet m: use GTK::Simple;
13:35 camelia rakudo-moar 2153bf: OUTPUT«===SORRY!===␤Could not find GTK::Simple at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::R…»
13:35 hahainternet aww
13:35 hahainternet will do it locally then
13:35 hahainternet (profiling startup as it seems to take 30s)
13:36 mohae_ joined #perl6
13:36 timotimo that'd be nice
13:36 andreoss joined #perl6
13:37 timotimo i was annoyed by how slow it is, but i didn't want to spend too much time on investigating just yet
13:38 timotimo oh crap! the APW is just about to happen! and i'm not actually free to attend it at that time! :o
13:38 skids joined #perl6
13:42 dsp_ joined #perl6
13:42 lizmat joined #perl6
13:43 dsp_ hi. just to check, is it `normal' for, say, GTK::Simple to take an extremely long time to execute? example:
13:43 dsp_ https://gist.githubusercontent.com/anon​ymous/4a4a0be493da17011107232448c3ef82/​raw/44983afe784e2e4a90f3fc360c67bb7406e​2f312/the%2520need%2520for%2520speed
13:43 dsp_ https://technoanimal.net/pr​ofile-1472045959.63195.html
13:44 dsp_ (i was just experimenting, and was surprised it took so long. wasn't sure if it was my fault or expected at this stage.)
13:44 hahainternet Time Spent
13:44 hahainternet The profiled code ran for 101.65ms
13:44 hahainternet so yeah something wacky's going on there
13:44 dsp_ moar is pegged at 100% cpu before it seems to do anything
13:45 dsp_ tried using moar and moar-blead built using rakudobrew
13:45 jnthn Modules are loaded at compile time, and the profile measures runtime, so if it's in module loading then the profile could still be correct, just not showing the actual problem
13:45 jnthn --profile-compile might give a more informative output
13:46 timotimo --stagestats will give you a breakdown of compile time, but i don't think it descends into compiling modules during loading (if it compiles anything at all)
13:48 hahainternet please re-post the uploaded html too dsp_ cause i wanna look :)
13:48 dsp_ yes, i am executing two more runs, one with --profile-compile and one with --stagestats (did not know if they could be combined)
13:49 timotimo they can. it's just a tiny bit of extra printing
13:49 timotimo not *that* informative
13:49 dsp_ % time perl6 --profile-compile gtk.pl
13:49 dsp_ Writing profiler output to profile-1472046521.54126.html
13:49 dsp_ perl6 --profile-compile gtk.pl  78.64s user 0.55s system 99% cpu 1:19.21 total
13:49 dsp_ i will upload now.
13:50 timotimo m: say <foo bar baz quux>.fmt("?", ",")
13:50 camelia rakudo-moar 2153bf: OUTPUT«Your printf-style directives specify 0 arguments, but 1 argument was supplied␤␤»
13:50 timotimo :(
13:51 timotimo can we have a directive "always print the empty string"? :)
13:52 VnrycepuxO joined #perl6
13:52 smls Is it possible to make EVAL interpret the given source code in expression context, rather than statement-list context?
13:53 jnthn '(' ~ $source ~ ')' # ;-)
13:53 smls ah of course
13:53 dsp_ https://technoanimal.net/pr​ofile-1472046521.54126.html -- https://gist.githubusercontent.com/anonymous/d​c0831ffde9420f15700dcb5c829acce/raw/658845bd80​89b4ba7a04c64cc6b5c0d55735029b/gistfile1.txt
13:53 smls thanks
13:53 jnthn Mild hack but :)
13:54 smls using EVAL in the first place is already a hack, so thats ok
13:54 timotimo lizmat: i won't actually be able to attend APW, because i've got to be somewhere else during it ;(
13:54 nine :(
13:54 lizmat :-(
13:55 RabidGravy I think I may have been having a bad day in the office when I wrote this https://github.com/cosimo/perl6-cache-mem​cached/blob/master/t/100-flush-bug.t#L34
13:56 timotimo that's not perl6 code :P
13:57 timotimo dsp_: the profile result may be too big for the browser-based profiler; you can --profile-filename=foobar.json to get a pure json thing, and then we can feed it into the qt profile viewer thingie
13:57 dsp_ ok, i can do that, one moment.
13:58 timotimo unless the json file is bigger than the arbitrary limit the json parser library we use enforces m(
13:58 timotimo https://github.com/tadzik/p6profiler-qt - this is the qt profile viewer thing
13:59 RabidGravy timotimo, I know, but because of the bogus skip above it just never got run
13:59 timotimo %)
14:03 Woodi "...just small quirk. But if it get logo and web page and some people goes mad, then you will fix this ?" :)) #Cluj++
14:05 canopus joined #perl6
14:06 kjs_ joined #perl6
14:11 Skarsnik joined #perl6
14:11 dsp_ https://technoanimal.net/gtk.json sorry for the delay.
14:13 timotimo that's only one second of recorded time
14:13 timotimo did you accidentally --profile instead of --profile-compile?
14:14 dsp_ ah, yes, doh.
14:14 dsp_ multitasking with work and sick :/ let me re-up
14:15 harmil joined #perl6
14:17 leont joined #perl6
14:17 harmil If I have an array @a and a potentially shorter array @b is the best way to check that @a starts with @b in a test to, "is-deeply @a[^+@b], @b, 'a starts with b'"?
14:17 Woodi timotimo: is there some way to view this .json nicelly ?
14:18 timotimo yes, look at the github link from 18 minutes ago
14:18 dsp_ 9.2mb, uncompressed: https://technoanimal.net/gtk.json.gz
14:19 timotimo i'm just now recording my own, too
14:21 timotimo huh. there seem to be ~1600 different EVALed code pieces
14:21 hahainternet well there's your problem!
14:21 kjs_ joined #perl6
14:22 timotimo not necessarily
14:22 hahainternet tell us oh profiler, where do we begin the witch hunt?
14:22 timotimo each one of those only runs for like 0.1ms
14:22 hahainternet timotimo: it was just a crap top gear reference :)
14:22 timotimo oh, ok
14:22 timotimo though to be fair, the method EVAL itself eats up about 30% of the whole run time
14:23 timotimo on that note ... does someone want to improve the p6profiler-qt? it's missing a bunch of stuff :)
14:26 nadim Hi, this is a request to the moar dev team. I installed p6 on a brand new box and It sefault when trying to run zef. a stack trace here http://nopaste.linux-dev.org/?1119781
14:26 timotimo nadim: cool. can you give us the --version of perl6 and moar?
14:26 nadim this problem is a mix of intel cpu problem, glibc using it, microcode that seems to not fix it
14:27 nadim timotimo: a sec ;)
14:27 timotimo what? %)
14:27 nadim OK, I get you that and I'll continue the story after
14:28 khw joined #perl6
14:28 cognominal joined #perl6
14:28 nadim This is MoarVM version 2016.07-24-g31eccd7 built with JIT support
14:28 timotimo hahainternet, dsp_, you could try seeing what happens if you time only from-json from the core setting.
14:29 timotimo it *could* be that it takes a big chunk of the time it takes to start up GTK::Simple.
14:29 AlexDaniel joined #perl6
14:30 nadim timotimo: This is Rakudo version 2016.07.1-243-gc201a76 built on MoarVM version 2016.07-24-g31eccd7
14:30 lizmat joined #perl6
14:32 nadim I have update microcode, and even tried to rebuild the glibc package with enable-lock-elision=no, but the packaging system is broken for some, still, obscure reason
14:33 nadim timotimo:  I don't know if it is possible to use something else apart uv_mutex_unlock, or if it is because of trying to unlock a lock that is not locked
14:33 timotimo time to spin up the debugger, eh?
14:33 nadim timotimo: there's plenty error reported about this for other applications
14:33 timotimo it should be somewhat easy to see exactly if the same address is being locked that's being unlocked there
14:33 nadim timotimo: that would be great because Zef seems to use that code and that means that i can't install modules
14:34 kjs_ joined #perl6
14:34 timotimo i don't think you can run any perl6 code on rakudo without triggering multi_cache_add
14:34 nadim p6 seems to work fine otherwise, my module runs through its tests and so does p6
14:34 timotimo ...wtf
14:35 TimToady harmil: you can use smartmatching for that
14:36 TimToady m: say <a b c d> ~~ |<a b c>, *
14:36 camelia rakudo-moar 2153bf: OUTPUT«False*␤»
14:36 TimToady m: say <a b c d> ~~ (|<a b c>, *)
14:36 camelia rakudo-moar 2153bf: OUTPUT«True␤»
14:36 TimToady like that
14:37 timotimo hahainternet, dsp_, did you get my message?
14:37 nadim timotimo: p6 -Ilib bin/zef is the command that breaks (there are probably other)
14:37 iH2O joined #perl6
14:38 timotimo i'm imagining something like 'my $start = now;' and at the end 'note "json parse took {now - $start}s";'
14:38 * timotimo AFK for a bit
14:38 smls m: say "a1" ~~ /a <? 1>/
14:38 camelia rakudo-moar 2153bf: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter < (must be quoted to match literally)␤at <tmp>:1␤------> 3say "a1" ~~ /a <?7⏏5 1>/␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> 3say "a1" ~~ /a <?7⏏5 1>/␤␤»
14:38 smls Wasn't there some shortcut for  <?before >  ?
14:39 ugexe nadim: try `perl6 -Ilib bin/zef --/cached ...` which will skip the part of zef that calls a lock. If that doesn't work then its probably a lock/unlock in compunit repo
14:39 TimToady m: say <a b c d> ~~ (|<a b c>, **)
14:39 camelia rakudo-moar 2153bf: OUTPUT«True␤»
14:40 jnthn smls: If it's a char class (which a single char boils down to) then <?[1]>
14:40 TimToady er, use **, not *, which only matches one element
14:40 smls jnthn: Ah, maybe that's what I was thinking of
14:40 dsp_ sorry, i've been multitasking. let me look into doiung this json thing you talk about.
14:42 TimToady smls: more generally, anything that goes inside <> can be turned into a lookahead by using <?x> instead of <x>
14:43 TimToady but not a general regex, without 'before'
14:43 smls ok
14:44 TimToady good reason to turn it into a rule if you use it more than once, so you can say <?foo>
14:44 hahainternet timotimo: yeah i'm confused, what's 'the core setting'?
14:45 TimToady we really should stop calling it the 'core', when it's really the 'skin'...
14:47 iH2O left #perl6
14:47 nadim ugexe: --/cached? with a slash?
14:48 harmil TimToady: Thank you
14:48 ugexe nadim: yes, the slash is like -- but false
14:48 nadim ugexe: still get a seg fault
14:49 ugexe nadim: probably in rakudo then. i pm'd you a longer command that should point out exactly where
14:49 nadim I've beed digging into that the last two days
14:49 nadim ugexe: timotimo got the details too
14:50 nadim ugexe: it's either changing microcode update, glibc, or maybe the mutexes that are used in p6
14:50 ugexe there are multiple locks in compunitrepo and precomp code
14:51 lizmat joined #perl6
14:56 nadim timotimo:  http://nopaste.linux-dev.org/?1119782
14:57 lizmat joined #perl6
15:05 timotimo hahainternet: it's the piece of code that gives you basically every single class, sub, and operator you'd use in perl6
15:07 tbrowder [Coke]: My bad, I did xtest in a non-current dir.  xtest looks good on master just now. Only error is the usual "t/00-load.t ............... 1/1
15:07 tbrowder # Failed test 'load module Pod::To::BigPage'
15:07 tbrowder # at t/00-load.t line 6
15:07 tbrowder # ===SORRY!===
15:07 tbrowder # Expected MAST::Frame, but didn't get one"
15:07 tbrowder which I assume all are getting (still an issue in Pod::To::BigPage).
15:08 hahainternet timotimo: well ultimately i was asking 'what do you want me/dsp to run exactly'?
15:08 dalek doc: 6600455 | (Zoffix Znet)++ | doc/Language/testing.pod6:
15:08 dalek doc: Fix broken URL
15:08 dalek doc: review: https://github.com/perl6/doc/commit/66004552e7
15:08 [Coke] tbrowder: no, I'm not getting that error because I don't have the broken optional dependecy installed.
15:08 [Coke] something SSL related.
15:08 timotimo hahainternet: run $EDITOR src/core/Rakudo/Internals/JSON.pm
15:10 timotimo m: say now; say time
15:10 camelia rakudo-moar 2153bf: OUTPUT«Instant:1472051478.944591␤1472051442␤»
15:10 * timotimo tends to forget which is the one that has the sub-second precision
15:13 tbrowder which optional dependency is that?
15:14 cibs joined #perl6
15:16 hoelzro o/ #perl6
15:17 timotimo heyo hoelzro
15:17 hoelzro howdy timotimo
15:18 timotimo who the hell is parsing all that json
15:18 tbrowder [Coke]:  I've tried uninstalling LWP::Simple and Pod::To::BigPage and reinstalling with "zef --force install Pod::To::BigPage" which didn't eliminate the error with xtest.  What did you do to eliminate the error?
15:19 tbrowder [Coke]:  Never mind, I read the rest of the comments on the issue.  Thanks.
15:20 hoelzro this might be a terrible idea - but do we have a way (from a module) to have a module B which is imported by module A at BEGIN time, and B installs an INIT phaser into A's unit?
15:21 timotimo i don't think we do.
15:21 timotimo but you can do it with a slang
15:22 hoelzro hmm, I hadn't thought of slangs
15:22 kyclark_ joined #perl6
15:22 hoelzro the best trick I had up my sleeve was exporting something into A that does...something.
15:23 acrussell joined #perl6
15:24 kyclark_ Given a hash like my %h = red => 10, blue => 3, green => 5; how can I sort it by the values?
15:25 jnthn for %h.sort(*.value) { ... }
15:25 jnthn (Note that you're actually sorting a list of the pairs in the hash; hashes themselves are unordered)
15:28 kyclark_ That is so nice!
15:28 timotimo dsp_, hahainternet, i get a total time spent in json parsing of 36.5 seconds, the profiler says the whole program took 70 seconds
15:31 tbrowder [Coke]:  See the comment I added to the Pod::To::BigPage issue.  The problem is solved for me at least for the moment (I need IO::Socket::SSL for another project).
15:32 timotimo that is, a simple "use GTK::Simple" will parse 407 blobs of json and takes 50% of its run time doing that.
15:32 timotimo dsp_, hahainternet, want to try plugging in JSON::Fast instead of JSON::Tiny and see how much better it gets? or maybe try caching json text to json result?
15:38 kyclark_ I’d like to constrain a “sort-by” argument to “key” or “value,” so I’m thinking about using “enum <key value>” and then somehow checking that the argument is in there.  1) Does that sound best? 2) How can I do that?
15:39 kyclark_ enum SortBy <key value>
15:39 timotimo you can also smart match against any(<key value>)
15:39 timotimo or against a hash
15:40 moritz or yes, use the enum
15:40 timotimo yup
15:40 moritz timotimo: or a Set :-)
15:40 timotimo right, anything Associative, really
15:40 moritz m: enum SortBy <key value>; sub f(SortBy $x) { say $x }; f key
15:40 camelia rakudo-moar 76e1ed: OUTPUT«key␤»
15:40 moritz m: enum SortBy <key value>; sub f(SortBy $x) { say $x }; f 'key'
15:40 camelia rakudo-moar 76e1ed: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling f(Str) will never work with declared signature (SortBy $x)␤at <tmp>:1␤------> 3ey value>; sub f(SortBy $x) { say $x }; 7⏏5f 'key'␤»
15:40 kyclark_ m: enum SortBy <key value>; say ‘key’ ~~ SortBy
15:40 camelia rakudo-moar 76e1ed: OUTPUT«False␤»
15:41 timotimo that's more problematic :)
15:41 timotimo but let's try this:
15:41 timotimo m: enum SortBy <key value>; sub f(SortBy() $x) { say $x }; f 'key'
15:41 camelia rakudo-moar 76e1ed: OUTPUT«Method 'SortBy' not found for invocant of class 'Str'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:41 timotimo aaw
15:41 mcmillhj joined #perl6
15:41 dsp_ timotimo: sorry for the lack of replies, i'm still at the office. but, i'm glad to know it wasn't "just me" that had the long execution times. i thought it was a quirk of my setup perhaps.
15:42 timotimo nope, it's not just you :)
15:42 dsp_ when i have some time, i will see if i can hack at it
15:44 leont joined #perl6
15:44 timotimo it's parsing the exact same json blob a million times
15:44 mspo should get pretty good at it ;)
15:45 timotimo except it doesn't :)
15:45 dsp_ timotimo: this JSON::Tiny to JSON::Fast, is it in the compiler you are referring to for the change?
15:46 timotimo it's in src/core/Rakudo/Internals/, that's all Perl 6 code
15:46 dsp_ aha
15:46 dsp_ i will have a look, thank you
15:46 pmurias can I declare a lexical variable with an arbitray name like $#@?!?
15:46 timotimo cool. it's doing 240 json parses, 237 of them could have come straight from the cache.
15:46 timotimo pmurias: it's possible with a slang, i suppose
15:48 timotimo dsp_: but putting a cache in there seems like a very bad idea, because it could be used from multiple threads
15:48 timotimo dsp_: it'd be better to put the cache into whatever part of the CompUnitRepo stuff uses json parsing
15:49 timotimo dsp_: https://gist.github.com/anonymous​/d174b1677499edc6838a05ebf1b1fb9c here's my diff for rakudo to do these measurements i was talking about
15:49 kyclark_ This script basically does what I want: Sorts by keys/values either asc/desc.  I was thinking of using a type to constrain the “sort-by”.  It’s not strictly necessary, but I’m trying to show cool examples.  Also, any other comments welcome. http://pastie.org/10939611
15:50 dsp_ thank you
15:50 timotimo YW :)
15:52 timotimo kyclark_: i'd personally get rid of both for loops :)
15:52 timotimo did you know about .Bag?
15:52 kyclark_ Yes, sorry, I should explain my MO.  I start with very simple, imperative examples and then build up. https://www.gitbook.com/book/​kyclark/metagenomics/details
15:52 timotimo m: <a b c a a a b b c>.Bag.say
15:52 camelia rakudo-moar 76e1ed: OUTPUT«bag(a(4), c(2), b(3))␤»
15:52 kyclark_ This is for teaching beginngers (grads/undergrads) programming.
15:53 timotimo $file.IO.lines.Bag would do the same thing your first for loop does
15:53 timotimo OK
15:53 timotimo in that case, maybe keep the for loop
15:53 kyclark_ I’m up to 5 versions of this script, will probably hit 10.  :-)
15:54 timotimo your current program would allow $sort-by to be 'age' or 'taste' as well :)
15:54 timotimo anyway, BBIAB :)
15:57 kyclark_ Right, I want to find a cool way to keep $sort-by to “key” or “value"
15:58 kyclark_ Preferable in the type/MAIN sig
15:58 kyclark_ Maybe a “subset”?
15:58 timotimo subset is fine
16:04 kyclark_ This seems to work:
16:04 kyclark_ subset SortBy of Str where * ~~ /^keys|values$/;
16:04 kyclark_ Is that the most elegant?
16:07 mcmillhj joined #perl6
16:07 kyclark_ What am I doing wrong here?
16:07 kyclark_ m: my $ok = <red green>.Bag; say ‘red’ ~~ $ok;
16:07 camelia rakudo-moar 76e1ed: OUTPUT«False␤»
16:08 kyclark_ How do I check for membership in a bag?
16:08 kyclark_ I see I can do $ok<red> — any other way?
16:08 grondilu m: subset SortBy of Str where "keys"|"values"; say "keys" ~~ SortBy
16:08 lizmat m: my $ok = <red green>.Bag; say $ok<red>:exists
16:08 camelia rakudo-moar 76e1ed: OUTPUT«True␤»
16:08 camelia rakudo-moar 76e1ed: OUTPUT«True␤»
16:08 kyclark_ Bag or Set, actually.  Either will do.
16:08 hoelzro kyclark_: (elem) would do it too, I think
16:09 hoelzro or ∈, if you're feeling fancy
16:09 kyclark_ Yes, (elem)!
16:16 kyclark_ What am I missing here?  I want to see if I was provided either “key” or “keys”.
16:16 kyclark_ m: my $sort-by = 'keys'; say $sort-by ~~ 'key'
16:16 camelia rakudo-moar 76e1ed: OUTPUT«False␤»
16:17 kyclark_ Oh, sorry, needed //
16:17 geekosaur m: my $sb = 'keys'; say so 'key'.ACCEPTS($sb)
16:17 camelia rakudo-moar 76e1ed: OUTPUT«False␤»
16:17 geekosaur ^ is what that actually means; when written that way it's more obvious it's not going to work...
16:18 mohae joined #perl6
16:18 timotimo well, you might also want to allow Key and Keys, too. as well as KEY and KEYS?
16:21 imcsk8 joined #perl6
16:25 kyclark_ Given a list of lists e.g.:
16:25 kyclark_ ((mouse 1) (cat 3) (bird 1) (dog 2) (frog 5) (cat 2) (mouse 7))
16:25 kyclark_ How can I sum those up on the first part?  Turn then into a BagHash?
16:25 kyclark_ So mouse => 8, cat => 5, ...
16:26 hoelzro you could use classify
16:26 hoelzro and then sum or...sumthing
16:26 hoelzro (•_•) / ( •_•)>⌐■-■ / (⌐■_■)
16:28 timotimo Bag.from-pairs?
16:28 gregf_ or reduce
16:29 timotimo in that case it'd probably have to be something like:
16:30 timotimo m: my @pieces = ("mouse", 1), ("cat", 3), ("bird", 1), ("dog", 2), ("frog", 5); my $bag = Bag.new; $bag{@pieces>>.[0]} = @pieces>>.[1]; say $bag.perl
16:30 camelia rakudo-moar 76e1ed: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
16:30 timotimo oh?
16:31 timotimo oh, yeah
16:31 timotimo m: my @pieces = ("mouse", 1), ("cat", 3), ("bird", 1), ("dog", 2), ("frog", 5); my $bag = BagHash.new; $bag{@pieces>>.[0]} = @pieces>>.[1]; say $bag.perl
16:31 camelia rakudo-moar 33be22: OUTPUT«("mouse"=>1,"frog"=>5,"cat"​=>3,"bird"=>1,"dog"=>2).BagHash␤»
16:31 timotimo Bag is immutable, BagHash is the mutable variant
16:32 awwaiid cool, but you missed the 'sum' bit
16:32 awwaiid kyclark_ had like mouse and cat listed twice
16:34 timotimo oh
16:34 timotimo that'd just be a += instead of = in there
16:34 awwaiid madness
16:35 timotimo yes, that's me
16:37 awwaiid m: my @pieces = <mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>; my %sums; for @pieces -> ($k, $v) { %sums{$k} += $v } ; say %sums
16:37 camelia rakudo-moar 33be22: OUTPUT«{bird => 1, cat => 5, dog => 2, frog => 5, mouse => 8}␤»
16:37 timotimo ah, that's a bit prettier than mine
16:37 timotimo thanks to the magic of val and all the right coercions being done for yo
16:38 lizmat joined #perl6
16:38 awwaiid kyclark_: the trickiest bit of this loop is the -> ($k, $v); the parenthesis de-structure the pair. If you left them out you'd get separate elements from @pieces. Otherwise it is just: loop over them all and sum them into a hash
16:40 mcmillhj joined #perl6
16:41 timotimo i think you may have to explain "separate elements" a bit more
16:42 timotimo because you'd still get the pairs as little lists in each run through the loop
16:53 canopus joined #perl6
16:58 gregf_ if you can translate this ruby code to perl6: [%w|mouse 1|, %w|cat 3|, %w|bird 1|, %w|dog 2|, %w|frog 5|, %w|cat 2|, %w|mouse 7|].reduce(Hash.new(0)){ |h,a| h[a[0]] += a[1].to_i; h }
16:59 timotimo what changes are allowed when translating?
17:01 timotimo m: sub infix:<INTO>(%h, ($k, $v)) { %h{$k} += $v; %h }; say [INTO] BagHash.new(), (<mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>);
17:01 camelia rakudo-moar 33be22: OUTPUT«Too many positionals passed; expected 2 arguments but got 7 in sub-signature␤  in sub infix:<INTO> at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:02 timotimo m: sub infix:<INTO>(%h, ($k, $v)) { %h{$k} += $v; %h }; say [INTO] BagHash.new(), |(<mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>)
17:02 camelia rakudo-moar 33be22: OUTPUT«BagHash.new(mouse(8), frog(5), cat(5), bird, dog(2))␤»
17:02 timotimo m: sub infix:<INTO>(%h, ($k, $v)) { %h{$k} += $v; %h }; .say for [\INTO] BagHash.new(), |(<mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>)
17:02 camelia rakudo-moar 33be22: OUTPUT«BagHash.new()␤BagHash.​new(mouse)␤BagHash.new(mouse, cat(3))␤BagHash.new(mouse, cat(3), bird)␤BagHash.new(mouse, cat(3), bird, dog(2))␤BagHash.new(mouse, frog(5), cat(3), bird, dog(2))␤BagHash.new(mouse, frog(5), cat(5), bird, dog(2))␤BagHash.…»
17:02 vcv m: my @pieces = ("mouse", 1), ("cat", 3), ("bird", 1), ("dog", 2), ("frog", 5); say @pieces.categorize(*[0]).map({ .key => .value.map(*[1]).sum })
17:02 camelia rakudo-moar 33be22: OUTPUT«(mouse => 1 frog => 5 cat => 3 bird => 1 dog => 2)␤»
17:02 vcv m: my @pieces = ("mouse", 1), ("cat", 3), ("bird", 1), ("dog", 2), ("frog", 5); say @pieces.categorize(*[0]).map({ .key => .value.map(*[1]).sum }).Hash
17:02 camelia rakudo-moar 33be22: OUTPUT«{bird => 1, cat => 3, dog => 2, frog => 5, mouse => 1}␤»
17:02 timotimo that's not using reduce :)
17:03 timotimo gregf_: how do you like my version with the triangle reduce added to it? :)
17:03 vcv m: my @pieces = <mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>; say @pieces.categorize(*[0]).map({ .key => .value.map(*[1]).sum }).Hash
17:03 camelia rakudo-moar 33be22: OUTPUT«{bird => 1, cat => 5, dog => 2, frog => 5, mouse => 8}␤»
17:08 skids m: my %h; %h.append: <<mouse 1 cat 3 bird 1 dog 2 frog 5 cat 2 mouse 7>>; %h = %h.kv.map: { $^k => [+] $^v }; %h.say
17:08 camelia rakudo-moar 33be22: OUTPUT«{bird => 1, cat => 5, dog => 2, frog => 5, mouse => 8}␤»
17:09 gregf_ wow, thats neat ;)
17:14 faubi joined #perl6
17:15 canopus joined #perl6
17:15 edehont joined #perl6
17:17 skids m: BagHash.^can("append")>>.signature.say # Hrm...
17:17 camelia rakudo-moar a4cc1c: OUTPUT«(($: | is raw))␤»
17:18 firstdayonthejob joined #perl6
17:19 skids m: my %h := BagHash.new(); %h.append("a",4); %h.say
17:19 camelia rakudo-moar a4cc1c: OUTPUT«Cannot resolve caller append(BagHash: Str, Int); none of these signatures match:␤    (Any:U \SELF: |values is raw)␤  in block <unit> at <tmp> line 1␤␤»
17:19 awwaiid m: my %h; %h.append: <<mouse 1 cat 3 bird 1 dog 2 frog 5 cat 2 mouse 7>> ; say %h # interesting!
17:19 camelia rakudo-moar a4cc1c: OUTPUT«{bird => 1, cat => [3 2], dog => 2, frog => 5, mouse => [1 7]}␤»
17:19 mcmillhj joined #perl6
17:31 setty1 joined #perl6
17:31 kjs_ joined #perl6
17:37 b2gills m: #`( pmurias: how about this ) my \term:<$#@?!?> = $ = 41; say $#@?!?++; say $#@?!?
17:37 camelia rakudo-moar a4cc1c: OUTPUT«41␤42␤»
17:38 Actualeyes joined #perl6
17:48 cognominal joined #perl6
17:52 andreoss left #perl6
17:52 andreoss joined #perl6
17:53 timotimo SourceBaby: BagHash append
17:53 timotimo s: BagHash, "append", \(Pair)
17:53 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/​blob/a4cc1ca/src/core/Any.pm#L186
17:53 andreoss is gather/take thread safe?
17:53 timotimo andreoss: you can't gather/take across thread boundaries
17:54 kjs_ joined #perl6
17:54 timotimo hmm
17:54 timotimo i wonder, though.
17:54 timotimo well, you can't force a Seq that's backed by a gather/take to generate a new value from two threads at the same time without expecting some trouble ... i think
17:55 timotimo s: BagHash, "append", \(BagHash:D: Pair)
17:55 SourceBaby timotimo, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Confusedâ�¤at -e:6â�¤------> [32mourcery( BagHash, "append", \(BagHash:D:[33mâ��[31m Pair) )[1];[0mâ�¤    expecting any of:â�¤        colon pairâ�¤
17:56 timotimo s: BagHash, "append", \(BagHash:D, Pair)
17:56 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/​blob/a4cc1ca/src/core/Any.pm#L186
17:56 timotimo now you're just fucking with me :(
17:58 timotimo i wonder if zoffix would know how to do this right?
18:03 dalek specs: b14828b | (Zoffix Znet)++ | v6d.pod:
18:03 dalek specs: Forbid Bare C<\b> in Regexes
18:03 dalek specs:
18:03 dalek specs: Implementation to close RT#128986
18:03 dalek specs: review: https://github.com/perl6/specs/commit/b14828bb01
18:03 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=128986
18:07 RabidGravy gah, starting yet another module :( I blame domm and davorg entirely for this
18:08 RabidGravy though to be fair I have spent three days trolling right wingers on twitter when I could have been finishing some software :-\
18:08 kjs_ joined #perl6
18:09 itaipu joined #perl6
18:10 zacts joined #perl6
18:11 timotimo sometimes you just need to engage in political discourse
18:13 timotimo do i want to read the oauth2 spec to figure out how the thing works?
18:18 mspo no unless you want to get sued for patent infringement
18:19 timotimo wat?
18:21 mspo oauth is encumbered multiple ways
18:22 timotimo software patents ...
18:22 jnthn It'll only lead to disappointment when you end up having to integrate with someone's home-grown oauth impl and discover they only half read the spec :P
18:22 mspo https://therealdaily.com/corporate/guyzar-l​lc-sues-zillow-redfin-espn-and-more-could-y​ou-be-this-new-patent-trolls-next-lawsuit/
18:22 mspo and of course the literal patent (not the one in that lawsuit) https://www.google.com/pat​ents/WO2013049461A2?cl=en
18:22 mspo etc
18:23 timotimo cool.
18:24 mspo but go for it :)
18:25 timotimo oracle has the oauth2 patent?
18:25 mspo it's a weird world
18:25 mspo the one from the lawsuit is ridiculous
18:25 mspo if you read it
18:25 RabidGravy timotimo, strange you talk about OAuth2 - is this for anything specific?
18:25 timotimo in general, i don't want to touch anything oracle owns with a ten foot pole
18:25 timotimo but that's hardly possible
18:26 timotimo RabidGravy: one of your last tweets
18:26 sjoshi joined #perl6
18:26 mspo timotimo: oracle holding it is probably a good thing since it's slightly less likely to get sold to one of those patent troll companies
18:27 RabidGravy oh yeah, my general approach is to implement just enough to get it to work with a given service :)
18:27 timotimo i'm not sure i'm able to read a patent
18:27 RabidGravy isn't there an oasis or w3c or something spec though?
18:29 jnthn For oAuth2? There's RFCs.
18:29 mspo timotimo: don't bother because you can get sued for anything even if it's barely related
18:29 jnthn https://tools.ietf.org/html/rfc6749
18:29 timotimo yeah
18:29 mspo the one from that article is something about ecommerce
18:29 mspo like very specifically
18:29 jnthn Also https://tools.ietf.org/html/rfc7662
18:30 RabidGravy yeah I knew I read it somewhere, got confused and settled on my current approach
18:30 khagan joined #perl6
18:31 timotimo i don't have anywhere near the necessary amount of focus that'd be needed to ingest patent language
18:33 mcmillhj joined #perl6
18:42 kjs_ joined #perl6
18:53 hoelzro timotimo: when you mentioned a slang for my idea earlier - I would "just" need to add some language construct that tacks a new intializer on top of $*UNIT[0], right?
18:53 timotimo um, i guess so?
18:53 timotimo the language construct may be as simple as "end of file" :)
18:54 hoelzro that should work nicely =)
18:54 timotimo :P
18:55 timotimo maybe you can already do the thing the moment your slang gets incorporated, or maybe even without a slang altogether?
18:56 hoelzro oh, yeah, haha
18:56 hoelzro well, the slang incorporation would be at BEGIN time, right?
18:56 ugexe joined #perl6
18:56 hoelzro hmm
18:56 hoelzro yeah, I don't think that would work
18:57 hoelzro it need to happen at INIT time, unfortunately =/
18:57 hoelzro *it needs
18:57 hoelzro (I want to write a module that allows users to write POD transform modules that don't require any work beyond DOC use Pod::My::Module)
19:08 zengargoyle joined #perl6
19:09 mohae_ joined #perl6
19:10 mohae__ joined #perl6
19:11 wamba joined #perl6
19:14 cgfbee joined #perl6
19:14 RabidGravy timotimo, going back to the Medium.com API I suspect I will just go for the "Self-issued access tokens" approach in the first place and not worry about the full OAuth2 dance
19:30 smls joined #perl6
19:38 [Coke]_ joined #perl6
19:39 * [Coke] finally drags himself into the 2010s and switches to tmux
19:41 El_Che what triggered the switch?
19:41 El_Che (still using screen)
19:41 [Coke] tmux -CC
19:42 [Coke] being able to have my original screen tabs as 2 separate OS X windows and having it remember the settings in between connections.
19:43 mohae joined #perl6
19:43 RabidGravy to be honest I'd probably use scr or jsb multiview if they were still going :-\
19:44 El_Che as a linux user (and linux on a VM when windows imposed), I mostly use screen to leave processes running. As a for window management, I just open an other gui terminal for a new session
19:45 El_Che what with the the drama on blogs.perl.org. Zoffix seems pretty pissed of. Hopefully it will fade
19:47 grondilu El_Che: consider switching to tmux.  I did and I'm happy about it.
19:48 grondilu for one it's more robust in terms of connection loss.
19:49 RabidGravy El_Che, yeah I'm mostly in the same place re terminals
19:51 canopus joined #perl6
19:55 TEttinger joined #perl6
19:58 kyclark_ joined #perl6
19:59 itaipu joined #perl6
20:01 TimToady m: my @pieces = <mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>; say [⊎] @pieces».Hash
20:01 camelia rakudo-moar a4cc1c: OUTPUT«bag(mouse(8), frog(5), cat(5), bird, dog(2))␤»
20:01 TheLemonMan joined #perl6
20:04 awwaiid I don't even
20:04 hoelzro so the multi-set union operator implicitly adds duplicate values?
20:05 awwaiid unrelatedly -- when I'm in a loop anything I call can do 'next' or 'last', dynamic like. Any way to stop them, maybe make it raise an error? I'm trying to make it so that 'last' doesn't exit the REPL
20:05 hoelzro awwaiid: I was looking at that bug earlier =P)
20:05 hoelzro I think it should be possible now that the REPL is all in REPL.pm
20:05 TimToady that's what multi-set union means, dumping two bags into one
20:05 hoelzro awwaiid: CONTROL { ... } should do it (I think)
20:05 hoelzro ah ha
20:05 awwaiid hoelzro: I've got it catching 'return', but stopping 'next' / 'last' via a CONTROL { ... } has weird consequences
20:06 hoelzro oh, really? =/
20:06 awwaiid well. maybe it shouldn't and I need to golf a bit
20:06 awwaiid but I think CONTROL { } maybe is only supposed to trigger when it _can't_ do 'next' ?
20:06 awwaiid though it seems to catch it all the time
20:06 jdv79 i thought the 5 6 crap was behind us.  guess that was overly optimistic...
20:08 RabidGravy what is the [⊎] character, and can it be composed?
20:08 TimToady it's just a reduce
20:08 cdg joined #perl6
20:09 TheLemonMan joined #perl6
20:09 hoelzro awwaiid: next should raise a control exception that an enclosing loop construct should catch via CONTROL
20:09 RabidGravy no, no the actual character in the brackets, I can't see what it is :)
20:10 TimToady it's just a ∪ (union) with a teeny tiny + inside, which is pretty indicative of what it's supposed to do to the values :)
20:10 kjs_ joined #perl6
20:10 hoelzro RabidGravy: http://www.fileformat.info/inf​o/unicode/char/228e/index.htm
20:10 hoelzro it all makes sense now!
20:11 RabidGravy it doesn't appear to be composable with three keystrokes :-\
20:12 TimToady oh, that kind of composable
20:12 TimToady I just type 'u union' and copy/paste out of the list :)
20:12 TimToady oughta be U+ or some such, I suppose
20:13 hoelzro isn't that the origin of the U+XXXX notation for Unicode?
20:14 TimToady m: my @pieces = <mouse 1>, <cat 3>, <bird 1>, <dog 2>, <frog 5>, <cat 2>, <mouse 7>; say [(+)] @pieces».Hash
20:14 camelia rakudo-moar a4cc1c: OUTPUT«bag(mouse(8), frog(5), cat(5), bird, dog(2))␤»
20:14 TimToady my program for looking up unicode char is called 'u'
20:15 TimToady I use it often enough that I have a single-char alias
20:15 dalek Inline-Perl6: 7d08b32 | niner++ | lib/Inline/Perl6.pm:
20:15 dalek Inline-Perl6: Little documentation update
20:15 dalek Inline-Perl6: review: https://github.com/niner/Inl​ine-Perl6/commit/7d08b32ec9
20:15 awwaiid https://docs.perl6.org/routine/($PLUS_SIGN) -- baggy additon operator
20:15 nowan joined #perl6
20:16 TimToady and I have a program 'unik' that lists composable chars, but no entry for multisets
20:16 dalek Inline-Perl6: c7697b1 | niner++ | lib/Inline/Perl6.pm:
20:16 dalek Inline-Perl6: Version 0.07
20:16 dalek Inline-Perl6: review: https://github.com/niner/Inl​ine-Perl6/commit/c7697b1c96
20:16 RabidGravy yeah in vim it's fine but six keystrokes
20:16 hoelzro TimToady: which program is it?
20:16 * hoelzro uses unichars
20:17 hoelzro RabidGravy: map it to a digraph then =)
20:17 TimToady I've posted it here several times, just a p5 code the uses 'do' to pull in the table and does a direct lookup
20:17 hoelzro ahhh
20:18 RabidGravy It's not something I do a great deal, don't automate until you need to do it more that once :)
20:18 TimToady there are fancier compose tables out there that probably include ⊎, but I haven't been able to get them to work with anthy
20:19 woolfy joined #perl6
20:19 RabidGravy yeah I think the xcompose thing here let's you set them up, and <Compose> U + doesn't do anything right now :)
20:22 Xliff Anyone know of a module or set of modules that can convert color names to hex values (or RGB)?
20:22 Xliff If not, I might have a solution. =)
20:23 Xliff I have X11 and Pantone C colors converted to something useable by Perl6. Was wondering if anyone had other lists that I could add to the stack?
20:24 zacts joined #perl6
20:24 awwaiid hoelzro: ok ... problem is that the CONTROL { ... } is in a block in which I actually DO want to do like 'next REPL' now and then. I'm now moving the CONTROL into a deeper method, but that is where things go weird.
20:25 hoelzro ah ha
20:25 hoelzro awwaiid: you said in here you're going to Strange Loop next month, right?
20:26 awwaiid yes
20:26 awwaiid you?
20:26 awwaiid we should all go
20:30 hoelzro I'll be there =)
20:30 hoelzro if you don't have a chance to fix this by then, we can team on it in person =)
20:30 hoelzro heck, we should have a mini REPL.pm hackathon
20:33 awwaiid indeed
20:33 awwaiid I have a smaller one, and am shrinking it further
20:34 awwaiid hoelzro: https://gist.github.com/awwaiid/​488cb1ef1d1b68eb6f7d86fcd314eaa8
20:35 awwaiid you can see here that it works for next/last/return, but now when you do a regular exception it is almost like the CONTROL still takes affect even though the scope is different, and it takes affect AFTER the the initial exception is caught
20:35 awwaiid I'm golfing further now
20:36 nadim joined #perl6
20:38 hoelzro interesting...
20:38 mvorg joined #perl6
20:38 RabidGravy Xliff, do it! But make it pluggabe perhaps so if someone comes up with some new colour lists it's easier :)
20:39 El_Che lizmat & woolfy: don't give out all the camelia stickers at yapc. Leave on for me :)
20:40 lizmat El_Che: we will :-)
20:40 El_Che \o/
20:44 awwaiid hoelzro: https://gist.github.com/awwaiid/​faa4a37e5769337f3b01fca111a7925c you can see here that the second loop gets into the CONTROL block even though it shouldn't
20:45 woolfy Claudio Ramirez: we have two types of Camelia stickers: round ones that I ordered to make by a Dutch company, and hexagonal full-colour stickers made by Mark Keating.
20:46 [Coke] we should make docs.perl6.org the main link on http://perl6.org/documentation/
20:46 awwaiid [Coke]++ # yep
20:47 [Coke] I'm sure it's been mentioned before, just hit me today because I went through the main page first.
20:48 hoelzro wth
20:48 * [Coke] has to figure out how to use start properly. blah.
20:49 canopus joined #perl6
20:49 timotimo [Coke]: i agree, it should get a big button at the top or something
20:49 timotimo maybe like a hero unit
20:49 timotimo perhaps smaller than a typical hero unit?
20:49 lizmat m: await start { say "started" }; say "done"
20:49 camelia rakudo-moar a4cc1c: OUTPUT«started␤done␤»
20:49 brrt joined #perl6
20:49 El_Che Wendy van Dijk: thx, curious how they look
20:51 [Coke] lizmat: don't want to await, I'm in a callback where I don't have control over the main loop.
20:51 [Coke] it'll probably be fine if no errors occur...
20:52 awwaiid m: https://gist.github.com/awwaiid/​7acc14380c3a0a45e8fda5b42933b55a
20:52 camelia rakudo-moar a4cc1c: OUTPUT«EXCEPTION: forced exception␤  in sub catch-control at <tmp> line 6␤  in block <unit> at <tmp> line 10␤␤Caught a CONTROL (Died with CX::Last␤)␤  in sub catch-control at <tmp> line 4␤  in block <unit> at <tmp> line 10␤␤»
20:52 lizmat well, you need to do something with the returned Promise, otherwise you run the risk of the program exiting before the started work is done
20:52 awwaiid I only expect that code to catch the exception, not enter the CONTROL block
20:52 lizmat m: start { say "started"; sleep 2; say "done" }
20:52 camelia rakudo-moar a4cc1c: ( no output )
20:52 lizmat m: start { say "started"; sleep 2; say "done" }
20:52 camelia rakudo-moar a4cc1c: ( no output )
20:52 lizmat m: start { say "started"; sleep 2; say "done" }
20:52 camelia rakudo-moar a4cc1c: ( no output )
20:52 lizmat m: start { say "started"; sleep 2; say "done" }; sleep 1
20:52 camelia rakudo-moar a4cc1c: OUTPUT«started␤»
20:53 hoelzro awwaiid: that's odd indeed - I wish I knew more about control blocks now =/
20:54 awwaiid well https://docs.perl6.org/syntax/CONTROL makes it sound like CONTROL { ... } should only get invoked when there is an _exception_ from a control flow. I guess I should look at roast
20:55 hoelzro good idea
20:56 [Coke] lizmat: it's a bailador app; so the last line puts the app into a non-busy wait so things can connect.
20:56 AndyBotwin joined #perl6
20:56 AndyBotwin joined #perl6
20:56 lizmat [Coke]: so you're saying you shouldn't have to worry about the program exiting before the started work is done?
20:56 [Coke] so, first pass, I probably -can- just wrap all the backend stuff in a start {} block.
20:57 [Coke] lizmat: aye.
20:57 [Coke] just seems like I'm cheating too much here. :)
20:57 lizmat [Coke]: then what is the problem, just start {}  :-)
20:58 awwaiid hoelzro: roast says CONTROL happens all the time, and doesn't mention die, https://github.com/perl6/roast/blob/ma​ster/S04-exception-handlers/control.t
20:58 harmil_wk joined #perl6
20:59 awwaiid hoelzro: well. I can work around it by returning a special value instead of die'ing
21:00 harmil_wk I think that it's safe to say that this is not the best way to generate the sequence defined by n*2^(n-1) :
21:00 harmil_wk m: say ^10 .map: -> $n { {[+] [<<+>>] [X] ^2 xx $n}}
21:00 camelia rakudo-moar a4cc1c: OUTPUT«Use of uninitialized value of type Any in numeric context  in block  at <tmp> line 1␤(0 1 4 12 32 80 192 448 1024 2304)␤»
21:00 nadim sharing a bit of YAPC with  P6 ... http://imgur.com/0whNEcV
21:00 nadim many people here talking about P6, namely not knowing if they should try or not
21:01 nadim we need to do something about it
21:01 timotimo what about wendy's brochure?
21:02 harmil_wk Minor side point: I don't think that warning should have happened. xxing by zero is sketchy, but not that sketchy. Shouldn't it just return the null Seq?
21:02 harmil_wk m: ^2 xx 0
21:02 camelia rakudo-moar a4cc1c: OUTPUT«WARNINGS for <tmp>:␤Useless use of "^" in expression "^2" in sink context (line 1)␤»
21:02 harmil_wk m: say ^2 xx 0
21:02 camelia rakudo-moar a4cc1c: OUTPUT«()␤»
21:02 harmil_wk Hmm, it does.
21:03 harmil_wk Oh, it's probably because of reducing on an empty list. That makes sense.
21:03 timotimo m: say [X] ^2 xx 0
21:03 camelia rakudo-moar a4cc1c: OUTPUT«(((Any)))␤»
21:04 lizmat sleep&
21:04 timotimo that's where it comes from i expect?
21:04 timotimo m: say [X] (^2 xx 0)
21:04 camelia rakudo-moar a4cc1c: OUTPUT«(((Any)))␤»
21:04 harmil_wk Yah
21:04 timotimo m: say [X] ()
21:04 camelia rakudo-moar a4cc1c: OUTPUT«(((Any)))␤»
21:04 timotimo kinda weird :)
21:04 harmil_wk Though that's probably not the right answer either
21:04 hoelzro awwaiid: that sounds good
21:04 nadim timotimo: I haven't seen it. but that they talk about not knowing is good
21:05 timotimo nadim: better than "no i don't use it because i heard it gave a friend of a colleague pimples on the nose"
21:05 harmil_wk heh
21:07 nadim timotimo: we'll make a few converts. i may have a short talk about it and shake them a bit
21:07 timotimo sounds good :)
21:07 nadim timotimo: did you have time to look at the seg fault code?
21:08 cognominal joined #perl6
21:08 timotimo sorry, i have not
21:08 timotimo that's the one where unlocking a mutex explodes, right?
21:09 nadim yes
21:09 nadim I can't install modules, it's a pain
21:09 nadim I'll install one or two by hand in the meantime
21:09 timotimo excuse me, what do i have to do again? install zef, and then what?
21:09 nadim nedd text::ansicolor for a talk
21:10 nadim timotimo:  it's going to work on your box
21:10 nadim timotimo: it's an intel microcode-libc-mutex problem.
21:11 timotimo so how do you expect me to even look at it?
21:11 nadim I posted a link to the stack trace
21:11 nadim timotimo: I don't expect anything, but I sure would like that you have a look
21:11 nadim let me find the stack trace
21:11 El_Che woolfy++: I saw live that you announced FOSDEM!
21:12 harmil_wk nadim: I think the point is that unless one has the specific hardware that you do, it's not likely to be something that can be investigated. Now, if you wanted to take a look at it...
21:12 nadim timotimo: http://nopaste.linux-dev.org/?1119781
21:13 nadim I wonder if the uv_mutext_lock can be replaced by something else
21:13 nadim otherwise a libc without elision   is needed
21:15 nadim timotimo:  maybe TimToady would like to have a look, i sat behind him all day. if it is something he'd like to do. I'd help but I am afraid I won't be very useful
21:15 nadim timotimo: the other possibility is a remote session.
21:16 timotimo i'm not sure libuv has a different kind of lock that we could use
21:16 timotimo maybe we could just plop a reentrant mutex in there if the current one is not reentrant
21:16 timotimo and thus it'd tickle a different code path in your libc?
21:17 itaipu joined #perl6
21:17 nadim I think that is worth a try, if you have a branch, I'll run the tests
21:17 tailgate If I make a change to a module I published on ecosystem, do I need to send a new pull request?
21:17 timotimo other than that you can implement the lock with a busy-loop of atomic operations
21:17 hoelzro tailgate: nope
21:17 nadim I think this problem is going to appear more and more as this hardware is getting popular
21:18 timotimo nadim: what kind of special hardware is this?
21:18 timotimo you said it's an intel chip, so ... the kind pretty much half the population has in their desktop computers?
21:18 nadim not special, newer
21:18 timotimo so you're saying that anything that uses the same kind of lock that libuv uses will randomly segfault on the newest intel chips?
21:19 timotimo what the fucking madness is this
21:19 tailgate there are non-x86 desktops?
21:19 timotimo tailgate: sure
21:19 timotimo i can imagine some powerpc macs still being in use
21:19 hoelzro timotimo: Madness? THIS IS PERL 6!
21:19 nadim timotimo: there are applications, games, ... that have had the same kind of problems, all at the same place
21:19 tailgate I know ARM servers...and ARM cell phones...and I guess there are a few ARM netbooks
21:20 * timotimo kicks hoelzro into a pit filled with cake
21:20 timotimo tailgate: the 50% number was to contrast intel cpus vs amd cpus
21:20 nadim timotimo: some mismatch between libc and the microcode patches on haswell architecture, and some previous too
21:20 hoelzro =)
21:20 * geekosaur would still be using his ibook if its hard drive hadn't died
21:21 timotimo because if amd went ahead and said "hey, intel crashes when using locks, and they are really popular, so we should make our cpus also crash when unlocking locks", then i'd have the whole hardware industry fired, because that would simply be wrong.
21:21 geekosaur (sadly replacing an ibook's hard drive is a complete teardown)
21:22 hoelzro timotimo: sounds sadly similar to Nvidia =/
21:22 timotimo hoelzro: what, the pit filled with tasty cake?
21:23 nadim here is an example bug report on debian  https://bugs.debian.org/cgi-​bin/bugreport.cgi?bug=800574
21:23 hoelzro haha, I wish
21:25 timotimo nadim: that sounds like it's firmly Not My Department
21:25 ugexe it appears related to module loading or precomp
21:25 zacts joined #perl6
21:25 nadim timotimo: its a glibc problem
21:26 nadim https://lwn.net/Articles/534758/
21:26 ugexe looking at his RAKUDO_MODULE_DEBUG=1 output and comparing to mine, his segfaults without reaching https://github.com/rakudo/rakudo/bl​ob/17281399ddbe11605834d57ad7b2f1ee​5a96c4ff/src/Perl6/World.nqp#L1124
21:26 nadim this article explains thtat it implements different types of locking, elision being one of them
21:26 nadim not using elision in the locking should fix the problem
21:27 woolfy Claudio Ramirez: I indeed announced that I submitted proposals to FOSDEM for devroom & booth, and that we probably will get them, and that I will accept talk proposals.  I made sure I included a little bit of uncertainty...  :-)
21:27 ugexe it seems to precompile and load the dependencies ok, but fails while trying to merge the last one
21:27 nadim the other way is to have a specific glibc, unfortunately, in debian-ubuntu, glibc is compiled with elision
21:28 nadim which means that this would force all the users of skylake-some-microcode to update their glibc
21:29 nadim and the packaging system is broken anyway, I had a try at it earlier today, I'll try again
21:29 cygx joined #perl6
21:29 cygx o/
21:29 nadim IMHO, if there is another locking mechanism and it removes the risk of users getting this error when running P6, it would be nice to look at it
21:30 cygx awwaiid: the behaviour you see is not because of CONTROL, but because the regular exception is resumable, ie the stack has not yet been unwound
21:30 cygx cf https://gist.github.com/cygx/7e​fc3f49089c7eb3b61ac2e8c500b81c
21:30 timotimo well, is there a way to tell libc to not use elision? like a #define we can set when we compile libuv?
21:31 hoelzro I don't mean to be negative, but isn't this something that glibc should be taking care of?
21:31 geekosaur you have to rebuild glibc itself
21:31 nadim there is but the packaging system seems broken, I tried to repackage it with the right options earlier
21:31 hoelzro I mean, part of the "contract" with glibc when it provides locks is that they work, right?
21:31 timotimo no, your contract with computers is that computers Never Fucking Work
21:32 hoelzro timotimo++ # wisdom
21:32 nadim timotimo: there is even a debian  request for the possibility to switch elision on-off at run time, but it seems to be dead in the water
21:33 timotimo we can implement a little signal handler for segfaults
21:33 nadim i'll try to talk with ubuntu development tomorrow but it seems unlikely to happen in the short term
21:33 timotimo it'll use libunwind to discover if the crash happened in an unlock operation, then it'd turn HLE off and resume
21:33 geekosaur timotimo, the problem with that is you don't always get a segfault, sometimes yoy get silent data corruption
21:33 awwaiid cygx: ah, interesting.
21:34 timotimo nadim: so why exactly didn't a microcode update fix the problem on your machine?
21:36 nadim I have no idea, the microcode patch that was already installed is not old. the one I installed today s a month old.
21:36 jnthn uv_mutex_lock is, afaik, just a thin wrapper (perhaps even a compiled-away wrapper) around pthreads mutexes.
21:37 nadim it seemes that the time of mutex used in the locking, via libc, is something that can be chosen, elision being one among other types
21:37 nadim jnthn: that's what I gathered too
21:37 jnthn And those are absolutely bog standard.
21:38 jnthn I guess Windows uses a different mechanism, if you're looking for alternatives :P
21:39 timotimo use dietlibc instead of glibc?
21:39 mcmillhj joined #perl6
21:39 jnthn Do we know if we're using pthreads mutexes in some highly dodgy way that trips over this problem?
21:40 cognominal joined #perl6
21:40 timotimo we could build a little loop that just reads random memory from commonly accessed regions of the program
21:40 timotimo that'll surely abort the transaction and fall back to a real lock
21:40 jnthn 'cus if it's as simple as "pthreads mutexes are broken" I can only imagine a huge number of things would be affected
21:41 ugexe it occurs in Perl6/World.nqp method load_module
21:41 nadim it seems that elision-TSX is not the simples thing to implement right https://software.intel.com/en-us/article​s/tsx-anti-patterns-in-lock-elision-code
21:41 timotimo nadim: you can get the perl6-level backtrace from within gdb, btw
21:41 jnthn ugexe: In a single-threaded program?
21:41 timotimo just "up" until you hit a frame that has a "tc" for you
21:42 timotimo and then "call MVM_print_backtrace(tc)" or what it's called
21:42 nadim timotimo: wasn't the stack trace i posted enough?
21:42 jnthn (e.g. you can hit this without actually using threads at all?)
21:42 ugexe jnthn: he never reaches the Import stage
21:42 timotimo nadim: it's not all. no clue if it's enough or not
21:43 jnthn Well, technically a module mainline coulda started threads, but yeah, it's unlikely.
21:43 jnthn That's a real wtf though.
21:43 timotimo to be totally honest, i'd rather smash my head against a hard surface than try to ... anything regarding this
21:43 nadim I'll do the work on this machine and can even give you guys access
21:44 nadim timotimo: don't smash rocks ;)
21:45 nadim how do you get these perl6-lvel backtrace? do I run the perl6-gdb-m?
21:45 timotimo you're already in a gdb, are you not?
21:46 timotimo it doesn't look like you have any debug symbols at all
21:46 nadim perl6-gdb-m seems to be there, yes
21:47 timotimo it doesn't show function signatures in that backtrace, is what i mean
21:48 nadim up gives me the same results as the trace I posted
21:52 nadim do I need a p6 with extra dbug info?
21:53 timotimo not p6, just moar
21:53 timotimo perl Configure.pl --debug=3 ...
21:57 rba_ joined #perl6
21:57 nadim unknown option debug!
21:57 timotimo that's the moarvm Configure.pl
21:57 nadim ah, not rakudo
21:59 nadim timotimo: where does rakudo download moar? or shall i get more separately?
21:59 timotimo it's either under moar/ or under nqp/moar/
21:59 timotimo with moar or less Vm or capitalization
22:01 nadim nqp/moaarVM got it
22:01 nadim nqp/MoarVM bleah!
22:03 nadim interesting, moar is on a detached HEAd
22:03 n1lp7r joined #perl6
22:04 nadim timotimo:  ok, configured and build, next?
22:04 timotimo "make install"
22:04 timotimo that'll be enough
22:04 timotimo but make install inside moar's folder only
22:05 nadim ok done
22:06 jnthn sleep &
22:07 timotimo now your perl6-gdb-m will hopefully give you better stack traces
22:07 TheLemonMan m: say (sub e(Any \ --> Mu) { ... }).signature
22:07 camelia rakudo-moar a4cc1c: OUTPUT«($)␤»
22:07 TheLemonMan m: say (sub e(Any \--> Mu) { ... }).signature
22:07 camelia rakudo-moar a4cc1c: OUTPUT«($ is raw)␤»
22:07 TheLemonMan bug or not ?
22:07 timotimo pretty weird
22:08 timotimo the parser clearly thinks you have a sigil-less variable in the second one
22:08 nadim timotimo: absolutely no change
22:09 timotimo how does a "bt full" look?
22:10 nadim the same
22:11 nadim but says: no symbole table available
22:11 timotimo not even line numbers?
22:11 nadim nada
22:11 timotimo did you get any lines that looked like compilation?
22:11 timotimo oh
22:11 timotimo duh
22:11 timotimo when you build moar with --gen-nqp, it'll give it a --prefix
22:11 nadim still using the same moar, right?
22:12 timotimo you've now got a rakudo/nqp/install/bin/moar
22:12 timotimo whereas you would have wanted an install/bin/moar
22:12 timotimo or whatever you came up with
22:12 nadim shall I copy the library there?
22:12 timotimo no
22:12 timotimo re-configure with the proper --prefix
22:14 mcmillhj joined #perl6
22:15 nadim the rakudo/install/bin right
22:15 nadim two directories up
22:19 timotimo the prefix is what install/ is
22:21 timotimo i.e. you'll want to have a --prefix that ends in "install/"
22:21 mcmillhj joined #perl6
22:22 nadim did that, obviously the prefix has to be with ../.. (oh my eyes) as a path to the directory gives very weird install commands. and the command doesn't fail even if the install directories are completely wrong
22:23 timotimo "completely wrong"?
22:23 timotimo how could they be? it'll take literally any path
22:23 timotimo the only thing that's not allowed in a path is the null byte, afaik
22:24 nadim this for example  usr/bin/perl -MExtUtils::Command -e cp 3rdparty/dyncall/dyncall/*.h /home/nadim/nadim/devel/repositories/ra​kudo/nqp/MoarVM/~/nadim/devel/repositor​ies/rakudo/install/bin/include/dyncall
22:24 nadim ~ in prefix wasn't welcome :)
22:24 timotimo oh, hehe
22:24 nadim let me see what I can do
22:25 nadim make install succeeded with those paths
22:25 nadim IE did return 0
22:25 timotimo so you have a folder named "~" inside your MoarVM folder now?
22:25 mohae_ joined #perl6
22:26 nadim actually yes :)
22:27 nadim I configure with .., let'ssee what I get
22:27 nadim timotimo: can make run with -j 8 or 16 ?
22:27 nadim and work properly
22:29 timotimo in moar, yes
22:29 nadim OK
22:29 timotimo in nqp, only one job per back-end you're building
22:29 timotimo in rakudo, same.
22:30 nadim it's installed in the right place, let's see what gdb gives us
22:33 Sgeo joined #perl6
22:34 nadim timotimo: http://nopaste.linux-dev.org/?1119791
22:35 nadim say if you'd like the full backtrace (looked interesting with all the stuff optimized away)
22:36 cdg joined #perl6
22:38 rkazak joined #perl6
22:38 TheLemonMan m: say (sub (Any \) { }).signature
22:38 camelia rakudo-moar a4cc1c: OUTPUT«($ is raw)␤»
22:38 TheLemonMan m: say (sub (Any \ ) { }).signature
22:38 camelia rakudo-moar a4cc1c: OUTPUT«($)␤»
22:39 TheLemonMan even better (or worse)
22:42 moritz joined #perl6
22:43 mohae joined #perl6
22:46 nadim timotimo: let's continue tomorrow
22:47 Util joined #perl6
22:52 edehont joined #perl6
23:28 Zoffix joined #perl6
23:41 tbrowder left #perl6
23:46 atweiden joined #perl6
23:48 atweiden anyone know what this error message is about? "Package ... is insufficiently type-like to qualify a parameter"
23:49 Zoffix atweiden, what's the code?
23:50 atweiden Zoffix: https://bitbucket.org/atweiden/txn-parser-ast/i​ssues/1/package-txn-parser-ast-entry-posting-is
23:50 Zoffix :) that's the error :) What's the code that triggers it? I recall seeing something similar but forget what the reason was
23:52 atweiden idk what triggers it. i can't get the code to compile
23:52 Zoffix Are you able to share that code?
23:53 atweiden Zoffix: ofc, you could `hg clone https://bitbucket.org/atweiden/txn-parser-ast`
23:53 atweiden the problem appears to be in lib/TXN/Parser/AST/Entry.pm
23:54 Zoffix atweiden, what do I run to trigger the error>?/
23:54 atweiden p6 t/grammar-actions/01-ledger.t
23:55 BenGoldberg joined #perl6
23:55 atweiden you may need to install libxxhash for your platform

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

Perl 6 | Reference Documentation | Rakudo