Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-09

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 timotimo oh god damn it.
00:00 timotimo this is pretty bad.
00:01 timotimo m: 'Hello' ~~ rx:i:m/ Hiyao /
00:01 camelia rakudo-moar fb4252: ( no output )
00:01 timotimo m: say 'Hello' ~~ rx:i:m/ Hiyao /
00:01 camelia rakudo-moar fb4252: OUTPUT«「Hello」␤»
00:01 timotimo ^- literal with ignoremark + ignorecase only checks the very first character ...
00:02 TimToady yao indeed
00:02 timotimo i came here to fix something entirely different :|
00:02 timotimo j: say "hi"
00:03 camelia rakudo-jvm cd19db: OUTPUT«hi␤»
00:03 timotimo https://github.com/perl6/nqp/blob/master/src/vm​/moar/QAST/QASTRegexCompilerMAST.nqp#L653-L662  -  would have to have a loop, or an entirely different approach
00:03 timotimo j: say 'Hello' ~~ rx:i:m/ Hiyao /
00:03 camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
00:03 timotimo :\
00:03 timotimo no NFG support ...
00:07 skids joined #perl6
00:10 TEttinger NFG?
00:11 timotimo Normalized Form Grapheme
00:12 timotimo though ordbaseat isn't NFG-only
00:12 TEttinger that's... a mouthful
00:12 TEttinger I thought normalization was primarily for diacritics and case folding?
00:12 timotimo that's right
00:13 timotimo i'd think moarvm learned the ordbaseat instruction at the same time it got NFC, but what do i know :)
00:13 TEttinger is this a case folding thing?
00:13 timotimo not case folding
00:13 timotimo ordbaseat gives you the ord of the character that's "minus" all the marks
00:13 timotimo so a for ä
00:14 TEttinger huh, there weren't any marks in that j: command though
00:14 TEttinger just wondering...
00:14 TEttinger j: say 'Hello' ~~ rx:i/ Hiyao /
00:14 camelia rakudo-jvm cd19db: OUTPUT«Nil␤»
00:14 timotimo well, :m is for "ignoremarks"
00:15 TEttinger and mark means anything normalization would remove, then, like graves and acutes?
00:15 timotimo normalization doesn't remove graves or acutes
00:15 timotimo it will re-order them, though
00:15 TEttinger j: say 'Hello' ~~ rx:m/ Hiyao /
00:15 camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
00:16 TEttinger oh yeah, right
00:16 TEttinger it would take the a with hat and separate it into the ascii a, then the hat
00:16 timotimo that depends on what normalization form you're running
00:16 timotimo there's NFD, which is "decomposed". that one will give you a and the hat
00:16 TEttinger that's the one I've used so far
00:16 timotimo NFC, which is "composed", will try to find an a-with-hat in the unicode corpus
00:16 AngeloMichael Excuse my naïveté, but what is actually done when the compiler sinks something (and what is that something referred to)?
00:17 timotimo the code generator will put calls to the .sink method of things into the code for you
00:17 TEttinger AngeloMichael, excused, but chiefly because that is some nice use of diacritics on naïveté
00:18 AngeloMichael Haha. Merci.
00:18 mcmillhj joined #perl6
00:18 MilkmanDan joined #perl6
00:19 timotimo m: Failure.new("hello")
00:19 camelia rakudo-moar fb4252: OUTPUT«hello␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
00:19 TEttinger u: exclamation
00:19 TimToady effectively, when you sink something, you don't care about the value, you only care about the side effect
00:19 timotimo m: my $foo = Failure.new("hello"); say "done"
00:19 camelia rakudo-moar fb4252: OUTPUT«done␤»
00:19 TimToady so it's sort of the driver of imperative programming
00:19 dalek doc: 0dc372f | (Eike Frost)++ | doc/Language/typesystem.pod6:
00:19 dalek doc: Fix typo (tuested -> trusted)
00:19 dalek doc: review: https://github.com/perl6/doc/commit/0dc372ffe6
00:19 dalek doc: 51db7bf | Altai-man++ | doc/Language/typesystem.pod6:
00:19 dalek doc: Merge pull request #829 from eikef/typesystemtypo
00:19 dalek doc:
00:19 dalek doc: Fix typo (tuested -> trusted)
00:19 dalek doc: review: https://github.com/perl6/doc/commit/51db7bf51c
00:19 TimToady as opposed to functional programming, which tries to avoid side effects
00:20 TimToady and hence tends to avoid semicolons
00:20 AngeloMichael Ah, okay; that makes sense. Thanks, TimToady.
00:21 TimToady semicolon isn't the only way to get a sink context, but it's the usual way
00:21 TimToady m: sub foo() { 42; 43 }
00:21 camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
00:21 TimToady m: sub foo(--> Nil) { 43 }
00:21 camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 43 in sink context (line 1)␤»
00:22 TEttinger hm. I wonder if there's any comparable "other direction" for side effects, like a "forward effect" that is still part of a pure computation, but changes some upcoming part of the computation in a mutable-like way
00:22 unmatched} m: say "All hell is breaking loose" ~~ m:i:m/"All is fine, I am sure of it"/
00:22 camelia rakudo-moar fb4252: OUTPUT«「All hell is breaking loose」␤»
00:22 TimToady TEttinger: well, arguably that's what binding is
00:22 * unmatched} peels "Production Ready" sticker off the Perl 6 box...
00:22 unmatched} :)
00:23 TEttinger m: say "Production Ready" ~~ m:i:m/"Pfft, Not Yet"/
00:23 camelia rakudo-moar fb4252: OUTPUT«「Production Re」␤»
00:23 timotimo unmatched}: do you want to RT it? i haven't done it yet
00:23 unmatched} Sure, will do.
00:23 TEttinger m: say "Production Ready" ~~ m:i:m/"Probably fine for lots of uses"/
00:23 camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:24 timotimo unless someone else did it already
00:24 TEttinger m: say "Production Ready" ~~ m:i:m/"\bPARTY PARTY PARTY, I WANNA HAVE A PARTY"/
00:24 camelia rakudo-moar fb4252: OUTPUT«False␤»
00:24 TEttinger interesting
00:24 TEttinger m: say "Production Ready" ~~ m:i:m/"\bProduction Ready"/
00:24 camelia rakudo-moar fb4252: OUTPUT«False␤»
00:24 timotimo it's too long
00:25 TEttinger m: say "Production Ready" ~~ m:i/"\bProduction Ready"/
00:25 camelia rakudo-moar fb4252: OUTPUT«False␤»
00:25 TEttinger isn't \b boundary?
00:25 timotimo not inside ""
00:26 TEttinger ???
00:26 unmatched} Done: https://rt.perl.org/Ticket/Display.html?id=128875
00:26 TEttinger m: say "Production Ready" ~~ m:i/\bProduction Ready/
00:26 camelia rakudo-moar fb4252: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3y "Production Ready" ~~ m:i/\bProduct…»
00:26 unmatched} m: say "Production Ready" ~~ m:i/\b 'Production Ready'/
00:26 camelia rakudo-moar fb4252: OUTPUT«False␤»
00:26 unmatched} m: say "Production Ready" ~~ m:i/<< 'Production Ready'/
00:26 camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:27 TEttinger m: say "Production Ready" ~~ m:i:m/<< 'Production Ready'/
00:27 camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:27 timotimo not sure what \b means in our regex syntax
00:27 TEttinger neat
00:27 TEttinger m: say "Production Ready" ~~ rx:i:m/<< 'Production Ready'/
00:27 camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:27 TEttinger so it correctly treats zero-length stuff as not changing the first letter
00:27 TEttinger m: say "Production Ready" ~~ rx:i:m/<< 'Production Readier'/
00:27 camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:29 timotimo um ... of course it does?
00:29 timotimo it's about every single literal you can find
00:31 timotimo 12.82user 0.68system 0:13.51elapsed 99%CPU (0avgtext+0avgdata 2647752maxresident)k
00:31 timotimo ^- used to be
00:31 timotimo 0.34user 0.02system 0:00.36elapsed 99%CPU (0avgtext+0avgdata 82720maxresident)k
00:31 timotimo ^- now is
00:32 timotimo actually ... used to be worse, i think.
00:32 timotimo let me check.
00:35 timotimo nah, used to be exactly that much
00:35 timotimo which makes me wonder why my first optimization attempt yielded no benefit at all ...
00:35 mcmillhj joined #perl6
00:35 timotimo when it should have reduced the amount of lc calls by a whole lot ...
00:37 timotimo maybe we ought to implement an op in moarvm that strips a character of all marks and returns the stripped result
00:40 * timotimo fires up his slightly more beefy desktop for a spec test run
00:42 timotimo um ... can't reach it
00:42 timotimo hack it is, then.
00:44 timotimo ugh. make test would have already shown my code to be broken
00:51 timotimo good thing at this time of day people don't tend to be building perl6
00:54 timotimo i have a bad history of not testing before i push; when will i learn? >:(
00:54 mcmillhj joined #perl6
00:55 timotimo ah, just a silly mistake i made
00:58 lee_ joined #perl6
00:59 timotimo right. my thing is still wrong
01:00 timotimo i'd need an ifnull for the lc-ing ...
01:03 timotimo makes me wonder why it didn't fail "make test" locally
01:03 timotimo tonight is the night timo talks to himself a lot
01:03 gfldex wut?
01:04 timotimo well, nobody engages me in this discussion :P
01:04 timotimo so i just use the open IRC channel as a rubber duckie
01:05 pierre_ joined #perl6
01:05 timotimo so, how are you doin, gfldex?
01:05 unmatched} *crickets*
01:05 unmatched} :D
01:06 gfldex i'm a wee bit dreaded by the perspective to write a complete description of class
01:07 timotimo oh, really?
01:07 timotimo that seems like biting off a lot at once
01:08 timotimo unmatched}: are you glad i made your shit faster, now that you've replaced it with other shit? :)
01:09 gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> $?CLASS:D){ self } }
01:09 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed return value␤at <tmp>:1␤------> 3has Any $.attr = Any; method foo(*%_ -->7⏏5 $?CLASS:D){ self } }␤»
01:09 gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> $?CLASS){ self } }
01:09 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed return value␤at <tmp>:1␤------> 3has Any $.attr = Any; method foo(*%_ -->7⏏5 $?CLASS){ self } }␤»
01:09 gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> C:D){ self } }
01:09 camelia rakudo-moar fb4252: ( no output )
01:10 gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS){ self } }
01:10 camelia rakudo-moar fb4252: ( no output )
01:10 gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS:D){ self } }
01:10 camelia rakudo-moar fb4252: ( no output )
01:10 unmatched} timotimo: I'm so drunk, I can barely read... so... Sure, I'm ghlad of any improvement :D
01:11 unmatched} m: say class {} ~~ Any
01:11 camelia rakudo-moar fb4252: OUTPUT«True␤»
01:11 timotimo if you can't read, let me summarize it for you: my cut-down version of your code runs in 0.36 seconds instead of 13.5 seconds
01:11 unmatched} .oO( my code?? )
01:11 unmatched} the bug about the m:i// on huge text?
01:11 timotimo m: say "and the memory usage is down to { 8272000 / 2647752 }% of what it used to be"
01:11 camelia rakudo-moar fb4252: OUTPUT«and the memory usage is down to 3.1241597% of what it used to be␤»
01:11 timotimo yes, that one
01:11 unmatched} timotimo++ fixing things
01:12 freezerburnv_ joined #perl6
01:12 gfldex m: class C is Any { has Any $.attr = Any; only method foo(*%_ --> ::?CLASS:D){ self } }
01:12 camelia rakudo-moar fb4252: ( no output )
01:13 mcmillhj joined #perl6
01:13 gfldex m: class C is Any { has Any $!attr = Any; only method attr { return-rw $!attr }; only method foo(*%_ --> ::?CLASS:D){ self } }
01:13 camelia rakudo-moar fb4252: ( no output )
01:13 timotimo ah, i *thought* it was something with :: at the beginning
01:14 gfldex i think that's all the defaults for a very simple class. Whereby the return type constraint is not really there ofc.
01:20 timotimo hum. i wonder ... S05-modifier perl5_5 has a bit of b0rkage
01:21 timotimo why? >:(
01:22 timotimo the output from these tests is really not helpful
01:23 mcmillhj joined #perl6
01:35 pierre_ joined #perl6
01:35 timotimo i can't tell why it's not matching there :\
01:36 itaipu joined #perl6
01:37 Actualeyes joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:54 mcmillhj joined #perl6
01:56 MilkmanDan joined #perl6
01:59 sufrostico joined #perl6
02:08 mcmillhj joined #perl6
02:16 cyphase_eviltwin joined #perl6
02:21 BenGoldberg joined #perl6
02:25 noganex_ joined #perl6
02:41 mcmillhj joined #perl6
02:41 AlexDaniel joined #perl6
02:42 wamba joined #perl6
02:42 TEttinger joined #perl6
02:52 mcmillhj joined #perl6
02:55 LegalResale joined #perl6
02:58 pierre_ joined #perl6
03:06 pierre__ joined #perl6
03:06 lucs m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( \S /{ ~$0.uc }/; say $s  # How to fix? I want: 「1A 2b 1C 2d␤」
03:06 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:2␤------> 3d") ~~ s:g/ 1 <( \S /{ ~$0.uc }/; say $s7⏏5  # How to fix? I want: 「1A 2b 1C 2d␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤  …»
03:06 mcmillhj joined #perl6
03:07 AlexDaniel committable: releases say "All hell is breaking loose" ~~ m:i:m/"All is fine, I am sure of it"/
03:07 committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.0​3,2016.04,2016.05,2016.06,2016.07,HEAD»: 「All hell is breaking loose」
03:09 AlexDaniel well, that's unfortunate
03:10 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( ( \S ) /{ ~$0.uc }/; say $s
03:10 camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
03:10 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( \S /{ ~$/.uc }/; say $s
03:10 camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
03:10 lucs TimToady: Oh, thanks.
03:10 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = ~$/.uc; say $s
03:10 camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
03:11 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = $/.uc; say $s
03:11 camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
03:11 lucs You wear your nick well :)
03:11 TimToady :)
03:16 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } = $/.uc; say $s
03:16 camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
03:18 lucs Hmm, that too right, of course (I may have overthought my regex), but your examples are instructive.
03:22 leego joined #perl6
03:22 * lucs didn't know about (or probably forgot about) the  s {⋯} = ⋯  form.
03:27 cog_ joined #perl6
03:30 Actualeyes joined #perl6
03:31 eam joined #perl6
03:38 TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } .= uc; say $s
03:38 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed assignment operator␤at <tmp>:1␤------> 3y $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } .=7⏏5 uc; say $s␤»
03:38 TimToady aww
03:39 lucs :)
03:39 holyghost joined #perl6
03:41 * TimToady finds it odd that that doesn't parse
03:43 TEttinger what is .= ?
03:43 AlexDaniel m: my $x = ‘foo bar’; $x ~~ s:g{foo} = ‘bar’; say $x
03:43 camelia rakudo-moar fb4252: OUTPUT«bar bar␤»
03:44 AlexDaniel m: my $x = ‘hello’; $x = $x.us; say $x
03:44 camelia rakudo-moar fb4252: OUTPUT«Method 'us' not found for invocant of class 'Str'␤  in block <unit> at <tmp> line 1␤␤»
03:44 AlexDaniel m: my $x = ‘hello’; $x = $x.uc; say $x
03:44 camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
03:44 AlexDaniel m: my $x = ‘hello’; $x = $x . uc; say $x
03:44 camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
03:44 AlexDaniel m: my $x = ‘hello’; $x .= uc; say $x
03:44 camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
03:44 TimToady m: my $x = ‘foo bar’; $x ~~ s:g{foo} ~= ‘bar’; say $x
03:44 camelia rakudo-moar fb4252: OUTPUT«foobar bar␤»
03:45 TimToady the ~= works...
03:46 lucs TEttinger: It's kind of like  += : 「$x .= foo」 -> 「$x = $x.foo」
03:46 TEttinger nice
03:46 TEttinger good thing to have
03:47 TimToady most often you see: my Foo $x .= new;
03:49 AlexDaniel TEttinger: basically any infix operator can be used like this
03:49 AlexDaniel but I know it sounds weird that . is an infix op…
03:49 TimToady well, not if the type is too different
03:50 AlexDaniel right
03:50 TimToady m: my $x = 42; $x [>]= 41; say $x
03:50 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot make assignment out of > because chaining operators are too diffy␤at <tmp>:1␤------> 3my $x = 42; $x [>]=7⏏5 41; say $x␤»
03:51 TimToady but that's why we made min and max into infixes
03:51 TimToady m: my $x = 42; $x min= 41; say $x
03:51 camelia rakudo-moar fb4252: OUTPUT«41␤»
03:52 jack_rabbit joined #perl6
03:53 TimToady m: my $x = 42; $x gcd= 120; say $x
03:53 camelia rakudo-moar fb4252: OUTPUT«6␤»
03:53 TimToady same reasoning there
04:06 kid51 joined #perl6
04:15 BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1;
04:15 camelia rakudo-moar fb4252: ( no output )
04:15 BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1; say @a;
04:15 camelia rakudo-moar fb4252: OUTPUT«[1]␤»
04:16 BenGoldberg m: my @a = 3, 5, 10; @a gcd= slip; say @a;
04:16 camelia rakudo-moar fb4252: OUTPUT«[3]␤»
04:16 BenGoldberg m: my @a = 3, 5, 10; @a max= slip; say @a;
04:16 camelia rakudo-moar fb4252: OUTPUT«[3 5 10]␤»
04:16 TimToady m: my @a = 3, 5, 10;  say [gcd] @a
04:16 camelia rakudo-moar fb4252: OUTPUT«1␤»
04:16 TimToady m: my @a = 3, 5, 10;  say [lcm] @a
04:16 camelia rakudo-moar fb4252: OUTPUT«30␤»
04:16 BenGoldberg m: my @a = 3, 5, 10; @a .= max; say @a;
04:16 camelia rakudo-moar fb4252: OUTPUT«[10]␤»
04:17 TimToady that's a little bizarre
04:17 BenGoldberg Not really unexpected, though.
04:18 TimToady it's odd to want to put it back into the array though
04:18 BenGoldberg True :)
04:18 AlexDaniel m: my @a = 3, 5, 10; @a .= @a
04:18 camelia rakudo-moar fb4252: OUTPUT«Invocant requires a type object of type Array, but an object instance was passed.  Did you forget a 'multi'?␤  in block <unit> at <tmp> line 1␤␤»
04:18 rindolf joined #perl6
04:19 AlexDaniel did I forget a ‘multi’? ;)
04:19 BenGoldberg You forgot a method
04:19 AlexDaniel that's right :)
04:20 BenGoldberg m: my $str = 'chars'; $str .= $str;
04:20 camelia rakudo-moar fb4252: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
04:20 BenGoldberg m: my $str = 'chars'; $str.$str().say;
04:21 camelia rakudo-moar fb4252: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
04:22 BenGoldberg m: my $str = 'chars'; $str .= "$str";
04:22 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.␤at <tmp>:1␤------> 3my $str = 'chars'; $str .= "$str"7⏏5;␤»
04:22 BenGoldberg m: my $str = 'chars'; $str .= "$str" ();
04:22 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.␤at <tmp>:1␤------> 3my $str = 'chars'; $str .= "$str"7⏏5 ();␤»
04:22 BenGoldberg m: my $str = 'chars'; $str .= "$str"();
04:22 camelia rakudo-moar fb4252: ( no output )
04:22 BenGoldberg m: my $str = 'chars'; say $str .= "$str"();
04:22 camelia rakudo-moar fb4252: OUTPUT«5␤»
04:26 BenGoldberg m: infix:<.>().say;
04:26 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3.7⏏5<EOL>␤»
04:27 TimToady it's not a real operator, quite
04:33 Cabanossi joined #perl6
04:50 mcmillhj joined #perl6
05:03 mcmillhj joined #perl6
05:10 pierre_ joined #perl6
05:14 mcmillhj joined #perl6
05:31 AngeloMichael TIL the blue streaks in Camelia's wings are 6s...
05:32 TimToady well, only one of them is a 6, the other is a P
05:32 hobbs A P and a 6
05:32 AngeloMichael Mind blown again, haha.
05:35 hobbs what just blew my mind is that John O'Hurley (the actor who played Mr. Peterman, the owner of the J. Peterman catalog) has since become part owner of the J. Peterman catalog in real life.
05:41 Possum joined #perl6
06:06 mcmillhj joined #perl6
06:12 rpburkholder joined #perl6
06:25 zhmylove joined #perl6
06:28 firstdayonthejob joined #perl6
06:32 CIAvash joined #perl6
06:37 AngeloMichael left #perl6
06:38 AngeloMichael joined #perl6
06:52 bitmap joined #perl6
06:57 ggoebel joined #perl6
07:09 TEttinger not sure how I started thinking about this, but the concept of animal mascots having human-like properties as well as their own animal-like properties leads to interesting areas. camelia would crave sodium, as almost all butterflies and moths do. she would have a sense that humans can only begin to grasp, since butterflies have a magnetic compass in their brain.
07:11 mcmillhj joined #perl6
07:12 TEttinger put this together and camelia seems like she'd always know where the closest fast food place is, and would always ask for 20 extra packets of salt
07:12 TEttinger very politely!
07:15 arrojo89 joined #perl6
07:15 arrojo89 hello all !
07:16 arrojo89 p6: say for (1 .. 30);
07:16 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1␤------> 3say7⏏5 for (1 ..…»
07:17 arrojo89 p6: say $_ for (1 .. 30);
07:17 camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16​␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
07:18 AlexDaniel m: .say for 1..30
07:18 camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16​␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
07:18 arrojo89 m: say for 1..30
07:18 camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1␤------> 3say7⏏5 for 1..30…»
07:18 arrojo89 m: .say for 1..30
07:18 camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16​␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
07:18 arrojo89 why with the dot AlexDaniel ?
07:19 AlexDaniel arrojo89: everything has a method .say, so you can do $_.say
07:20 AlexDaniel m: $_.say for 1..30
07:20 camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16​␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
07:20 AlexDaniel arrojo89: but you can omit $_ in this case because it is very common
07:21 AlexDaniel arrojo89: so it becomes just “.say”. Basically, it works very similarly to how some things default to $_ in Perl 5, but it is way more explicit and consistent
07:22 arrojo89 ok thanks AlexDaniel
07:25 labster joined #perl6
07:27 mcmillhj joined #perl6
07:29 bjz joined #perl6
07:31 darutoko joined #perl6
07:32 RabidGravy joined #perl6
07:32 Psy-Q joined #perl6
07:34 captain-adequate joined #perl6
07:37 zakharyas joined #perl6
07:42 dakkar joined #perl6
07:42 mcmillhj joined #perl6
07:46 dalek Inline-Perl5: b2dda91 | niner++ | / (2 files):
07:46 dalek Inline-Perl5: Fix memory corruption when multiple interpreters are used
07:46 dalek Inline-Perl5:
07:46 dalek Inline-Perl5: Re-ordering of the includes in p5helper.c made memory corruptions surface
07:46 dalek Inline-Perl5: that should have been there all along. While we did call PERL_SET_CONTEXT
07:46 dalek Inline-Perl5: as preparation for calling into the Perl 5 interpreter, we did so only
07:46 dalek Inline-Perl5: after already making calls like newAV() in a bogus attempt to stick to
07:46 dalek Inline-Perl5: C89 rules of keeping declarations before statements.
07:46 dalek Inline-Perl5: Fix by moving the PERL_SET_CONTEXT call to the very first line of each
07:46 dalek Inline-Perl5: function it occurs in.
07:46 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/b2dda91a81
07:47 pierre_ joined #perl6
07:55 bjz joined #perl6
07:58 sno joined #perl6
08:04 * lizmat clickbaits https://p6weekly.wordpress.com/2​016/08/08/2016-32-a-quiet-week/
08:07 canopus joined #perl6
08:13 rindolf joined #perl6
08:26 yoleaux joined #perl6
08:27 mcmillhj joined #perl6
08:44 harrison_ joined #perl6
08:54 notostraca joined #perl6
08:59 gregf_ *holidays*
08:59 mcmillhj joined #perl6
09:02 TEttinger joined #perl6
09:08 TEttinger joined #perl6
09:19 xinming_ joined #perl6
09:26 Skarsnik joined #perl6
09:27 Skarsnik hello
09:28 kurahaupo joined #perl6
09:29 zakharyas joined #perl6
09:33 TEttinger joined #perl6
09:33 pierre_ joined #perl6
09:34 DrForr Afternoon, Skarsnik.
09:38 Skarsnik hm, I had a weird issue when trying to install a module I write 6 months ago. one test fail. I tried to make sense of the error to fix it, but I had no idea what is wrong. it fail on a simple open https://gist.github.com/anonymous​/6b244812c41ed39850c06b5b332f22a1
09:38 MorayJ joined #perl6
09:39 mcmillhj joined #perl6
09:39 TEttinger joined #perl6
09:42 nine Skarsnik: the line numbers in your trace are way off. You sure you pasted the whole files?
09:42 nine Ah, just saw the # line 24 comment
09:47 TEttinger joined #perl6
09:51 kurahaupo_ joined #perl6
09:54 mcmillhj joined #perl6
09:56 Skarsnik btw hello nine, Are you done with the pre comp hell finally? :)
09:58 nine Skarsnik: I dare not say "done", but the dust seems to settle.
09:59 Skarsnik It can be 'system wide' finally? or it's still by users?
10:02 jnthn Wouldn't it be "both" since users can always install modules locally as well as system wide?
10:04 TEttinger joined #perl6
10:04 nine jnthn: true
10:05 Skarsnik I mean, root install Module A. User U use code that use A and it does not have to wait for A to be precompiled for him since root already did it (but using the test?)
10:05 nine Skarsnik: yes, that works now :)
10:05 Skarsnik Nice :)
10:06 nine Skarsnik: even better, one can now build distro packages for modules including those precomp files. Even if the package is built by an unpriviledged user in a different build root.
10:07 RabidGravy boom!
10:07 sjohnsen joined #perl6
10:07 Skarsnik nice :)
10:07 Skarsnik I am repeating myself
10:08 RabidGravy that's fine, I used the same 50,000 words over and over again just in a different order
10:12 bisectable joined #perl6
10:20 MilkmanDan joined #perl6
10:21 Ulti whoa my bioinformatics tests are now down to 1.26s
10:21 RabidGravy yay!
10:21 RabidGravy where did they start?
10:21 Ulti two years ago 36s
10:21 Ulti 6 months ago 10s
10:21 RabidGravy excellent stuff
10:21 Ulti something like that
10:21 jnthn How fast is fast enough? :)
10:22 Ulti depends
10:22 Ulti this is now fast enough for little things for sure
10:22 RabidGravy http://www.brewerydb.com/developers
10:22 Ulti for more realistic bioinformatics loads an order of magnitude :(  but really I have got *bad* Perl 6 code here
10:22 Ulti I haven't changed it in years just so I could benchmark
10:22 TEttinger joined #perl6
10:23 Ulti I only updated for GLR and the hash/bag equivalent
10:23 stmuk https://media.ccc.de/v/emf​2016-269-beer-for-everyone
10:23 Ulti I could probably get a lot of speedup just optimising my own code and finding more optimised routes through Rakudo
10:23 Ulti that I haven't and I've got like a 30x speedup is kind of amazing
10:24 Ulti shaving off a whole second in the last month is quite impressive given its a much bigger % change
10:24 jnthn RabidGravy: Ooh, I gotta use that in some demo :)
10:25 ribasushi joined #perl6
10:26 Ulti also the reality is bioinformatics libraries everywhere else tend to wrap C to get the perf
10:26 Ulti and Perl 6 does make that easier than most languages
10:27 jnthn How parallelizable are bioinformatics algorithms, generally?
10:27 stmuk I don't suppose anyone knows (roughly) when perl6-bench last ran 100%?
10:28 Actualeyes joined #perl6
10:28 jnthn stmuk: http://www.moarvm.org/measurements/perl6-bench/ has results going back to February, so if you can figure out what's working or not from that you can bisect :)
10:28 stmuk ok thanks
10:28 Ulti jnthn generally highly parallelizable
10:29 Ulti but more importantly they are trivially parallelizable usually on the outside of data you are reading
10:29 Ulti so you are doing the same thing for a billion objects rather than having lots of internal parallelism to your algorithm
10:29 jnthn Aha.
10:29 Ulti IO and memory performance is really the actual bottle neck
10:31 Ulti for some reason everyone in bioinformatics has a preference for awful text formats that are hugely bloated
10:31 Ulti so fast parsers make the difference nearly always
10:31 Ulti fairly sure if grammars got faster that would be the big thing for me now
10:32 Ulti or really the main thing is being able to define a token that the grammar can parallelize around would be amazing
10:32 Ulti I've sort of done that myself badly
10:32 Ulti so you read a chunk of file you know to split on to then parse
10:33 Ulti and you can parse in parallel if your read all those chunks quickly
10:33 Ulti not sure how grammars .parse is implemented but that did make a difference if I did that
10:36 Ulti like we have TOP could maybe have CHUNK which is used to split IO up and then TOP is matched against that chunked string over and over
10:39 arrojo89 is there a way to convert perl scripts into exe  ?
10:41 DrForr Not yet, at least to my knowledge. Also, usually that's a question we get for perl 5.
10:42 Ulti not yet for MoarVM but the JVM can produce a JAR for you
10:42 DrForr Ah, cool.
10:44 Ulti --target=jar iirc
10:44 RabidGravy jnthn, I was just pointed at https://untappd.com/api/docs as well
10:45 Ulti jnthn just looking at your grammar debugger and tracer looks like Metamodel::GrammarHOW might let me do the chunked IO nicely in a module?
10:46 unmatched} "@zoffix Pearl 6 has been an ongoing development since 2000. Yet after 14 years it is not officially done.. Its not dead its dead end"
10:47 * unmatched} slowly shakes head
10:48 unmatched} And from now on I'm totally gonna troll people who bring up The Name Issue by saing it's not Perl 6, but "Pearl 6" :P
10:48 RabidGravy nuke them from orbit, it's the only way to be sure
10:48 jnthn If they can't even calculate 2016 - 2000 then I don't hold much hope for them being smart enough to assess whether something is ready for them to use :P
10:48 TEttinger joined #perl6
10:48 jnthn Ulti: Thing is, you'd kinda like the results back incrementally too
10:49 jnthn Ulti: Not a single huge match object at the end.
10:49 jnthn Ulti: Or I'd guess that's what you'd want anyway
10:49 DrForr People don't "assess" languages or products anymore, they just assuem the top hit on Google is the best.
10:50 Ulti jnthn: yup you would want .parse to return a supply or something
10:50 jnthn So it may be more that we want a module that provides a role you compose into a grammar, so you get a parse-chunks and it takes a chunking operation or so
10:50 Ulti then react whenever
10:50 unmatched} Oh, quite the contrary, this person did extensive research before declaring Perl 6 a failure: "Number 6 is a sign of failure for scripting languages php6 and now perl 6"
10:50 jnthn Oh, that old chessnut :P
10:50 Ulti jnthn yup but it would be nice if the chunking rule was part of the grammar declaration too, though equally easy to just pass it in
10:50 unmatched} :)
10:51 jnthn Ulti: Well, that could be a method required by the role :)
10:51 jnthn I don't think this needs meta-programming to solve though
10:51 jnthn Just a nicely designed role
10:52 Ulti unmatched}: this is the author https://www.linkedin.com/in/ubereng
10:53 pierre_ joined #perl6
10:53 Ulti jnthn will give that a go, at the moment I have a weird class that sort of holds an actions and grammar class together with the chunking rule and does the IO on the outside and calls .parse lots of times
10:53 Ulti would be nice to have something a little more reuseful
10:53 jnthn Yeah, it's an interesting problem :)
10:55 Ulti wasnt there chat of having a Slang which kept actions and grammar rules declaratively together at one point?
10:55 andreoss joined #perl6
10:55 RabidGravy can you have traits on grammars and their constituent parts?
10:56 jnthn RabidGravy: Sure, they're just classes/methods really
10:56 andreoss what is a function equivalent for qx``? `run("who", :out).out.slurt-rest` is noisy
10:57 andreoss *spurt
10:57 andreoss *slurp
10:57 Ulti you could have a trait for TOP where you have multiple concurrent routes through the grammar and they race to match :)
10:58 TEttinger joined #perl6
10:59 jnthn andreoss: So...why not use qx? :)
11:00 andreoss m: map { say qx`$_` }, qw/date who/
11:00 camelia rakudo-moar ddcbae: OUTPUT«qx, qqx is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub QX at src/RESTRICTED.setting line 11␤  in block <unit> at <tmp> line 1␤␤»
11:00 jnthn You'd need qqx to interpolate, I think
11:01 literal is there a way to pass further arguments to 'use' via the -M commandline option? specifically :from
11:01 andreoss hmm, qx`$_` hangs for some reason, probably bash
11:03 andreoss jnthn: a function would be better with .map
11:03 TEttinger joined #perl6
11:10 edehont joined #perl6
11:20 canopus joined #perl6
11:21 jameslenz joined #perl6
11:29 TEttinger joined #perl6
11:30 brrt joined #perl6
11:32 sena_kun joined #perl6
11:35 TEttinger joined #perl6
11:38 pierre_ joined #perl6
11:42 TEttinger joined #perl6
11:44 kid51 joined #perl6
11:50 TEttinger joined #perl6
11:57 TEttinger joined #perl6
12:09 unmatched} Ulti: author of what? I don't have LinkedIn
12:09 TEttinger joined #perl6
12:12 TEttinger joined #perl6
12:12 * unmatched} gifts TEttinger a new router
12:14 unmatched} m: say "[foo" ~~ /"[" ~ "]" \w+/
12:14 camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
12:15 unmatched} The Internals Course says about the above syntax: "failure to find the closing ] produces a descriptive error message instead of just failing to match.".... what error is it talking about?
12:15 harrison_ joined #perl6
12:16 lambd0x joined #perl6
12:16 lambd0x Hi fellas!
12:16 yoleaux 7 Aug 2016 02:04Z <b2gills> lambd0x: I was trying to get you to realize it could be written as 「my %h; for $*IN.words -> $word { %h{$word}++ }」 then I was going to tell you about 「my %h := $*IN.words.BagHash」 http://irclog.perlgeek.de/p​erl6/2016-08-06#i_12978231
12:17 ilmari m: say $*IN.words.BagHash
12:17 camelia rakudo-moar ddcbae: OUTPUT«BagHash.new(Atá, do(2), I, a(8), dom(2), chúl, pilleadh, gan(3), shéimh, fóill,, bhí(2), Lúich’, le(5), coll;, ina(2), chroí., miste, seal, dhílis, cluain, feall,, B'é, dhiaidh, dhá, siúl;, Go, Meiriceá, thiomáin, 'S, ghaoil,, os, na(3), Cho…»
12:17 lambd0x lol :)
12:17 ilmari shiny :)
12:18 lambd0x ilmari: Do you know how to read just a word or a sigle number from a file?
12:19 unmatched} m: say $*IN.words[0]
12:19 camelia rakudo-moar ddcbae: OUTPUT«Céad␤»
12:19 unmatched} m: say $*IN.words.grep(/^\d+$/)[0]
12:19 camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
12:20 unmatched} m: say $*IN.words.grep(/^D/)[0]
12:20 camelia rakudo-moar ddcbae: OUTPUT«Dhún␤»
12:20 lambd0x unmatched}: but doesn't that give you the first line?
12:20 lambd0x unmatched}: ah
12:20 unmatched} It gives you first word from the first line
12:21 unmatched} m: say $*IN.lines[1].words[0]
12:21 camelia rakudo-moar ddcbae: OUTPUT«Agus␤»
12:21 unmatched} ^ first word from second line
12:21 ilmari m: say $*IN.lines.is-lazy
12:21 camelia rakudo-moar ddcbae: OUTPUT«False␤»
12:21 ilmari huh, I'd have expected that to be True
12:21 lizmat hmmm.... that should be True
12:21 unmatched} That seems to be a bug
12:21 * lizmat checks
12:21 ilmari m: say $*IN.words.is-lazy
12:21 camelia rakudo-moar ddcbae: OUTPUT«False␤»
12:22 lambd0x unmatched}: nice so words works like lines \o/
12:22 lambd0x unmatched}: didn't noticed that earlier, thanks you.
12:22 lambd0x *notice.
12:22 unmatched} .oO( or do lines work like words :o )
12:22 unmatched} m: say $*IN.lines[1].words[2].comb[3]
12:22 camelia rakudo-moar ddcbae: OUTPUT«a␤»
12:23 unmatched} 4th letter of 3rd word on 2nd line :)
12:23 unmatched} s/letter/character/;
12:23 ilmari m: $*IN.WHAT.say
12:23 camelia rakudo-moar ddcbae: OUTPUT«(Handle)␤»
12:24 ilmari m: $*IN.lines.WHAT.say
12:24 camelia rakudo-moar ddcbae: OUTPUT«(Seq)␤»
12:25 jnthn lizmat: .lines.is-lazy being False is likely correct
12:25 jnthn lizmat: Because my @lines = $*IN.lines; probably wants to be eager by default
12:25 lizmat @a.STORE is eager afaik
12:25 unmatched} How come? It does read lazily
12:26 lizmat but for $*IN.lines -> $line { } would be lazy
12:26 ilmari https://github.com/rakudo/rakudo/b​lob/nom/src/core/IO/Handle.pm#L568 # looks lazy to me
12:26 TEttinger joined #perl6
12:26 unmatched} "10GB-file".IO.lines[0..3].say # will not read the entire 10GB
12:26 lambd0x unmatched}: haha I'm surprised semantics are meaninful in perl 6. Not many languages work alike. I liked it :)
12:27 lizmat looks like it's just a matter of forgetting an "is-lazy" method in the iterator
12:28 jnthn unmatched}: That isn't what is-lazy means though.
12:28 AlexDaniel “How fast is fast enough?” – it is never fast enough
12:28 * lizmat is confused now
12:28 unmatched} jnthn: oh, I thought it did
12:29 * lizmat hopes for a TIL moment
12:29 jnthn No, it means "we *must* never try to evaluate more than the user absolutely asks for"
12:30 jnthn It doesn't mean "all the data is obtained before iteration starts"
12:30 lizmat jnthn: so you're saying that making .lines.is-lazy True would make the .STORE non-eager ?
12:30 jnthn Correct
12:31 jnthn You'd make my @a = $foo.lines; behave like my @a = lazy $foo.lines;
12:31 lizmat # Whether the iterator is lazy (True if yes, False if no).
12:32 lizmat this is the description in Iterator.pm
12:33 lizmat hmmm.. quite some spectest fallout with .lines / .words being lazy
12:36 dalek specs: 2e72b5d | (Zoffix Znet)++ | html/perl-with-historical-message.css:
12:36 dalek specs: Display historical message based on <body> and not <html>
12:36 dalek specs:
12:36 dalek specs: Fixes rendering issues on rekonq
12:36 dalek specs: review: https://github.com/perl6/specs/commit/2e72b5d1d8
12:36 wamba joined #perl6
12:39 jnthn lizmat: I figured so. Which means it'll break a bunch of real world code too I'd guess
12:40 TEttinger joined #perl6
12:41 pierre_ joined #perl6
12:41 moritz so, something for v6.d?
12:41 lizmat moritz: why ?
12:42 moritz lizmat: becaues it breaks a bunch of real world code
12:42 lizmat yeah, but I guess jnthn's point was that we *shouldn't* do this in the first place, in any version :-)
12:43 Util joined #perl6
12:43 moritz still, that's what stability means
12:43 moritz that we don't break user's code
12:44 moritz do we have a document yet with plans for v6.d?
12:46 jnthn Yeah, I don't think we want to change it at all :)
12:49 kid51 joined #perl6
12:51 perlpilot joined #perl6
12:53 mcmillhj joined #perl6
12:56 Ulti unmatched}: the quote from zoffix was a quote of a blog online not zoffix
12:57 andreoss qx seems to be broken on windows
12:57 andreoss cannot handle non-ascii characters
12:57 andreoss http://paste.debian.net/787615/
12:59 unmatched} Ulti: ah, damn, just when I started to think Zoffix was an asshole :)
12:59 * unmatched} snickers
12:59 unmatched} Ulti: it's actually from someone Tweeting: https://twitter.com/imansari​pk/status/757427077192769536
13:01 [Coke] (doc with plans for v6.d) not yet. I think we need a general plan and then maybe also what breaking changes we're considering.
13:01 [Coke] (-> -dev)
13:03 RabidGravy unmatched}, I don't know where to start: "pearl", numerology, "scripting" - I think the persons opinion can be disregarded
13:04 TEttinger joined #perl6
13:06 unmatched} I'd aim for "corrected" rather than disregarded :) I did find it by searching for "Perl 6" on Twitter, after all.
13:09 w4and0er96 php6 ? where? XD
13:09 andreoss it occurs with code page 866, works okay with 65001
13:09 andreoss should it work with 866 too?
13:10 unmatched} What's 866, Latin-1 or something?
13:11 andreoss cyrillic
13:11 unmatched} Oh
13:11 noganex joined #perl6
13:13 MilkmanDan joined #perl6
13:13 RabidGravy but it's similar to latin-1 in that it's ascii with additional high characters
13:15 unmatched} My guess would be say qx`echo абвг` gives абвг in utf-8; so that's why it works under utf cp
13:16 unmatched} I recall seeing some RT ticket about printing unicode
13:16 unmatched} buggable: rt
13:16 buggable unmatched}, TOTAL: 1390, UNTAGGED: 600, BUG: 425, LTA: 98, JVM: 62, NYI: 35, SEGV: 30, RFC: 28, UNI: 26, CONC: 24, PERF: 20, POD: 14, @LARRY: 14, PRECOMP: 9, TODO: 9, GLR: 6, BUILD: 5, STAR: 4, NATIVECALL: 4, WEIRD: 3, BOOTSTRAP: 3, MOARVM: 2, OSX: 2, LHF: 1, SPESH: 1, DOCS: 1, MATH: 1   Details: http://bug.perl6.party/1470748600.html
13:17 unmatched} This one: https://rt.perl.org/Ticket/Displ​ay.html?id=127925#ticket-history maybe there's some relevance
13:17 cdg joined #perl6
13:17 TEttinger joined #perl6
13:18 cdg joined #perl6
13:21 Ulti unmatched}: yeah I just posted a reply to the tweet... the guy is just trying to look smarts by copy pasting FUD from blog posts written two years ago :S
13:21 Ulti *sigh*
13:22 Ulti being a critic is one thing, but just spreading old hate is lame
13:22 Ulti the latest times for my code have perked up interest at work since they've now seen 10s go down to 1.2s
13:24 RabidGravy big jumps get attention :)
13:24 TEttinger joined #perl6
13:26 Ulti yup
13:26 dalek specs: 899560e | moritz++ | v6d.pod:
13:26 dalek specs: Add v6d.pod, a place to track proposed language changes for v6.d
13:26 dalek specs: review: https://github.com/perl6/specs/commit/899560e86a
13:26 Ulti also I posted quite a nice asynch SQL example after someone was going on about a hacker news post about a python module to do the same.... literally core Perl 6 does it all
13:27 Ulti well with DBIish
13:27 Ulti but all the asynch is just primitives that /just work/ in a couple of lines
13:28 mcmillhj joined #perl6
13:29 andreoss Proc.run doesn't work either with 866, throws Malformed UTF-8
13:29 dvh joined #perl6
13:29 dvh Hello there!
13:30 tokomer joined #perl6
13:30 RabidGravy yeah because it isn't utf-8
13:30 skids joined #perl6
13:30 dvh m: say 'hello'
13:30 camelia rakudo-moar e1205c: OUTPUT«hello␤»
13:31 moritz andreoss: you can pass :bin to Proc.run
13:31 moritz andreoss: or specify an encodingwith :enc
13:31 moritz https://docs.perl6.org/type/Proc
13:37 mohae_ joined #perl6
13:37 TEttinger joined #perl6
13:37 dvh A friend has shown me Perl 6, and I'm interested, though not interested enough yet to read the specs. The friend has directed me here. Could someone please answer some general questions? I'm particularly interested in type systems. Does Perl 6 support sum types? Can I declare an equivalent of Haskell's "data Maybe a = Nothing | Just a" and then pattern match that? So far I've been shown only pattern matching of lists, but can I match typ
13:38 andreoss moritz: is there a list of encodings known to perl 6?
13:39 andreoss m: run("echo", enc => 'iso-8859-5');
13:39 camelia rakudo-moar e1205c: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
13:39 unmatched} dvh: look up Junctions for that
13:39 unmatched} huggable: Junction
13:39 huggable unmatched}, Logical superposition of values: https://docs.perl6.org/type/Junction
13:39 unmatched} dvh: and the "specs" are historical documents. You shouldn't really read them to learn Perl 6, other than in historical context. Read the docs at https://docs.perl6.org instead
13:40 ilmari m: "foo".encode(encoding => 'iso-8859-5')
13:40 camelia rakudo-moar e1205c: ( no output )
13:40 dvh ... but can I match types that aren't built-in? (for some reason I see the whole message but the archives only have part of it)
13:40 ilmari m: say "foo".encode(encoding => 'iso-8859-5')
13:40 camelia rakudo-moar e1205c: OUTPUT«utf8:0x<66 6f 6f>␤»
13:40 dvh I'll read that, thanks.
13:40 ilmari m: say "€".encode(encoding => 'iso-8859-9')
13:40 camelia rakudo-moar e1205c: OUTPUT«utf8:0x<e2 82 ac>␤»
13:40 nine dvh: there is no difference at all between types that are built-in and custom types
13:40 unmatched} dvh: this may be a bit useful: http://perl6.party/post/Per​l-6-Types--Made-for-Humans
13:41 ilmari m: say "€".encode('iso-8859-9')
13:41 camelia rakudo-moar e1205c: OUTPUT«Unknown string encoding: 'iso-8859-9'␤  in block <unit> at <tmp> line 1␤␤»
13:41 nine dvh: also you'd get much more useful answers by asking about concrete problems you want to solve. Just asking for feature X of another language won't ever lead you to features Y and Z of Perl 6 that make the problem X solves obsolete or simply a non-issue.
13:41 unmatched} m: subset Prime of Int where .is-prime; say $_ ~~ Prime for 2, 6, 7
13:41 camelia rakudo-moar e1205c: OUTPUT«True␤False␤True␤»
13:42 andreoss ilmari: i got Unknown string encoding iso-8859-5 on Windows
13:42 andreoss
13:42 dvh unmatched}: For some reason, I can't open the last link, it loads for some time and then stops without receiving a single byte.
13:43 ilmari andreoss: https://github.com/moarvm/moarvm/b​lob/master/src/strings/ops.c#L1716
13:44 andreoss ilmari: that's sad
13:44 unmatched} dvh: works fine for me. You can read the site's source on GitHub: https://github.com/zoffixznet/perl6.party/blob​/master/post/Perl-6-Types--Made-for-Humans.md
13:44 jnthn andreoss: Patches welcome. ;)
13:45 dvh unmatched}: I've already found the article with this name, thanks. Reading it right now.
13:46 MilkmanDan joined #perl6
13:46 TEttinger joined #perl6
13:46 RabidGravy alternative is to add the encodings you want to the https://github.com/sergot/perl6-encode
13:51 bjz_ joined #perl6
13:51 ptolemarch joined #perl6
13:57 TEttinger joined #perl6
14:01 dvh nine: Okay. If I have a data structure consisting of three fields -- let's say two numbers and a list -- then can I write a function which would pattern match this structure?
14:01 TEttinger joined #perl6
14:02 dvh Fox example, one can match a list this way: sub ([$x, $y, *@rest]).
14:03 ugexe create a role with the appropriate ACCEPTS?
14:03 dalek specs: ce29255 | (Zoffix Znet)++ | v6d.pod:
14:03 dalek specs: Add: Signature/Attribute Defaults Based on Definedness
14:03 dalek specs: review: https://github.com/perl6/specs/commit/ce29255b71
14:04 jnthn You can unpack an object using named parameters, e.g. sub ((:$x, :$y, *%rest))
14:05 mr-foobar joined #perl6
14:05 jnthn By default, the unpack consists of the public attribute (declared has $.foo)
14:05 jnthn Though you can actually customize how an object is unpacked/destructured by implementing a method Capture on it, that returns the argument capture it destructures into
14:06 jnthn (If the default behavior isn't good enough)
14:06 RabidGravy Ooh I didn't know that :)
14:07 RabidGravy (learn something new every day,)
14:07 TEttinger joined #perl6
14:07 dvh jnthn: Thank you, that's enlightening!
14:08 grondilu joined #perl6
14:10 mavo joined #perl6
14:11 dvh Next, let's assume I want a binary tree. I don't want to use hashes for this because each node has exactly two childs, and I wish to enforce it on the type level. Can I write a recursive class?
14:11 xinming joined #perl6
14:12 nine dvh: yes. Pretty much as you'd think it works
14:12 DrForr There's a sample binary tree in the docs for ... the 'Classes and...' section?
14:12 ugexe also rosetta code
14:15 kid511 joined #perl6
14:19 dvh Now I've read the examples and I think I understand it. Thank you everyone, your explanations are appreciated!
14:22 brrt joined #perl6
14:23 Ulti dvh out of interest how often does the concept of "pattern matching" in data structures come up for you? I've never really worked on data structures where I didnt know what I was looking at...
14:23 TEttinger joined #perl6
14:23 Ulti even some big JSON blob usually has a schema or I take a look at it and specify exactly what to extract rather than search for it
14:24 Ulti I guess DOM manipulation is the closest I've ever come
14:25 Ulti I can see how implementing xpath or something becomes really nice with this sort of native feature in a language
14:25 unmatched} They quit IRC.
14:25 Ulti oh :(
14:25 Ulti why
14:25 Ulti did I smell
14:25 Ulti maybe they will read the logs...
14:25 sena_kun Ulti, in haskell land pattern matching is almost everywhere.
14:25 Ulti sure but I guess I'm asking why?
14:26 Ulti it rarely comes up for me so feels a bit like there must be some deeper difference or something Haskell doesn't do well to cause it
14:26 nine Ulti: write an optimizing compiler. You'll have plenty of opportunity to pattern match :)
14:27 Ulti true enough
14:27 Ulti but again thats quite a specific example
14:27 Ulti if its everywhere in the language that means it has some deeper necessity to it
14:27 Ulti like how hashes are everywhere in Perl
14:28 cdg_ joined #perl6
14:28 sena_kun If you want to avoid a bunch of 'if's, if you want to unpack things clearly, etc. Also it's super useful with ADTs(not abstract, but algebraic) everywhere.
14:28 Ulti I think auto viv is one of the deeper reasons for that
14:29 sena_kun But I'm not a pro in haskell.
14:30 Ulti I was wondering if its to do with less mutable state? so you can always expect data structures to be well structured... no one is going to just inject in something horrible in the wrong place due to the type and immutability
14:31 sena_kun It mostly defines behavior, not structure.
14:31 Ulti guess I need to see some examples
14:31 TEttinger joined #perl6
14:31 sena_kun Like, em, "If this func accepts one thing -> do something1, if some another thing -> do something2).
14:31 sena_kun Ulti, see factorial function written with pattern matching. (:
14:32 Ulti oh thats what you call pattern matching
14:32 sena_kun Ulti, http://www.willamette.edu/~f​ruehr/haskell/evolution.html - see third and fourth examples.
14:33 sena_kun Ulti, is there any pattern matching other than this? I yes, I want to know more about it.
14:37 TEttinger joined #perl6
14:37 vytas joined #perl6
14:40 Ulti you aren't matching a pattern in any of those examples though... its multi dispatch, list expansion and reducing a list
14:40 sena_kun Ulti, as for me(not a pro), pattern matching is useful to define behavior depending on data and is useful to unpack things. In haskell you can't really do `array[0].first_element.content`(without lenses, but it's not default haskell, I suppose), so you can de-construct your data only in the left side of a function. It works in almost any totally functional language, though.
14:41 Ulti http://vvv.tobiassjosten.net/h​askell/factorials-in-haskell/  <--- the pattern matching thing there is literally just multi dispatch and recursion in Perl and plenty of other languages
14:41 lichtkind__ joined #perl6
14:41 Ulti I think Haskell might just have a load of maths people naming things :P
14:42 Ulti multi dispatch is essentially pattern matching though
14:42 moritz it's not a bad name
14:42 Ulti especially the more advanced kind found in P6
14:42 sena_kun Util, multi-dispatch works only with a type. If you do somehting like `data Bool = True | False`, then you cannot multi-dispatch it, because every walue is Bool, You need to decompose it to see is it True literal or False literal.
14:43 sena_kun Correct me if I'm wrong here.
14:43 sena_kun *value
14:43 unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo 1; foo 0
14:43 camelia rakudo-moar 9e497c: OUTPUT«Cannot resolve caller foo(1); none of these signatures match:␤    (Bool $ where { ... })␤    (Bool $ where { ... })␤  in block <unit> at <tmp> line 1␤␤»
14:43 unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo True; foo False
14:43 camelia rakudo-moar 9e497c: OUTPUT«tis a true␤tis a true␤»
14:43 unmatched} :S
14:44 sena_kun Wow. Cool.
14:44 jnthn True as a smart-match always matches....
14:44 jnthn But yeah, you can match values
14:44 unmatched} m: multi foo(Bool where { not so $_ }){say "tis a false" }; multi foo(Bool where { so $_ }) { say "tis a true" }; foo True; foo False
14:44 camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3multi foo(Bool where { not so $_ }7⏏5){say "tis a false" }; multi foo(Bool wh␤»
14:44 unmatched} bah
14:44 cyphase joined #perl6
14:45 unmatched} m: multi foo($ where { not so $_ }){say "tis a false" }; multi foo($ where { so $_ }) { say "tis a true" }; foo True; foo False
14:45 camelia rakudo-moar 9e497c: OUTPUT«tis a true␤tis a false␤»
14:45 unmatched} Third time a charm
14:45 sena_kun jnthn, if you can match values and deconstruct data structures, then Perl 6 has pattern mathing, obviously(which is good).
14:46 unmatched} m: multi foo(Int $ where .is-prime){say "tis a prime" }; multi foo(Int $) { say "tis not a prime" }; foo 31337; foo 666
14:46 camelia rakudo-moar 9e497c: OUTPUT«tis a prime␤tis not a prime␤»
14:46 sena_kun How can I take first two elements of a list in a signature, btw?
14:47 sena_kun Or just first.
14:47 jnthn m: sub foo([$a, $b, *@]) { say $a; say $b } foo([1..10])
14:47 camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3sub foo([$a, $b, *@]) { say $a; say $b }7⏏5 foo([1..10])␤    expecting any of:␤        infix␤        infix stopper…»
14:47 jnthn m: sub foo([$a, $b, *@]) { say $a; say $b }; foo([1..10])
14:47 camelia rakudo-moar 9e497c: OUTPUT«1␤2␤»
14:47 sena_kun jnthn, neat. Thanks for your example.
14:47 unmatched} m: multi foo([$type, Int $ where .is-prime]){ say "tis a $type prime" }; multi foo([$type, Int $]) { say "tis $type not a prime" }; foo ["foo", 31337]; foo ["meow", 666]
14:47 camelia rakudo-moar 9e497c: OUTPUT«tis a foo prime␤tis meow not a prime␤»
14:48 unmatched} \o/
14:48 ugexe Does that differ `sub foo(@ ($a, $b, *@)) {}`?
14:49 jnthn No
14:49 ugexe or is that so you can still name the overall capture
14:49 jnthn The [...] just puts a Positional constraint on the parameter
14:49 jnthn Otherwise it works just like (...)
14:49 brrt joined #perl6
14:51 ugexe ah, didnt know sub foo(@all [$a, $b, *@]) worked the same
14:51 unmatched} m: sub factorial {[*] 1..$^a}; say factorial $_ for ^10;
14:51 camelia rakudo-moar 9e497c: OUTPUT«1␤1␤2␤6␤24␤120␤720␤5040␤40320␤362880␤»
14:54 TEttinger joined #perl6
15:02 araujo joined #perl6
15:04 b2gills say +permutations $_ for ^10
15:04 bdmatatu joined #perl6
15:04 b2gills m: say +permutations $_ for ^10
15:04 camelia rakudo-moar 9e497c: OUTPUT«1␤1␤2␤6␤24␤120␤720␤5040␤40320␤362880␤»
15:04 setty1 joined #perl6
15:04 hoelzro o/ #perl6
15:05 [Coke] hio
15:05 TEttinger joined #perl6
15:06 hoelzro o/ [Coke]
15:07 hoelzro I am thinking of assembling some material on helping devs with Git, and since Rakudo uses Git, I thought you all might have helpful feedback.  Please fill out this form if you're willing and have time: https://goo.gl/forms/Fi6YQcv6c9BJ86A43
15:09 b2gills hoelzro: I forget who did it, but you may want to ask the person who transferred Perl5 from Perforce to Git to look at it
15:17 hoelzro b2gills: I didn't know Perl5 was ever on perforce...I'll do that if I can figure out who it was!
15:18 TEttinger joined #perl6
15:21 awwaiid joined #perl6
15:22 cdg joined #perl6
15:23 cdg joined #perl6
15:24 khw joined #perl6
15:24 TEttinger joined #perl6
15:25 unmatched} b2gills++
15:25 mcmillhj joined #perl6
15:29 acrussell joined #perl6
15:31 wamba joined #perl6
15:31 cdg_ joined #perl6
15:35 awwaiid joined #perl6
15:51 RabidGravy and I think it was in CVS before that
15:58 mohae joined #perl6
16:01 edwinsage joined #perl6
16:02 Skarsnik hm, why panda is not installed aside the perl6 bin btw? instead of prefix/perl6/site/...
16:04 TEttinger joined #perl6
16:04 bob777 joined #perl6
16:16 zacts joined #perl6
16:16 unmatched} m: say [\*] 1..10
16:16 camelia rakudo-moar 9e497c: OUTPUT«(1 2 6 24 120 720 5040 40320 362880 3628800)␤»
16:17 awwaiid joined #perl6
16:18 TEttinger joined #perl6
16:21 gregf_ m: say [*] 1..10
16:21 camelia rakudo-moar 9e497c: OUTPUT«3628800␤»
16:22 cdg joined #perl6
16:23 mrf joined #perl6
16:23 cdg joined #perl6
16:25 TEttinger joined #perl6
16:28 spebern joined #perl6
16:30 MilkmanDan joined #perl6
16:31 rudolfoc` joined #perl6
16:39 TEttinger joined #perl6
16:47 edwinsage Is there a p6 construct like the p5 diamond <> ?
16:48 hoelzro edwinsage: you probably want some form of lines()
16:48 gfldex m: for lines { .say }
16:48 camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5===␤Function 'lines' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3for lines { .say }7⏏5<EOL>␤Missing block (apparently claimed by 'lines')␤at <tmp>:1␤------> 3for lines { .say }7⏏5<EOL>␤␤»
16:48 gfldex m: for lines() { .say }
16:48 camelia rakudo-moar 9e497c: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
16:51 edwinsage But does that automatically open files listed on the command line, or fallback to STDIN?
16:51 mcmillhj joined #perl6
16:51 unmatched} edwinsage: no
16:52 edwinsage That's what I'm looking for.
16:52 hoelzro then you want $*ARGFILES
16:52 Actualeyes left #perl6
16:52 edwinsage Opening files or reading STDIN, with error output if the arguments aren't files.
16:52 hoelzro actually, doesn't lines() default to $*ARGFILES?
16:53 unmatched} Oh, yeah, my bad: "Without any arguments, sub lines operates on $*ARGFILES, which defaults to $*IN in the absence of any filenames."?"
16:57 cdg_ joined #perl6
16:58 edwinsage Ok, I'm seeing how that works.
16:58 TEttinger joined #perl6
16:58 cdg_ joined #perl6
16:58 pierre_ joined #perl6
16:58 unmatched} perl6 -e '.uc.say for lines' file1 file2 file3 will print uppercased lines, for example, and if you omit the filenames, it'll read from STDIN
16:59 mcmillhj joined #perl6
17:00 edwinsage I was working on a wordcount one-liner as part of my figuring out perl6.
17:01 edwinsage p6: lines().split( /\s+/, :skip-empty).elems.say;
17:01 camelia rakudo-moar 9e497c: OUTPUT«219␤»
17:02 gregf_ m: .say for lines()[1..10]
17:02 camelia rakudo-moar 9e497c: OUTPUT«Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth Dobhair, is beag nár bhris mo chroí.␤␤Ag tais…»
17:02 unmatched} m: lines.join.words.BagHash.say
17:02 camelia rakudo-moar 9e497c: OUTPUT«BagHash.new(do(2), dom(2), a(8), pilleadh, gan(3), shéimh, fóill,, miste, bhí(2), Lúich’, le(5), ina(2), seal, dhílis, cluain, feall,, dhiaidh, dhá, Meiriceá, thiomáin, os, na(3), Chontae, thriall, nuair, shaoil, chroí.Ag, mórAtá, gnéillB'é,…»
17:02 edwinsage The error output for a missing file is a lot more verbose, though.
17:02 unmatched} edwinsage: ^ something like that
17:03 gfldex m: my \term:«<>» := {lines()}(); for <> { .say }
17:03 camelia rakudo-moar 9e497c: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
17:03 gfldex m: my \term:«<>» := {lines()}(); while <> { .say }
17:03 camelia rakudo-moar 9e497c: OUTPUT«(timeout)(Any)␤(Any)␤(Any)␤(Any)␤(​Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤​(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)​␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any​)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)…»
17:04 gfldex m: my \term:«<>» := {lines()}(); given <> { .say }
17:04 camelia rakudo-moar 9e497c: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth…»
17:05 TimToady m: for <> { .say }
17:06 camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty list␤at <tmp>:1␤------> 3for <7⏏5> { .say }␤»
17:06 unmatched} m: lines.join.words.Bag.sort(:by(*.value)).fmt("%10s => %3d\n").say
17:06 camelia rakudo-moar 9e497c: OUTPUT«        's =>   1␤    Chontae =>   1␤       Céad =>   1␤       Dhún =>   3␤   Dobhair, =>   1␤   Dobhair. =>   1␤ Dobhair.Níorbh =>   1␤ Dobhair.Slán! =>   1␤    Domhain =>   1␤        Dún =>   1␤   Eireagal =>   1␤      Gall, =>…»
17:06 * unmatched} kinda expected that to get sorted by value :/
17:06 unmatched} Oh, it's *.value not :by(*.value)
17:07 unmatched} m: lines.join.words.Bag.sort(​*.value).reverse.fmt("%10s => %3d\n").say
17:07 camelia rakudo-moar 9e497c: OUTPUT«        mo =>   9␤          a =>   8␤         is =>   5␤         le =>   5␤     Ghaoth =>   4␤         an =>   4␤         ag =>   4␤       gach =>   3␤         go =>   3␤          i =>   3␤       Dhún =>   3␤       slán =>   3␤   …»
17:07 TimToady why lines.join instead of slurp?
17:08 TimToady and you can sort on -*.value instead of reverse
17:08 unmatched} 'cause I don't read documentation :)
17:08 unmatched} I know it looks like I know how to program sometimes, but it's all an illusion :) I merely parrot things I see
17:09 unmatched} m: slurp.words.Bag.sort(-*.value).fmt("%10s => %3d\n").say
17:09 camelia rakudo-moar 9e497c: OUTPUT«        mo =>   9␤          a =>   8␤         le =>   5␤         is =>   5␤         ag =>   4␤         an =>   4␤     Ghaoth =>   4␤        gan =>   3␤         na =>   3␤     ghlas’ =>   3␤       slán =>   3␤       Dhún =>   3␤ …»
17:09 unmatched} TimToady++
17:09 mcmillhj joined #perl6
17:09 TEttinger joined #perl6
17:11 TEttinger joined #perl6
17:12 [Coke] PARROT! GET IT!
17:12 unmatched} Where? WHERE?
17:13 unmatched} Fetch the net!
17:17 kaare_ joined #perl6
17:18 lloyd__ joined #perl6
17:21 gregf_ nah, theres no more birds left.. its a camelia now ;)
17:21 hankache joined #perl6
17:21 hankache hello #perl6
17:22 unmatched} \o
17:22 hankache ohai zoffix
17:23 unmatched} m: BEGIN say "there is no syntax error there" and exit; mash the keyboard real good!!! :D
17:23 camelia rakudo-moar 9e497c: OUTPUT«there is no syntax error there␤»
17:24 gfldex m: $*IN = <peter paul marry> but role { method slurp-rest { self.Str } }; for lines() { .say }
17:24 camelia rakudo-moar 9e497c: OUTPUT«Method 'opened' not found for invocant of class 'List+{<anon|73205008>}'␤  in block <unit> at <tmp> line 1␤␤»
17:24 gfldex m: $*IN = <peter paul marry> but role { method slurp-rest { self.Str } }; for slurp() { .say }
17:24 camelia rakudo-moar 9e497c: OUTPUT«peter paul marry␤»
17:27 unmatched} m: say 2 + 2; CHECK my &infix:<+> = { $^a - $^b }; say 2 + 2
17:27 camelia rakudo-moar 9e497c: OUTPUT«0␤0␤»
17:28 unmatched} How come this produces zeros? I expected it to run "at run time as late as possible"
17:28 firstdayonthejob joined #perl6
17:29 unmatched} Oh. I need coffee.. it's at *compile* time as late as possible >_<>
17:30 timotimo oh, Skarsnik is back! :)
17:30 unmatched} m: role Foo { COMPOSE { say "meow" } }; class Bar does Foo {} ;
17:30 camelia rakudo-moar 9e497c: ( no output )
17:31 Skarsnik Hello timotimo
17:32 timotimo a few days ago i noticed a twitch user by the name of "skarsnikus" or something; i wondered if that was you
17:32 Skarsnik Yay, I have a 15 sec gain on the same code running with a more recent rakudo on a less powerfull cpu over a may rakudo x)
17:32 Skarsnik Yes, it's me
17:33 timotimo neat
17:33 Skarsnik Where did you see me? x)
17:34 timotimo i forgot
17:35 Skarsnik a speedrunner stream? x)
17:37 Skarsnik Not sure how it's relevant https://gist.github.com/anonymous​/4ecd00e869f52cb3f4b276b8d7f3980d
17:38 timotimo speedrunner stream seems likely; perhaps metasigma?
17:38 Skarsnik Oh maybe
17:39 Skarsnik I am not often on his stream now. He had a bad attitude toward the WR holder of SoE for while
17:42 kurahaupo joined #perl6
17:47 rudolfoc` joined #perl6
17:48 rangolaf joined #perl6
17:49 rangolaf rakudo: 'say "hi"';
17:49 camelia rakudo-moar 9e497c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "say \"hi\"" in sink context (line 1)␤»
17:49 unmatched} m: say "hi"
17:49 camelia rakudo-moar 9e497c: OUTPUT«hi␤»
17:50 rangolaf m: say "hi";
17:50 camelia rakudo-moar 9e497c: OUTPUT«hi␤»
17:50 rangolaf m: print "hi";
17:50 camelia rakudo-moar 9e497c: OUTPUT«hi»
17:50 cdg joined #perl6
17:50 unmatched} You can also /msg camelia m: say "Hi";
17:51 rangolaf oh thanks
17:51 rangolaf my bad for using pub chan
17:51 cdg joined #perl6
17:51 unmatched} Not a problem :)
17:55 domidumont joined #perl6
17:59 unmatched} m: say "foo" ~~ /<!ww>+/
17:59 unmatched} wwweeeeeeeeeeeeeeeee :)
17:59 camelia rakudo-moar 9e497c: OUTPUT«Memory allocation failed; could not allocate 978223104 bytes␤»
17:59 unmatched} What's <!ww> ?
18:00 spider-mario joined #perl6
18:00 unmatched} Ah "# only match when not within a word"
18:00 timotimo "is this between two different characters?" basically
18:01 timotimo oh
18:01 unmatched} Well, that's the comment in the example on https://docs.perl6.org/language/regexes
18:01 timotimo so what's the one that'll match if the cursor is between two identical characters?
18:01 unmatched} "negated "within word" assertion"
18:01 timotimo m: say "foo" ~~ /<ww>./
18:01 camelia rakudo-moar 9e497c: OUTPUT«「o」␤ ww => 「」␤»
18:02 timotimo m: say "asdf" ~~ /<ww>./
18:02 camelia rakudo-moar 9e497c: OUTPUT«「s」␤ ww => 「」␤»
18:02 timotimo hm, ok
18:02 unmatched} m: say "foo" ~~ /<!ww>./
18:02 camelia rakudo-moar 9e497c: OUTPUT«「f」␤»
18:02 unmatched} neat
18:05 brrt joined #perl6
18:05 MilkmanDan joined #perl6
18:09 perlpilot joined #perl6
18:20 dalek doc: 80c9b69 | (Zoffix Znet)++ | doc/Language/glossary.pod6:
18:20 dalek doc: Improve QAST
18:20 dalek doc:
18:20 dalek doc: Fix broken link. Explain what Q stands for.
18:20 dalek doc: review: https://github.com/perl6/doc/commit/80c9b69f9e
18:26 sno joined #perl6
18:28 telex joined #perl6
18:30 labster joined #perl6
18:40 FROGGS joined #perl6
18:42 TEttinger joined #perl6
18:43 mr-foobar joined #perl6
18:47 cpage_ joined #perl6
18:48 harmil_wk I don't know why, but I'm having a really hard time not typing "while $*IN.lines -> $line {...}" instead of "for..."
18:49 harmil_wk I think it was about 10 minutes that I was trying to figure out why $line was an Seq and not a string.
18:53 rangolaf left #perl6
18:57 brrt joined #perl6
18:59 TimToady harmil_wk: not sure how we could help much with that failure mode
19:00 harmil_wk Me either. It's just frustrating. Perhaps you could check $*USER.is-stupid?
19:00 TEttinger joined #perl6
19:01 moritz the compiler could randomly present you an intelligence test, and give you a friendly advise to postpone coding when you're too far below your personal average
19:02 harmil_wk perl6 --go-home-youre-drunk
19:02 moritz .oO( You're well past the Ballmer peak )
19:05 parabolize joined #perl6
19:08 TimToady harmil_wk: that doesn't help if you're already home and drunk
19:11 mcmillhj joined #perl6
19:13 harmil_wk TimToady: I'd call that a race condition, but you'd be in no condition to race
19:15 perlpilot .oO( race to the bottom? )
19:23 notostraca joined #perl6
19:26 kaare_ joined #perl6
19:26 mcmillhj joined #perl6
19:28 kaare_ joined #perl6
19:28 TEttinger joined #perl6
19:34 MilkmanDan joined #perl6
19:36 dalek doc: aa997c4 | (Bill Barry)++ | doc/Language/traps.pod6:
19:36 dalek doc: Update traps.pod6
19:36 dalek doc:
19:36 dalek doc: syntax error, missing ')'
19:36 dalek doc: review: https://github.com/perl6/doc/commit/aa997c47bd
19:36 dalek doc: d8c638c | Altai-man++ | doc/Language/traps.pod6:
19:36 dalek doc: Merge pull request #830 from bbarry/patch-1
19:36 dalek doc:
19:36 dalek doc: Update traps.pod6
19:36 dalek doc: review: https://github.com/perl6/doc/commit/d8c638cecb
19:39 mcmillhj joined #perl6
19:48 ovibos left #perl6
19:53 mcmillhj joined #perl6
19:57 cdg joined #perl6
19:57 cpage_ joined #perl6
20:05 zakharyas joined #perl6
20:06 mcmillhj joined #perl6
20:20 dalek doc: 0df7524 | Altai-man++ | doc/Type/IO/ (9 files):
20:20 dalek doc: Make examples compile. Use table instead of code block for IO::Path. Fix and update signatures, add some examples.
20:20 dalek doc: review: https://github.com/perl6/doc/commit/0df7524c64
20:20 dj_goku joined #perl6
20:23 mcmillhj joined #perl6
20:24 mr-foobar what is the perl6 equivalent of do "file.pl" ?
20:24 hoelzro mr-foobar: EVALFILE, iirc
20:26 gfldex m: say "1-a 2-b 3-c".subst(:g, /\d/, {<one two three>[$++]});
20:26 camelia rakudo-moar 328402: OUTPUT«one-a two-b three-c␤»
20:29 AlexDaniel mr-foobar: by the way, we have special doc files for that: https://docs.perl6.org/language/5to6-perlfunc#do
20:30 mr-foobar sweet thx !
20:34 prammer joined #perl6
20:34 dalek doc: dc95d9c | (Wenzel P. P. Peppmeyer)++ | doc/Language/variables.pod6:
20:34 dalek doc: better example for anon state scalar
20:34 dalek doc: review: https://github.com/perl6/doc/commit/dc95d9c662
20:36 gfldex i really like how closure blocks and the anon state variable make another loop redundant in that example by sneaking the block into the loop inside of subst
20:36 brrt joined #perl6
20:36 zacts joined #perl6
20:47 mr-foobar is there an equivalent of Time::HiRes for perl6 ? I want to sleep for 0.428571 seconds
20:47 timotimo then just sleep 0.428571
20:47 brrt .tell masak i'd like to discuss macros some time in the future
20:47 yoleaux brrt: I'll pass your message to masak.
20:48 mr-foobar timotimo: there is a noticable lag when I am using it in a forever loop.
20:49 timotimo perl6 isn't the fastest
20:50 * geekosaur suspects that adding an external module would not be faster than a builtin
20:59 TimToady mr-foobar: if the intent is to do something at a recurring interval, you'd probably do better with a timing Supply of some sort
21:00 TimToady which should avoid drift
21:02 mr-foobar here is the gist -- https://gist.github.com/harsha-mud​i/f8506ecffa378a34a43d1688356546af
21:02 ugexe m: for (0..*) { last if $_ > 10000; sleep(0.0001); }; say time - INIT { time }
21:02 camelia rakudo-moar 328402: OUTPUT«2␤»
21:03 AlexDaniel committable: HEAD Supply.interval(0.1).tap({say now}); sleep 20
21:03 committable AlexDaniel: https://gist.github.com/2161​3554f54784f45078c026cd47a5fe
21:03 mr-foobar I am trying to write code which triggers midi events.
21:03 AlexDaniel it does drift.
21:03 ugexe why are you using Thread.new?
21:03 ugexe if you dont know why, you probably want to use start { } instead
21:04 mr-foobar basically I want it to run like as a separate thread so that it doesn't interfere with previous execution.
21:05 ugexe have you seen https://docs.perl6.org/language/concurrency ?
21:06 AlexDaniel m: Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞
21:06 AlexDaniel oops
21:06 AlexDaniel committable: HEAD Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞
21:06 committable AlexDaniel: https://gist.github.com/b537​5dfa4f5c4465cd6e2e7e362f7688
21:06 camelia rakudo-moar 328402: OUTPUT«(timeout)0.01948394␤0.01860007␤0.018711​50␤0.018810360␤0.01893974␤0.01908832␤0.0191974​0␤0.019327999␤0.01943767␤0.019563883␤0.0197047​9␤0.019851825␤0.019975939␤0.020085140␤0.020210​911␤0.020317997␤0.020463765␤0.020563204␤0.0…»
21:07 AlexDaniel sooo… why?
21:07 mavorg joined #perl6
21:07 ugexe your lag is almost certainly from EVALFILE
21:09 gfldex m: sub f(@a){@a is default(1); say @a[1]}; f;
21:09 camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3sub f(@a){@a7⏏5 is default(1); say @a[1]}; f;␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modi…»
21:09 gfldex is there a way to set the default of a container without a declarator?
21:10 AlexDaniel m: sub f(@a = [42,69]){ say @a[1]}; f  # ?
21:10 camelia rakudo-moar 328402: OUTPUT«69␤»
21:11 AlexDaniel aahh
21:11 AlexDaniel no
21:12 gfldex m: my @a; @a.VAR.default := 1;
21:12 camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3my @a; @a.VAR.default := 17⏏5;␤»
21:16 AlexDaniel gfldex: interestingly, it looks like I was trying to get it to work too: http://irclog.perlgeek.de/p​erl6/2016-05-26#i_12552791
21:16 AlexDaniel not sure why though
21:18 gfldex m: my @a; use nqp; my $descriptor := nqp::getattr(@a.VAR, @a.VAR.WHAT.^mixin_base, '$!descriptor').set_default(nqp::decont(1)); say @a[0];
21:18 camelia rakudo-moar 328402: OUTPUT«1␤»
21:18 gfldex AlexDaniel: ^^^
21:18 AlexDaniel oh well…
21:19 gfldex m: my @a; trait_mod<is>(@a.VAR, 1, :default);
21:19 camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    trait_mod used at line 1␤␤»
21:19 mr-foobar here is an audio sample of the output https://clyp.it/bmyfclu0
21:19 mr-foobar I tried removing the thread .. still the same.
21:20 gfldex m: my @a; trait_mod:<is>(@a.VAR, 1, :default);
21:20 camelia rakudo-moar 328402: OUTPUT«Cannot resolve caller trait_mod:<is>(Array, Int, :default); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $type, :$nativesize!)␤    (Mu:U $type, :$ctype!)␤    …»
21:21 gfldex the trait is defined for Variable:D
21:23 El_Che is Perl 5 POD a subset op Perl 6 Pod?
21:23 AlexDaniel m: my $x = 42; my @a is default($x); say @a[1]
21:23 camelia rakudo-moar 328402: OUTPUT«(Any)␤»
21:23 AlexDaniel ↑ well, um… uh?
21:24 gfldex it's a compile time trait so it's called with the variable behind @a
21:24 AlexDaniel it is doc-ed correctly, but I still wonder why does it have to be so silent in this case
21:26 harovali joined #perl6
21:27 gfldex m: my @a; say @a.default;
21:27 camelia rakudo-moar 328402: OUTPUT«(Any)␤»
21:27 gfldex m: my @a; say @a.default = 1;
21:27 camelia rakudo-moar 328402: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at <tmp> line 1␤␤»
21:27 gfldex m: my @a; say @a.default: = 1;
21:27 camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3my @a; say @a.default: =7⏏5 1;␤»
21:27 gfldex m: my @a; @a.default: = 1;
21:27 camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3my @a; @a.default: =7⏏5 1;␤»
21:27 gfldex m: my @a; @a.default(1);
21:27 camelia rakudo-moar 328402: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
21:28 AlexDaniel m: BEGIN { say ‘begin’ }; CHECK { say ‘check’ }; my @a is default(say ‘hello’); say @a[1]
21:28 camelia rakudo-moar 328402: OUTPUT«begin␤hello␤check␤True␤»
21:28 AlexDaniel so if you need a phaser that is should run between BEGIN and CHECK …
21:28 AlexDaniel -is
21:31 gfldex m: my @a is default({1+1}); print @a[0].()
21:31 camelia rakudo-moar 328402: OUTPUT«2»
21:31 gfldex it would be nice to have the closure called automatically
21:32 AlexDaniel gfldex: why make it a closure if you want it to be called?
21:32 AlexDaniel ah, so that it's not compile-time ?
21:37 gfldex yes
21:38 gfldex and call the block with self/value of the container for Array/Scalar
21:39 gfldex that would allow:
21:39 gfldex m: my @a is default({Failure.new("booboo")}); put @a[0];
21:39 camelia rakudo-moar 328402: OUTPUT«Block object coerced to string (please use .gist or .perl to do that)  in block <unit> at <tmp> line 1␤␤»
21:40 gfldex m: my @a is default({Failure.new("booboo")}); put @a[0].();
21:40 camelia rakudo-moar 328402: OUTPUT«booboo␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
21:41 prammer joined #perl6
21:43 avuserow_ joined #perl6
21:45 avuserow_ hi all. are there any cool options for parsing binary files in perl6? I noticed unpack was marked experimental and haven't seen anything about grammars or anything higher level
21:46 dalek perl6-bench: 9769703 | (Steve Mynott)++ | microbenchmarks.pl:
21:46 dalek perl6-bench: post Sep 30 2015 append replaces shift
21:46 dalek perl6-bench: review: https://github.com/japhb/pe​rl6-bench/commit/9769703675
21:46 dalek perl6-bench: 57e34bb | (Steve Mynott)++ | microbenchmarks.pl:
21:46 dalek perl6-bench: lizmat++ fix broken fix
21:46 dalek perl6-bench: review: https://github.com/japhb/pe​rl6-bench/commit/57e34bb522
21:46 dalek perl6-bench: fbee8cb | lizmat++ | microbenchmarks.pl:
21:46 dalek perl6-bench: Merge pull request #26 from stmuk/master
21:46 dalek perl6-bench:
21:46 dalek perl6-bench: post Sep 30 2015 append replaces shift
21:46 dalek perl6-bench: review: https://github.com/japhb/pe​rl6-bench/commit/fbee8cb75a
21:49 mcmillhj joined #perl6
21:53 cpage_ joined #perl6
21:55 brrt avuserow_: it's been talked about, but it isn't really there
21:55 brrt for my part i want erlang style binary pattern matching
22:00 avuserow_ I don't remember that part of erlang but sounds interesting
22:00 avuserow_ thanks brrt
22:00 Sgeo_ joined #perl6
22:00 brrt yw, not sure what for :-)
22:01 avuserow_ responding quickly, thoughts, etc :)
22:02 brrt that's what we're here for
22:02 brrt if not asleep
22:02 brrt speaking of which
22:04 chris2 joined #perl6
22:05 cpage_ joined #perl6
22:06 mcmillhj joined #perl6
22:50 rpburkholder joined #perl6
22:57 jack_rabbit joined #perl6
22:57 cpage_ joined #perl6
23:00 khw joined #perl6
23:04 gfldex lolibloggedalittle https://gfldex.wordpress.com/20​16/08/10/sneaking-into-a-loop/
23:09 labster joined #perl6
23:16 eyck joined #perl6
23:18 brrt gfldex: we don't have string-to-io-handles? :-o
23:18 gfldex brrt: at least I couldn't find any
23:19 khw joined #perl6
23:20 brrt weird
23:20 BinGOs joined #perl6
23:23 gfldex could very well be the restricted setting that camelia is running with. Makes bugs and omissions hard to spot for IRC centric dev folk. :)
23:27 brrt hmm, i don't know either
23:28 pierre_ joined #perl6
23:31 canopus joined #perl6
23:41 gfldex m: my UInt $a = 42; put (+^$a).base(2)
23:41 camelia rakudo-moar 328402: OUTPUT«-101011␤»
23:42 avuserow_ left #perl6
23:44 gfldex i dont't think .base should return a negative number for UInt
23:44 gfldex m: my UInt $a = 42; put (+^$a).fmt('%b')
23:44 camelia rakudo-moar 328402: OUTPUT«-101011␤»
23:47 titsuki_ joined #perl6
23:52 labster joined #perl6

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

Perl 6 | Reference Documentation | Rakudo