»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
timotimo oh god damn it. 00:00
this is pretty bad.
m: 'Hello' ~~ rx:i:m/ Hiyao / 00:01
camelia ( no output )
timotimo m: say 'Hello' ~~ rx:i:m/ Hiyao /
camelia rakudo-moar fb4252: OUTPUT«「Hello」␤»
timotimo ^- literal with ignoremark + ignorecase only checks the very first character ...
TimToady yao indeed 00:02
timotimo i came here to fix something entirely different :|
j: say "hi" 00:03
camelia rakudo-jvm cd19db: OUTPUT«hi␤»
timotimo github.com/perl6/nqp/blob/master/s...#L653-L662 - would have to have a loop, or an entirely different approach 00:03
j: say 'Hello' ~~ rx:i:m/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
timotimo :\ 00:04
no NFG support ...
TEttinger NFG? 00:10
timotimo Normalized Form Grapheme 00:11
though ordbaseat isn't NFG-only 00:12
TEttinger that's... a mouthful
I thought normalization was primarily for diacritics and case folding?
timotimo that's right 00:13
i'd think moarvm learned the ordbaseat instruction at the same time it got NFC, but what do i know :)
TEttinger is this a case folding thing?
timotimo not case folding
ordbaseat gives you the ord of the character that's "minus" all the marks
so a for ä
TEttinger huh, there weren't any marks in that j: command though 00:14
just wondering...
j: say 'Hello' ~~ rx:i/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«Nil␤»
timotimo well, :m is for "ignoremarks"
TEttinger and mark means anything normalization would remove, then, like graves and acutes? 00:15
timotimo normalization doesn't remove graves or acutes
it will re-order them, though
TEttinger j: say 'Hello' ~~ rx:m/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
TEttinger oh yeah, right 00:16
it would take the a with hat and separate it into the ascii a, then the hat
timotimo that depends on what normalization form you're running
there's NFD, which is "decomposed". that one will give you a and the hat
TEttinger that's the one I've used so far 00:17
timotimo NFC, which is "composed", will try to find an a-with-hat in the unicode corpus
AngeloMichael Excuse my naïveté, but what is actually done when the compiler sinks something (and what is that something referred to)?
timotimo the code generator will put calls to the .sink method of things into the code for you
TEttinger AngeloMichael, excused, but chiefly because that is some nice use of diacritics on naïveté
AngeloMichael Haha. Merci. 00:18
timotimo m: Failure.new("hello") 00:19
camelia rakudo-moar fb4252: OUTPUT«hello␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
TEttinger u: exclamation
TimToady effectively, when you sink something, you don't care about the value, you only care about the side effect
timotimo m: my $foo = Failure.new("hello"); say "done"
camelia rakudo-moar fb4252: OUTPUT«done␤»
TimToady so it's sort of the driver of imperative programming
dalek c: 0dc372f | (Eike Frost)++ | doc/Language/typesystem.pod6:
Fix typo (tuested -> trusted)
c: 51db7bf | Altai-man++ | doc/Language/typesystem.pod6:
Merge pull request #829 from eikef/typesystemtypo

