Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-19

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:01 M-tadzik joined #perl6
00:04 M-Illandan joined #perl6
00:14 muraiki_ joined #perl6
00:14 muraiki_ m: map { say $_ }, "test".split("")
00:14 camelia rakudo-moar bd4400: OUTPUT«␤t␤e␤s␤t␤␤»
00:15 muraiki_ what causes the beginning and ending newlines? I suppose there's probably a better way to do htis though
00:16 teatime m: map { say $_ }, "test".comb
00:16 camelia rakudo-moar bd4400: OUTPUT«t␤e␤s␤t␤»
00:16 muraiki_ thanks teatime++ :)
00:16 timotimo you get the beginning and end because there's empty strings there
00:17 muraiki_ I see
00:17 muraiki_ I just didn't know about comb. now it makes sense :)
00:17 timotimo ayup
00:20 BenGoldberg joined #perl6
00:21 johndau joined #perl6
00:21 tailgate so would it be called with $the-additionoperator = &[+]; $the-additionoperator($a, $b); ?
00:25 timotimo yeah, for example
00:25 Juerd Out of the not-very-spectacular features of Perl 6, .comb is one of my favorites.
00:25 timotimo if you use a & instead of the $ for the variable name, you don't have to spell it another time
00:35 cdg joined #perl6
00:36 MadcapJake m: say &infix:<+>(10, 2)
00:36 camelia rakudo-moar bd4400: OUTPUT«12␤»
00:36 MadcapJake m: say &infix:<R->(2, 10)
00:36 camelia rakudo-moar bd4400: OUTPUT«8␤»
00:37 ZoffixWin :o
00:38 MadcapJake are meta ops considered infixes?
00:38 MadcapJake probably not
00:39 MadcapJake m: say &prefix:<[+]>([1, 2, 3])
00:39 camelia rakudo-moar bd4400: OUTPUT«6␤»
00:40 tardisx joined #perl6
00:45 skink This experiment worked first try...
00:45 skink I'm deeply suspicious
00:46 cdg_ joined #perl6
00:46 khw joined #perl6
01:00 Ben_Goldberg joined #perl6
01:05 nightfrog joined #perl6
01:07 skink What in the
01:08 skink Someone verify my sanity for a moment here
01:08 skink https://github.com/skinkade/p6-crypt-argon2/blob/KeyDerive/lib/Crypt/Argon2/KeyDerive.pm6
01:08 skink The Argon2-meta being return by that function has $.keylen => 0 somehow
01:09 skink Yet the other values within are as expected, and the returned $key does have 32 elems
01:10 timotimo the argon2d_hash_raw function may change the value of $keylen
01:11 timotimo oh
01:11 timotimo you pass "hashlen", but you want "keylen"
01:11 timotimo that should be what's wrong
01:12 timotimo also, you do know you can write "t_cost => $t_cost" as ":$tcost"?
01:13 skink ...
01:13 timotimo perhaps one of my fav shortcuts in the language
01:13 skink I changed that variable name :D
01:14 skink but forgot it in the class
01:14 timotimo that'd be it; you may want to invest in "is required" for your attributes :)
01:14 timotimo i wonder if we have (or should have) a trait that can go on the class that'd imply "is required" for all attributes
01:15 skink I'm surprised I didn't get an error trying to assign to an attribute that doesn't exist
01:15 skink or at least a warn
01:16 timotimo that's one place where "interface consistency" rules tend to bite people
01:16 timotimo methods take any named parameter you give to them
01:16 timotimo and if you don't have "is required", the class will accept no value to be passed without complaining
01:17 hoelzro there's no builtin way to convert a 8-byte buffer into a Num via IEEE 754, is there?
01:17 timotimo there's CArray + nativecast
01:18 timotimo but that only works if your architecture uses IEEE 754 compatible floats/doubles internally
01:18 hoelzro that's what I figured, thanks timotimo!
01:18 hoelzro that's acceptable for my purposes =)
01:18 timotimo thought so :)
01:18 timotimo did you know microsoft visual cpp interprets "long double" as "double"?
01:18 timotimo and did you know there is *quadruple precision*?
01:18 timotimo (but usually no hardware implementation for arithmetic on quadruple precision floats)
01:19 Khisanth joined #perl6
01:19 skink timotimo, Maybe there could just be class Foo is (all-)required or something
01:19 timotimo skink: yeah
01:19 skink and thanks for the named var trick
01:19 timotimo you're welcome :)
01:19 timotimo "all-required" should be easy-ish to add, if you go look at how "is rw" is implemented on a class vs on an attribute
01:19 hoelzro I did not know either of those =)
01:20 timotimo i know of long double because tux has been keeping us posted about rakudo-moar + Inline::Perl5 not being compatible with a perl5 built to use long doubles
01:21 timotimo we'll be needing code to allow our registers to be extra-big for that to happen; currently we're capped at 64bits
01:21 timotimo well, needing code isn't surprising. but we'll need a bit of design first
01:22 timotimo skink: if you're interested in implementing that, you can also look at the ecosystem for AttrX:: modules
01:26 * timotimo goes to bed
01:27 timotimo gnite, friends!
01:31 hoelzro night timotimo
01:31 molaf joined #perl6
01:37 tardisx joined #perl6
01:38 MadcapJake what does this error mean: Native call expected return type with CPointer representation, but got a P6opaque
01:40 hoelzro MadcapJake: sounds like you're somehow returning an object from a class that doesn't have a CPointer repr
01:40 hoelzro MadcapJake: could you paste some code?
01:46 MadcapJake hoelzro: here's the function that triggers it (I actually think it's an argument thing) https://github.com/MadcapJake/p6-MyHTML/blob/complete-raw-transform/lib/HTML/MyHTML/Raw.pm6#L426
01:46 MadcapJake hoelzro: here's where it's called: https://github.com/MadcapJake/p6-MyHTML/blob/complete-raw-transform/eg/attributes-high.pl6#L30
01:46 MadcapJake Maybe it's actually $*OUT
01:46 MadcapJake I probably need to do $*OUT.file-descriptor
01:46 hoelzro probably
01:46 MadcapJake hmm, or not :P
01:46 MadcapJake I don't understand, what's the difference between CPointer and P6opaque
01:48 hoelzro a CPointer is just a pointer from C land
01:48 mst CPointer is a pointer to something in C, P6opaque is 'whatever the implementation decides to do, which might incidentally be implemented via a C-level pointer but that's none of your business'
01:48 dolmen joined #perl6
01:48 hoelzro a P6opaque is a chunk of memory managed by MoarVM
01:50 MadcapJake oh ok, so it probably means that I'm not properly C-ifying something :P
01:51 ajoe joined #perl6
01:59 aries_liuxueyang joined #perl6
02:00 colomon joined #perl6
02:04 Herby_ joined #perl6
02:04 Herby_ Evening, everyone!
02:04 Herby_ o/
02:06 snarkyboojum joined #perl6
02:20 colomon joined #perl6
02:24 johndau joined #perl6
02:31 sortiz MadcapJake, are you still there?
02:32 skink pfft, I think my travis build failed because I forgot done-checking
02:32 skink hey sortiz, Herby_
02:32 sortiz \o
02:33 Herby_ o/
02:36 noganex_ joined #perl6
02:52 vendethiel joined #perl6
02:52 Herby_ ZoffixWin: I got your Twitter example to work :)
02:52 Herby_ I forgot that on this fresh virtualbox I hadn't installed Curl
03:16 MadcapJake I am now
03:17 Ben_Goldberg joined #perl6
03:17 MadcapJake I love IRCCloud but sometimes I don't receive notifications...
03:35 luis joined #perl6
03:39 lucs joined #perl6
03:39 MadcapJake I just dangerously commented about the ease of Perl 6 in a JavaScript reddit thread
03:39 * MadcapJake crosses fingers
03:40 MadcapJake It felt necessary, the article was about 3 ways to do Title Case and the comments included more. so I had to show how easy Title Case is with Perl 6!
03:46 johndau joined #perl6
03:57 cpage_ joined #perl6
04:05 sortiz joined #perl6
04:08 bitmap joined #perl6
04:09 khagan joined #perl6
04:13 ugexe joined #perl6
04:13 Cabanossi joined #perl6
04:13 perlawhirl joined #perl6
04:15 perlawhirl MadcapJake: the only problem with doing .words».tc.Str is any arbitrary spacings get squished to one (though I will admit that's rarely an issue)
04:16 perlawhirl Alternatively...
04:16 perlawhirl m: say "I'm a little tea    pot".subst(/<:WB>(<:L>)/, -> $/ { " $0.tc()" }, :g)
04:16 camelia rakudo-moar bd4400: OUTPUT«I'm A Little Tea    Pot␤»
04:16 perlawhirl or...   given "I'm a little tea pot" { S:g/<:WB>(\w)/ {$0.uc}/; }
04:18 ugexe joined #perl6
04:19 perlawhirl actually... i guess this might be slightly less mutating... "I'm a little tea    pot".subst(/<?after <:WB>>(<:L>)/, -> $/ {$0.tc}, :g)
04:23 perlawhirl it also seems that P6's <:WB> behaves differently to p5's new \b{wb} ( added in 5.20-something, i think)
04:30 perlawhirl m: say "i'm a little tea    pot".subst(/<?after <:WB> >(<:L>)/, -> $/ {$0.tc}, :g) # Initial wb is ignored
04:30 camelia rakudo-moar bd4400: OUTPUT«i'm A Little Tea    Pot␤»
04:32 perlawhirl whereas in p5, this works:  $text =~ s/ (?<= \b{wb} ) ( \w ) / uc($1) /xge;
04:32 perlawhirl ie, "i'm" becomes "I'm"
04:34 bitmap joined #perl6
04:36 ugexe joined #perl6
04:37 javan joined #perl6
04:44 khagan joined #perl6
04:51 tardisx joined #perl6
04:54 hubble joined #perl6
04:54 hubble hi all.
05:11 skids joined #perl6
05:14 perlawhirl hi hubble... it's a bit quiet in here
05:20 CIAvash joined #perl6
05:25 xiaomiao joined #perl6
05:27 mtj_ joined #perl6
05:28 * teatime waves.
05:30 darutoko joined #perl6
05:32 dalek DBIish: 609dd02 | (Salvador Ortiz)++ | lib/DBDish/SQLite.pm6:
05:32 dalek DBIish: SQLite: Fix error report for missing library
05:32 dalek DBIish: review: https://github.com/perl6/DBIish/commit/609dd02107
05:32 dalek DBIish: 076111c | (Salvador Ortiz)++ | / (7 files):
05:32 dalek DBIish: mysql: Fixes for Windows.
05:32 dalek DBIish:
05:32 dalek DBIish: The mysql library on Windows uses other name and has minor diferences
05:32 dalek DBIish: Tested with the official oracle "community" release.
05:32 dalek DBIish: review: https://github.com/perl6/DBIish/commit/076111cefe
05:32 jjido joined #perl6
05:37 ufobat morning perl6
05:42 perlawhirl morning
05:43 perlawhirl however, it's afternoon here
05:43 sortiz and midnight here
05:43 stmuk its always morning on perl 6
06:01 dalek ecosystem: 7c87bc3 | (Alex Maslakov)++ | META.list:
06:01 dalek ecosystem: Add TelegramBot to ecosystem; see https://github.com/GildedHonour/TelegramBot
06:01 dalek ecosystem:
06:01 dalek ecosystem: Add TelegramBot to ecosystem; see https://github.com/GildedHonour/TelegramBot
06:01 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/7c87bc38cf
06:01 dalek ecosystem: a813eb8 | (David Warring)++ | META.list:
06:01 dalek ecosystem: Merge pull request #197 from GildedHonour/patch-2
06:01 dalek ecosystem:
06:01 dalek ecosystem: Add TelegramBot to ecosystem
06:01 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/a813eb8a1d
06:24 _mg_ joined #perl6
06:26 PapaChub joined #perl6
06:30 firstdayonthejob joined #perl6
06:33 PapaChub p6: my %h = { a => 1, b => 2 }; given (%h) { my $x = { x => $_<a>, y => $_<b> }; say $x; }
06:33 camelia rakudo-moar bd4400: OUTPUT«Potential difficulties:␤    Useless use of hash composer on right side of hash assignment; did you mean := instead?␤    at /tmp/tmpfile:1␤    ------> 3my %h = { a => 1, b => 2 }7⏏5; given (%h) { my $x = { x => $_<a>, y =␤-> ;; $_? is raw { #`…»
06:34 PapaChub p6: my %h = a => 1, b => 2; given (%h) { my $x = { x => $_<a>, y => $_<b> }; say $x; }
06:34 camelia rakudo-moar bd4400: OUTPUT«-> ;; $_? is raw { #`(Block|65848024) ... }␤»
06:34 PapaChub p6: my %h = a => 1, b => 2; given (%h) { my $x = { x => "{$_<a>}", y => "{$_<b>}" }; say $x; }
06:34 camelia rakudo-moar bd4400: OUTPUT«{x => 1, y => 2}␤»
06:35 PapaChub Anybody know why the first (ok, middle) evals as a Block, not a Hash?
06:35 ufobat fuck yeah! a TelegramBot! :D cool
06:35 ufobat oh excuse my language
06:35 PapaChub http://dabe.com/misc/hash-block.pl6
06:36 ufobat i was thinking of writing one myself for quite a while
06:44 rindolf joined #perl6
06:45 jack_rabbit joined #perl6
06:51 perlawhirl PapaChub: more often than not, { ... } denotes a code block rather than a hash. why not just use %x instead of $x ?
06:51 perlawhirl m: my %h = a => 1, b => 2; given (%h) { my %x = x => $_<a>, y => $_<b>; say %x; }
06:51 camelia rakudo-moar bd4400: OUTPUT«{x => 1, y => 2}␤»
06:52 RabidGravy joined #perl6
06:53 perlawhirl you could do 'my $x = ( x => $_<a>, y => $_<b> );` but then you have a list of Pairs, not a Hash
06:55 PapaChub perlawhirl: I know %x is more idiomatic (see the link) but I was [naïvely] porting some old P5 code, and MOST places, the $x = { ... } worked fine — but inside a do/for, the $_ topic seemed to throw it off.
06:56 PapaChub So it's more of a "help me /understand/ it" question, than a "help me fix it" one. :)
06:57 perlawhirl well, i'm not an expert... but it looks like the parser sees $_ inside the { ... } and infers that it's a block.
06:58 perlawhirl m: my $h = { a => 1 }; say $h.WHAT; my $b = { a => $_ }; say $b.WHAT;
06:58 camelia rakudo-moar bd4400: OUTPUT«(Hash)␤(Block)␤»
06:59 PapaChub «scratches chin» A bug or a feature?
06:59 domidumont joined #perl6
07:00 perlawhirl PapaChub: I'm... not sure
07:00 moritz feature
07:00 PapaChub ;)
07:00 RabidGravy It's a feature, a consequence of the way it works - you'd struggle to return a pair from a block otherwise ;-)
07:02 zakharyas joined #perl6
07:02 perlawhirl since you don't need references anymore, when porting your p5 code, just change all your hash refs to plain ol' hashes
07:05 domidumont joined #perl6
07:05 PapaChub If that's not already in a 5-to-6 gotcha list, it might be nice to document it for switchers.  Is there a way I can submit a pull-request, or anything?
07:06 RabidGravy yes
07:06 RabidGravy fork https://github.com/perl6/doc make changes, do PR
07:07 PapaChub ✔️
07:08 PapaChub Thanks, all!  perlawhirl++ RabidGravy++ moritz++
07:10 moritz PapaChub: or tell me your github username, and I'll give you commit acces right away
07:11 wamba joined #perl6
07:11 abraxxa joined #perl6
07:12 RabidGravy moritz++
07:13 RabidGravy So I successfully procrastinated adding the authentication to Sofa yesterday by making something cool instead, so let's see what I can do today
07:17 perlawhirl any unicode experts around? I know wb/wordbreak isn't documented, so maybe it's implementation isn't final, but is it supposed to break at the start of a string?
07:17 perlawhirl m: say "A B C" ~~ m:g/ <:WordBreak> . /
07:17 camelia rakudo-moar bd4400: OUTPUT«(「 B」 「 C」)␤»
07:18 perlawhirl if i understand http://unicode.org/reports/tr29/#WB1 correctly, it should break before the A as well
07:20 abraxxa joined #perl6
07:20 CIAvash joined #perl6
07:25 PapaChub left #perl6
07:43 lizmat joined #perl6
07:43 * lizmat clickbaits https://p6weekly.wordpress.com/2016/04/18/2016-16-a-quick-one-from-dublin/
07:46 azawawi joined #perl6
07:48 azawawi hi
07:49 RabidGravy Ooh, I've just found that JSON::Fast isn't a completely drop in replacement for JSON::Tiny
07:49 RabidGravy :-\
07:49 RabidGravy which is fun
07:52 g4 joined #perl6
07:52 g4 joined #perl6
07:58 RabidGravy m: use JSON::Fast;
07:58 camelia rakudo-moar bd4400: OUTPUT«===SORRY!===␤Could not find JSON::Fast 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::Re…»
07:59 moritz star-m: use JSON::Fast;
07:59 camelia star-m 2016.01: ( no output )
08:00 dakkar joined #perl6
08:00 TimToady joined #perl6
08:01 RabidGravy ah okay
08:01 domidumont joined #perl6
08:01 RabidGravy star-m: use JSON::Fast; say to-json({foo => Str})
08:01 camelia star-m 2016.01: OUTPUT«Cannot unbox a type object␤  in sub str-escape at /home/camelia/star-2016.01/share/perl6/site/sources/02AB8FEB8507E54529CA09DAB757E1747C5E96EE line 5␤  in sub to-json at /home/camelia/star-2016.01/share/perl6/site/sources/02AB8FEB8507E54529CA09DAB757E1747C…»
08:02 RabidGravy which is less than ideal (it works with JSON::Tiny)
08:04 RabidGravy I'll fix
08:05 ocbtec joined #perl6
08:26 mr-foobar joined #perl6
08:31 uruwi joined #perl6
08:41 RabidGravy timotimo, https://github.com/timo/json_fast/pull/12 if you're about
09:12 ufobat m: sub get(Pair $x) {}; get "bla" => "blubb"
09:12 camelia rakudo-moar bd4400: ( no output )
09:12 ufobat m: class Foo {method get(Pair $x) {   } }; my $foo = Foo.new; $foo.get "bla" => "blubb"
09:12 camelia rakudo-moar bd4400: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fWy4KfbR1n␤Two terms in a row␤at /tmp/fWy4KfbR1n:1␤------> 3$x) {   } }; my $foo = Foo.new; $foo.get7⏏5 "bla" => "blubb"␤    expecting any of:␤        infix␤        infix stopper␤        sta…»
09:12 ufobat what is wrong?
09:13 psch m: class Foo {method get(Pair $x) {   } }; my $foo = Foo.new; $foo.get( "bla" => "blubb" )
09:13 camelia rakudo-moar bd4400: ( no output )
09:13 psch m: class Foo {method get(Pair $x) {   } }; my $foo = Foo.new; $foo.get: "bla" => "blubb"
09:13 camelia rakudo-moar bd4400: ( no output )
09:13 psch ufobat: methods need either parenthesis or a colon
09:13 ufobat subs not?
09:13 psch subs not
09:13 ufobat ok
09:13 ufobat thanks :)
09:19 RabidGravy isn't it "subs usually not"?  aren't there places where the parse needs to distinguish the sub from some term or infix operator for example?
09:20 psch RabidGravy: right, ?? !! comes to mind
09:20 psch m: sub f() { "foo" }; say False ?? foo !! True
09:20 camelia rakudo-moar bd4400: OUTPUT«Non ast passed to WANTED: NQPMu␤5===SORRY!5=== Error while compiling /tmp/oesojtqu0m␤Your !! was gobbled by the expression in the middle; please parenthesize␤at /tmp/oesojtqu0m:1␤------> 3sub f() { "foo" }; say False ?? foo !!7⏏5 True␤ …»
09:21 RabidGravy well that's a strange error
09:21 RabidGravy m: sub foo() { "foo" }; say False ?? foo !! True
09:21 camelia rakudo-moar bd4400: OUTPUT«Non ast passed to WANTED: NQPMu␤5===SORRY!5=== Error while compiling /tmp/iUqwb4fQgQ␤Your !! was gobbled by the expression in the middle; please parenthesize␤at /tmp/iUqwb4fQgQ:1␤------> 3sub foo() { "foo" }; say False ?? foo !!7⏏5 True…»
09:22 RabidGravy infact quite awful
09:22 jnthn m: sub foo() { "foo" }; say False ?? foo() !! True
09:22 camelia rakudo-moar bd4400: OUTPUT«True␤»
09:22 psch yeah, a bit at least
09:22 * psch doesn't know how WANTED works
09:22 jnthn That Non ast thingy looks like a leftover debug warning being leaked
09:22 jnthn The rest of the error is fine, though.
09:23 jnthn The !! got parsed as two prefix !s
09:23 jnthn Because listops drop precedence
09:23 RabidGravy yeah, the debug stuff stops proper comprehension of the rest of the message
09:23 jantore joined #perl6
09:23 jervo joined #perl6
09:24 jnthn TimToady: Maybe something for you to check out... ^^
09:28 andrewalker joined #perl6
09:31 bartolin psch: if you have some time: there is another PR to unbust rakudo-j: https://github.com/rakudo/rakudo/pull/748
09:31 bartolin psch: with that NPE out of the way we are back to 19 test files with issues
09:32 psch bartolin: i have a hunch that would fall under the VMNull change jnthn proposed yesterday, which i think would be the more resilient change
09:32 psch bartolin: but i'll look at it later, gotta go in about half an hour
09:32 bartolin psch: even better
09:32 bartolin thanks, ++psch :-)
09:35 CIAvash m: (if False {}).WHAT.say
09:35 camelia rakudo-moar bd4400: OUTPUT«(Slip)␤»
09:35 CIAvash Is that how it's supposed to work?
09:36 nine_ Looks ok to me
09:36 psch m: sub f { }; f().WHAT.say
09:36 camelia rakudo-moar bd4400: OUTPUT«Nil␤»
09:36 RabidGravy yeah, I can't imagine what else it could do
09:37 RabidGravy so JSON::Marshal works fine with the fixed JSON::Fast
09:37 ocbtec joined #perl6
09:38 CIAvash I thought when I used in subs before, It would just return Nil.
09:38 psch m: say (eager (if False {})).WHAT
09:38 camelia rakudo-moar bd4400: OUTPUT«(Slip)␤»
09:39 RabidGravy If you want that, you need to be explicit
09:39 RabidGravy m: (if False {} else {}).WHAT.say
09:39 camelia rakudo-moar bd4400: OUTPUT«Nil␤»
09:43 RabidGravy right anyway off out for a bit
09:43 RabidGravy toodles
09:43 CIAvash I probably assumed it was Nil, now I noticed it with type check failure for return value
09:49 abraxxa joined #perl6
09:59 hahainternet was reading this, it's so unfair: http://www.slideshare.net/osfameron/is-haskell-an-acceptable-perl
09:59 hahainternet really tempted to write a perl6 rebuttal
10:00 hahainternet they even mention perl 6 in there, but completely fail to provide comparisons or any downsides to haskell
10:00 hahainternet also "manipulexity" is assigned to the haskell column
10:05 psch slides 33 is just not understanding perl5 list context, isn't it?
10:05 psch 33 to 35 i suppose
10:05 hahainternet psch: the assertion seems to be that it's all worthless in the face of the almighty god of Types
10:05 psch ah, mentioned on slide 36
10:06 psch hahainternet: ah, yeah, slide 49
10:06 pmurias joined #perl6
10:06 hahainternet psch: it's quiiiite biased lol
10:07 hahainternet i mean i wouldn't mind if there was a little footnote "Perl 6 has basically none of these problems"
10:07 psch yeah, slide 53 is kinda eh
10:07 psch and, well, 49 too
10:07 hahainternet psch: 53 is the one i found most offensive
10:07 hahainternet as it reads "Perl is just for jobbing programmers and magpies, Haskell is for us pure hard maths professor types"
10:08 hahainternet i also like on page 55 how it says "We"
10:08 hahainternet when it actually means "they"
10:08 psch yeah
10:08 hahainternet but the author realised that writing "they" would be quite offensive, and instead claimed himself in the same crew
10:08 hahainternet which makes no sense, as he's the one advocating for FP
10:10 hahainternet psch: i also like slide 86
10:10 hahainternet which has a green background
10:10 hahainternet for 'good code'
10:10 hahainternet and is absolutely unreadable on its face
10:30 teatime so, there's something you can do in P6, and I'm curious if you can do this in any other language as easily.
10:31 teatime with map, your function can return Empty, and you get a shorter list as output than as input.  and presumably you could return a Slip w/ multiple values, and end up w/ a longer output list.
10:32 hahainternet perhaps not as easily but that's a fairly normal gather/take arrangement
10:32 jnthn teatime: In other languages they break that out into two functions, often
10:32 jnthn In C# they're Select and SelectMany for example
10:32 jnthn But this makes you wrap single items up in a throwaway list
10:33 teatime thx
10:37 nine_ In Perl 5 map can do the same by always flattening the list of values returned.
10:37 cpage__ joined #perl6
10:42 timotimo o/
10:43 timotimo hahainternet: i wouldn't call it "unreadable to its face" if you know what the syntax for "where" and guards and such is
10:43 hahainternet timotimo: compare it to the perl on the previous slide marked as bad
10:43 hahainternet which is bad perl to begin with
10:43 timotimo yeah. "wtf is ref, and why would it string-equals?"
10:44 timotimo and ... dunno what else is bad about it; i don't perl5 at all
10:45 * jnthn finds Armenian unreadable
10:45 jnthn It's probably a bad language. Doubt it's that I spent zero time studying it. :P
10:45 hahainternet i'm not saying Haskell is bad because that's hard to read
10:45 hahainternet i'm saying it's a rather dishonestly shoved in comparison right at the end
10:46 timotimo for my personal enlightenment, how would you change the perl5 code?
10:46 jnthn My point is that any language is going to be hard to read if you haven't studied it at all.
10:46 hahainternet timotimo: i'd define a method on each prog that did the matching
10:46 hahainternet so it was much clearer what denoted equality
10:46 jnthn And the languages you find "readable" will be entirely coloured by their similarity to those you have learned.
10:47 timotimo oh, perl5 has classes! i forgot! :P
10:47 hahainternet jnthn: i agree with that, my complaint is just about the comparisons used
10:49 timotimo it'd probably be easier to have an "isUndef" method, that'd probably make things easier
10:50 timotimo and then write the match from "the perspective" of one of the objects
10:55 ajoe joined #perl6
10:57 smls joined #perl6
10:58 smls "Internal error: zeroed target thread ID in work pass", that's a new one... :P
11:00 timotimo sounds memory-corruption-y
11:01 smls unfortunately I can't reproduce it, it only happened on one run...
11:09 pmurias isn't the point of the perl5/haskell talk to show how cool and familiar haskell is rather then bashing perl5?
11:11 ilmari pmurias: the talk was given at a functional programming meetup, not a perl meetup
11:12 grondilu joined #perl6
11:13 pmurias ilmari: wasn't it given at YAPC::2015?
11:13 ilmari no, LambdaLounge
11:13 ilmari and will be at LPW 2016
11:13 kid51 joined #perl6
11:14 ilmari no, sorry, london pm tech meet in june
11:14 ilmari «From session at http://www.lambdalounge.org.uk/ on 18th April 2016.» - in the description on slideshare
11:16 grondilu m: sub f { pi but method gist { "pi" } }()
11:16 camelia rakudo-moar bd4400: OUTPUT«Potential difficulties:␤    Useless declaration of a has-scoped method in mainline (did you mean 'my method gist'?)␤    at /tmp/e7sIonCzAV:1␤    ------> 3sub f { pi but method7⏏5 gist { "pi" } }()␤»
11:17 grondilu m: sub f { pi but role { method gist { "pi" } } }()
11:17 camelia rakudo-moar bd4400: ( no output )
11:17 dogbert17 joined #perl6
11:17 grondilu m: sub f { pi but role { method gist { "pi" } } }().say
11:17 camelia rakudo-moar bd4400: OUTPUT«pi␤»
11:18 grondilu m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).say
11:18 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:18 * grondilu was expecting 3.1415...
11:18 moritz why?
11:18 moritz oh, I see
11:19 grondilu m: sub f($x) { $x.flip but role { method gist { "I'm pi!!" } } }(pi).say
11:19 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:19 timotimo m: sub f($x) { $x.flip but role { method gist { "I'm pi!!" } } }(pi).gist.say
11:19 camelia rakudo-moar bd4400: OUTPUT«I'm pi!!␤»
11:20 timotimo kind of interesting
11:20 Juerd m: tau.say
11:20 camelia rakudo-moar bd4400: OUTPUT«6.28318530717959␤»
11:20 Juerd :)
11:20 dogbert17 good afternoon #perl6
11:20 grondilu m: role Pi { method gist { "I'm pi!!" } }; sub f($x) { pi but Pi }().say
11:20 camelia rakudo-moar bd4400: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in sub f at /tmp/Swmt1HgYNK line 1␤  in block <unit> at /tmp/Swmt1HgYNK line 1␤␤»
11:21 timotimo woof woof, dogbert
11:21 grondilu m: role Pi { method gist { "I'm pi!!" } }; sub f { pi but Pi }().say
11:21 camelia rakudo-moar bd4400: OUTPUT«I'm pi!!␤»
11:21 dogbert17 woof
11:21 grondilu m: role Pi { method gist { "I'm pi!!" } }; sub f($x) { $x but Pi }(355/113).say
11:21 camelia rakudo-moar bd4400: OUTPUT«I'm pi!!␤»
11:21 Juerd grondilu: What are you trying to do?
11:22 Juerd Your code will happily claim that 5 is pi.
11:22 grondilu it's just an example
11:22 Timbus_ 'es figgerin out when gist is called
11:22 Juerd Ah
11:22 grondilu I want to make a sub that returns an int with a mixin role redefining gist
11:23 timotimo well, you can't return an "int" with a mixed in role, but an Int would do
11:23 grondilu yes.
11:24 jameslenz joined #perl6
11:24 grondilu m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).say
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:24 nine_ m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:24 grondilu that looks wrong
11:24 grondilu wrong as in "bug"
11:24 nine_ m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.^name
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤Num␤»
11:24 nine_ m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.WHAT
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤(Num)␤»
11:24 DrForr Useful if you're programming in Indiana :)
11:24 nine_ m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.roles
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤Method 'roles' not found for invocant of class 'Num'␤  in block <unit> at /tmp/SNOY3Ol4zc line 1␤␤»
11:24 nine_ m: sub f($x) { my $orig = $x; $x.flip but role { method gist { ~$orig } } }(pi).say; say pi.^roles
11:24 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤((Real) (Numeric))␤»
11:25 grondilu m: sub f($x) { $x.flip but role { method gist { "$x " } } }(pi).say
11:25 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:25 grondilu m: sub f($x) { $x.flip but role { method gist { note "I'm calling gist!"; return "$x " } } }(pi).say
11:25 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:25 grondilu not even called
11:26 timotimo could very well be that Int defines .gist directly for performance reasons
11:26 timotimo er, i mean
11:26 timotimo .say
11:26 grondilu but there are no Int here
11:26 timotimo oh, sorry
11:27 timotimo that's a Rat, right
11:27 Timbus_ he means Real or whatever pi is
11:27 grondilu m: sub f($x) { "foo" but role { method gist { note "I'm calling gist!"; return "$x " } } }(pi).say
11:27 camelia rakudo-moar bd4400: OUTPUT«foo␤»
11:27 timotimo m: say pi.WHAT
11:27 camelia rakudo-moar bd4400: OUTPUT«(Num)␤»
11:28 Timbus_ ye that
11:28 grondilu m: say pi but role { method gist { "Pi!" } }
11:28 camelia rakudo-moar bd4400: OUTPUT«Pi!␤»
11:29 dogbert17 Doesn't the type Pair have a 'key' method. According to the docs it does not, although it does have 'value'.
11:29 Timbus_ huh.. its the flip?
11:29 nine_ m: sub f($x) { $x but role { method gist { ~$x } } }(pi).say;
11:29 camelia rakudo-moar bd4400: OUTPUT«3.14159265358979␤»
11:29 nine_ yep
11:29 kaare_ joined #perl6
11:29 Timbus_ m: say pi.flip but role { method gist { "Pi!" } }
11:29 camelia rakudo-moar bd4400: OUTPUT«97985356295141.3␤»
11:29 Timbus_ wowza
11:30 nine_ m: sub f($x) { $x.Str but role { method gist { ~$x } } }(pi).say;
11:30 camelia rakudo-moar bd4400: OUTPUT«3.14159265358979␤»
11:31 moritz dogbert17: seems to be missing from the docs
11:31 nine_ m: sub f($x) { $x.Str but role { method gist { note "I'm calling gist!";  ~$x } } }(pi).say;
11:31 camelia rakudo-moar bd4400: OUTPUT«3.14159265358979␤»
11:31 timotimo yeah, it's missing
11:31 Timbus_ i guess Strs arent gisted
11:31 timotimo only missing in the documentation
11:32 timotimo i'm clearly not awake yet, wow.
11:32 jnthn iirc, there's a multi candidate for say on Str that doesn't bother calling .gist, 'cus a Str gists to itself
11:32 nine_ No, there's a multi sub say(Str:D: \x) candidate that doesn't call gist
11:32 jnthn ...except it doesn't if you do a mixin, which may be in DIHWIDT or "you broke Liskov" territory
11:33 nine_ m: sub f($x) { $x.flip but role { method gist { ~$x } } }(pi).gist.say;
11:33 camelia rakudo-moar bd4400: OUTPUT«3.14159265358979␤»
11:33 nine_ m: sub f($x) { $x.flip but role { method gist { note "gisted!"; ~$x } } }(pi).gist.say;
11:33 camelia rakudo-moar bd4400: OUTPUT«gisted!␤3.14159265358979␤»
11:33 nine_ The workaround seems simple enough.
11:36 dogbert17 moritz: and timotimo, ok then I'll fix that later today
11:37 dogbert17 unless someone beats me to it ...
11:38 moritz dogbert17: I guess I'm too pacifistic to beat you to it :-)
11:39 dogbert17 moritz: :-) was thinking about printf as well, in theory we should be able to take the sprintf docs and change a sentence or two if my reasoning is correct
12:06 b2gills joined #perl6
12:20 ajoe_ joined #perl6
12:30 ajoe joined #perl6
12:34 zakharyas joined #perl6
12:35 _mg__ joined #perl6
12:39 sufrostico joined #perl6
12:49 Actualeyes joined #perl6
12:50 skids joined #perl6
12:58 masak today's mini-challenge -- a re-run: write a Perl 6 program that finds all `1/p + 1/q + 1/r == 1` (p, q, r positive integers)
12:59 masak there are ten solutions.
12:59 masak I have a working solution. it's 18 lines of code, including some blank lines.
13:00 masak er, sorry - `1/p + 1/q + 1/r == 1/2`
13:01 cdg joined #perl6
13:03 jeek p <= q <= r ?
13:03 masak might as well, yes
13:03 masak the 10 solutions are symmetry-broken in that way
13:05 ufobat :D
13:05 ufobat my @num = (1..*); my @cross = @num X @num X @num; for @cross -> $x { my ($p, $q, $r) = $x.flat; say "got it" if 1/$p + 1/$q + 1/$r == 1/2}
13:06 ufobat i am not serious ;)
13:07 sufrostico joined #perl6
13:07 ufobat if we randomize the order in @cross and exit after 10, this could terminate
13:07 wamba m: {say "$^a $^b $^c" if 1/$^a+1/$^b+1/$^c == 1/2} for flat(^10 X, ^10 X, ^10)
13:07 camelia rakudo-moar bd4400: OUTPUT«4 8 8␤6 6 6␤8 4 8␤8 8 4␤»
13:09 jeek Going for speed or golf?
13:10 jnthn m: for flat combinations(1..200, 3) -> $p, $q, $r { state $found = 0; if 1/$p + 1/$q + 1/$r == 1/2 { say (:$p, :$q, :$r); last if ++$found == 10; } }
13:10 pmurias jeek: it's O(1) anyway ;)
13:11 camelia rakudo-moar bd4400: OUTPUT«(timeout)(p => 3 q => 7 r => 42)␤(p => 3 q => 8 r => 24)␤(p => 3 q => 9 r => 18)␤(p => 3 q => 10 r => 15)␤(p => 4 q => 5 r => 20)␤(p => 4 q => 6 r => 12)␤»
13:12 brabo joined #perl6
13:14 jnthn Damn, that one actually only finds 6 even if it doesn't time out
13:15 masak jnthn: it's doing way too much work :)
13:15 masak my solution runs in the blink of an eye
13:15 jnthn masak: Yeah, but so am I :P
13:15 masak m: constant nums = 1, 2, 3 ... Inf; sub replace($divisor, $word) { -> $n { $n ~~ Int && $n %% $divisor ?? $word !! $n } }; constant fizzbuzz = nums.map(replace(3, "Fizz")).map(replace(5, "Buzz")).map(replace(15, "FizzBuzz")); say fizzbuzz[^100]
13:15 camelia rakudo-moar bd4400: OUTPUT«(1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 Fizz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 Fizz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 Fizz 61 62 Fizz 64 Buzz Fizz …»
13:16 jeek m: my $answers = 0; my $r = 1; while $answers < 10 { for 1..$r -> $q { if ($q*($r-2) != 2 * $r) && ((2 * $q * $r) % ($q*($r - 2) - 2 * $r) == 0) { my $p = 2 * $q * $r / ($q * ($r - 2) - 2 * $r); if ($p <= $q) && ($p > 0) { print "$p $q $r\n"; $answers++; } } }; $r++; }
13:16 camelia rakudo-moar bd4400: OUTPUT«6 6 6␤4 8 8␤5 5 10␤4 6 12␤3 12 12␤3 10 15␤3 9 18␤4 5 20␤3 8 24␤3 7 42␤»
13:17 masak that looks right
13:18 jeek Could be sped up by using q as main loop, counting p from 1 to q, and calculating r
13:18 masak here's my solution: https://gist.github.com/masak/a26d1b2b7417b0db7a28
13:19 masak I especially like how it contains three nested loops running to Infinity, and yet it's quite fast :P
13:20 masak by the way, this is very related: http://math.ucr.edu/home/baez/42.html
13:20 masak (you notice there's a 42 in one of the solutions)
13:20 ufobat thats smart!
13:22 jeek m: my $a = 0; my $q = 1; while $a < 10 { for 1..$q -> $p { if ($q*($p-2) != 2 * $p) && ((2 * $q * $p) % ($q*($p - 2) - 2 * $p) == 0) { my $r = 2 * $q * $p / ($q * ($p - 2) - 2 * $p); if $r >= $q { print "$p $q $r\n"; $a++; } } }; $q++; }
13:22 camelia rakudo-moar bd4400: OUTPUT«4 5 20␤5 5 10␤4 6 12␤6 6 6␤3 7 42␤3 8 24␤4 8 8␤3 9 18␤3 10 15␤3 12 12␤»
13:22 jeek It IS faster. :D
13:22 arnsholt masak: "Perl 6, the programming language that counts to infinity *thrice* in less than a second!" =D
13:23 masak :P
13:24 sena_kun joined #perl6
13:26 sufrostico joined #perl6
13:26 Actualeyes joined #perl6
13:28 cur8or joined #perl6
13:36 cur8or joined #perl6
13:40 dalek ecosystem: 2fa2e98 | Altai-man++ | META.list:
13:40 dalek ecosystem: Add App::Whiff
13:40 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/2fa2e98fb4
13:40 dalek ecosystem: e652610 | (Zoffix Znet)++ | META.list:
13:40 dalek ecosystem: Merge pull request #198 from Altai-man/master
13:40 dalek ecosystem:
13:40 dalek ecosystem: Add App::Whiff: https://github.com/Altai-man/perl6-app-whiff/
13:40 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/e652610968
13:40 cur8or joined #perl6
13:42 dalek perl6-most-wanted: d003b32 | (Zoffix Znet)++ | most-wanted/modules.md:
13:42 dalek perl6-most-wanted: App::Whiff is now in the ecosystem
13:42 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/d003b32146
13:42 sena_kun ZoffixWin++
13:43 cur8or_ joined #perl6
13:43 wamba m: my  $c=6; say $c ~~ Int;
13:43 camelia rakudo-moar bd4400: OUTPUT«True␤»
13:44 wamba m: my  $c=1/(1/6); say $c;$c ~~ Int;
13:44 camelia rakudo-moar bd4400: OUTPUT«6␤»
13:44 wamba m: my  $c=1/(1/6); say $c;say $c ~~ Int;
13:44 camelia rakudo-moar bd4400: OUTPUT«6␤False␤»
13:46 moritz m: my  $c=1/(1/6); say $c;say $c.narrow ~~ Int
13:46 camelia rakudo-moar bd4400: OUTPUT«6␤True␤»
13:49 devtom30 joined #perl6
13:55 wamba m: {next if 1/$^a+1/$^b==1/2; my $c=-1/(1/$^a+1/$^b-1/2); say "$^a $^b $c" if $c.Int.abs == $c <= $^b
13:55 wamba <= $^a} for flat(^100+1 X, ^100+1)
13:55 camelia rakudo-moar bd4400: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LZFB4Gja0Q␤Missing block␤at /tmp/LZFB4Gja0Q:1␤------> 3 "$^a $^b $c" if $c.Int.abs == $c <= $^b7⏏5<EOL>␤»
13:55 wamba m: {next if 1/$^a+1/$^b==1/2; my $c=-1/(1/$^a+1/$^b-1/2); say "$^a $^b $c" if $c.Int.abs == $c <= $^b  <= $^a} for flat(^100+1 X, ^100+1)
13:56 camelia rakudo-moar bd4400: OUTPUT«6 6 6␤8 8 4␤10 5 5␤12 6 4␤12 12 3␤15 10 3␤18 9 3␤20 5 4␤24 8 3␤42 7 3␤»
13:56 grondilu do we have a p6doc-capable pager?
13:57 chris2 joined #perl6
13:57 CIAvash joined #perl6
13:57 masak grondilu: whatever do you mean? would it be enough for your needs to pipe something to `less` ?
14:06 sufrostico joined #perl6
14:10 colomon joined #perl6
14:12 sufrostico joined #perl6
14:20 lizmat joined #perl6
14:23 stmuk p6doc uses a pager
14:40 sufrostico joined #perl6
14:44 lizmat joined #perl6
14:48 zzz joined #perl6
14:51 * [Coke] wonders if there is anyone else on this channel who is theoretically eligible to vote today in the US. :)
14:51 [Coke] s/else// since technically I am not eligible :P
14:52 moritz [Coke]: I'd guess TimToady is?
14:52 moritz and diakopte1
14:52 tadzik there's a vote today?
14:53 [Sno] Is someone interested previewing a talk regarding cross-compile for perl hackers? http://www.netbsd.org/~sno/talks/nrpm/Cross-Compiling-For-Perl-Hackers-Handout.pdf
14:54 awwaiid tadzik: State presidential primary elections in some states (New York is the one I keep hearing about)
14:54 [Coke] NYS party-only primaries, don't think there's any CA elections today
14:54 [Sno] jnthn, froggs, nine and timotimo are expected to be interested :)
14:55 DrForr I'm technically allowed, but statistically my vote gets ignored.
14:56 tadzik awwaiid: ah, I see. I thought it's another of those mini-presidental elections
14:56 awwaiid DrForr: I wrote a whole talkin-blues song about that, https://thelackthereof.org/Talking_DC_Vote_Blues (I should actually record it, this is only lyrics)
14:57 awwaiid tadzik: ah sorry I might have mis-explained. It is another of these mini-presidential elections
14:57 Amnez777 joined #perl6
14:57 perlpilot [Sno]: s/Clearity/Clarify/  "Sensibilize" isn't a word either, but I don't know what you're really trying to say there.
14:58 perlpilot [Sno]: er, s/Clearify/Clarify/  geez, I can't even get the correction right
14:58 tadzik awwaiid: oh, I blame myself :) I don't really understand how US election system works, and at this point, I'm too afraid to ask
14:58 [Sno] perlpilot: Sensibilize is probably much better - I re-read
14:59 [Coke] tadzik: then you're pretty much on par with US citizens.
14:59 tadzik it seems extremely complex, and I don't think scalability is the issue with the "normal" way
14:59 DrForr And at least one Presidential candidate.
14:59 awwaiid tadzik: this is one of the worst ones for understanding, so you're ok. Each party has to select a final presidential candidate by july or so, and each party in each state has different rules for how this is done. madness.
14:59 tadzik :)
14:59 * [Coke] apologizes for derailing #perl6 today. :)
15:00 [Coke] I imagine it's going to make the EU process when they decide to form a single state look sane. :)
15:00 [Sno] perlpilot: http://dict.leo.org/ende/index_de.html#/search=sensibilize
15:00 tadzik I read quite a bit of reddit, and it's all about Bernie Sanders all the time, to the point when I start exercising those subreddit filters
15:00 tadzik but when I see how people apparently donate money and their time to do phone calls, I slowly back away :o
15:01 tadzik awwaiid: well, the fact that there's only two parties makes at least that part easier, I guess
15:01 awwaiid tadzik: everyone is just going through the motions despite, as far as I can tell, it being pretty obvious that without something very severe happening Clinton will be our next president. I guess everyone is hoping for something to happen.
15:02 awwaiid m: say "la la la"
15:02 camelia rakudo-moar baf8ac: OUTPUT«la la la␤»
15:03 moritz awwaiid: to me as an outside observer, it looks as though Trump is going to be president, and he's going to be worse than Bush Jr.
15:03 tadzik awwaiid: so that part is just desperation/people really wanting to contribute to someone's success, not a regular part of the campaign?
15:03 perlpilot [Sno]: I'm having trouble imagining what you're going to talk about for slides 9/10, but the rest looks excellent.
15:04 perlpilot moritz: There's more drama to be had before that happens.
15:04 lizmat joined #perl6
15:08 moritz perlpilot: the mere fact that it seems to be quite possible repells me from the US
15:08 Relsak joined #perl6
15:08 perlpilot moritz: yeah, imagine what it's like for those of us who are living in the US  :(
15:09 moritz perlpilot: come to the EU. We have cookies!
15:09 tadzik hmm
15:09 stmuk cookie warnings you mean :/
15:09 moritz perlpilot: and no software patents
15:09 awwaiid moritz: Yeah. madness.
15:09 moritz stmuk: yes, that too :(
15:09 DrForr works for me.. :/
15:09 * pmurias OTOH finds the Trump campaign highly entertaining (compared to the politics in his own country)
15:10 awwaiid If only we were electing chief entertainer!
15:10 tadzik having a shift in government in poland recently, I can say that a constant feeling that you should run the fuck away from your own country because of who leads is something you can get used to
15:10 perlpilot moritz: I've already moved my family across Texas in the last 6 months; I don't think they'll be up for another move and even if they were, "out of state" would be a hard sell and "out of country" near impossible I think
15:10 moritz pmurias: I found it entertaining only as long as it didn't seem to be a real possibility that he'd win
15:10 awwaiid tadzik: yeah ... on the good side our gov is pretty specifically designed to deadlock on error
15:11 moritz awwaiid: ... not only on error
15:11 moritz perlpilot: yes, understandable
15:11 awwaiid moritz++ # truth
15:11 DrForr s/ on error//; # ...
15:11 awwaiid By design though, that's the key :)
15:12 tadzik awwaiid: ah, how do you specify an error though
15:12 perlpilot moritz: It's worse than you state though (about the election).  Because Ted Cruz could get the Republican nomination.   And because Clinton will get the Democratic nomination.
15:12 perlpilot If ever there was a time for the phrase "least of all evils", it's this election.
15:12 DrForr Nyarlathotep for President.
15:13 stmuk john mcafee :)
15:13 RabidGravy goats
15:13 huf_ i'd like to see orban as the US president
15:14 huf_ it would be even more hilariously awesome than trump.
15:14 Relsak joined #perl6
15:16 moritz or be like Beligum, try it without a government for a few years
15:16 huf_ :)
15:18 tadzik oh, mongodb sponsors qah
15:18 tadzik I can't wait to see mst grind his teeth
15:20 * nine_ can't think of any country that displays sane politics. Even Iceland seems to have fallen :/
15:21 huf_ but in an insane context, insanity is the only sane choice
15:22 sufrostico joined #perl6
15:26 nine_ [Sno]: oh I wish I hadn't read your slides. This makes things...more complicated. Makes it harder now to continue living in the "if it works on your system it must be good" bubble :)
15:27 [Sno] :)
15:27 lostinfog joined #perl6
15:28 psch and *that* is why i mostly stick with the jvm backend :P
15:28 RabidGravy something weird going on with module loading, I changed JSON::Marshal to use JSON::Fast - all good and it works fine
15:29 RabidGravy however JSON::Class uses JSON::Marshal and JSON::Unmarshal and it was giving me "global merge errors for Fast"
15:29 RabidGravy which is odd
15:30 RabidGravy so I twatted everything reinstalled the modules and it's fine and happy
15:30 tadzik :|
15:32 [Coke] moritz: (cookies) you should lead with stroopwafel
15:32 * [Coke] bought some wafel on the jersey turnpike on the way home from awwaiid's con this weekend. it was disappointing after the real thing.
15:32 [Coke] (the wafel, not the con!)
15:33 RabidGravy there must be something like it thinks there are two JSON::Fasts, one gets loaded from one place and then it has the difficulty when it tries to load the "different" one
15:34 pmurias is it possible to access the debugname from the nqp level?
15:39 jnthn pmurias: No
15:40 jnthn pmurias: You can always do .^name if you're at that level
15:49 khw joined #perl6
15:54 Timbus joined #perl6
15:55 zakharyas joined #perl6
16:04 stmuk if anyone is in San Francisco (and hasn't seen their mailing list) sue and myself will be at a SF Mongers meeting at the Mikkeller Bar from 5.30 onwards
16:05 zakharyas joined #perl6
16:12 ajoe joined #perl6
16:13 colomon joined #perl6
16:15 grondilu m: role :: does Numeric { has $.x handles <Numeric> }.new(1) + 1
16:15 camelia rakudo-moar baf8ac: OUTPUT«WARNINGS for /tmp/xsDQVEpTqV:␤Useless use of "+" in expression ".new(1) + 1" in sink context (line 1)␤Package '<anon|76829520>' already has a method 'Numeric' (did you mean to declare a multi-method?)␤  in any add_method at gen/moar/m-Metamodel.nqp l…»
16:16 grondilu m: say role :: does Numeric { has $.x handles <Numeric> }.new(1) + 1
16:16 camelia rakudo-moar baf8ac: OUTPUT«Package '<anon|51200816>' already has a method 'Numeric' (did you mean to declare a multi-method?)␤  in any add_method at gen/moar/m-Metamodel.nqp line 474␤  in any compose_attributes at gen/moar/m-Metamodel.nqp line 382␤  in any compose at gen/moar/…»
16:18 grondilu m: say class :: does Numeric { has $.x handles <Numeric> }.new(:x(1)) + 1
16:18 camelia rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CEQLEICR1T␤Package '<anon|80245408>' already has a method 'Numeric' (did you mean to declare a multi-method?)␤at /tmp/CEQLEICR1T:1␤»
16:22 wamba joined #perl6
16:25 tbrowder joined #perl6
16:26 tbrowder my $a := "t";
16:27 tbrowder say $a.VAR.WHAT;
16:28 teatime https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/  <--  I love this, and it also provides further reason (as if needed) to never `curl | bash`
16:29 tbrowder $a:="t";say $a.VAR.WHAT;
16:30 teatime m: my $a := "t"; say $a.VAR.WHAT;
16:30 camelia rakudo-moar baf8ac: OUTPUT«(Str)␤»
16:34 tbrowder my $a=42;my $b := $a; $b=100;say$a;
16:35 RabidGravy "this REPL is really good it looks just like IRC"
16:36 tbrowder
16:36 grondilu ever considered making Pair a role and not a class?
16:38 timotimo so that it gets parameterized on its key and value type?
16:39 nine_ The idea smells a bit like bootstrap hell ;)
16:39 dogbert2 joined #perl6
16:41 xiaomiao joined #perl6
16:44 zakharyas joined #perl6
16:45 grondilu it's just that I have a class I'd like to behave as Pair and it'd be so much easier if Pair was a role and not a class.  Maybe class inheritance would do but it seems merkier to me.
16:46 grondilu but maybe that's just me who got too much used to do mixins and not inheritance.
16:49 timotimo hehe
16:49 timotimo you've been in #perl6 too long ;)
16:49 timotimo thing is, when you buy into inheritance, you ought to liskov it; is your class acceptable everywhere a Pair would be?
16:49 grondilu I don't know what liskov means.
16:51 timotimo liskov substitution principle
16:53 dogbert2 timotimo: hello, have time for a question?
16:54 timotimo we can try :)
16:54 sufrostico joined #perl6
16:55 timotimo i mean, i have time
16:55 dogbert2 i'm going to dcoument the key method for Pair but I'm not sure how it's defined, should i be 'multi method key(Pair:D:)'
16:55 dogbert2 s/i/it/
16:56 grondilu the key is actually an attribute of the class, isn't it?
16:56 timotimo https://github.com/rakudo/rakudo/blob/nom/src/core/Pair.pm#L37 - check it! :D
16:56 timotimo oh, oops :)
16:56 timotimo there's "keys" and such in there, but not actually "key" or "value"
16:56 timotimo but you're right. at the top of the file you find the key and value definitions
16:57 dogbert2 value is 'multi method value(Pair:D:) is rw'
16:57 timotimo the signature itself doesn't actually specify :D i don't think. but the fact that it's an accessor to an attribute pretty much means it'll immediately explode if the Pair you supply isn't defined
16:57 timotimo m: Pair.key.say
16:57 camelia rakudo-moar baf8ac: OUTPUT«Cannot look up attributes in a type object␤  in method key at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at /tmp/c6Qug7es5n line 1␤␤»
16:59 dogbert2 so, should I go with multi method key(Pair:D:) or is that utter nonsense :-)
17:00 timotimo nope, that's good
17:00 dogbert2 ok, give me a couple of minutes, thx for the help
17:01 timotimo thx for your contribution :)
17:01 dogbert2 with help like this there will be more :-)
17:03 dalek doc: 79be2f6 | (Jan-Olof Hendig)++ | doc/Type/Pair.pod:
17:03 dalek doc: Added documentation for the key method
17:03 dalek doc: review: https://github.com/perl6/doc/commit/79be2f6fe2
17:08 Amnez777 joined #perl6
17:08 wamba luku můžeš mi tam dát toho  líkaře?
17:11 huf_ is this the joke about the bread?
17:12 wamba bad chat guys sorry
17:13 [Coke] it's not entirely off topic here. :)
17:14 [Coke] (mainly because it's not english)
17:15 arnsholt Pretty sure it's Czech
17:17 arnsholt Might be Slovak, but IIRC Slovak doesn't have the r with hacek (or was it vowels with hackek?)
17:17 wamba It is Czech
17:18 masak was gonna say
17:19 huf_ okay okay, but is it the joke about the bread?
17:19 arnsholt I haven't the faintest idea. I don't know any Czech =D
17:19 arnsholt (I've only seen enough of it to recognize it =)
17:20 huf_ "- doctor, i cant pee. - let me look at it... you have a knot on your dick! - oh my god, the bread!"
17:20 huf_ is the skeleton of the joke
17:21 tadzik wat :o
17:21 huf_ you know that thing where if you're prone to forget something, tie a knot in your handkerchief or something to remember it by?
17:23 grondilu kind of weird:  I was watching a TV series episode and in that episode suddenly a character starts to speak Czech as well.   Kind of a weird coincidence.
17:23 masak tadzik: apparently in some parts of Europe, people tie knots on things to remember other things.
17:23 masak tadzik: I've known Dutch people to do this, too.
17:24 huf_ i've never actually seen this happen
17:24 timotimo i have heard about this, but i've never seen anybody actually do it, or did it myself
17:24 masak tadzik: if you tie two knots, you're supposed to remember two things.
17:24 masak no, I've seen people do it.
17:24 huf_ but i understood somehow that this is the thing underlying the joke
17:25 [Coke] my grandmother used to, for example, move her wedding ring to remind her to turn off the lights in the car when she got out.
17:25 molaf joined #perl6
17:25 [Coke] sameish thing.
17:26 huf_ hmm... so this is why people often look at me strange when i tell this joke.
17:27 huf_ _especially_ as i tend to tell jokes backwards
17:27 timotimo backwards, eh?
17:27 huf_ yes, just like i did here
17:27 timotimo like .flip, or like .words.reverse.join?
17:27 huf_ punchline, skeleton, underlying cultural thing
17:28 [Coke] m: say "Why did the chicken cross the road?".words.reverse;
17:28 camelia rakudo-moar baf8ac: OUTPUT«(road? the cross chicken the did Why)␤»
17:29 kaare_ joined #perl6
17:30 masak m: say .uc.map: * ~ "!" for "Why did the chicken cross the road?".words.reverse
17:30 camelia rakudo-moar baf8ac: OUTPUT«(ROAD?!)␤(THE!)␤(CROSS!)␤(CHICKEN!)␤(THE!)␤(DID!)␤(WHY!)␤»
17:30 vendethiel joined #perl6
17:30 masak :)
17:30 arnsholt masak: I don't tie knots, but I have been known when shopping to make a mental note of the number of things I Was supposed to get. That way I can at least checksum the number of things in my basket before paying
17:31 masak arnsholt: I've started doing that too, lately
17:31 masak arnsholt: I find it soothing
17:31 huf_ :)
17:31 huf_ i picked that one up a few years ago
17:31 arnsholt Although these days I generally make a list on my phone
17:31 masak I often just snap a photo of the recipe
17:31 domidumont joined #perl6
17:32 arnsholt Yeah, or that
17:35 timotimo i'm using "OurGroceries" on my phone, which has the nice feature that i can give out access to the grocery list to others who only have to use a browser to push stuff my way
17:37 arnsholt Oh, neat!
17:38 arnsholt I've actually been wanting something like that, for sharing that kind of thing with the missus
17:39 timotimo our groceries is free to use, but it'll pop up a "wanna go premium?" dialog every now and then
17:40 arnsholt Sounds like something I can live with
17:40 confundus joined #perl6
17:41 timotimo me, too
17:42 unbound_delegate joined #perl6
17:45 unbound_delegate howdy
17:46 dalek Inline-Perl5: 6a5f4ae | (Zoffix Znet)++ | README.md:
17:46 dalek Inline-Perl5: Update perlbrew instructions to build latest stable perl
17:46 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/6a5f4ae377
17:47 _mg_ joined #perl6
17:48 grondilu m: use MONKEY-TYPING; augment class Int { multi method gist(UInt $:) { self ~ " (>0)" } }; say 7
17:48 camelia rakudo-moar baf8ac: OUTPUT«7 (>0)␤»
17:48 grondilu ^wondering how to a methods to subsets.
17:49 colomon joined #perl6
17:52 unbound_delegate perl6: my uint8 $x = 255;   say $x;   $x++;   say $x;
17:52 camelia rakudo-jvm 40a953: OUTPUT«cannot connect to eval server: Connection refused␤»
17:52 camelia ..rakudo-moar baf8ac: OUTPUT«255␤256␤»
17:53 timotimo oh, that's awkward
17:54 timotimo we must be missing the codegen for truncation for inc and dec opcodes
17:54 timotimo they are the only opcodes that have a parameter that they both read from and write to, afaik
17:54 timotimo so there's special cases for those two all over our code :|
17:54 unbound_delegate Any idea when this will be fixed? I found this similar bug on rt: https://rt.perl.org/Public/Bug/Display.html?id=127144
17:58 firstdayonthejob joined #perl6
17:58 timotimo sadly, not many of us are familiar with that part of the compiler's internals
17:59 diakopte1 which part is that
18:00 diakopter timotimo: could you try to reproduce in a mostly-nqp:: edition?
18:00 masak the codegen-for-truncation-for-inc-and-dec-opcodes part, duh
18:00 timotimo it's probably a change needed inside QASTCompilerMAST inside nqp
18:01 timotimo m: my uint8 $v = 255; nqp::inc_i($v); say $v
18:01 camelia rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PDJXzjMH97␤Could not find nqp::inc_i, did you forget 'use nqp;' ?␤at /tmp/PDJXzjMH97:1␤------> 3my uint8 $v = 255; nqp::inc_i($v)7⏏5; say $v␤»
18:01 diakopter my favorite
18:01 timotimo m: use nqp; my uint8 $v = 255; nqp::inc_i($v); say $v
18:01 camelia rakudo-moar baf8ac: OUTPUT«===SORRY!===␤No registered operation handler for 'inc_i'␤»
18:01 timotimo i think we actually codegen the op when we see ++
18:01 timotimo and there's some more code about ++ and -- in the optimizer, iirc
18:02 timotimo huh, it actually codegens an add_i with 1 as the second operator
18:03 masak m: my uint8 $x = 255; say $x; $x = $x + 1; say $x;
18:03 camelia rakudo-moar baf8ac: OUTPUT«255␤0␤»
18:03 masak ...and yet, that works
18:03 timotimo yeah
18:04 masak probably because that one is storing something back into $x
18:04 masak explicitly, I mean
18:04 diakopter m: my uint8 $x = 255; say $x; $x = nqp::add_i($x, 1); say $x
18:04 camelia rakudo-moar baf8ac: OUTPUT«5===SORRY!5=== Error while compiling /tmp/a7rz1ZgLfZ␤Could not find nqp::add_i, did you forget 'use nqp;' ?␤at /tmp/a7rz1ZgLfZ:1␤------> 3$x = 255; say $x; $x = nqp::add_i($x, 1)7⏏5; say $x␤»
18:04 diakopter m: use nqp; my uint8 $x = 255; say $x; $x = nqp::add_i($x, 1); say $x
18:04 camelia rakudo-moar baf8ac: OUTPUT«255␤0␤»
18:04 timotimo it might be about sink vs no sink
18:05 sufrostico joined #perl6
18:05 diakopter m: use nqp; my uint8 $x = 255; say $x; say nqp::add_i($x, 1);
18:05 camelia rakudo-moar baf8ac: OUTPUT«255␤256␤»
18:05 pmurias grondilu: is your Pair class really just a Pair or an object consisting of two things?
18:06 timotimo well, just adding 1 to $x shouldn't truncate it. assigning it back to $x or another uint8 variable should
18:06 * timotimo AFK for a bit
18:06 grondilu pmurias: I'd like it to behave as a pair because it'd be very usefull to feed it to a MixHash.
18:06 diakopter timotimo: you're right, the codegen there needs the truncation
18:07 masak m: my uint8 $x = 255; say $x; ++$x; say $x
18:07 camelia rakudo-moar baf8ac: OUTPUT«255␤256␤»
18:07 grondilu so yeah, it's really a pair I guess.
18:07 grondilu I mean I want it to be.
18:07 nine_ /win 40
18:11 dalek joined #perl6
18:13 jjido_ joined #perl6
18:13 confundus Hi, is there any built-in takeWhile routine? Old logs suggested something like this: sub take-while(@list, &cond) { @list.grep: { &cond($_) ?? True !! last } };
18:13 confundus This works fine here: my @list = (^Inf).&take-while(* < 5); .say for @list;
18:13 confundus But I can't use it do do further chaining. This doesn't work: .say for (^Inf).&take-while(* < 5);
18:16 grondilu maybe with ...
18:16 grondilu @list ... &cond
18:17 grondilu or rather @list ...^ { !cond($_) }
18:17 moritz m: sub take-while(&cond, @list) { gather for @list { take $_ while cond($_) } }
18:17 camelia rakudo-moar 2d6f5c: ( no output )
18:22 masak m: my @a = 1, 2, 3, 4, 5, 3, 2, 4; .say for @a ...^ * > 4
18:22 camelia rakudo-moar 2d6f5c: OUTPUT«1␤2␤3␤4␤»
18:22 masak confundus: ^^
18:26 spider-mario joined #perl6
18:26 confundus masak, pretty cool, except I don't have the first clue about how to read that...
18:26 grondilu ... is the sequence operator
18:26 grondilu as in 1, 2 ... *
18:27 confundus and what is ...^ if you don't mind me asking.
18:27 grondilu ^ indicates exclusion at the border
18:27 Ven joined #perl6
18:27 confundus oh yes
18:28 confundus isn't writing * > 4 a bit anti-intuitive? after all it's accumulating values below 4.
18:29 TimToady m: say 1, 2, 4 ... 1024
18:29 camelia rakudo-moar 2d6f5c: OUTPUT«(1 2 4 8 16 32 64 128 256 512 1024)␤»
18:29 TimToady the thing on the right is a goal, not a filter
18:29 diakopter m: say 1, 2, 4 ...^ 1024
18:30 camelia rakudo-moar 2d6f5c: OUTPUT«(1 2 4 8 16 32 64 128 256 512)␤»
18:31 masak confundus: it's more intuitive if you think about that construction as takeUntil
18:32 _28_ria joined #perl6
18:33 rindolf joined #perl6
18:34 confundus m: say 2, 4 ... * > 10;
18:34 camelia rakudo-moar 2d6f5c: OUTPUT«(2 4 6 8 10 12)␤»
18:35 confundus why is 12 included here?
18:35 TimToady because you didn't use ^, and 12 was your "goal"
18:36 TimToady also, because you used > rather than >= :)
18:36 confundus ah right, thank you all for being so helpful :)
18:36 TimToady we're not really helpful, we just pretend to be most of the time :)
18:37 kaare__ joined #perl6
18:37 confundus apparently that's quite enough ;)
18:38 TimToady "The whole world runs on hypocrisy."  —my daughter
18:43 confundus This is probably the coolest possible solution of project euler #2 (fibonacci) in any language: say [+] (0, 1, * + * ...^ * > 4_000_000).grep: * %% 2;
18:44 nine_ Is --target=mast supposed to show the optimized version?
18:44 moritz mast comes after optimize, so yes
18:44 timotimo since it's later in the chain, yeah
18:45 timotimo does --target=mast actually output anything usable?
18:45 timotimo i thought it'd just say "don't know how to dump this"
18:45 moritz but before dynamic optimization :-)
18:47 ab6tract joined #perl6
18:47 ab6tract o/ #perl6
18:47 ab6tract working on Git::Version with BooK in a bar in Amsterdam ;)
18:48 BooK :-)
18:48 ab6tract how do I go about overriding comparison for a class?
18:48 ab6tract is that by adding coercions to Less/Same/More ?
18:49 timotimo i'm afraid not
18:50 timotimo override the cmp operator? :\
18:50 ab6tract ouchhh
18:50 timotimo yeah
18:51 aindilis joined #perl6
18:57 patrickz joined #perl6
18:57 ZoffixW joined #perl6
18:57 nine_ I just wonder because perl6 --target=optimize -e 'm: my uint8 $x = 255; ++$x;' clearly shows usage of the add_i op while --target=mast looks very much like a call to &prefix:<++>
18:58 ZoffixW Is there a way to import optionally-exported subroutines from Perl 5 modules when using Inline::Perl5? I'm using Perl 5's Text::Markdown but its markdown sub is exported only by request (I know I can use the full name, but I rather not)
18:58 timotimo may have to do with whether or not the void or regular variant of the Want node gets taken
19:00 nine_ I find it very cool that after my debugging EVAL endeavour, the --target=mast output makes complete sense to me :)
19:00 nine_ ZoffixW: same as you'd do in Perl 5
19:00 nine_ use Foo:from<Perl5> <fooicate>
19:01 ZoffixW That's too easy! :P
19:01 ZoffixW Thanks, nine_++
19:02 takadonet joined #perl6
19:03 colomon joined #perl6
19:03 takadonet hey everyone
19:03 * [Coke] ends up writing a "git for dummies" equivalent for his dayjob. whee.
19:04 timotimo hello, adventurer
19:07 masak hello [ad], venturer
19:08 timotimo have ad you, venturer
19:11 Timbus joined #perl6
19:17 jjido_ joined #perl6
19:20 sortiz joined #perl6
19:25 zakharyas joined #perl6
19:25 * sjn looks at the perl6 command-line options, and sees there are a bunch of them that aren't mentioned in the usage text
19:27 mane joined #perl6
19:30 ab6tract re: the Version type
19:31 ab6tract was there discussion about adding 'rc' logic?
19:39 _mg_ joined #perl6
19:43 teatime ok, so, someone was telling me about how people complain about Perl6's datetime being evil... I have to share this someone just snapshotted from some (non-perl) production code they're working on:  http://i.imgur.com/XFYUhL5.png
19:44 psch uhh, that doesn't actually turn $date into a unix timestamp, does it..?
19:45 teatime no.  not at alllllll
19:45 timotimo i didn't know perl6's datetime is supposedly evil
19:45 timotimo what's wrong about it?
19:45 timotimo err, what the flying fuck?
19:45 teatime timotimo: nothing afaict, but someone was mentioning that it's frequently whinged about.
19:46 timotimo wat? i thought "nobody uses perl6"? :P
19:46 teatime and time is hard enough to get right that I don't claim to be sure there's nothing wrong with it, although I don't see anything.
19:46 teatime haha
19:46 timotimo but that unix timestamp implementation is ... amazing
19:46 teatime the guy says the best part is, mktime() returns a unix timestamp
19:48 moritz I'd go so far as to call it "creative" :-)
19:48 teatime best thing I've seen in a while.
20:04 takadonet masak: adventurer.... more returning from the dead
20:08 huf_ ofcourseit'sphp :D
20:13 takadonet Was looking over jnthn http://jnthn.net/papers/2015-yapcasia-concurrency.pdf and was curious to know if there is thread safe variable?  Saw the ability to have monitor and actor for thread safe method. No indication for variables.
20:20 TEttinger joined #perl6
20:21 nine_ takadonet: what would a thread safe variable look like? The concept seems strange to me since only actions have the time component that can make them thread unsafe.
20:22 perlpilot perhaps he means shared and non-volatile?
20:23 takadonet perlpilot: yes
20:23 grondilu m: role A {...}; dd class :: does A {}.new; role A {}  # failed to pre-declare a role
20:23 camelia rakudo-moar d6ed4c: OUTPUT«Use of uninitialized value of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in any try_select at gen/moar/m-Metamodel.nqp line 2601␤5===SORRY!5=== Error while compiling /tmp/y3r1q3Qofm…»
20:24 wamba m: say  [+] (0, 1  ...^ * > 4_000).grep:  * %% 3
20:24 camelia rakudo-moar d6ed4c: OUTPUT«2667333␤»
20:24 wamba m: say  [+] (0, 1  ...^ * > 4_000).race.grep:  * %% 3
20:24 camelia rakudo-moar d6ed4c: OUTPUT«0␤»
20:24 TungMay joined #perl6
20:24 perlpilot takadonet: I think the short answer is "yes, you can do that".   I don't really have the long answer though.
20:24 takadonet I am looping over an array of files and each iteration does some calculation and deposit its single result into an array.
20:24 wamba m: say  [+] (0, 1  ...^ * > 4_000).race.map:  {$_ if $_ %% 3  }
20:24 camelia rakudo-moar d6ed4c: OUTPUT«2667333␤»
20:24 grondilu m: role A {...}; class :: does A {}.new; role A {}  # failed to pre-declare a role
20:24 camelia rakudo-moar d6ed4c: OUTPUT«Use of uninitialized value of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in any try_select at gen/moar/m-Metamodel.nqp line 2601␤5===SORRY!5=== Error while compiling /tmp/nKkDX1ZX__…»
20:25 grondilu it's weird that there is a string context anywhere here
20:25 domidumont joined #perl6
20:25 cdg joined #perl6
20:26 grondilu I just wanted to put the definition of the role at the end of the file to keep things tidy.
20:26 grondilu I thought that was allowed.
20:26 jnthn The warning hides the real error
20:26 jnthn ===SORRY!=== Error while compiling -e
20:26 jnthn No appropriate parametric role variant available for 'A'
20:26 jnthn (when I do it locally)
20:27 jnthn Feel free to RT the warning. But it's correct that you can't do that.
20:27 grondilu we can't predeclare roles?
20:27 jnthn You can but you must define them before you try to consume them.
20:28 grondilu ok
20:28 arnsholt I assume the issue is that the composition of the role into the class requires the full role definition to work properly (detect method conflicts, for example)
20:28 jnthn `does` is compile-time composition, and class composition time is at the closing curly
20:28 arnsholt And since does is a compile-time directive, it's broken
20:28 [Coke] m: m: role A {...}; role A {}; class :: does A {}.new;
20:28 camelia rakudo-moar d6ed4c: ( no output )
20:28 arnsholt Since the role body isn't available at that point, compile-time
20:28 jnthn And composing a role involves copying its stuff into the class at composition time, and conflicts etc.
20:28 jnthn As arnsholt++ points out :)
20:29 jnthn So yeah, that one's in the realm of "can't really work" rather than "doesn't work"
20:31 patrickz jnthn / TimToady: I try to solve #123934 and I think I need some guidance on what the expected behavior of Perl6 should be.
20:31 RabidGravy but doing the same at run time works fine
20:32 patrickz m: say "asdfEnd" ~~ / :ratchet ^ [ .+? || z ] {say $/} End $ /;
20:32 camelia rakudo-moar d6ed4c: OUTPUT«「a」␤「a」␤「a」␤「a」␤「asdfEnd」␤»
20:32 patrickz m: say "asdfEnd" ~~ / :ratchet ^ [ .+? | z ] {say $/} End $ /;
20:32 camelia rakudo-moar d6ed4c: OUTPUT«「a」␤Nil␤»
20:32 jnthn RabidGravy: As a mixin? Sure, 'cus you defined the role before runtime :)
20:32 patrickz [ || ] allows to be backtracked into in ratchet mode, while [ | ] does not. My gut feeling tells me the two should behave the same.
20:33 RabidGravy yeah, it was more about encouraging grondilu :)
20:33 jnthn patrickz: Interesting...I think I'd have to defer to TimToady on that one, though :)
20:34 patrickz Ok.
20:34 patrickz .seen TimToady
20:34 yoleaux I saw TimToady 18:38Z in #perl6: <TimToady> "The whole world runs on hypocrisy."  —my daughter
20:38 leont joined #perl6
20:40 khw joined #perl6
20:40 _mg_ joined #perl6
20:41 perlpilot patrickz: why would [||] be backtracked into when ratchet mode is on?   That doesn't make any sense to me.
20:42 perlpilot patrickz: why would say "asdfEnd" ~~ /:ratchet [ xyz | .+! ] End /; match?
20:44 ab6tract timotimo: so we were a bit surprised that overriding cmp and exporting it from our module did not cascade to lt/gt/etc
20:45 ab6tract it's not such a big deal at all, just too used to 'use overload', maybe
20:45 patrickz perlpilot: From what I heard up to now, the opinions differ on what ratchet mode means. I'm still unclear if ratcheting means preventing giving up consumed input or going leftwards in the regex.
20:46 patrickz m: say "asdfEnd" ~~ /:ratchet [ xyz | .+! ] End /;
20:46 camelia rakudo-moar d6ed4c: OUTPUT«Nil␤»
20:49 timotimo ab6tract: you do realize that lt and gt are strictly for string comparison?
20:49 perlpilot my mental model has ":ratchet means : after every atom", so that makes sense
20:50 ab6tract timotimo: i do realize that, but then... i didn't connect it to a different set of ops :)
20:50 ab6tract what are the generic forms of lt/gt then?
20:50 perlpilot m:  say "asdfEnd" ~~ / [ xyz: | .+: ]: End /;  # should be the same
20:50 camelia rakudo-moar d6ed4c: OUTPUT«Nil␤»
20:50 unbound_delegate joined #perl6
20:51 patrickz say "asdfEnd" ~~ /:ratchet [ .+! ] End /;
20:51 patrickz m: say "asdfEnd" ~~ /:ratchet [ .+! ] End /;
20:51 camelia rakudo-moar d6ed4c: OUTPUT«「asdfEnd」␤»
20:51 ab6tract or is it that if we override leg we get our expected cascade?
20:52 ab6tract the use case is a class which has a $!literal-version and a $!normalized
20:52 perlpilot patrickz: that last one looks like a bug to me.
20:52 ab6tract the comparisons need to use the $!normalized, but we want Str to return $!literal-version
20:53 patrickz m: say "asdfEnd" ~~ / :ratchet ^ [ .+? || z ] {say $/} End $ /; # Do you also think this one is a bug?
20:53 camelia rakudo-moar d6ed4c: OUTPUT«「a」␤「a」␤「a」␤「a」␤「asdfEnd」␤»
20:53 timotimo ab6tract: also, the operators can only work where they have been exported to ;(
20:54 perlpilot patrickz: I would
20:54 ab6tract timotimo: yeah, that's not an issue in this case. but yeah, this is a bit of a super-sad face
20:55 [Coke] can we get yoleaux to switch back to "saw ... time ago" instead of <time>Z ?
20:57 teatime hehe
20:57 patrickz perlpilot: I'd be ok with making the [ || ] cases also fail. It's just that I'm not sure what the intended behavior is. I have heard opinions on both sides and have been sent to the authorities for a definite decision. :-)
20:58 teatime It is said, “Go not to the Elves for counsel, for they will say both no and yes.”
20:59 teatime j/k
21:00 perlpilot patrickz: we'd all have to defer to TimToady :)  But also, I think the language in S05 would need to be clearer too since my understanding comes from reading S05.
21:03 [Coke] S05 ain't nothing but some notes.
21:03 perlpilot then whatever the "official documentation" ends up being :)
21:04 perlpilot S05 is a a good first approximation for many concepts, unfortunately, it's the _only_ approximation for some of them.
21:07 ZoffixWin I think those who'll start programming with Perl 6 will have trouble grasping other languages: https://twitter.com/zoffix/status/722531566413594626
21:08 ZoffixWin (from a JS tutorial: "// Some basic arithmetic works as you'd expect: .1 + 0.2; // = 0.30000000000000004" )
21:10 TEttinger ZoffixWin: how does perl 6 do floating point?
21:10 ZoffixWin m: say 0.1 + 0.2 == 0.3
21:10 camelia rakudo-moar d6ed4c: OUTPUT«True␤»
21:10 TEttinger yes
21:10 ZoffixWin m: say 0.1.nude
21:10 camelia rakudo-moar d6ed4c: OUTPUT«(1 10)␤»
21:10 TEttinger ah ok
21:10 ZoffixWin It's stored as a rat
21:10 TEttinger m: say pi.nude
21:10 camelia rakudo-moar d6ed4c: OUTPUT«Method 'nude' not found for invocant of class 'Num'␤  in block <unit> at /tmp/WprzVk11CW line 1␤␤»
21:11 TEttinger m: say pi
21:11 camelia rakudo-moar d6ed4c: OUTPUT«3.14159265358979␤»
21:11 ZoffixWin It's not magical :) You still get the same problems in places, just not with 0.1 + 0.2 :)
21:11 timotimo m: say pi.Rat.nude; say pi.Rat(0.0000001e0).nude
21:11 camelia rakudo-moar d6ed4c: OUTPUT«(355 113)␤(103993 33102)␤»
21:11 teatime TEttinger: by default, anyway; you have lots of options.
21:12 TEttinger well you could represent it as 314159265358979/100000000000000
21:12 TEttinger m: say 314159265358979/100000000000000
21:12 camelia rakudo-moar d6ed4c: OUTPUT«3.14159265358979␤»
21:12 ZoffixWin That's not pi, though
21:12 TEttinger it's as much as pi knows here right?
21:12 teatime Rat is supposed to have 64-bit denominator... but it seems (usually) arbitrary-precision, currently.
21:12 ZoffixWin m: say pi.Rat.nude; say pi.Rat(1/100000000000000).nude
21:12 camelia rakudo-moar d6ed4c: OUTPUT«(355 113)␤(80143857 25510582)␤»
21:13 TEttinger ?
21:13 ZoffixWin hm
21:13 ZoffixWin m: say pi*100000000000000_00
21:13 camelia rakudo-moar d6ed4c: OUTPUT«3.14159265358979e+16␤»
21:13 ZoffixWin Seems so
21:14 ZoffixWin m: say 80143857/25510582 == 314159265358979/100000000000000
21:14 camelia rakudo-moar d6ed4c: OUTPUT«False␤»
21:16 ZoffixWin teatime, oh and I've no idea about date stuff and I've no idea what that code you linked is about :)
21:16 timotimo m: say 80143857/25510582 - 314159265358979/100000000000000
21:16 camelia rakudo-moar d6ed4c: OUTPUT«2.65937562694571e-15␤»
21:18 timotimo my constant pi  = 3.14159_26535_89793_238e0;
21:18 timotimo that's how it's defined in rakudo, btw
21:19 timotimo when we get long double support, we may want to up the precision on that
21:19 teatime ZoffixWin: if you know what "unix timestamp" typically means, it's really really funny.  take another look.
21:20 ZoffixWin I already closed that PM window.
21:20 teatime well, really funny, anyway.
21:20 geekosaur joined #perl6
21:20 diakopter TimToady: how would one make a constant pi with arbitary precision (the more digits you request, the more it refines it using the series expansion)
21:21 timotimo diakopter: i suppose you'd mix a role into the pi Num that gives you better rationals in its .Rat
21:21 diakopter *arbitrary
21:21 hankache joined #perl6
21:22 ZoffixWin teatime, I give it 7/10 :)
21:23 timotimo ZoffixWin: you know what the number a unix timestamp is means? then, how correct does it seem that the function "toUnixTimestamp" returns "YYYYMMDD000000" given a date?
21:23 unbound_delegate joined #perl6
21:25 timotimo i wonder if any unix timestamps coincide with their representation in that format when you chop off any initial digits and normalize the last six digits to zeroes
21:26 ZoffixWin Right. I didn't even look at the function name. I thought the joke was all that messing about with mktime instead of tossing the dashes and appending the zeros :P
21:26 skids it could be a holiday :-)
21:27 ZoffixWin Oh well... I don't judge. I have worse :)
21:27 ufobat does anyone like, dislike or have a certain opinion on https://gist.github.com/ufobat/72aceef40b683339a38e88336d6be3e0
21:27 ZoffixWin Like this: https://metacpan.org/source/ZOFFIX/Syntax-Highlight-CSS-0.0102/lib/Syntax/Highlight/CSS.pm#L105
21:27 patrickz Do RT accounts have to be activated in some way to allow to view bugs or reply to them? I'm basically locked out of all tickets as soon as I log in to bitcard.
21:28 ZoffixWin patrickz, not that I know of.
21:29 skids patrickz: do you own any tickets?  For several people including myself, you can only view your own tickets when logged in.
21:29 skids Unless you explicitly provide the number.
21:29 patrickz Seems to be the same for me.
21:29 [Coke] Yes, you need to be a bugadmin to interact with perl 6 tickets once logged in.
21:30 patrickz Is there a way to reply to bugs by email?
21:30 [Coke] Anyone who wants to be a bugadmin, you're welcome to if you follow some simple guidelines.
21:30 [Coke] patrickz: yes. reply to them.
21:30 [Coke] if you don't have the existing ticket, someone can hook you up with the subject/to combination you'll need.
21:32 ZoffixWin Huh? So I'm a bugadmin somehow? I can reply to any ticket and view both p6 and p5 queues
21:32 patrickz Coke: Can you close 127935? I accidentally created that ticket while trying to reply to another one..
21:33 skink joined #perl6
21:34 [Coke] Sure.
21:35 [Coke] RT #127935 # closed
21:35 patrickz Thank you!
21:37 [Coke] ZoffixWin is not a p6 bugadmin.
21:37 [Coke] you can see the queues. you just can't interact with the tickets, probably.
21:37 ZoffixWin [Coke], I was able to view and reply to this ticket this morning: https://rt.perl.org/Ticket/Display.html?id=127925
21:37 [Coke] ZoffixWin: via the UI?
21:37 ZoffixWin Yeah, by going to https://rt.perl.org/
21:38 ZoffixWin And clicking things
21:38 [Coke] weird.
21:38 [Coke] could you perhaps be a p5 bug admin?
21:38 [Coke] and their permissions are leaking?
21:38 [Coke] you're not on my list, though.
21:38 patrickz How long do email replies to tickets usually take to manifest in the webinterface?
21:39 [Coke] depends. if they're flagged as spam, someone has to release 'em
21:40 lizmat joined #perl6
21:40 TimToady diakopter: The problem with your question is the phrase "the more digits you request".  It's easy enough to write a pi spigot, but how would you want to implement a lazy digits API in relation to existing types?
21:44 TimToady In fact, RC has a pi spigit in P6 already, but at what point does a calculation know it wants "more precision"?
21:45 TimToady (http://rosettacode.org/wiki/Pi#Perl_6 if you want the link)
21:45 leont joined #perl6
21:46 ZoffixWin no, I'm not a p5 bug admin. Thought my bitcard account is probably more than a decade old. Who knows what perms it got :P
21:47 ZoffixWin s/Thought/Though/;
21:48 diakopter TimToady: I dunno, maybe using sprintf
21:48 diakopter (lololololz)
21:52 [Coke] ZoffixWin: yah, no clue. use your power responsibly, thank you! ;)
21:52 ZoffixWin Will do! :D
21:53 timotimo diakopter: imagine every mathematical operation had to be expressed as a format string
21:53 timotimo or every reference to a variable had to have a precision specifier in its mention
21:53 patrickz TimToady: Can you have a look at my #123934 question above?
21:53 * [Coke] tries to find his roll of turing tape.
21:53 timotimo damn it, synopsebot.
21:53 [Coke] RT #123934
21:53 [Coke] ... more damns.
21:54 [Coke] is it smart enough to catch a bare #123 when it's here?
21:54 timotimo it is, yes
21:55 timotimo you can try it out right now!
21:55 synopsebot6 joined #perl6
21:55 MadcapJake How can I get a FILE pointer for stdout in native call? $*OUT and $*OUT.native-descriptor aren't solving it for me
21:56 MadcapJake I tried open($*OUT, :w) which works in Perl 6 but isn't working in NativeCall routines
21:56 timotimo well, you have to use a function that turns the fd into a FILE*
21:56 MadcapJake timotimo: what function?
21:57 RabidGravy fdopen
21:57 RabidGravy in C
21:57 timotimo No manual entry for fdopen in section 2
21:57 timotimo isn't that where c functions live?
21:57 timotimo oh, it's section 3
21:57 timotimo that explains why i didn't find it!
21:57 MadcapJake section 2/3? what's that?
21:58 RabidGravy unix manpage
21:58 geekosaur fdopen is the stdio library, not a syscall
21:58 geekosaur so section 3
21:58 MadcapJake how do i access section 3?
21:58 RabidGravy http://linux.die.net/man/3/fdopen
21:58 geekosaur man 3 fdopen
21:58 geekosaur unless your'e on solaris then it's man -s3 fdopen
21:59 MadcapJake so you think if I pass it $*OUT.native-descriptor, that will create a FILE handle?
21:59 RabidGravy no, I know it will ;-p
21:59 MadcapJake ok good! thanks timotimo RabidGravy!
22:00 timotimo you need the red and blue security access keys to get to section 3 of the MAN complex
22:00 timotimo be careful, a bugbear with a rocket launcher guards the blue one
22:01 skink timotimo, re: last night, there is ClassX::StrictConstructor which throws an exception if you attempt to assign a non-specific attribute
22:01 MadcapJake O_O good thing I've got my Book of Camelian Spells & Native Calls
22:01 skink non-specified*
22:03 RabidGravy MadcapJake, https://gist.github.com/jonathanstowe/6561a7ab0b7213eb6b5733cf6f9f47fa - is one I prepared earlier
22:03 timotimo yup
22:04 timotimo i forgot about that one
22:04 RabidGravy anyhow that's me done for the day, toodles
22:04 MadcapJake RabidGravy: what's the termios?
22:04 RabidGravy don't worry about that
22:05 MadcapJake ok! worrying done
22:05 MadcapJake very elegant File repr class! thanks RabidGravy++
22:08 BooK the final discussion with ab5tract was how maybe .Str and .gist could return different things
22:09 ZoffixWin They do:
22:09 ZoffixWin m: class Foo { method gist { 'gist' }; method Str { 'Str' } }; put Foo.new; say Foo.new
22:09 camelia rakudo-moar d6ed4c: OUTPUT«Str␤gist␤»
22:12 BooK ZoffixWin: yes, exactly
22:12 BooK so stuff like eq, cmp, etc would run throught Str, while "$obj" would go through gist, right?
22:13 ZoffixWin No, "$obj" would be .Str
22:13 BooK arg
22:13 ZoffixWin AFAIK, only say calls .gist
22:14 timotimo oh hey master book
22:14 BooK we figures that the difference with perl5 overload was that in p5 you define the behaviour of + when the object is on either side, while in p6, + just expects numbers and will call .Int
22:14 BooK hey timotimo
22:14 timotimo hm, not totally
22:14 lizmat BooK: prefix:<+> defined +foo
22:15 timotimo you are free to supply variants of + that work on your custom class
22:15 lizmat infix:<+> defines foo + bar
22:15 timotimo but + is meant to add numbers and numeric things
22:15 TimToady patrickz: you do realize that if I get my brane back into regexland I'm likely to rewrite the whole parser?  :)
22:15 BooK but then it needs to be loaded in the scope that will use those objects
22:15 ZoffixWin Right
22:15 timotimo so when you start overloading + to do string concatenation, we might get mad at you
22:15 BooK it does not simply follow the objects
22:15 colomon joined #perl6
22:15 timotimo that is correct
22:16 BooK whereas in perl5 it does follow the objects
22:16 ZoffixWin m: class Foo { method Numeric { 40 }; }; say 2 + Foo.new;
22:16 camelia rakudo-moar d6ed4c: OUTPUT«42␤»
22:17 BooK tiny differences, I guess I'm frustrated because I still try to apply my p5 knowledge and expectations to this new p6 thing
22:17 timotimo mhm
22:17 BooK new magic, old magic
22:17 * ZoffixWin gave up doing that long time ago :P
22:17 lizmat m: class A { has $.a = "foo" }; sub infix:<+>(A:D $a, A:D $b) { $a.a ~ $b.a }; say A.new + A.new
22:17 camelia rakudo-moar d6ed4c: OUTPUT«foofoo␤»
22:17 timotimo that's actually a gigantic difference
22:18 BooK I was still really happy, when I realized afterwards that I had been writing perl 6 (porting a p5 module) without really thinking about it
22:18 BooK after ab5tract showed a few things to me, I just filled the gaps and wrote nice valid perl6 on the first try
22:18 timotimo oh
22:19 patrickz TimToady: Can I borrow you brane for a bit? I promise to return it unharmed (whatever that means for borrowed brains).
22:19 timotimo that sounds nice
22:19 TimToady errands & # unfortunately, brane needs to transport itself elsewhere for a bit
22:20 BooK he forced me to rewrite some of my perl5 one-liners in like an actual block and everything
22:20 BooK but to be honest, I had trouble remembering what my stuff did
22:20 BooK this is why we have libraries! to hide the ugly away from innocnent eyes
22:21 BooK ($c) = ( 1, splice @v, -1 ) if $v[-1] eq 'GIT';           # before 1.4
22:21 BooK ($c) = splice @v, -2 if substr( $v[-1], 0, 1 ) eq 'g';    # after  1.4
22:21 BooK the lines that ab5tract didn't like :-)
22:21 BooK he seemed to take issue with my 1-letter vars too
22:22 BooK cramming stuff in 80 columns with comment takes some sacrifice, right? ;-)
22:24 BooK my takeaway from the evening is: xx is pretty cool
22:25 bitmap joined #perl6
22:26 BooK I think ab5tract was kinda frustrated by this manual page: http://docs.perl6.org/language/typesystem :-)
22:27 skink What's that travis-like ci that's just for Windows?
22:28 khagan joined #perl6
22:28 timotimo appveyor
22:29 ZoffixWin NOW I get why people say the P6 community is hugtastic ???????????? http://i.imgur.com/4GwUggA.png
22:30 skink That's it, thanks timotimo
22:36 Herby_ joined #perl6
22:36 Herby_ Afternoon, everyone!
22:36 Herby_ o/
22:37 timotimo hey Herby_
22:37 timotimo i saw your tweet; was that with a perl6 module for tweeting?
22:37 Herby_ Yep!  Using the zoffix's Twitter module
22:38 kurahaupo joined #perl6
22:40 Herby_ Haven't played with it too much just, just copied the github example to send out a test tweet
22:40 Herby_ just yet... I can't type today.
22:40 ZoffixWin Now I feel bad for it being a bare-bone tweet-only thing and not a solid and tested API implementation :P
22:40 timotimo oh, now i remember what i wanted to do with my particle system test code
22:40 ZoffixWin Should give it more attention on the weekend.
22:41 Herby_ I was contemplating creating something similar but I didn't even know where to start.  Then I saw your module :)
22:41 grondilu m: say ("foo", "bar" but role {}).MixHash<foo bar>
22:41 camelia rakudo-moar d6ed4c: OUTPUT«(1 0)␤»
22:42 * grondilu was expecting (1 1)
22:42 grondilu m: say ("foo" => 1, ("bar" but role {}) => 1).Hash<foo bar>
22:42 camelia rakudo-moar d6ed4c: OUTPUT«(1 1)␤»
22:43 * patrickz is off to bed
22:48 ugexe joined #perl6
22:48 Xliff joined #perl6
22:50 skink ZoffixWin, Could add an optional param of a path to a media file and have it be uploaded with the tweet. I could see someone automating certain types of postings with that
22:50 skink Just a random idea, though.
22:51 ZoffixWin Yeah
22:51 ZoffixWin I kinda got distracted after the "look, I can Tweet with Perl 6" moment :P
22:54 Xliff MadcapJake, you there?
22:56 timotimo holy wow
22:56 timotimo the framerate just went up 3x
22:58 lizmat timotimo: what did you do ?
23:01 MadcapJake Xliff: yeah
23:02 MadcapJake Made some progress on MyHTML wrapper but I am in the midst of a large refactor now.
23:05 mtj_ joined #perl6
23:05 MadcapJake all the NativeCall stuff will now be in HTML::MyHTML::Raw so you can choose to just use this part
23:07 MadcapJake then HTML::MyHTML and sub-modules will be high-level 6y interface
23:07 MadcapJake I'll be back on later tonight Xliff
23:07 * MadcapJake is off to pizza buffet &
23:08 au joined #perl6
23:08 MadcapJake (the complete-raw-transform branch is where the action is at)
23:08 Herby_ mmm pizza
23:08 agentzh joined #perl6
23:08 petercommand joined #perl6
23:08 MadcapJake pizza is the best thing ever
23:08 sunnavy_ joined #perl6
23:08 * MadcapJake is really off now :)
23:08 Herby_ i concur
23:08 Herby_ \o
23:08 timotimo lizmat: use nqp::atpos and nqp::bindpos instead of .AT-POS
23:08 BenGoldberg joined #perl6
23:09 grondilu m: say ("foo", "bar" but role {}).MixHash<foo bar>
23:09 camelia rakudo-moar d6ed4c: OUTPUT«(1 0)␤»
23:09 lizmat timotimo: ah, yes, if you can do that, :-)
23:09 grondilu ^every time I write things in Perl 6 I encounter bugs like that.  It's very LTA
23:09 lizmat timotimo: but that would not be very portable Perl 6 code now would it ?
23:09 Herby_ LTA?
23:10 grondilu "Less Than Awesome".  See S99
23:10 Herby_ ahh
23:10 _notbenh joined #perl6
23:11 diakopter timotimo: if the framerate went up [to] 3x, that means more than 66% of time was spent in those two routines??
23:13 grondilu I love perl6 but frankly it's very discouraging to spend so much time trying to figure out what I did wrong only to find out it's actually a bug.  :(
23:13 TimToady I don't think that's a bug
23:14 grondilu really?
23:14 TimToady "bar" but role {} is a different object from "bar"
23:14 grondilu m: say ("foo" => 1, ("bar" but role {}) => 1).Hash<foo bar>
23:14 lizmat m: say +{}
23:14 camelia rakudo-moar d6ed4c: OUTPUT«(1 1)␤»
23:14 camelia rakudo-moar d6ed4c: OUTPUT«0␤»
23:14 grondilu m: say ("foo", "bar" but role {}).MixHash<foo bar>
23:14 camelia rakudo-moar d6ed4c: OUTPUT«(1 0)␤»
23:14 grondilu Hash and MixHash should at least be consistent in that regard.
23:14 TimToady no, Hash is not an object hash, but MixHash is
23:14 Xliff MadcapJake, yeah. I pulled a couple of hours ago. Noticed new branches.
23:14 TimToady Hash coerces keys to strings
23:15 Xliff MadcapJake, anything I can help with?
23:15 TimToady MixHash doesn't
23:15 Xliff MadcapJake, Right now I think origin/master has that dependency loop you were talking about, earlier.
23:16 Xliff D'oh! Pizza. Missed that in the backlog. Now I'm jealous!!
23:16 lizmat m: say +("bar" but role {})   # perhaps we lose an error somewhere?
23:16 camelia rakudo-moar d6ed4c: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5bar' (indicated by ⏏)␤  in block <unit> at /tmp/_OD42AOviT line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/_OD42AOviT line 1␤␤»
23:17 TimToady why would it be coercing to numeric anywhere in the OP?
23:18 TimToady is it trying to do even/odd stuff?
23:19 TimToady yes, the OP didn't have => 1
23:19 TimToady m: say <a a b>.BagHash.perl
23:19 camelia rakudo-moar d6ed4c: OUTPUT«("a"=>2,"b"=>1).BagHash␤»
23:20 TimToady m: say <a a b>.Hash.perl
23:20 camelia rakudo-moar d6ed4c: OUTPUT«Odd number of elements found where hash initializer expected␤  in block <unit> at /tmp/UHZUr4MppG line 1␤␤»
23:20 TimToady m: say <a a b>.Bag.perl
23:20 camelia rakudo-moar d6ed4c: OUTPUT«("a"=>2,"b"=>1).Bag␤»
23:20 timotimo diakopter: fwiw, i'm using a very big amount of AT-POS and BIND-POS. but replacing postcircumfix:<[ ]> with AT-POS and ASSIGN-POS manually already gave a tiny speed boost
23:20 TimToady except it's not doing even/odd for mixes or bags
23:21 timotimo diakopter: and there's a problem where moar won't optimize spesh-time-inlined things strongly that causes the result of bind pos to be boxed and returned even when we have a native array, so it also had a bunch of GC overhead
23:21 TimToady so I think my original diagnosis is correct, it's just never gonna be able to lookup "bar" but role {} using a bare "bar" key
23:21 TimToady because sets/bags/mixes use object identity, not value identity
23:22 diakopter m: say ("foo", 3, "bar" but role {}, 5).Hash<foo bar>
23:22 camelia rakudo-moar d6ed4c: OUTPUT«(3 5)␤»
23:22 ZoffixWin m: my $h = ("foo", "bar" but role {}).MixHash; say $h{ 'bar' but role {} }
23:22 camelia rakudo-moar d6ed4c: OUTPUT«0␤»
23:23 TimToady it's a different object, still
23:23 TimToady apparently
23:23 ZoffixWin m: my $bar = 'bar' but role {}; my $h = ("foo", $bar).MixHash; say $h{ $bar }
23:23 camelia rakudo-moar d6ed4c: OUTPUT«1␤»
23:23 ZoffixWin TimToady++ # good diagnosis
23:23 diakopter m: 1 but role {} but role {}
23:23 camelia rakudo-moar d6ed4c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xo2kxA7cd0␤Only identical operators may be list associative; since 'but' and 'but' differ, they are non-associative and you need to clarify with parentheses␤at /tmp/xo2kxA7cd0:1␤------> 1 but role {}7…»
23:24 TimToady but, but, but... :)
23:24 diakopter wut wut
23:24 diakopter tadzik: ^^
23:24 lizmat m: dd ("foo","bar" but role {}).MixHash
23:24 camelia rakudo-moar d6ed4c: OUTPUT«("bar"=>1,"foo"=>1).MixHash␤»
23:24 diakopter TimToady: in my example above the lookup succeeded
23:24 lizmat m: dd ("foo","bar" but role {}).MixHash.keys
23:24 camelia rakudo-moar d6ed4c: OUTPUT«("bar", "foo").Seq␤»
23:25 diakopter oh, but MixHash
23:26 grondilu m: say ("foo", "bar" but role { method WHICH { ~self } }).MixHash<foo bar>
23:26 camelia rakudo-moar d6ed4c: OUTPUT«(1 0)␤»
23:26 ZoffixWin m: say 'bar' === ("foo","bar" but role {}).MixHash.keys.sort[0]
23:26 camelia rakudo-moar d6ed4c: OUTPUT«True␤»
23:27 ZoffixWin Does feel a bit buggish in this respect
23:27 TimToady yes, === should require the same type
23:27 TimToady so that should say False
23:28 timotimo diakopter: even with nqp::atpos_n and nqp::bindpos_n everywhere, i'm still getting 12.5% time spent inside the GC :\
23:29 diakopter timotimo: actually 12.5% isn't bad, unless you think it should be static state
23:30 timotimo it'd be dreamy if it'd be static state
23:30 timotimo but all the arithmetic i'm doing ... not all of it is inlined properly, i'd bet. and superfluous boxing *everywhere*
23:30 diakopter static statist statistical state stasis
23:30 timotimo (is my guess)
23:30 timotimo do you think you can get SDL2::Raw to work on your machine? because then i can just give you my code :)
23:31 * diakopter runs away screaming fire
23:31 timotimo i don't *really* understand why i'm getting calls to .Bridge in my arithmetic, for example. i'm trying to make everything i can use Num, and shouldn't we have candidates for + - * / on Num and Num?
23:34 lizmat m: use nqp;  say nqp::unbox_s("bar" but role {})   # why "bar" === "bar" but role {} is True
23:34 camelia rakudo-moar d6ed4c: OUTPUT«bar␤»
23:35 lizmat m: use nqp;  say nqp::istype("bar" but role {},Str)   # related
23:35 camelia rakudo-moar d6ed4c: OUTPUT«1␤»
23:36 skink timotimo, Appveyor takes like half an hour per test o_o
23:36 skink Travis Linux 7min, OS X 14min, Appveyor Windows 32min
23:37 timotimo skink: windows boots slow :P
23:37 skink No this is just for building
23:37 skink VM creation/boot time isn't included
23:38 cdg joined #perl6
23:38 lizmat TimToady: are you suggesting all infix:<===> should have a nqp::istype(a.WHAT,b.WHAT) ?
23:39 TimToady it should fall out of correct WHICH-ness
23:39 TimToady m: say "foo".WHICH
23:39 camelia rakudo-moar d6ed4c: OUTPUT«Str|foo␤»
23:39 TimToady m: say ("foo" but role {}).WHICH
23:39 camelia rakudo-moar d6ed4c: OUTPUT«Str+{<anon|77223360>}|foo␤»
23:40 timotimo *sigh*, replaced three / with nqp::div_n and got another sixth of performance extra
23:41 sue joined #perl6
23:41 TimToady m: say "foo" === ("foo" but role {})
23:41 camelia rakudo-moar d6ed4c: OUTPUT«True␤»
23:42 TimToady obviously === is not correctly comparing WHICH there, somehow
23:43 lizmat TimToady: I just noticed that most infix:<===> *do* have a a.WHAT =:= b.WHAT test in there
23:43 tardisx joined #perl6
23:43 lizmat just the Any / Str candidates didn't
23:43 lizmat spectesting that change now
23:43 TimToady it has always been the intent that === and eqv fail if types are not identical
23:43 rjbs joined #perl6
23:44 timotimo diakopter: the thing ran for 1018 frames, which took 13669 ms, of which 160ms were spent doing the 304 garbage collections; a collection on every third frame ain't even that terrible
23:44 timotimo basically all of the collections took around 5.3 ms
23:44 timotimo m: say 13669 / 1018, " ms per frame"
23:44 camelia rakudo-moar d6ed4c: OUTPUT«13.427308 ms per frame␤»
23:44 lizmat TimToady: will check all of the infix:<eqv> candidates as well
23:45 timotimo m: say 13.669 R/ 1018, " FPS on average"
23:45 camelia rakudo-moar d6ed4c: OUTPUT«74.475090 FPS on average␤»
23:45 timotimo that's with 2000 particles on screen on every frame
23:45 timotimo *and* running the profiler in the background
23:46 lizmat TimToady: if a mixed in role doesn't provide an altered .WHICH, the comparison would succeed
23:49 rjbs joined #perl6
23:49 grondilu I can't tell exactly why, but I feel there's something deeply wrong in the whole thing.  For one, I find it silly that mixing an empty, anonymous role could change a variable in any way.  I know it was still a dummy example, but still.
23:50 b2gills say ("a" but role {}).^name
23:50 b2gills m: say ("a" but role {}).^name
23:50 camelia rakudo-moar d6ed4c: OUTPUT«Str+{<anon|75617728>}␤»
23:50 lizmat m: say 42 === 42 but role {}
23:50 camelia rakudo-moar d6ed4c: OUTPUT«False␤»
23:51 lizmat grondilu: that was the inconsistent part ^^^
23:51 grondilu ^ that is just dumb if you ask me
23:51 lizmat m: say "foo" === "foo" but role {}
23:51 camelia rakudo-moar d6ed4c: OUTPUT«True␤»
23:51 lizmat grondilu: well, that may be so, but that was TimToady's intent (at one point, anyway :-)
23:51 grondilu oh ok I had followed all the analysis
23:52 grondilu *hadn't
23:52 infina_ joined #perl6
23:52 infina_ joined #perl6
23:53 grondilu it so happens that in my original code it was an integer I was mixing, so maybe things will change tomorrow.  I should get some sleep now anyway.
23:53 lizmat grondilu: same for me
23:54 lizmat the change breaks quite a few spectests, and makes one TODO pass  :-)
23:54 lizmat will look at it more in depth tomorrow
23:55 kid51 joined #perl6
23:58 lizmat good night, #perl6!

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

Perl 6 | Reference Documentation | Rakudo