»ö« 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.
Zoffix . 00:08
.tell melezhik your attempt to gather captures may be hindered with what I think is a bug: irclog.perlgeek.de/perl6/2016-09-15#i_13212176 00:09
yoleaux Zoffix: I'll pass your message to melezhik.
Zoffix m: my $m = 'a 123' ~~ /(\d\d\d)/; dd [$m.list];
camelia rakudo-moar 2c95f7: OUTPUT«[Match.new(ast => Any, list => (), hash => Map.new(()), orig => "a 123", to => 5, from => 2)]␤»
Zoffix m: my $input = '(\d\d\d)'; my $m = 'a 123' ~~ /<$input>/; dd [$m.list];
camelia rakudo-moar 2c95f7: OUTPUT«[]␤»
Zoffix RT: rt.perl.org/Ticket/Display.html?id=129271 00:11
ugexe m: my $input = q|(\d\d\d)|; my $rx = rx/<$input>/; my $m = "a 123 456" ~~ m:g/$rx/; dd [$m.list>>.Str]; 00:17
camelia rakudo-moar 2c95f7: OUTPUT«["123", "456"]␤»
awwaiid I've arrived in STL for StrangeLoop! 00:51
tailgate is there a difference between the different ways you mar a function's return type? 01:06
i.e sub foo(--> Int) or sub foo() returns Int
or my Int sub foo() 01:07
ugexe technically there should not be. however it seems they can behave differently (or maybe that was recently fixed?)
awwaiid bleh. Not being able to paste multiple lines into the REPL is annoying. Need to fix that. 01:32
pmichaud m: my $input = '(\d\d\d)'; my $m = 'a 123' ~~ /<input=$input>/; say $m 01:34
camelia rakudo-moar 2c95f7: OUTPUT«「123」␤ input => 「123」␤ 0 => 「123」␤»
pmichaud m: my $input = '(\d\d\d)'; my $m = 'a 123' ~~ /$0=<$input>/; say $m
camelia rakudo-moar 2c95f7: OUTPUT«「123」␤ 0 => 「123」␤ 0 => 「123」␤»
shantanu Hello #perl6! 02:32
AlexDaniel o/ 03:05
Woodi hi :) 03:12
raydiak \o 03:14
sammers hi perl6 04:22
skids o/ 04:31
sammers m: my $m1 = Map.new("id", 1234); my $m2 = Map.new("score", 54321); say ($m1.Hash, $m2.Hash).Map 04:34
camelia rakudo-moar 2c95f7: OUTPUT«Map.new((:id(1234),:score(54321)))␤»
sammers hmm, is there any other way to merge Maps together? 04:35
sammers Hash is a bit simpler 04:37
m: my %h1 = id => 1234; my %h2 = score => 54321; say %(%h1, %h2);
camelia rakudo-moar 2c95f7: OUTPUT«{id => 1234, score => 54321}␤»
El_Che DrForr: cheers! (O'Reilly) 05:10
sammers m: my $m1 = Map.new("id", 1234); my $m2 = Map.new("score", 54321); say Map.new($m1.pairs, $m2.pairs); 05:39
camelia rakudo-moar 2c95f7: OUTPUT«Map.new((:id(1234),:score(54321)))␤»
konobi is there documentation of all the set operators available? 06:17
sammers konobi: have you seen this? docs.perl6.org/language/setbagmix 06:20
konobi thanks!
sammers np
konobi is larry around at all? 06:21
sammers haven't seen him today. 06:24
konobi any other linguists around? 06:33
fdsfds is there any information about perl6 performance, benchamarks, has it been improved lately? 07:02
moritz fdsfds: there have been blog posts about that on perl6.party/ 07:04
fdsfds yeah, but the article about performance was posted in april, it's a long ago 07:06
konobi moarvm has been making good incremental improvements 07:06
fdsfds are there any benchmarks? 07:09
El_Che fdsfds: tux posts results about his module very regularly 07:10
fdsfds El_Che: who's tux? 07:12
moritz the maintainer of perl 5's Text::CSV_XS, iirc 07:13
El_Che idd
El_Che I don't know if he moved the results to -dev or -toolchain 07:14
konobi also, is there any company using perl6 heavily (so time investment) ? 07:24
zengargoyle fdsfds: p6weekly.wordpress.com/ - usually has a list of recent speed improvements. there's amost always a few things that got faster since last week... 07:34
fritz_ lizmat_, moritz: I just sent the eMail with the Perl6-course request to moritz (as I don't have lizmat's eMail address). 07:37
simonsharry Hello all! Where can I find examples of Phasers? Secondly, as I begin using Perl6, I'll have a need to see demo examples of each language feature. I do see examples.perl6.org/ but not sure if this is a comprehensive set of examples. Many thanks in advance. 07:38
moritz simonsharry: more working code can be found through modules.perl6.org/
fritz_ moritz: please forward the mail to any of the other German speaking experts in case you can't do the course.
moritz fritz_: will do 07:39
fritz_ I don't know how big the market is at this point, but it might be worthwhile to have a section about potential speakers/trainers for commercial Perl6 courses (if there isn't one yet). 07:40
moritz simonsharry: and as for phasers, one thing you can do to find examples is to clone github.com/moritz/perl6-all-modules which contains all public perl 6 modules, and then use 'git grep' to search for some 07:41
simonsharry: for example git grep --word LEAVE
simonsharry Will do, thanks moritz. 07:42
lizmat fritz_: No problem, if moritz is picking this up, he can do a better job than I can :-) 07:58
fritz_ lizmat: I am sure they would profit from you as well ... and I guess there should be plenty of people that would benefit from Perl6 classes ... :-) 08:03
lizmat well, if no native-german speaker can give the course, I can :-) 08:04
fritz_ lizmat: good to know that there are several people that can teach in German. At least for Germany that seems to be an issue (here in Switzerland English would usually work well). 08:06
DrForr El_Che: Thanks! The wording is now what I'd chosen, people at ORA got some wires crossed and I wasn't able to review things before the landing page was created. 08:23
El_Che DrForr: yeah, I saw that. On the otherhand, some troll will have a full belly by now :) 08:30
DrForr Not *really* blaming ORA, but I really would have liked a chance to review things before they put up the landing page. 08:32
And of course the only comment on /r/perl6 is 'F*ck em' (censoring: mine.) Tempted to reply with "Thus proving *why* I made the change." but that might have been too mean. 08:34
El_Che DrForr: silly, if you ask me. But out of your hands. It doesn't change that it's great news 08:50
\o/
Woodi m: class C { has $.g; method m( Int $i ) { $.g = $i } }; my $c = C.new( :g(0) ); $c.m(2); 08:52
camelia rakudo-moar 2c95f7: OUTPUT«Cannot modify an immutable Int␤ in method m at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
Woodi how to use $.-type attrs ?? 08:53
sammers m: class C { has $.g is rw; method m( Int $i ) { $.g = $i } }; my $c = C.new( :g(0) ); say $c.m(2); 09:22
camelia rakudo-moar 2c95f7: OUTPUT«2␤»
sammers Woodi: ^^^^
Woodi sammers: I'm pretty sure I try to put is rw on attribute... but works, thanx :) 09:27
sammers np
dalek c: a2c9940 | (Armand Halbert)++ | doc/Language/variables.pod6:
Fixed confusing wording in the state variables docs
10:00
c: 45635a0 | RabidGravy++ | doc/Language/variables.pod6:
Merge pull request #907 from ahalbert/906