Fix typo (tuested -> trusted)
TimToady as opposed to functional programming, which tries to avoid side effects 00:20
and hence tends to avoid semicolons
AngeloMichael Ah, okay; that makes sense. Thanks, TimToady.
TimToady semicolon isn't the only way to get a sink context, but it's the usual way 00:21
m: sub foo() { 42; 43 }
camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
TimToady m: sub foo(--> Nil) { 43 }
camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 43 in sink context (line 1)␤»
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"/
camelia rakudo-moar fb4252: OUTPUT«「All hell is breaking loose」␤»
TimToady TEttinger: well, arguably that's what binding is
unmatched} peels "Production Ready" sticker off the Perl 6 box...
:)
TEttinger m: say "Production Ready" ~~ m:i:m/"Pfft, Not Yet"/ 00:23
camelia rakudo-moar fb4252: OUTPUT«「Production Re」␤»
timotimo unmatched}: do you want to RT it? i haven't done it yet
unmatched} Sure, will do. 00:23
TEttinger m: say "Production Ready" ~~ m:i:m/"Probably fine for lots of uses"/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
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"/
camelia rakudo-moar fb4252: OUTPUT«False␤»
TEttinger interesting
m: say "Production Ready" ~~ m:i:m/"\bProduction Ready"/ 00:25
camelia rakudo-moar fb4252: OUTPUT«False␤»
timotimo it's too long
TEttinger m: say "Production Ready" ~~ m:i/"\bProduction Ready"/
camelia rakudo-moar fb4252: OUTPUT«False␤»
TEttinger isn't \b boundary?
timotimo not inside ""
TEttinger ??? 00:26
unmatched} Done: rt.perl.org/Ticket/Display.html?id=128875
TEttinger m: say "Production Ready" ~~ m:i/\bProduction Ready/
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…»
unmatched} m: say "Production Ready" ~~ m:i/\b 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«False␤»
unmatched} m: say "Production Ready" ~~ m:i/<< 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
TEttinger m: say "Production Ready" ~~ m:i:m/<< 'Production Ready'/ 00:27
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
timotimo not sure what \b means in our regex syntax
TEttinger neat
m: say "Production Ready" ~~ rx:i:m/<< 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
TEttinger so it correctly treats zero-length stuff as not changing the first letter
m: say "Production Ready" ~~ rx:i:m/<< 'Production Readier'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
timotimo um ... of course it does? 00:29
it's about every single literal you can find
12.82user 0.68system 0:13.51elapsed 99%CPU (0avgtext+0avgdata 2647752maxresident)k 00:31
^- used to be
0.34user 0.02system 0:00.36elapsed 99%CPU (0avgtext+0avgdata 82720maxresident)k 00:32
^- now is
actually ... used to be worse, i think.
let me check.
nah, used to be exactly that much 00:35
which makes me wonder why my first optimization attempt yielded no benefit at all ...
timotimo when it should have reduced the amount of lc calls by a whole lot ... 00:35
maybe we ought to implement an op in moarvm that strips a character of all marks and returns the stripped result 00:37
timotimo fires up his slightly more beefy desktop for a spec test run 00:40
um ... can't reach it 00:42
hack it is, then.
ugh. make test would have already shown my code to be broken 00:44
good thing at this time of day people don't tend to be building perl6 00:51
i have a bad history of not testing before i push; when will i learn? >:( 00:54
timotimo ah, just a silly mistake i made 00:55
timotimo right. my thing is still wrong 00:59
i'd need an ifnull for the lc-ing ... 01:00
makes me wonder why it didn't fail "make test" locally 01:03
tonight is the night timo talks to himself a lot
gfldex wut? 01:04
timotimo well, nobody engages me in this discussion :P
so i just use the open IRC channel as a rubber duckie
timotimo so, how are you doin, gfldex? 01:05
unmatched} *crickets* 01:05
:D
gfldex i'm a wee bit dreaded by the perspective to write a complete description of class 01:06
timotimo oh, really? 01:07
that seems like biting off a lot at once
unmatched}: are you glad i made your shit faster, now that you've replaced it with other shit? :) 01:08
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 } }␤»
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> $?CLASS){ self } }
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 } }␤»
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> C:D){ self } }
camelia ( no output )
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS){ self } } 01:10
camelia ( no output )
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS:D){ self } }
camelia ( no output )
unmatched} timotimo: I'm so drunk, I can barely read... so... Sure, I'm ghlad of any improvement :D
m: say class {} ~~ Any 01:11
camelia rakudo-moar fb4252: OUTPUT«True␤»
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
unmatched}
.oO( my code?? )
the bug about the m:i// on huge text?
timotimo m: say "and the memory usage is down to { 8272000 / 2647752 }% of what it used to be"
camelia rakudo-moar fb4252: OUTPUT«and the memory usage is down to 3.1241597% of what it used to be␤»
timotimo yes, that one
unmatched} timotimo++ fixing things
gfldex m: class C is Any { has Any $.attr = Any; only method foo(*%_ --> ::?CLASS:D){ self } } 01:12
camelia ( no output )
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 ( no output )
timotimo ah, i *thought* it was something with :: at the beginning
gfldex i think that's all the defaults for a very simple class. Whereby the return type constraint is not really there ofc. 01:14
timotimo hum. i wonder ... S05-modifier perl5_5 has a bit of b0rkage 01:20
why? >:( 01:21
the output from these tests is really not helpful 01:22
timotimo i can't tell why it's not matching there :\ 01:35
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␤ …»
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.03,2016.04,2016.05,2016.06,2016.07,HEAD»: 「All hell is breaking loose」
AlexDaniel well, that's unfortunate 03:09
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␤»
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( \S /{ ~$/.uc }/; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
lucs TimToady: Oh, thanks. 03:11
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = ~$/.uc; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = $/.uc; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
lucs You wear your nick well :)
TimToady :)
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␤»
lucs Hmm, that too right, of course (I may have overthought my regex), but your examples are instructive. 03:18
lucs didn't know about (or probably forgot about) the s {⋯} = ⋯ form. 03:22
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␤»
TimToady aww
lucs :) 03:39
TimToady finds it odd that that doesn't parse 03:42
TEttinger what is .= ? 03:43
AlexDaniel m: my $x = ‘foo bar’; $x ~~ s:g{foo} = ‘bar’; say $x 03:44
camelia rakudo-moar fb4252: OUTPUT«bar bar␤»
AlexDaniel m: my $x = ‘hello’; $x = $x.us; say $x
camelia rakudo-moar fb4252: OUTPUT«Method 'us' not found for invocant of class 'Str'␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: my $x = ‘hello’; $x = $x.uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
AlexDaniel m: my $x = ‘hello’; $x = $x . uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
AlexDaniel m: my $x = ‘hello’; $x .= uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
TimToady m: my $x = ‘foo bar’; $x ~~ s:g{foo} ~= ‘bar’; say $x
camelia rakudo-moar fb4252: OUTPUT«foobar bar␤»
TimToady the ~= works... 03:45
lucs TEttinger: It's kind of like += : 「$x .= foo」 -> 「$x = $x.foo」 03:46
TEttinger nice
good thing to have 03:47
TimToady most often you see: my Foo $x .= new; 03:48
AlexDaniel TEttinger: basically any infix operator can be used like this 03:49
but I know it sounds weird that . is an infix op…
TimToady well, not if the type is too different
AlexDaniel right 03:50
TimToady m: my $x = 42; $x [>]= 41; say $x
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␤»
TimToady but that's why we made min and max into infixes 03:51
m: my $x = 42; $x min= 41; say $x
camelia rakudo-moar fb4252: OUTPUT«41␤»
TimToady m: my $x = 42; $x gcd= 120; say $x 03:53
camelia rakudo-moar fb4252: OUTPUT«6␤»
TimToady same reasoning there
BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1; 04:15
camelia ( no output )
BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1; say @a; 04:16
camelia rakudo-moar fb4252: OUTPUT«[1]␤»
BenGoldberg m: my @a = 3, 5, 10; @a gcd= slip; say @a;
camelia rakudo-moar fb4252: OUTPUT«[3]␤»
BenGoldberg m: my @a = 3, 5, 10; @a max= slip; say @a;
camelia rakudo-moar fb4252: OUTPUT«[3 5 10]␤»
TimToady m: my @a = 3, 5, 10; say [gcd] @a
camelia rakudo-moar fb4252: OUTPUT«1␤»
TimToady m: my @a = 3, 5, 10; say [lcm] @a
camelia rakudo-moar fb4252: OUTPUT«30␤»
BenGoldberg m: my @a = 3, 5, 10; @a .= max; say @a;
camelia rakudo-moar fb4252: OUTPUT«[10]␤»
TimToady that's a little bizarre 04:17
BenGoldberg Not really unexpected, though.
TimToady it's odd to want to put it back into the array though 04:18
BenGoldberg True :)
AlexDaniel m: my @a = 3, 5, 10; @a .= @a
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␤␤»
AlexDaniel did I forget a ‘multi’? ;) 04:19
BenGoldberg You forgot a method
AlexDaniel that's right :)
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␤␤»
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␤␤»
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;␤»
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 ();␤»
BenGoldberg m: my $str = 'chars'; $str .= "$str"();
camelia ( no output )
BenGoldberg m: my $str = 'chars'; say $str .= "$str"();
camelia rakudo-moar fb4252: OUTPUT«5␤»
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>␤»
TimToady it's not a real operator, quite 04:27
AngeloMichael TIL the blue streaks in Camelia's wings are 6s... 05:31
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.
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:35
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:09
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
very politely!
arrojo89 hello all ! 07:15
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);
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␤»
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␤»
arrojo89 m: say for 1..30
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…»
arrojo89 m: .say for 1..30
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␤»
arrojo89 why with the dot AlexDaniel ?
AlexDaniel arrojo89: everything has a method .say, so you can do $_.say 07:20
m: $_.say for 1..30
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␤»
AlexDaniel arrojo89: but you can omit $_ in this case because it is very common
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:21
arrojo89 ok thanks AlexDaniel 07:22
dalek line-Perl5: b2dda91 | niner++ | / (2 files):
Fix memory corruption when multiple interpreters are used

Re-ordering of the includes in p5helper.c made memory corruptions surface that should have been there all along. While we did call PERL_SET_CONTEXT as preparation for calling into the Perl 5 interpreter, we did so only after already making calls like newAV() in a bogus attempt to stick to C89 rules of keeping declarations before statements. Fix by moving the PERL_SET_CONTEXT call to the very first line of each function it occurs in.
07:46
lizmat clickbaits p6weekly.wordpress.com/2016/08/08/...uiet-week/ 08:04
gregf_ *holidays* 08:59
Skarsnik hello 09:27
DrForr Afternoon, Skarsnik. 09:34
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 gist.github.com/anonymous/6b244812...5b332f22a1 09:38
nine Skarsnik: the line numbers in your trace are way off. You sure you pasted the whole files? 09:42
Ah, just saw the # line 24 comment
Skarsnik btw hello nine, Are you done with the pre comp hell finally? :) 09:56
nine Skarsnik: I dare not say "done", but the dust seems to settle. 09:58
Skarsnik It can be 'system wide' finally? or it's still by users? 09:59
jnthn Wouldn't it be "both" since users can always install modules locally as well as system wide? 10:02
nine jnthn: true 10:04
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 :)
Skarsnik Nice :) 10:05
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:06
RabidGravy boom! 10:07
Skarsnik nice :) 10:07
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:09
Ulti whoa my bioinformatics tests are now down to 1.26s 10:21
RabidGravy yay!
where did they start?
Ulti two years ago 36s
6 months ago 10s
RabidGravy excellent stuff
Ulti something like that 10:22
jnthn How fast is fast enough? :)
Ulti depends
this is now fast enough for little things for sure
RabidGravy www.brewerydb.com/developers
Ulti for more realistic bioinformatics loads an order of magnitude :( but really I have got *bad* Perl 6 code here
I haven't changed it in years just so I could benchmark
Ulti I only updated for GLR and the hash/bag equivalent 10:23
stmuk media.ccc.de/v/emf2016-269-beer-for-everyone
Ulti I could probably get a lot of speedup just optimising my own code and finding more optimised routes through Rakudo
that I haven't and I've got like a 30x speedup is kind of amazing
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 :)
Ulti also the reality is bioinformatics libraries everywhere else tend to wrap C to get the perf 10:26
and Perl 6 does make that easier than most languages
jnthn How parallelizable are bioinformatics algorithms, generally? 10:27
stmuk I don't suppose anyone knows (roughly) when perl6-bench last ran 100%?
jnthn stmuk: 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
Ulti jnthn generally highly parallelizable
but more importantly they are trivially parallelizable usually on the outside of data you are reading 10:29
so you are doing the same thing for a billion objects rather than having lots of internal parallelism to your algorithm
jnthn Aha.
Ulti IO and memory performance is really the actual bottle neck
for some reason everyone in bioinformatics has a preference for awful text formats that are hugely bloated 10:31
so fast parsers make the difference nearly always
fairly sure if grammars got faster that would be the big thing for me now
or really the main thing is being able to define a token that the grammar can parallelize around would be amazing 10:32
I've sort of done that myself badly
so you read a chunk of file you know to split on to then parse
and you can parse in parallel if your read all those chunks quickly 10:33
not sure how grammars .parse is implemented but that did make a difference if I did that
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:36
arrojo89 is there a way to convert perl scripts into exe ? 10:39
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
DrForr Ah, cool.
Ulti --target=jar iirc 10:44
RabidGravy jnthn, I was just pointed at untappd.com/api/docs as well
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:45
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
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
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
jnthn Ulti: Thing is, you'd kinda like the results back incrementally too 10:49
Ulti: Not a single huge match object at the end.
Ulti: Or I'd guess that's what you'd want anyway
DrForr People don't "assess" languages or products anymore, they just assuem the top hit on Google is the best.
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
Ulti then react whenever
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"
jnthn Oh, that old chessnut :P
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:51
unmatched} :)
jnthn Ulti: Well, that could be a method required by the role :)
I don't think this needs meta-programming to solve though
Just a nicely designed role
Ulti unmatched}: this is the author www.linkedin.com/in/ubereng 10:52
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:54
Ulti wasnt there chat of having a Slang which kept actions and grammar rules declaratively together at one point? 10:55
RabidGravy can you have traits on grammars and their constituent parts? 10:55
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
*spurt 10:57
*slurp
Ulti you could have a trait for TOP where you have multiple concurrent routes through the grammar and they race to match :)
jnthn andreoss: So...why not use qx? :) 10:59
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␤␤»
jnthn You'd need qqx to interpolate, I think
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
jnthn: a function would be better with .map 11:03
unmatched} Ulti: author of what? I don't have LinkedIn 12:09
unmatched} gifts TEttinger a new router 12:13
m: say "[foo" ~~ /"[" ~ "]" \w+/ 12:14
camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
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
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」 irclog.perlgeek.de/perl6/2016-08-06#i_12978231
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…»
lambd0x lol :)
ilmari shiny :)
lambd0x ilmari: Do you know how to read just a word or a sigle number from a file? 12:18
unmatched} m: say $*IN.words[0] 12:19
camelia rakudo-moar ddcbae: OUTPUT«Céad␤»
unmatched} m: say $*IN.words.grep(/^\d+$/)[0] 12:20
camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
unmatched} m: say $*IN.words.grep(/^D/)[0]
camelia rakudo-moar ddcbae: OUTPUT«Dhún␤»
lambd0x unmatched}: but doesn't that give you the first line?
unmatched}: ah
unmatched} It gives you first word from the first line
m: say $*IN.lines[1].words[0] 12:21
camelia rakudo-moar ddcbae: OUTPUT«Agus␤»
unmatched} ^ first word from second line
ilmari m: say $*IN.lines.is-lazy
camelia rakudo-moar ddcbae: OUTPUT«False␤»
ilmari huh, I'd have expected that to be True
lizmat hmmm.... that should be True
unmatched} That seems to be a bug
lizmat checks
ilmari m: say $*IN.words.is-lazy 12:22
camelia rakudo-moar ddcbae: OUTPUT«False␤»
lambd0x unmatched}: nice so words works like lines \o/
unmatched}: didn't noticed that earlier, thanks you.
*notice.
unmatched}
.oO( or do lines work like words :o )
m: say $*IN.lines[1].words[2].comb[3] 12:23
camelia rakudo-moar ddcbae: OUTPUT«a␤»
unmatched} 4th letter of 3rd word on 2nd line :)
s/letter/character/;
ilmari m: $*IN.WHAT.say
camelia rakudo-moar ddcbae: OUTPUT«(Handle)␤»
ilmari m: $*IN.lines.WHAT.say 12:24
camelia rakudo-moar ddcbae: OUTPUT«(Seq)␤»
jnthn lizmat: .lines.is-lazy being False is likely correct 12:25
lizmat: Because my @lines = $*IN.lines; probably wants to be eager by default
lizmat @a.STORE is eager afaik
unmatched} How come? It does read lazily
lizmat but for $*IN.lines -> $line { } would be lazy 12:26
ilmari github.com/rakudo/rakudo/blob/nom/...le.pm#L568 # looks lazy to me
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 :)
lizmat looks like it's just a matter of forgetting an "is-lazy" method in the iterator 12:27
jnthn unmatched}: That isn't what is-lazy means though. 12:28
AlexDaniel “How fast is fast enough?” – it is never fast enough
lizmat is confused now
unmatched} jnthn: oh, I thought it did 12:29
lizmat hopes for a TIL moment
jnthn No, it means "we *must* never try to evaluate more than the user absolutely asks for"
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
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
this is the description in Iterator.pm
lizmat hmmm.. quite some spectest fallout with .lines / .words being lazy 12:33
dalek ecs: 2e72b5d | (Zoffix Znet)++ | html/perl-with-historical-message.css:
Display historical message based on <body> and not <html>