Fixed confusing wording in the state variables docs
DrForr Was talking with one of our marketing people here, and it transpired that he had a problem finding articles on Perl for a non-technical market. He pointed me to blog.hellojs.org/el-capitan-and-be...rce=latest and blog.hellojs.org/spying-on-the-dom....mazdywc41 as articles that he was hoping to see for Perl/Perl6. Not that I have the time to help right now, but after conf 10:06
Woodi DrForr: what exactly your buddy wants ? becouse links show technical articles :) just light popular-programming ? who is target audience ? rechnical ppls interested on subject/news or rather management ? 10:33
DrForr I haven't read the articles in question, and he really couldn't explain why they worked for him. I'm guessing the target audience is lighter weight than what he'd been looking for. 10:36
Woodi :w 10:56
raydiak I'd guess the target audience is non-techincal coworkers. E.g. marketing people wanting to write glowing fluffy things about the technology underlying their products. Also decision-making executives with more managerial than technical skill, who need convincing (a need I had recently). 11:01
DrForr Yep. I was just noticing a potential hole in what we're talking about in blogging and such. 11:05
raydiak Also, generally, I'd think maximizing our positive impression on as many people as possible regardless of their programming proficiency could only be a good thing. People talk about things they're ignorant of all the time, because they think it makes them sound less ignorant. Like me right now :) 11:07
raydiak Oh yes, bloggers are another great example 11:12
timotimo oh, it's raydiak! :) 11:14
raydiak hiya timo! how goes it?
DrForr Once I feel like I can focus less on what I'm working on right now... 11:15
timotimo all right, how about you?
raydiak I'm great! Got a good job, talked my boss into using perl instead of php, and moved to Austin, TX. 11:16
timotimo \o/ 11:17
perl is a definite big step up from php
tadzik nice :) 11:18
raydiak No kidding...big step up, and very nice indeed :)
hopefully I can be more active here again in the near future, but all my time goes into more direct work things right now. It's almost 6:30 AM here. I'm still up, just winding down now. 11:19
DrForr CPanel?
raydiak But being up all night loving perl instead of loathing php is something I'm truly thankful for 11:20
nope not cpanel, our own products. can't talk about it much yet though, non-disclosure agreement
DrForr Ah. 11:22
raydiak Very exiciting though, rest assured I'll be spouting off about it all as soon as they'll let me. Perl 6, not 5. 11:23
raydiak Luckily $boss is quite technically literate, used to be a p5 coder himself. So there is a good foundational understanding of what we're getting in to, advantages and obstacles and so forth. 11:35
raydiak tip for anyone else having those discussions, "it'll get lighter and faster over time without us changing one line of our own code" was one of the key selling points 11:38
timotimo oh, really? 11:41
timotimo isn't that just "it's currently performing very bad, but bad performance will be improved in the future"? 11:41
lizmat timotimo: please remember that requirements in an agile environment can change quickly 11:44
raydiak depends on which side of the coin you face towards the audience :) but yeah it's only one of the points. so far we seem to be finding approaches which perform adequately for immediate needs, so if y'all keep up the awesome performance work, we'll end up with something quite speedy in the long run 11:45
lizmat oops, read raydiak;'s comment wrong :-) 11:45
lizmat raydiak: yes, the goal is to be faster than perl 5 :-) 11:45
www.youtube.com/watch?v=wxU8OXKGNKc # stmuk's talk at YAPC::EU 11:46
raydiak nice, I like that goal, that would be more than adequate 11:46
timotimo you may end up writing "performance optimized" code today because you can't get it to perform well enough, and two days later a core builtin gets optimized by lizmat and suddenly the "idiomatic" code would be 10x faster than your optimized code :P
basically: hire a perl6 core dev :P 11:47
lizmat timotimo: disagree :)
that kind of optimization effects I expect from merging brrt's work on the JIT
raydiak we aren't really optimizing with fiddly chunks of longhand code, more building assumptions of slowness into the design and structure itself 11:49
timotimo a noticable amount of slowness still comes from doing stuff we don't even need to do
not sure how much of that the jit will be able to kick out, but there's still many avenues of optimization that spesh'll learn one day
lizmat timotimo: any suggestions of areas to look into aa far as you know ? 11:51
timotimo difficult to say. i read everywhere that you have to measure before you optimize ;) 11:53
so we'd have to find a few benchmarks first that show some flaw
like, one cool thing we can have is "allocation sinking" where we pretend an object has been allocated even though we still only have the values that would go into the fields around in registers 11:54
and we only actually allocate the object if something really, really, really wants to have the object
raydiak timotimo: another little selling point was "I have a good relationship with this guy who knows quite a bit about rakudo internals and performance" ;) 11:55
nine timotimo: in other words: being lazy
timotimo nine: yes, almost criminally lazy ;)
when we get "escape analysis", a big amount of things that used to be allocated in the global heap will be able to live on the stack and immediately be "reclaimed" when a routine or code block or whatever is left 11:56
nine Which is where a large part of the 2 order of magnitue module loading speedup comes from
arnsholt There's a neat mailing list post about why GNU grep is fast which basically has that as the moral: "read as few bytes as possible"
timotimo the assumption is that a gigantic amount of Scalar allocation (except when you're using Arrays) will be cheapened this way 11:57
arnsholt Yeah, stack allocation is way better than heap allocation
timotimo aye
still it's hard to know when you can get away with it
that's the reason we don't have escape analysis yet ;-
arnsholt Definitely, definitely
timotimo every single moarvm op has to be annotated as to *how* it treats values passed to it 11:58
arnsholt And why it's a task that more or less only jnthn++ can do =)
timotimo jnthn and masak started on it a year or two ago, but didn't pull through yet
arnsholt Oh, neato!
I'm way, way out of the loop on a lot of this stuff these days =(
timotimo these days it's mostly "lizmat glances at a core builtin, and suddenly it's 10x faster" 11:59
lizmat at the expense of beauty :-( 11:59
timotimo jnthn has done a very good job of making everything stable when multi-threading is involved
timotimo lizmat: the internals are allowed to be less beautiful; only surgeons get to see it when they cut open the outside ;) 12:00
nine timotimo: less beautiful also means less maintainable and harder to get into. We lose a large selling point that way as suddenly perl 5's C code doesn't compare all that bad anymore. 12:01
timotimo ah, hmm
our internals now basically resemble lisp :P
lizmat this is how we look at it now; I distinctly remember a view posted here that the Perl 6 internals should be exemplary Perl 6 code
arnsholt It's a tradeoff, definitely
timotimo i remember that, too :(
arnsholt But as speed and elegance in code are frequently opposed, we have to choose 12:02
As an example of favouring elegance and simplicity, consider CPython
nine I would consider CPython neither simple, nor elegant 12:03
arnsholt They explicitly want their code to be simple and easy to get into, meaning that many things that make things go faster are off the table
timotimo hm, right
arnsholt Yeah, I'm not familiar with the codebase, but apparently it's a problem with making CPython go faster
timotimo and then something like pypy has to come along for the performance part :P
timotimo something i personally would like to see is less code generated for trying to call .sink on stuff 12:06
but i don't know how big the performance impact of that is for things that don't have a sink method callable on it 12:07
masak I may have expressed the view that setting code should be held to a standard of beauty -- that sounds like something I'd say 12:09
however, I also recognize the need to compromise with other factors, chiefly performance
my main worry with that is that, as we get better at actually folding optimizations into the compiler so they no longer have to be done manually, scars of manual optimizations will remain in the setting 12:10
maybe that's a silly worry, I don't know
timotimo if we had macros, we could perhaps make that stuff a bit more concise and readable
nine Well...
timotimo that's a truth, masak. i 100% expect that to happen ;(
on the other hand, it's probably easy to see which parts of the core setting have been manually optimized like that, just search for lizmat commits with a few words in them, like fast 12:11
nine A crazy way to do it would be to have the optimizer replace our beautiful core code with hand crafted nqp implementations...
masak macros are on the way. 007 is working as intended there, showing what will be possible.
arnsholt Yeah, there will definitely be performance-detrimental performance optimizations once the compiler gets better 12:14
masak oh, that too
masak perhaps we would do well to keep unoptimized code around in comments (or in some other way) 12:15
so that something automated could spectest and perftest on a regular basis
and flag things up as "hey, this optimization does nothing anymore -- hooray!"
arnsholt I remember reading about someone who removed all instances of Duff's device from X.org (I think) and suddenly the binary was both faster and smaller
timotimo hah, ouch
masak: well, we already have #?if stuff
arnsholt Because 2010s CPUs are different from 1980s CPUs 12:16
lizmat afk&
masak timotimo: that may or may not be better than what I proposed
timotimo we can keep the code honest by generating both variants of CORE.setting on travis
masak aye
timotimo and then spec test
nine lizmat++'s optimized versions frequently also fix bugs 12:18
timotimo oh, that's not good for turning diffs by lizmat into "unoptimized, clean in the ‘then’, optimized, complicated in the ‘else’" thing 12:20
we'll end up with bugged clean code in the ‘then’ that we'll also have to fix
but maybe now is a good time to start doing that kind of thing? 12:21
raydiak alright #perl6, I'm very happy to be chatting with you all again! but it's after 7 AM, my reality is melting from sleep deprivation, can't even keep up with conversation any more :) good morning/night all o/
timotimo \o/
gnite raydiak 12:22
nine Well considering our plentiful resources for core development, I'd suggest taking on one problem at a time and focus on low level performance barriers. Somewhere down the road we may be able to start porting our NQP internals back to Perl 6 (including all the improvements added since porting to NQP). 12:28
masak +1 12:29
timotimo OK
Venkatesh Hi 12:29
nine Btw. I just don't buy into the whole "only jnthn can do this" line. Yes, he is an exceptional developer. But often it's just a matter of accepting that it will take time to dig into something and just stick with it.
Which is something jnthn++ has done often enough to not need as much digging anymore :) 12:30
grondilu yeah but still in the end, whether it's becaus of previous commitment or just talent, the assertion "only X can do this" remains true. 12:33
jnthn does try to write clear code that others *can* get in to
jnthn I think some of the time, people assume compiler/VM stuff "must be terribly scary". 12:35
nine grondilu: no it doesn't. If it was "only jnthn can do it in a week", that's something else and certainly true in many cases. Others will take longer as they need to do a lot of digging first. But they can do that.
grondilu well if you take the sentence *litterally*, sure.
jnthn And it sometimes is, but it's the exception, not the norm.
grondilu I'm sure even I could do what jnthn did, if you give a me a hundred years or something :) 12:36
jnthn I think Zoffix++'s write-up of how he fixed the quotes in qw constructs recently was a good example of how taking the time and being methodical lets you dig in and solve problems.
arnsholt Yeah, I agree. Internals are frequently less scasry than one might expect 12:37
I still suspect that escape analysis is kinda complicated, though =) 12:38
jnthn I dunno, given that a bunch of people here are rather stronger at their mathematics than me...
nine Well if most of it really is just "every single moarvm op has to be annotated as to *how* it treats values passed to it", then it sounds like just reading a lot of code to me. 12:39
jnthn (EA algorithms involve lattices. I don't grok those yet. :))
Well, they often involve, anyway :) 12:40
arnsholt Oh, lattices are fairly straightforward as far as their theoretical construction goes 12:43
Of course, that doesn't always help with grokking uses of them =) 12:44
But it's basically just a DAG with some special properties
arnsholt Basically, for any pair of nodes there's a node that's reachable from both nodes (a join) and a node from which you can reach both nodes (a meet) 12:46
timotimo hasn't yet heard of this yet 12:47
arnsholt The Wikipedia page discusses it in terms of partially ordered sets, but for a computer scientists a DAG is more familiar 12:47
jnthn Hm, the DAG explanation makes more sense to me given I'm used to those :) 12:48
arnsholt Yeah, if you're in CS it's more intuitive
jnthn Hm, so the think looks like a diamond :) 12:49
*thing
arnsholt Yeah
The meet and join conditions imply that there's a singular meet from which you can reach everything (the infimum), and a join which is reachable from everything (the supremum) 12:50
The DAG to poset mapping is that the nodes of the graph are the elements of the set being ordered, and an edge from A to B means that A < B
jnthn Aha 12:52
jnthn This makes some sense; thanks! 12:53
jkramer Ahoy! 12:54
Is there a more efficient way to look for bytes or byte sequences in a Buf/Blob than looping over its bytes?
moritz you could decode as latin-1 and then use the index function 12:55
jkramer Buf doesn't seem to have a whole lot of methods to mess with its contents
moritz not sure how that compares in efficiency
jkramer Hmm, I'd like to avoid decoding because the buffer can theoretically contain big amounts of binary data and the byte sequence I'm looking for is typically somewhere in the front 12:56
nine jkramer: do what moritz++ suggested with subbufs? 13:10
jkramer nine: That probably saves some memory but I guess it'd be even slower decoding chunks and then searching them 13:34
nine jkramer: never try to guess how performance will be :)
bioduds how does simple math works in perl6? 13:37
bioduds like Math.Random for instance? 13:38
moritz m: say 1 + 4 # simple math
camelia rakudo-moar 2c95f7: OUTPUT«5␤»
bioduds like other languages have Math class for instance 13:39
is there a rand function?
moritz m: say rand 13:40
camelia rakudo-moar 2c95f7: OUTPUT«0.945241411041802␤»
moritz bioduds: that was too hard for you to try out on your own, right? :-)
bioduds yep, sorry
lazy here
lizmat m: say ^10 .pick 13:40
camelia rakudo-moar 2c95f7: OUTPUT«5␤»
lizmat m: say ^10 .pick
camelia rakudo-moar 2c95f7: OUTPUT«5␤»
lizmat m: say ^10 .pick
camelia rakudo-moar 2c95f7: OUTPUT«8␤»
lizmat *phew* :-)
m: say ^10 .pick
camelia rakudo-moar 2c95f7: OUTPUT«5␤»
lizmat hmmm 13:40
m: say ^10 .pick 13:41
camelia rakudo-moar 2c95f7: OUTPUT«6␤»
moritz would have been very amused if the third try would have been 5 too :-)
bioduds pick is nice
can I range pick?
like 10..1000.pick?
moritz bioduds: try it! 13:42
lizmat sure
bioduds cool
lizmat m: 10..10000 .pick.say 13:42
camelia rakudo-moar 2c95f7: OUTPUT«WARNINGS for <tmp>:␤Useless use of ".." in expression "10..10000 .pick." in sink context (line 1)␤10000␤»
lizmat huh? 13:42
moritz m: say 10..10000 .pick
camelia rakudo-moar 2c95f7: OUTPUT«10..10000␤»
lizmat m: (10..10000).pick.say
camelia rakudo-moar 2c95f7: OUTPUT«53␤»
moritz parsing weirdness?
lizmat yeah probably 13:43
commute to NR.pm meeting&
jnthn Probably confusing it with ^10000 .pick; here prefix:<^> binds tigether than infix:<.> 13:44
whereas infix:<.> is tighter than infix:<..>
jkramer m: 10..100 .WHAT 13:45
camelia rakudo-moar 2c95f7: OUTPUT«WARNINGS for <tmp>:␤Useless use of ".." in expression "10..100 ." in sink context (line 1)␤===SORRY!===␤Method call must either supply a name or have a child node that evaluates to the name␤»
jkramer What does the stuff after SORRY! mean? 13:45
(It's a pretty long stack trace when I do it locally)
moritz it's confused :-) 13:46
basically WHAT is not a normal method, but something special
bioduds you have to enclose in ()
moritz and that special form doesn't seem to work with the . operator, just when call it without a space
bioduds like (10..100).pick
works here 13:47
jkramer Yeah, I know, just wanted to see what .WHAT would say about x..y vs (x..y) 13:48
moritz m: say WHAT 10..100
camelia rakudo-moar 2c95f7: OUTPUT«(Range)␤»
jkramer Ah nice :D
bioduds $.galaxies = ($.smallest-number-of-galaxies..$.greatest-number-of-galaxies).pick; 13:51
ugexe technically wouldn't you use `roll` for such a random value 14:10
you wouldnt do `($galaxies1, $galaxies2) = (1..10).pick(2)` for instance 14:12
moritz depends on whether you want them to be always distinct or not 14:19
ugexe awaits the day work code review involves zero argument pick vs roll 14:25
moritz we don't do enough randomness to discuss that often here :-) 14:27
mst the only thing that's random in here is the puns :D 14:28
ugexe m: say ().pick(1); say ().pick 14:45
camelia rakudo-moar 2c95f7: OUTPUT«()␤Nil␤»
Xliff <moritz> you could decode as latin-1 and then use the index function 14:48
Buf could probably use an .index method for byte sequences where decoding is not necessary.
m: my ($g1, $g2); ($g1, $g2) = ^20.pick(2); say $g1; say $g2 15:02
camelia rakudo-moar 2c95f7: OUTPUT«Potential difficulties:␤ Precedence of ^ is looser than method call; please parenthesize␤ at <tmp>:1␤ ------> 3my ($g1, $g2); ($g1, $g2) = ^207⏏5.pick(2); say $g1; say $g2␤0␤(Any)␤»
Xliff m: my ($g1, $g2); ($g1, $g2) = (^20).pick(2); say $g1; say $g2
camelia rakudo-moar 2c95f7: OUTPUT«1␤7␤»
Xliff m: my ($g1, $g2); ($g1, $g2) = (^20).pick(2); say $g1; say $g2
camelia rakudo-moar 2c95f7: OUTPUT«1␤7␤»
Xliff Interesting
m: my ($g1, $g2); ($g1, $g2) = (^20).roll(2); say $g1; say $g2 15:03
camelia rakudo-moar 2c95f7: OUTPUT«2␤11␤»
Xliff m: my ($g1, $g2); ($g1, $g2) = (^20).roll(2); say $g1; say $g2
camelia rakudo-moar 2c95f7: OUTPUT«3␤14␤»
dalek c: d658a1b | (Armand Halbert)++ | doc/Language/functions.pod6:
Added documetation on function return types.
15:14
c: 5f8fb85 | RabidGravy++ | doc/Language/functions.pod6:
Merge pull request #908 from ahalbert/903

Added documetation on function return types.
skids ^^ might want to mention that Nil and Failure are exempt. 15:18
dalek c: 417fbfe | (Zoffix Znet)++ | doc/Language/functions.pod6:
Indicate Nil/Failure are exempt from return constraints
16:07
isBEKaml OHHAI, why does the RSS feed entry for p6weekly produce some mojibake for a summary? 17:49
This is what I see: PHA+VGhpcyB3ZWVrIHNhd.... 17:50
and here's the URL to that entry: p6weekly.wordpress.com/2016/09/12/...-youtuben/ 17:51
DrForr That looks like base64 encoding, maybe a YouTube URL is getting misinterpreted somewhere? 17:53
isBEKaml DrForr: that's what I thought, but I don't see any video embedding on the page! 17:53
Oh, youtube URLs getting mangled into base64. Nice! 17:56
DrForr Heh, I'm just having fun watching people on reddit playing ping-pong with my ORA training submission. 17:58
isBEKaml ORA -- Oracle? 17:59
DrForr Yep.
isBEKaml DrForr: www.oreilly.com/live-training/top-1...erl-6.html (:-( 18:01
I'll be on vacation then, with no access to a compute
*r
DrForr Vacation good. 18:01
DrForr At least I assume what's between the up/down arrows is the karma (or whatever they call votes) the article gets - It bounces between 1 and 6 every time I refresh the page. 18:03
(knowing very little about reddit as I do.)
isBEKaml DrForr: Don't worry about karma. 18:04
DrForr Oh, I'm not worried, I'm just bemused. 18:04
isBEKaml It'll still come back to you when you need it (as to whether that's good or bad, it's a different question)
DrForr I already have plenty from other sources :)
stmuk_ DrForr: I suspect its some issue with distributing content votes between servers 18:05
or the caching or something
DrForr Yeah, round-robin caching and whatnot. As I said I don't know how the internals work, though it'd make sense that I'm rotating around servers. I'll just let it anneal over a weekend and check later. 18:06
OTOH I think I can get a v0.2 of Perl6::Tidy out the door over the weekend, assuming I can figure out a decent unification scheme for the disastrous mess that is WS handling at the moment. 18:08
stmuk_ I've also noted the nay sayers seem to get in early to downvote and then voting gradually goes up as people actually read the content or link
mspo mm format conventions 18:09
stmuk_ I suspect some language wars people just downvote anything not in their language of choice 18:09
mspo reddit does fake up/down numbers on early articles to mess with bots 18:10
it's normal
DrForr Shrug. Only one person has deigned to comment, and that was with the oh-so-helpful "F*ck em." 18:10
Ah, cool. Again, there's not a helluva lot to do. I just wanted to make sure the usual suspects got the notice so i can get more stuff outside the anechoic chamber, how the message is *received* I can't help. 18:11
And again I know nothing of the "community" other than they're another channel where I can get the news out. 18:12
stmuk_ its not just perl 5 or 6 which gets reddit abuse I've seen it posting about other langs
DrForr (I shouldn't use scare-quotes there, as I gather it's more of a community than others I could mention, such as perlmonks.
DrForr I don't doubt that it's just people downvoting for the helluvit, I'm just having fun watching. 18:13
mspo DrForr: www.reddit.com/r/programmingcirclejerk/ 18:14
DrForr Not taking any of this personally or seriously. 18:15
mst it seems to be doing fine on r/perl and r/perl6
r/programming is ... variable
DrForr Oh, it got shared over to /r/perl, cool. 18:17
stmuk_ mspo++ 18:18
mst I wonder if r/perl should mention r/perl6 exists instead of claiming it's 'the' subreddit for both 18:19
mspo stmuk_: it's so funny (sometimes) 18:21
the rust-shilling guy has slowed down, though
"did you know that if you used Rust.. fearless concurrency.."
DrForr OSCON Austin gave everybody free Rust guides. 18:22
tailgate It could be worse, PHP is the butt-monkey of languages. 18:25
mst PHP is a malignant perl5 templating engine that metastasised. 18:27
mspo claim credit 18:30
php is a decent little economy
TimToady
.oO(half of PHP programmers are in the deplorable basket)
mspo you can build a career around wordpress 18:31
it's impressive
mst mspo: I am *hugely* impressed by the PHP *community*
DrForr tacfully refrains from a "Silence of the Lambs" reference.
mspo you can build a career as a wordpress plugin developer, even
I'm starting to come around to the fact that tech elegance/taste is totally unimportant 18:32
but that same argument is made against perl all of the time :) 18:33
mspo so I guess it's all about your POV 18:33
DrForr mspo: I'm maintaining a WP blog at work, I can completely understand why. 18:40
jsimonet Hello, I'm trying to use 'file'.IO.rw to check if it is readable and writable, but I'm getting an error like "Type check failed for return value; expected Bool but got Int (1)". Is it normal? 18:54
jsimonet I tested it with "Rakudo version 2016.08.1-196-g2c95f74 built on MoarVM version 2016.08-47-g2eedba8" 18:56
moritz jsimonet: this is indeed a bug in rakudo 19:01
jsimonet: will fix within the next 20min
jsimonet From what I know, it is located somewhere in src/core/Rakudo/Internals:1212 ? 19:03
moritz jsimonet: src/core/IO/Path.pm 19:04
Rakudo::Internals returning an Int is fine; all the other methods in IO::Path have a ? in them that coerces to Bool, but rw is missing that
so if my setting compiles fine, I'm confident that adding that prefix will fix it 19:05
moritz fix pushed. 19:06
mspo DrForr: yeah it sucks 19:08
bioduds hey all, im checking this to understand the constructors but not getting it. docs.perl6.org/language/classtut#Constructors
someone has more links to perl6 constructors examples?
pretty please
DrForr Plenty on rosettacode :) 19:09
mspo popular + sucks = $$$
perlpilot bioduds: what don't you get ? 19:09
bioduds actually, I don't understand the callback and the array
are they necessary? what do they do exactly?
timotimo they are just part of the example 19:10
they are the attributes of the class that gets consrtucted
moritz there's also docs.perl6.org/language/objects#Ob...nstruction
perlpilot I guess that bit of doc could be more explicit that those things are just part of the example 19:11
bioduds oh, now I got it
thanks moritz
DrForr You don't need to write them if you're happy with the default, but you do need to use them (or something that blesses a reference) to get an object back.
nine niner.name/talks/Perl%205%20and%20P...les/Dancr/
moritz bioduds: when you're looking for examples, cloning github.com/moritz/perl6-all-modules and doing a "git grep" for some keywords (like "method new", "method BUILD", "BUILDALL") typically turns up plenty of code
bioduds okey :) 19:13
tx
bartolin m: use Test; ok (1 ~~ **,1,**), 'smartmatch with Array RHS co-erces LHS to list'; ## from S03-smartmatch/array-array.t 19:38
camelia rakudo-moar 466770: OUTPUT«ok 1 - smartmatch with Array RHS co-erces LHS to list␤»
bartolin I don't understand that test. could it be that it's bogus because ~~ has a tighter precedence than the comma?
m: say so 1 ~~ **,1,** 19:39
camelia rakudo-moar 466770: OUTPUT«True1**␤»
jnthn m: dd (1 ~~ **,1,**) 19:41
camelia rakudo-moar 466770: OUTPUT«(sub (*@_) { #`(Sub|54615136) ... }, 1, **)␤»
jnthn Looks like.
It's passing a List to OK, and since the List is non-empty it'll pass
So yeah, looks bogus
bartolin github.com/perl6/roast/blob/master...rray.t#L67
there are two of those tests ... 19:42
perlpilot m: use Test; ok (1,2,5), "looks good to me!"; # ;-)
camelia rakudo-moar 466770: OUTPUT«ok 1 - looks good to me!␤»
bartolin *g*
jnthn Seems legit :P
m: say 1 ~~ (**,1,**)
camelia rakudo-moar 466770: OUTPUT«False␤»
jnthn m: say 1 ~~ (1,**) 19:43
camelia rakudo-moar 466770: OUTPUT«False␤»
jnthn m: say (1,2) ~~ (1,**)
camelia rakudo-moar 466770: OUTPUT«True␤»
jnthn m: say (1,) ~~ (**,1,**)
camelia rakudo-moar 466770: OUTPUT«True␤»
jnthn So, seems it doesn't coerce it to the list, contrary to what the test claims. 19:44
bartolin aha, the LHS is not coerced to a list with 1 ~~ (**,1,**)
bartolin is to slow
jnthn Well, the test's *comment* claims, at least. :P
It's also misleading 'cus it says "Array RHS" but the RHS there is actually a List...
konobi any linguists about at all? 19:45
perlpilot konobi: one might say we're all linguists since we study these strange, foreign languages called "programming languages" 19:46
bartolin so, those bogus tests could be removed from roast? and, perhaps more important, should '1 ~~ (**,1,**)' actually return True? 19:48
skids bartolin: there are a few hoops to jump through WRT removing roast tests, since the tests are the language definition/contract. 19:52
(adding tests is less cumbersome)
I don't know if anyone wrote that up as an administrative procedure yet. 19:53
jnthn Yes, but it's the executional behavior of the tests that's the contract, not the hopeful comments. And all these were actually testing is, "does a non-empty list evaluate to True". So long as that is covered somewhere else (surely it is) then we can modify these tests to whatever the answer to "is the LHS coerced" is 19:55
And I don't know the answer to that, sorry. 19:56
perlpilot bartolin: I don't see why 1 ~~ (**,1,**) should return True. Maybe if it were (1,) ~~ (1, **, **) or perhaps 1 ~~ (1,**,**)
jnthn If the latter is going to work, the former would too... ** means "any number of elements" 19:56
bartolin jnthn: I see, thanks for looking and explaining! (skids++ and perlpilot++, too) 19:58
AlexDaniel TIL perlfoundation.org does not support unicode in comments. Second half of my comment was cut off because of emoji 20:06
arnsholt konobi: You called? =) 20:07
konobi ah, larry got back to me =0) 20:08
b2gills m: say {[R[&(1/*+*)]](@_).nude}(3,7,15,1,292,1) # codegolf.stackexchange.com/a/93385/1147 20:09
camelia rakudo-moar 466770: OUTPUT«(104348 33215)␤»
bartolin I think, I'll leave those tests from S03-smartmatch/array-array.t as they are, but will add a comment, linking to this discussion 20:10
konobi arnsholt: turns out that it's more semiotics that I'm after 20:11
arnsholt Ah. I'm decidedly less useful for that, I'm afraid =) 20:12
tailgate Is there a way to see all the members/methods of an object avaliable? Also, can you construct a type hiearchy of an object? 20:14
konobi tailgate: the mop 20:16
tailgate the mop?
konobi docs.perl6.org/language/mop
spebern tailgate: say $obj.^methods;
perlpilot m: "foo".^methods.say; 20:18
camelia rakudo-moar 466770: OUTPUT«(BUILD Int Num chomp pred succ simplematch match ords samecase samemark samespace word-by-word trim-leading trim-trailing trim encode NFC NFD NFKC NFKD wordcase trans indent codes chars uc lc tc fc tclc flip ord WHY WHICH Bool Str Stringy DUMP ACCEPTS chop…»
tailgate can you do the same thing for members?
perlpilot m: class C { has $!a; }; say C.^attributes; 20:19
camelia rakudo-moar 466770: OUTPUT«(Mu $!a)␤»
spebern tailgate: say $obj.^attributes;
tailgate thanks
El_Che DrForr: the first review on your talk on safari has arrived :) 20:20
DrForr Hooboy.
optikalmouse submitted the 1st draft of my article and for the second draft adding another part about saving JSON strings to a file. 20:34
spurt 'cool.json', to-json(my-obj);
are the brackets around my-obj necessary? 20:35
moritz no
they'd only be necessary if there's another argument to spurt after the to-json call 20:36
optikalmouse spurt 'cool.json', to-json my-obj; 20:38
nice :D
DrForr In passing I just noticed that there's a language/ page for lists and sets, not one for hashes. Something *else* to add to my list of documentation. 20:45
ab6tract perl6 -MHTTP::UserAgent -e 'say HTTP::UserAgent.new.get("google.com")' # Failed to resolve host name 21:02
google.com is accessible via ping/curl/browser/etc
ab6tract and LWP::Simple doesn't seem to survive when run many times in parallel ('could not parse headers') 21:05
what started as a benchmark against shelling out to curl to via qq:x has led to the realization that this shelling out seems to be the best option 21:06
s/best/only/
timotimo we're using libuv's dns resolving stuff, i think? 21:09
maybe that has some problem with something 21:11
ugexe there were problems resolving IPv6 i think 21:14
additionally I think google.com forwards to https, so you need IO::Socket::SSL installed to properly hit it 21:15
ab6tract ugexe: I thought that might be the case, still seeing the same issue 21:16
ab6tract i have now tried adding Net::Curl::Easy to the mix 21:17
it is also unhappy
ugexe what about this 21:20
use IO::Socket::SSL; my $ssl = IO::Socket::SSL.new(:host<google.com>, :port(443)); $ssl.print("GET / HTTP/1.1\r\nHost:www.google.com\r\nConnection:close\r\n\r\n"); say $ssl.get
ugexe re: IPv6 rt.perl.org/Public/Bug/Display.html?id=123282 21:22
optikalmouse DrForr: can some aliases be added to the languages list? I was looking for multiple method dispatch and I think the search bar showed the OO page but I couldn't find the docs on it. 21:23
in language
Xliff Does nqp::index work with Buf? 21:26
ugexe m: say Buf.new(0,1,2,3,4,5,6).contents.index(3,4); # if you don't care about laziness 21:28
camelia rakudo-moar 466770: OUTPUT«6␤»
ab6tract ugexe: HTTP::UserAgent fails regardless of what url i give it, IDK 21:30
ugexe: gist.github.com/ab5tract/ce9b7045d...3d2688b479 21:31
ugexe ab6tract: you'd need to test a site without IPv6 assuming you can hit an IPv4 address fine 21:32
ab6tract ugexe: like i said, I am not strictly testing google.com 21:34
sorry for the bad example
huh...
ugexe lots of site have ipv6 support
ab6tract ugexe: first, i don't think there should be any such barriers to using one of our native libraries 21:35
if curl can hit the url, http-useragent should be able to as well
ugexe right, thats why there is a ticket filed above
ab6tract second, you were right, i had been using the google case too frequently 21:36
http-useragent does find my site at fys.wtf 21:37
but it will still not do the full 1000 requests
that code i have just shared should make it easy to test for yourself
ugexe I'm familiar with most of this from writing net::http
ab6tract so, familiar with the fact that all the other libraries fall down? :) 21:38
ugexe and one persons connection may not use IPv6 when anothers does
ugexe sure. zef shells out for all its fetching adapters 21:39
ab6tract great 21:40
ugexe originally it used the code that became net::http. obviously the shell approach worked better
ab6tract ugexe: and now it seems that net::http doesn't enjoy attempts to load it 21:42
harmil_wk Is there any reason that someone would write: return unless [and] test($w1, $w2), test($w2, $w3), test($w3, $w4); 21:43
It's the same number of characters as: return unless test($w1, $w2) and test($w2, $w3) and test($w3, $w4);
harmil_wk ab6tract: that's a wonderful turn of phrase... 21:44
timotimo personally, i'd "all" that :P
timotimo saves 2 characters 21:44
harmil_wk timotimo: all might have been problematic, I'm not sure. $w1, etc. are all junctions in this example. 21:44
It's from rosettacode.org/wiki/Amb#Perl_6 21:45
timotimo you can nest junctions 21:45
ab6tract sorry ugexe, i was holding that module wrong. use/import is fine 21:48
harmil_wk timotimo: I know, I just don't know if there was some subtle interaction, here. There's some comments about any vs. all being necessary because of subtle interactions, so I wasn't sure if they avoided another level of junctioning for that reason. 21:49
dalek c: 1d2e9a7 | ugexe++ | doc/Type/List.pod6:
Clarify argless pick/roll behavior
harmil_wk More in terms of comprehension rather than syntax 21:49
timotimo there's a thing when you have any and all mixed into the same call
it'll execute one kind before the other
harmil_wk "pick/roll" behavior? Was I just pickrolled?
timotimo: oh, interesting. 21:50
travis-ci Doc build failed. Nick Logan 'Clarify argless pick/roll behavior' 21:57
travis-ci.org/perl6/doc/builds/160299240 github.com/perl6/doc/compare/417fb...2e9a7e67e1
dalek c: f8c5be4 | MasterDuke17++ | doc/Type/Signature.pod6:
Fix typo in Signature
22:26
harmil_wk I wrote up a RC entry for jumps at: rosettacode.org/wiki/Jump_anywhere#Perl_6 22:42
If anyone has time to review...
travis-ci Doc build passed. MasterDuke17 'Fix typo in Signature' 22:45
travis-ci.org/perl6/doc/builds/160307434 github.com/perl6/doc/compare/1d2e9...c5be4337a0
ugexe ab5tract_: using net::http I get 110-120. if i add a `sleep 1` after each request it gets to 400-500. maybe thats a clue for something socket related... 22:57
timotimo what gets to those values? 22:58
TimToady harmil_wk: this is a slight lie: Will unwind the stack until either some `CATCH` block intercepts the specific exception type or we exit the program.
TimToady the unwinding does not happen until after the CATCH block executes, in case we want to .resume 22:58
ugexe timotimo: gist.github.com/ab5tract/ce9b7045d...3d2688b479 22:58
TimToady also, we have the entire dynamic scope of the error available to the handler
ugexe so a bunch of threads trying to make 1000 total http requests. the numbers i posted are how many went through before it just seemingly stops 22:59
ugexe all the pure perl http clients appear to never make it close to the 1000 requests. but the one shelling out to curl does 23:00
ugexe for whatever reason the threads quickly and quietly die off until there are 1 or 2 left. those eventually die as well but they make up half the total requests 23:03
naturally no errors are thrown 23:04
AlexDaniel yeah, can confirm that curl is more reliable…
ab6tract ugexe: i've noted that this invocation will flap: perl6 -MNet::HTTP::GET -e 'await do for ^16 -> $i { start { say "$i: " ~ Net::HTTP::GET("fys.wtf").body.decode("utf8").comb("stupid") } }' 23:05
gist has been updated 23:06
mostyl cosmetic though
*mostly 23:07
and with that typo, i'm going to sleep :)
timotimo mo style, mo problems 23:09
ugexe for some reason http::useragent does not get a benefit from a `sleep 1`
timotimo sleep 1 will block a thread for one second to make it unavailable for receiving new work or doing stuff
you could try building a scheduler with a lower max-threads for this and see if that helps any?
or rather whether it has the same kind of effect 23:10
ab6tract will take a look at using perl 5 fetchers tomorroq 23:11
gahh! ok: bed time :)
ugexe right, and it also could mean the server is less likely to cause some unexpected socket close
SmokeMachine____ if someone get some time, could (please) comment/critic this module? github.com/FCO/Heap 23:18
MasterDuke SmokeMachine____: are you sure you want '==' for your eqv? 23:41
m: say <a ab> ~~ <aa b>
camelia rakudo-moar ad5336: OUTPUT«False␤»
MasterDuke m: say <a ab> == <aa b>
camelia rakudo-moar ad5336: OUTPUT«True␤»
MasterDuke m: say <a ab> == <a a b> 23:42
camelia rakudo-moar ad5336: OUTPUT«False␤»
MasterDuke m: say <a ab> ~~ <a a b> 23:42
camelia rakudo-moar ad5336: OUTPUT«False␤»
MasterDuke m: say <a ab> == <c d>
camelia rakudo-moar ad5336: OUTPUT«True␤»
SmokeMachine____ Yes, I do not want that...
MasterDuke i think == for lists just checks that they have the same number of elems 23:43
BenGoldberg Perl6's == operator is the same as perl5's: it just checks for numeric equality. 23:48
BenGoldberg m: say <a b> == 2; 23:48
camelia rakudo-moar ad5336: OUTPUT«True␤»
BenGoldberg Also, note that == is not truly aware of lists, it only cares that it's arguments can be converted to Number. 23:50
m: say <a b>.Number;
camelia rakudo-moar ad5336: OUTPUT«Method 'Number' not found for invocant of class 'List'␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: say <a b>.Int;
camelia rakudo-moar ad5336: OUTPUT«2␤»
BenGoldberg m: say Int.^roles 23:51
camelia rakudo-moar ad5336: OUTPUT«((Real) (Numeric))␤»
BenGoldberg m: say <a b>.Numeric; 23:51
camelia rakudo-moar ad5336: OUTPUT«2␤»
BenGoldberg Err, pretend I said, Numeric, not Number.