Fixes rendering issues on rekonq
12:36
jnthn lizmat: I figured so. Which means it'll break a bunch of real world code too I'd guess 12:39
moritz so, something for v6.d? 12:41
lizmat moritz: why ? 12:42
moritz lizmat: becaues it breaks a bunch of real world code
lizmat yeah, but I guess jnthn's point was that we *shouldn't* do this in the first place, in any version :-)
moritz still, that's what stability means 12:43
that we don't break user's code
do we have a document yet with plans for v6.d? 12:44
jnthn Yeah, I don't think we want to change it at all :) 12:46
Ulti unmatched}: the quote from zoffix was a quote of a blog online not zoffix 12:56
andreoss qx seems to be broken on windows 12:57
cannot handle non-ascii characters
paste.debian.net/787615/
unmatched} Ulti: ah, damn, just when I started to think Zoffix was an asshole :) 12:59
unmatched} snickers
Ulti: it's actually from someone Tweeting: twitter.com/imansaripk/status/7574...7192769536
[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
(-> -dev)
RabidGravy unmatched}, I don't know where to start: "pearl", numerology, "scripting" - I think the persons opinion can be disregarded 13:03
unmatched} I'd aim for "corrected" rather than disregarded :) I did find it by searching for "Perl 6" on Twitter, after all. 13:06
w4and0er96 php6 ? where? XD 13:09
andreoss it occurs with code page 866, works okay with 65001 13:09
should it work with 866 too?
unmatched} What's 866, Latin-1 or something? 13:11
andreoss cyrillic
unmatched} Oh
RabidGravy but it's similar to latin-1 in that it's ascii with additional high characters 13:13
unmatched} My guess would be say qx`echo абвг` gives абвг in utf-8; so that's why it works under utf cp 13:15
I recall seeing some RT ticket about printing unicode 13:16
buggable: rt
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: bug.perl6.party/1470748600.html 13:16
unmatched} This one: rt.perl.org/Ticket/Display.html?id...et-history maybe there's some relevance 13:17
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:22
*sigh*
being a critic is one thing, but just spreading old hate is lame
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:22
RabidGravy big jumps get attention :) 13:24
Ulti yup 13:26
dalek ecs: 899560e | moritz++ | v6d.pod:
Add v6d.pod, a place to track proposed language changes for v6.d
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
well with DBIish
but all the asynch is just primitives that /just work/ in a couple of lines
andreoss Proc.run doesn't work either with 866, throws Malformed UTF-8 13:29
dvh Hello there! 13:30
RabidGravy yeah because it isn't utf-8 13:30
dvh m: say 'hello' 13:31
camelia rakudo-moar e1205c: OUTPUT«hello␤»
moritz andreoss: you can pass :bin to Proc.run
andreoss: or specify an encodingwith :enc
docs.perl6.org/type/Proc
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 type 13:37
andreoss moritz: is there a list of encodings known to perl 6? 13:38
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␤␤»
unmatched} dvh: look up Junctions for that
huggable: Junction
huggable unmatched}, Logical superposition of values: docs.perl6.org/type/Junction
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 docs.perl6.org instead
ilmari m: "foo".encode(encoding => 'iso-8859-5') 13:40
camelia ( no output )
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)
ilmari m: say "foo".encode(encoding => 'iso-8859-5')
camelia rakudo-moar e1205c: OUTPUT«utf8:0x<66 6f 6f>␤»
dvh I'll read that, thanks.
ilmari m: say "€".encode(encoding => 'iso-8859-9')
camelia rakudo-moar e1205c: OUTPUT«utf8:0x<e2 82 ac>␤»
nine dvh: there is no difference at all between types that are built-in and custom types
unmatched} dvh: this may be a bit useful: perl6.party/post/Perl-6-Types--Made-for-Humans 13:41
ilmari m: say "€".encode('iso-8859-9')
camelia rakudo-moar e1205c: OUTPUT«Unknown string encoding: 'iso-8859-9'␤ in block <unit> at <tmp> line 1␤␤»
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.
unmatched} m: subset Prime of Int where .is-prime; say $_ ~~ Prime for 2, 6, 7 13:42
camelia rakudo-moar e1205c: OUTPUT«True␤False␤True␤»
andreoss ilmari: i got Unknown string encoding iso-8859-5 on Windows
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.
ilmari andreoss: github.com/moarvm/moarvm/blob/mast...ps.c#L1716 13:43
andreoss ilmari: that's sad 13:44
unmatched} dvh: works fine for me. You can read the site's source on GitHub: github.com/zoffixznet/perl6.party/...-Humans.md
jnthn andreoss: Patches welcome. ;)
dvh unmatched}: I've already found the article with this name, thanks. Reading it right now. 13:45
RabidGravy alternative is to add the encodings you want to the github.com/sergot/perl6-encode 13:46
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
dvh Fox example, one can match a list this way: sub ([$x, $y, *@rest]). 14:02
ugexe create a role with the appropriate ACCEPTS? 14:03
dalek ecs: ce29255 | (Zoffix Znet)++ | v6d.pod:
Add: Signature/Attribute Defaults Based on Definedness
jnthn You can unpack an object using named parameters, e.g. sub ((:$x, :$y, *%rest)) 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:05
(If the default behavior isn't good enough) 14:06
RabidGravy Ooh I didn't know that :)
RabidGravy (learn something new every day,) 14:07
dvh jnthn: Thank you, that's enlightening! 14:08
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
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?
ugexe also rosetta code
dvh Now I've read the examples and I think I understand it. Thank you everyone, your explanations are appreciated! 14:19
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
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:23
I guess DOM manipulation is the closest I've ever come 14:24
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.
Ulti oh :(
why
did I smell
maybe they will read the logs...
sena_kun Ulti, in haskell land pattern matching is almost everywhere.
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 :)
Ulti true enough 14:27
but again thats quite a specific example
if its everywhere in the language that means it has some deeper necessity to it
like how hashes are everywhere in Perl 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
sena_kun But I'm not a pro in haskell. 14:29
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:30
sena_kun It mostly defines behavior, not structure. 14:31
Ulti guess I need to see some examples
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
sena_kun Ulti, www.willamette.edu/~fruehr/haskell/...ution.html - see third and fourth examples.
Ulti, is there any pattern matching other than this? I yes, I want to know more about it. 14:33
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.
Ulti vvv.tobiassjosten.net/haskell/facto...n-haskell/ <--- the pattern matching thing there is literally just multi dispatch and recursion in Perl and plenty of other languages 14:41
Ulti I think Haskell might just have a load of maths people naming things :P 14:41
multi dispatch is essentially pattern matching though 14:42
moritz it's not a bad name
Ulti especially the more advanced kind found in P6
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.
sena_kun Correct me if I'm wrong here. 14:43
*value
unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo 1; foo 0
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␤␤»
unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo True; foo False
camelia rakudo-moar 9e497c: OUTPUT«tis a true␤tis a true␤»
unmatched} :S 14:44
sena_kun Wow. Cool.
jnthn True as a smart-match always matches....
But yeah, you can match values
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
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␤»
unmatched} bah
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␤»
unmatched} Third time a charm
sena_kun jnthn, if you can match values and deconstruct data structures, then Perl 6 has pattern mathing, obviously(which is good).
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␤»
sena_kun How can I take first two elements of a list in a signature, btw?
Or just first. 14:47
jnthn m: sub foo([$a, $b, *@]) { say $a; say $b } foo([1..10])
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…»
jnthn m: sub foo([$a, $b, *@]) { say $a; say $b }; foo([1..10])
camelia rakudo-moar 9e497c: OUTPUT«1␤2␤»
sena_kun jnthn, neat. Thanks for your example.
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:48
camelia rakudo-moar 9e497c: OUTPUT«tis a foo prime␤tis meow not a prime␤»
unmatched} \o/
ugexe Does that differ `sub foo(@ ($a, $b, *@)) {}`? 14:48
jnthn No 14:49
ugexe or is that so you can still name the overall capture
jnthn The [...] just puts a Positional constraint on the parameter 14:49
Otherwise it works just like (...)
ugexe ah, didnt know sub foo(@all [$a, $b, *@]) worked the same 14:51
unmatched} m: sub factorial {[*] 1..$^a}; say factorial $_ for ^10;
camelia rakudo-moar 9e497c: OUTPUT«1␤1␤2␤6␤24␤120␤720␤5040␤40320␤362880␤»
b2gills say +permutations $_ for ^10 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␤»
hoelzro o/ #perl6 15:05
[Coke] hio
hoelzro o/ [Coke] 15:06
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: goo.gl/forms/Fi6YQcv6c9BJ86A43 15:07
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:09
hoelzro b2gills: I didn't know Perl5 was ever on perforce...I'll do that if I can figure out who it was! 15:17
unmatched} b2gills++ 15:25
RabidGravy and I think it was in CVS before that 15:51
Skarsnik hm, why panda is not installed aside the perl6 bin btw? instead of prefix/perl6/site/... 16:02
unmatched} m: say [\*] 1..10 16:16
camelia rakudo-moar 9e497c: OUTPUT«(1 2 6 24 120 720 5040 40320 362880 3628800)␤»
gregf_ m: say [*] 1..10 16:21
camelia rakudo-moar 9e497c: OUTPUT«3628800␤»
edwinsage Is there a p6 construct like the p5 diamond <> ? 16:47
hoelzro edwinsage: you probably want some form of lines() 16:48
gfldex m: for lines { .say }
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>␤␤»
gfldex m: for lines() { .say }
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…»
edwinsage But does that automatically open files listed on the command line, or fallback to STDIN? 16:51
unmatched} edwinsage: no 16:52
edwinsage That's what I'm looking for.
hoelzro then you want $*ARGFILES
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."?"
edwinsage Ok, I'm seeing how that works. 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:58
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␤»
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…»
unmatched} m: lines.join.words.BagHash.say
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'é,…»
edwinsage The error output for a missing file is a lot more verbose, though.
unmatched} edwinsage: ^ something like that
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…»
gfldex m: my \term:«<>» := {lines()}(); while <> { .say }
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 }
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…»
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 }␤»
unmatched} m: lines.join.words.Bag.sort(:by(*.value)).fmt("%10s => %3d\n").say
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, =>…»
unmatched} kinda expected that to get sorted by value :/
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␤ …»
TimToady why lines.join instead of slurp?
TimToady and you can sort on -*.value instead of reverse 17:08
unmatched} 'cause I don't read documentation :)
I know it looks like I know how to program sometimes, but it's all an illusion :) I merely parrot things I see
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␤ …»
unmatched} TimToady++
[Coke] PARROT! GET IT! 17:12
unmatched} Where? WHERE? 17:13
Fetch the net!
gregf_ nah, theres no more birds left.. its a camelia now ;) 17:21
hankache hello #perl6 17:22
unmatched} \o
hankache ohai zoffix
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␤»
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␤␤»
gfldex m: $*IN = <peter paul marry> but role { method slurp-rest { self.Str } }; for slurp() { .say }
camelia rakudo-moar 9e497c: OUTPUT«peter paul marry␤»
unmatched} m: say 2 + 2; CHECK my &infix:<+> = { $^a - $^b }; say 2 + 2 17:27
camelia rakudo-moar 9e497c: OUTPUT«0␤0␤»
unmatched} How come this produces zeros? I expected it to run "at run time as late as possible" 17:28
unmatched} Oh. I need coffee.. it's at *compile* time as late as possible >_<> 17:29
timotimo oh, Skarsnik is back! :) 17:30
unmatched} m: role Foo { COMPOSE { say "meow" } }; class Bar does Foo {} ;
camelia ( no output )
Skarsnik Hello timotimo 17:31
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:33
Yes, it's me
timotimo neat
Skarsnik Where did you see me? x)
timotimo i forgot 17:34
Skarsnik a speedrunner stream? x) 17:35
Not sure how it's relevant gist.github.com/anonymous/4ecd00e8...b8d7f3980d 17:37
timotimo speedrunner stream seems likely; perhaps metasigma? 17:38
Skarsnik Oh maybe
I am not often on his stream now. He had a bad attitude toward the WR holder of SoE for while 17:39
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)␤»
unmatched} m: say "hi"
camelia rakudo-moar 9e497c: OUTPUT«hi␤»
rangolaf m: say "hi"; 17:50
camelia rakudo-moar 9e497c: OUTPUT«hi␤»
rangolaf m: print "hi";
camelia rakudo-moar 9e497c: OUTPUT«hi»
unmatched} You can also /msg camelia m: say "Hi"; 17:50
rangolaf oh thanks 17:51
my bad for using pub chan
unmatched} Not a problem :) 17:52
unmatched} m: say "foo" ~~ /<!ww>+/ 17:59
wwweeeeeeeeeeeeeeeee :)
camelia rakudo-moar 9e497c: OUTPUT«Memory allocation failed; could not allocate 978223104 bytes␤» 18:00
unmatched} What's <!ww> ?
unmatched} Ah "# only match when not within a word" 18:00
timotimo "is this between two different characters?" basically 18:01
oh
unmatched} Well, that's the comment in the example on docs.perl6.org/language/regexes
timotimo so what's the one that'll match if the cursor is between two identical characters?
unmatched} "negated "within word" assertion"
timotimo m: say "foo" ~~ /<ww>./ 18:02
camelia rakudo-moar 9e497c: OUTPUT«「o」␤ ww => 「」␤»
timotimo m: say "asdf" ~~ /<ww>./
camelia rakudo-moar 9e497c: OUTPUT«「s」␤ ww => 「」␤»
timotimo hm, ok
unmatched} m: say "foo" ~~ /<!ww>./
camelia rakudo-moar 9e497c: OUTPUT«「f」␤»
unmatched} neat
dalek c: 80c9b69 | (Zoffix Znet)++ | doc/Language/glossary.pod6:
Improve QAST

Fix broken link. Explain what Q stands for.
18:21
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:48
I think it was about 10 minutes that I was trying to figure out why $line was an Seq and not a string. 18:49
TimToady harmil_wk: not sure how we could help much with that failure mode 18:59
harmil_wk Me either. It's just frustrating. Perhaps you could check $*USER.is-stupid? 19:00
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:01
harmil_wk perl6 --go-home-youre-drunk 19:02
moritz
.oO( You're well past the Ballmer peak )
19:03
TimToady harmil_wk: that doesn't help if you're already home and drunk 19:08
harmil_wk TimToady: I'd call that a race condition, but you'd be in no condition to race 19:13
perlpilot
.oO( race to the bottom? )
19:15
dalek c: aa997c4 | (Bill Barry)++ | doc/Language/traps.pod6:
Update traps.pod6

syntax error, missing ')'
19:36
c: d8c638c | Altai-man++ | doc/Language/traps.pod6:
Merge pull request #830 from bbarry/patch-1

Update traps.pod6
dalek c: 0df7524 | Altai-man++ | doc/Type/IO/ (9 files):
Make examples compile. Use table instead of code block for IO::Path. Fix and update signatures, add some examples.
20:20
mr-foobar what is the perl6 equivalent of do "file.pl" ? 20:24
hoelzro mr-foobar: EVALFILE, iirc 20:25
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␤»
AlexDaniel mr-foobar: by the way, we have special doc files for that: docs.perl6.org/language/5to6-perlfunc#do 20:29
mr-foobar sweet thx ! 20:30
dalek c: dc95d9c | (Wenzel P. P. Peppmeyer)++ | doc/Language/variables.pod6:
better example for anon state scalar
20:34
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
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
brrt .tell masak i'd like to discuss macros some time in the future
yoleaux brrt: I'll pass your message to masak.
mr-foobar timotimo: there is a noticable lag when I am using it in a forever loop. 20:48
timotimo perl6 isn't the fastest 20:49
geekosaur suspects that adding an external module would not be faster than a builtin 20:50
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 20:59
which should avoid drift 21:00
mr-foobar here is the gist -- gist.github.com/harsha-mudi/f8506e...88356546af 21:02
ugexe m: for (0..*) { last if $_ > 10000; sleep(0.0001); }; say time - INIT { time }
camelia rakudo-moar 328402: OUTPUT«2␤» 21:03
AlexDaniel committable: HEAD Supply.interval(0.1).tap({say now}); sleep 20
committable AlexDaniel: gist.github.com/21613554f54784f450...26cd47a5fe
mr-foobar I am trying to write code which triggers midi events.
AlexDaniel it does drift.
ugexe why are you using Thread.new?
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.
ugexe have you seen docs.perl6.org/language/concurrency ? 21:05
AlexDaniel m: Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞ 21:06
oops
committable: HEAD Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞
committable AlexDaniel: gist.github.com/b5375dfa4f5c4465cd...7e362f7688
camelia rakudo-moar 328402: OUTPUT«(timeout)0.01948394␤0.01860007␤0.01871150␤0.018810360␤0.01893974␤0.01908832␤0.01919740␤0.019327999␤0.01943767␤0.019563883␤0.01970479␤0.019851825␤0.019975939␤0.020085140␤0.020210911␤0.020317997␤0.020463765␤0.020563204␤0.0…»
AlexDaniel sooo… why? 21:07
ugexe your lag is almost certainly from EVALFILE 21:07
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…»
gfldex is there a way to set the default of a container without a declarator?
AlexDaniel m: sub f(@a = [42,69]){ say @a[1]}; f # ? 21:10
camelia rakudo-moar 328402: OUTPUT«69␤»
AlexDaniel aahh 21:11
no
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;␤»
AlexDaniel gfldex: interestingly, it looks like I was trying to get it to work too: irclog.perlgeek.de/perl6/2016-05-26#i_12552791 21:16
not sure why though
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␤»
gfldex AlexDaniel: ^^^
AlexDaniel oh well…
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␤␤»
mr-foobar here is an audio sample of the output clyp.it/bmyfclu0
I tried removing the thread .. still the same.
gfldex m: my @a; trait_mod:<is>(@a.VAR, 1, :default); 21:21
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!)␤ …»
gfldex the trait is defined for Variable:D
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]
camelia rakudo-moar 328402: OUTPUT«(Any)␤»
AlexDaniel ↑ well, um… uh?
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
gfldex m: my @a; say @a.default; 21:27
camelia rakudo-moar 328402: OUTPUT«(Any)␤»
gfldex m: my @a; say @a.default = 1;
camelia rakudo-moar 328402: OUTPUT«Cannot modify an immutable Any␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: my @a; say @a.default: = 1;
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;␤»
gfldex m: my @a; @a.default: = 1;
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;␤»
gfldex m: my @a; @a.default(1);
camelia rakudo-moar 328402: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at <tmp> line 1␤␤»
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␤»
AlexDaniel so if you need a phaser that is should run between BEGIN and CHECK …
-is
gfldex m: my @a is default({1+1}); print @a[0].() 21:31
camelia rakudo-moar 328402: OUTPUT«2»
gfldex it would be nice to have the closure called automatically
AlexDaniel gfldex: why make it a closure if you want it to be called? 21:32
ah, so that it's not compile-time ?
gfldex yes 21:37
and call the block with self/value of the container for Array/Scalar 21:38
that would allow: 21:39
m: my @a is default({Failure.new("booboo")}); put @a[0];
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␤␤»
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␤␤»
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:45
dalek rl6-bench: 9769703 | (Steve Mynott)++ | microbenchmarks.pl:
post Sep 30 2015 append replaces shift
21:46
rl6-bench: 57e34bb | (Steve Mynott)++ | microbenchmarks.pl:
lizmat++ fix broken fix
rl6-bench: fbee8cb | lizmat++ | microbenchmarks.pl:
Merge pull request #26 from stmuk/master

post Sep 30 2015 append replaces shift
brrt avuserow_: it's been talked about, but it isn't really there 21:55
for my part i want erlang style binary pattern matching 21:56
avuserow_ I don't remember that part of erlang but sounds interesting 22:00
thanks brrt
brrt yw, not sure what for :-) 22:01
avuserow_ responding quickly, thoughts, etc :)
brrt that's what we're here for 22:02
if not asleep
speaking of which
gfldex lolibloggedalittle gfldex.wordpress.com/2016/08/10/sn...to-a-loop/ 23:04
brrt gfldex: we don't have string-to-io-handles? :-o 23:18
gfldex brrt: at least I couldn't find any
brrt weird 23:20
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:23
brrt hmm, i don't know either 23:28
gfldex m: my UInt $a = 42; put (+^$a).base(2) 23:41
camelia rakudo-moar 328402: OUTPUT«-101011␤»
gfldex i dont't think .base should return a negative number for UInt 23:44
m: my UInt $a = 42; put (+^$a).fmt('%b') 23:45
camelia rakudo-moar 328402: OUTPUT«-101011␤»