Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-01-07

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:01 BenGoldberg joined #perl6
00:02 skids joined #perl6
00:06 ggoebel111111118 joined #perl6
00:25 gentoo joined #perl6
00:27 japhb _sri: Re: http://irclog.perlgeek.de/​perl6/2015-01-06#i_9895878 , what is responsible for the 30% speed increase?  (I've been away from Perl 5 blead for a few releases; I was unaware such large improvements were still coming down the pipe.)
00:31 araujo joined #perl6
00:33 Vlavv joined #perl6
00:33 tinyblak_ joined #perl6
00:35 _sri japhb: cheaper method calls and multi level dereferencing (mostly through new special ops)
00:36 japhb _sri: Meaning, they made '$foo->bar(1,2,3)' and '$foo{bar}{baz}[1][2][3]' faster?
00:36 _sri ye
00:36 japhb Interesting.
00:37 _sri (there's more to it, but that's the tldr)
00:39 japhb Very nice indeed.
00:40 vendethiel- joined #perl6
00:51 raiph joined #perl6
01:05 andreoss joined #perl6
01:07 andreoss m: sub foo(int \x) {x}; my int $x = 1; say foo $x;
01:07 camelia rakudo-moar 80b912: OUTPUT«1␤»
01:07 andreoss m: sub foo(int \x) is cached {x}; my int $x = 1; say foo $x;
01:07 camelia rakudo-moar 80b912: OUTPUT«Cannot find method 'gist': no method cache and no .^find_method␤  in method gist at src/gen/m-CORE.setting:7738␤  in block  at src/gen/m-CORE.setting:3694␤  in any enter at src/gen/m-Metamodel.nqp:3185␤  in method invoke at src/gen/m-CORE.setting:3…»
01:08 andreoss native ints conflict with memoization
01:18 tinyblak joined #perl6
01:26 andreoss m: my int \x = 1; say x;
01:26 camelia rakudo-moar 80b912: OUTPUT«Type check failed in binding; expected 'int' but got 'Int'␤  in any bind_error at src/vm/moar/Perl6/Ops.nqp:224␤  in block <unit> at /tmp/FmDtOoccID:1␤␤»
01:26 andreoss m: my int \x = (my int $x = 1); say $x;
01:26 camelia rakudo-moar 80b912: OUTPUT«Type check failed in binding; expected 'int' but got 'Int'␤  in any bind_error at src/vm/moar/Perl6/Ops.nqp:224␤  in block <unit> at /tmp/yNR4H5UDBt:1␤␤»
01:28 TimToady we don't have native pointers, at least, not yet
01:28 skids m: my int $r = 1; "OHAI".say; my int \x = $r;
01:28 TimToady and that's a binding, really, not an assignment
01:28 camelia rakudo-moar 80b912: OUTPUT«OHAI␤Type check failed in binding; expected 'int' but got 'Int'␤  in any bind_error at src/vm/moar/Perl6/Ops.nqp:224␤  in block <unit> at /tmp/Ok9YqIcRBg:1␤␤»
01:29 TimToady the \x notation is really aliasing
01:31 TimToady and we can't do native aliases yet
01:31 TimToady it might be possible after jnthn's pe work
01:33 andreoss memoization for natives doesn't work for the same reason?
01:34 andreoss due to lack of pointer arithmetic for natives
01:35 vendethiel joined #perl6
01:38 TimToady the current caching probably depends on object introspection, and with natives you have to introspect the descriptors of the location, not the object itself
01:39 TimToady since a set of 64 bits can't really tell you anything about itself if it happens to be all dedicated to holding an int
01:40 dayangkun joined #perl6
01:42 sirdancealot joined #perl6
01:43 yeahnoob joined #perl6
01:51 kaare__ joined #perl6
01:56 anaeem1_ joined #perl6
02:00 raiph joined #perl6
02:05 chenryn joined #perl6
02:07 Akagi201 joined #perl6
02:21 yeahnoob joined #perl6
02:21 orafu joined #perl6
02:21 skids Hrm.  Some PASS results on cpandatesters are actually FAIL if you open them up.    http://testers.perl6.org/report/dist/Sum/8688
02:23 rmgk_ joined #perl6
02:28 tinyblak joined #perl6
02:51 andreoss left #perl6
02:51 BenGoldberg joined #perl6
03:03 raiph joined #perl6
03:08 cognominal joined #perl6
03:12 tinyblak_ joined #perl6
03:19 Akagi201 joined #perl6
03:20 xinming_ joined #perl6
03:25 ugexe skids: its also saying all those tests are on the same line
03:25 ugexe s/all/many/
03:28 skids Yeah that's more Test::'s problem I think.
03:34 ugexe did you have this problem more than a week ago?
03:35 noganex joined #perl6
03:38 ugexe looks like no
03:41 cognominal @_ericelloit is setting a gist https://gist.github.com/eric​elliott/d576f72441fc1b27dace  about js resources. This is one of them that I find of general interest because defining a lot of programming vocabulary ; https://github.com/kriskowal/gtor
03:49 ugexe yea i think its when Panda switched to the pipe command recently
03:50 skids ugexe: I just today even discovered cpandatesters.
03:51 skids (nonsequiter) https://gist.github.com/skids/47f2ed6b2f64630fc571
03:54 skids time to upgrade 1000 wifi aps.  wish me luck.
04:04 KCL_ joined #perl6
04:04 ugexe looks like it may be fixed now
04:06 tinyblak joined #perl6
04:07 ugexe i saw this because here Slang::SQL also clearly fails it Test stage but is marked as passed: http://testers.perl6.org/r​eport/dist/Slang::SQL/8215
04:08 ugexe 1 day later it was tested again with the same output but is marked as fail: http://testers.perl6.org/r​eport/dist/Slang::SQL/8814
04:09 skids OK, so it was previously fixed, just Sum had no tests run since the fix, you mean?
04:10 ugexe well i dont know if it was actually fixed, it just seems like it may be
04:11 skids Ah.
04:11 ugexe my $x = pipe("prove -e 'perl6 -Ilib' t/ 2>&1"); say $x.handle.close == 0;
04:11 ugexe can you run that on your bsd machine?
04:11 ugexe i think that will give you the exit code
04:12 skids I don't have one, that's someone else's test.
04:12 ugexe ah
04:13 ugexe nope, you have a failure on the same day using the same compiler and backend
04:13 ugexe a failure that says pass^
04:16 * skids busy hunting for 6 AWOL wifi APs.
04:19 ugexe i submitted a issue to panda's repo (even though it could be a rakudo or nqp pipe bug) https://github.com/tadzik/panda/issues/130
04:19 skids ugexe++
04:28 Mouq joined #perl6
04:32 ugexe i just fired off a legit passing test for Sum (on debian) fwiw http://testers.perl6.org/report/dist/Sum/8978
04:38 skids Thanks.
04:41 adu joined #perl6
04:42 skids Architecture "64" hmm.
04:43 adu skids: what are you talking about?
04:46 skids On your test the "Architecture" column just says "64".  Probably can't parse the OS string or something.
04:52 skids Yep same with my debian test.
04:58 adu my test?
04:59 adu your test?
04:59 ugexe skids: its under the debian column
05:01 anaeem1 joined #perl6
05:02 ugexe or you mean parse the arch out of os string
05:02 ugexe s/or/oh/
05:03 ugexe odd, for hardware it has x86_64
05:12 Sqirrel joined #perl6
05:17 chenryn joined #perl6
05:25 tinyblak joined #perl6
05:28 Sqirrel joined #perl6
05:33 TimToady m: say << a b c 'x' >>[0]
05:33 camelia rakudo-moar 80b912: OUTPUT«a b c␤»
05:33 * TimToady is testing a fix for this...
05:40 yeahnoob joined #perl6
05:41 yeahnoob joined #perl6
06:00 chenryn joined #perl6
06:01 TimToady unfortunately, it appears that there's a different part of the parser that depends on the bug, but it's minor, so I'm gonna check it in anyway, I think
06:02 dalek roast: d8d3a15 | TimToady++ | S02-literals/quoting.t:
06:02 dalek roast: ensure << a b c 'x' >> doesn't parcelize <a b c>
06:02 dalek roast: review: https://github.com/perl6/roast/commit/d8d3a15aa7
06:02 dalek rakudo/nom: 4c6cfab | TimToady++ | src/Perl6/Actions.nqp:
06:02 dalek rakudo/nom: make << a b c 'x' >>[0] return 'a' not 'a b c'
06:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4c6cfab0cf
06:04 chenryn joined #perl6
06:10 dalek roast: 2edaa16 | TimToady++ | S06-operator-overloading/sub.t:
06:10 dalek roast: fudge circumfix:<<` `>> misparse for now
06:10 dalek roast: review: https://github.com/perl6/roast/commit/2edaa16c91
06:11 sqirrel_ joined #perl6
06:16 TimToady jnthn: ^^ I don't understand how the old code produced "` `" for that, which is apparently simple enough to pass the 'too complex to use in name' check
06:17 TimToady fixing the bug I just fixed, the <<` `>> construct now properly returns ("`", "`"), but this gives the circumfix parser heartburn, so I've fudged the test for the moment
06:18 TimToady I also don't understand why ("`","`") isn't considered to have a compile-time value...
06:19 TimToady the test in question seems to be examining the parts of the infix:<,>, but failing anyway
06:48 chenryn joined #perl6
06:52 araujo joined #perl6
06:54 kaleem joined #perl6
06:58 xinming joined #perl6
06:59 dayangkun joined #perl6
07:04 Mso150 joined #perl6
07:22 sergot_ hi o/
07:22 raydiak \o sergot
07:23 darutoko joined #perl6
07:24 sergot_ tony-o: it should handle server connections
07:24 Exodist joined #perl6
07:24 sergot_ tony-o: and yeah, it has poor tests :(
07:24 sergot_ hi raydiak ! :)
07:25 IllvilJa joined #perl6
07:26 Woodi hallo #perl6 :)
07:26 yeahnoob joined #perl6
07:27 sergot_ hi Woodi :)
07:27 yeahnoob joined #perl6
07:27 yeahnoob joined #perl6
07:28 yeahnoob joined #perl6
07:29 yeahnoob joined #perl6
07:31 Woodi it is a bit strange question: which one to learn v5 or v6 ?  and even more uncomfortable to answer it. but I wonder if good answer thes days is: learn both and you will use one which match your use case (app for sale/learning to program/hobby scripting)
07:32 Woodi I think in last years multi-languagines is common in IT. even in Java/MS shops :)
07:33 Woodi and all the Hello Worlds looks nearly identical in all languages :)
07:34 Woodi perfect lesson for newbie programmer
07:39 Woodi there is no moarvm in Debian repos, which is good news. we can make one so we can keep it up to date. Debian have Rakudo from 2014.07 (what is not so bad) but it is 2 R* behind current
07:39 Ugator joined #perl6
07:46 El_Che Hi Woodi: I think perl5 would be easier to learn because there are great books out there. v6 will get there soon, I hope
07:48 Woodi El_Che: the problem is that "learn" depends on student case... learn can be "just make a script I need" or "complete knowledge to put into CV"...
07:51 lumimies joined #perl6
07:52 El_Che Woodi: true. But often those 2 scenarios are related
07:58 fhelmberger joined #perl6
07:58 raydiak yes p5 would likely be easier to get started with. but it doesn't really answer the question of "which to learn"...that choice can only sensibly be made in the context of your goals and motivations, like any choice
07:59 raydiak iow my answer is it's impossible to give a good answer without more information specific to each individual...even learning both would often be the least sensible thing to do, depending on what your gaol is
07:59 raydiak *goal
08:01 raydiak heck sometimes the most sensible thing to do is pull out a notebook and pencil :)
08:01 moritz \o
08:02 raydiak o/
08:05 Woodi but is using many languages more common now ? this is my impresion in last years...
08:06 [Sno] joined #perl6
08:07 JimmyZ learn both, and then choose which you want to learn more
08:09 raydiak JimmyZ++, well put...if you have to seriously ask yourself this, you'd be well-served to at least spend a few hours or days with each before deciding
08:10 eternaleye joined #perl6
08:14 Woodi btw. not so long ago I hear my uncle (who is building and fixing thing real things) stated thet he probably will be learning to his death :
08:14 Woodi becouse water and masonery and other "technologies" is evolving :)
08:15 Woodi *are
08:23 zakharyas joined #perl6
08:31 Woodi hmm, found MoarVM on the list of not ready packages...  https://www.debian.org/devel/wnpp/being_packaged
08:31 sirdancealot joined #perl6
08:34 pdcawley joined #perl6
08:34 rindolf joined #perl6
08:41 krunen joined #perl6
08:42 tinyblak joined #perl6
08:48 virtualsue joined #perl6
08:57 tinyblak joined #perl6
08:58 masak good morning, #perl6
08:58 moritz good masak, morning
08:58 lizmat joined #perl6
08:58 masak ice-breaker of the day: the README.md of https://github.com/masak/007 is clearly inadequate as it stands. what should a decent project have in its README.md, and in what order?
08:59 * masak wishes he could remember where he read about the need for a section "## But is it awesome?nYes." in all project READMEs
09:01 anaeem1 joined #perl6
09:02 cognominal joined #perl6
09:03 rurban joined #perl6
09:06 moritz masak: it needs a story, like ufo's README :-)
09:08 abraxxa joined #perl6
09:09 FROGGS joined #perl6
09:10 anaeem1_ joined #perl6
09:11 jluis joined #perl6
09:12 abraxxa joined #perl6
09:12 telex joined #perl6
09:17 baest joined #perl6
09:20 vendethiel joined #perl6
09:20 molaf__ joined #perl6
09:21 masak moritz: hokay. remember, you asked for it. :P
09:24 dalek specs/newio: f2ed255 | (Stéphane Payrard)++ | S99-glossary.pod:
09:24 dalek specs/newio: gorilla/banana problem
09:24 dalek specs/newio: review: https://github.com/perl6/specs/commit/f2ed2550e7
09:24 dalek specs/newio: 210cb23 | (Stéphane Payrard)++ | S99-glossary.pod:
09:24 dalek specs/newio: fixing outward links in gorilla/banana
09:24 dalek specs/newio: review: https://github.com/perl6/specs/commit/210cb23166
09:24 dalek specs/newio: 197d679 | (Stéphane Payrard)++ | S99-glossary.pod:
09:24 dalek specs/newio: FP
09:24 dalek specs/newio: review: https://github.com/perl6/specs/commit/197d67905f
09:24 dalek specs/newio: 17976d9 | lizmat++ | S99-glossary.pod:
09:24 dalek specs/newio: Merge branch 'master' into newio
09:24 dalek specs/newio: review: https://github.com/perl6/specs/commit/17976d9b9b
09:26 yeahnoob joined #perl6
09:26 yeahnoob joined #perl6
09:27 yeahnoob joined #perl6
09:28 yeahnoob joined #perl6
09:29 yeahnoob joined #perl6
09:29 yeahnoob joined #perl6
09:30 yeahnoob joined #perl6
09:31 yeahnoob joined #perl6
09:35 Ovid joined #perl6
09:36 CurtisOvidPoe Morning all. Can anyone tell me why this doesn’t print the k/v pairs I’m expecting? https://gist.github.com/Ovid/fc552949223750349a8b
09:37 dakkar joined #perl6
09:38 moritz CurtisOvidPoe: because the match object isn't global
09:38 CurtisOvidPoe I don’t know what that means.
09:38 anaeem1 joined #perl6
09:39 moritz ok, the grep gets a block, { / $<key>=\w+ ',' $<value>=\w+ / }
09:39 arnsholt It means that $fh.lines.grep({ / $<key>=\w+ ',' $<value>=\w+ / }) is basically $fh.lines.grep({ my $/; / $<key>=\w+ ',' $<value>=\w+ / })
09:39 moritz and inside that grep, there's a $/, which is the match object
09:39 arnsholt So the $/ you're accessing in the loop isn't the one you're accessing in the grep closure
09:39 moritz but there's no mechanism to get one match per list item into the for-block
09:40 CurtisOvidPoe So I *can’t* use the $fh.lines.grep idiom and capture the data after? (Since {} forces a closure, that belatedly makes sense)
09:40 moritz no
09:41 moritz there are two idiomatic ways to do it (IMHO)
09:41 moritz one is to say $fh.lines.map(/ $<key>=\w+ ',' $<value>=\w+ /).grep(*.so).map( -> $/ { say $<key>, $<value> })
09:41 moritz that is, first transform into match objects
09:42 moritz and the other is a bit more procedural:
09:42 dayangkun joined #perl6
09:42 moritz my @result = gather for $fh.lines { if /regex here/ { take $<key> => $<value> } }
09:42 dalek rakudo/nom: fd77386 | lizmat++ | src/core/Inc.pm:
09:42 dalek rakudo/nom: Apparently, *all* backends need a populated $*VM
09:42 dalek rakudo/nom:
09:42 dalek rakudo/nom: to be able to create valid precomped modules.  Please note that this does
09:42 dalek rakudo/nom: *not* fix #123276 on the JVM, but at least it now generates an error that
09:42 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=123276
09:42 dalek rakudo/nom: actually indicates the problem.
09:42 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fd77386616
09:43 CurtisOvidPoe The first won’t fly. I’m trying to cherry pick the “Perl 6 for Mere Mortals” idioms.
09:45 CurtisOvidPoe For the second, that “take” returns pairs with the key being a string and the value being a match object. That
09:45 CurtisOvidPoe That seems counterintuitive.
09:46 CurtisOvidPoe To make it work, I need take $<key> => ~$<value>
09:46 CurtisOvidPoe Or is that a bug?
09:46 moritz no, not a bug
09:46 btyler_ lizmat: to follow up on Inline::P5 and threading stuff -- after a bit of consideration, it seems obvious that having multiple threads access p5 guts in parallel is going to be a Bad Time. firing up a new I::P5 object per thread works great as long as perl is compiled with -Dusemultiplicity
09:46 masak no, you have to stringify explicitly.
09:47 moritz CurtisOvidPoe: elements of match objects are match objects again (it's a tree), it's just that pair keys stringify by default (I think)
09:47 masak that gather/take example feels funny to me. I knew you were trying to fix the grep example, but if I saw such a gather/take with an if in it, I'd go "that one is better written as a grep"...
09:47 moritz the => stringifies the key
09:48 moritz masak: except it's not a pure grep, because it also transforms the data
09:48 moritz one could also write .map({ /regex/; $<key> => ~$<value> if $/ })
09:48 masak I think I'm not seeing the part where it transforms the data.
09:48 CurtisOvidPoe I’ve found plenty of examples for my “mere mortals” talk which are clean and easy, but if I add that lines.map.grep.map example, I’ll get laughed out of the room.
09:48 masak I just see a pair.
09:50 moritz masak: it turns a string (the line) into a pair
09:51 moritz CurtisOvidPoe: then go with the gather/take, that's fairly intuitive, IMHO
09:51 masak "it turns an X into a Y" is what grep *does*.
09:51 moritz no
09:51 moritz grep is "select only the Y"
09:51 masak oh wait. yes.
09:51 CurtisOvidPoe grep is likely better written as “filter” and map as “transform"
09:51 CurtisOvidPoe (No, I’m not suggesting we change those names :)
09:51 moritz masak++ usually knows that :-)
09:52 masak yeah, momentary lapse.
09:52 masak now would be a good time to claim that I need to learn more FP, though :P
09:53 masak CurtisOvidPoe: "map" and "transform" are synonyms in English, no? given how useful "map" is, I think three letters is much better Huffman than nine.
09:53 masak the etymology of "grep" is exceesdingly silly, but it's also nice and short. and it kinda "rhymes" with "map".
09:53 CurtisOvidPoe “map” is ambiguous in the English language, but “transform” is not.
09:54 masak "map" as a verb is not that ambiguous, IMO.
09:54 masak "map these things to those things"
09:54 btyler_ let's map out the project
09:54 CurtisOvidPoe To “map something out” is to plan it.
09:54 CurtisOvidPoe Heh :)
09:54 * lizmat also likes the audio proximity of grep and grok
09:55 CurtisOvidPoe I know people love Huffman encoding (I usually do), but I’ll cheerfully go with a longer keyword if it’s more clear.
09:55 * moritz must agree with python that "filter" is a very good name for "grep"
09:55 masak it is.
09:55 CurtisOvidPoe grok I could live with due to the silliness :)
09:56 btyler_ also, CurtisOvidPoe, -great- idea for a talk -- looking forward to it :)
09:56 moritz and grog you could dring :-)
09:56 moritz erm, drink :-)
09:57 CurtisOvidPoe btyler_: Thanks, but I have to admit that I’m finding it harder and harder to find examples “for mere mortals”. It’s making me feel uncomfortable with the premise.
09:57 btyler_ one of the things I struggled with when I started getting into p6 was that a lot of the examples floating around were written by core p6 hackers showing off some amazingly powerful feature in a handful of lines, which was often hard to digest as someone who only knew a bit
09:57 CurtisOvidPoe Agreed.
09:57 CurtisOvidPoe That’s been scaring people off for a long time. In Perl 5, I wouldn’t show symbol table hackery to a newbie to get around a renamed method.
09:58 btyler_ pssh, 'no strict "refs"' is a great first step :D
09:59 btyler_ but yeah, absolutely agreed
09:59 CurtisOvidPoe Heh.
10:00 CurtisOvidPoe The .perl method has no formatting options, right?
10:00 moritz correct
10:01 sven_123 joined #perl6
10:02 CurtisOvidPoe Is it planned in the future, or is it staying the way it is?
10:03 JimmyZ stay, I would say
10:03 moritz I'm not sure
10:03 moritz we need some work for making .perl work on cyclic object graphs
10:04 JimmyZ .perl return codes that can be evaled?
10:04 moritz maybe in that course it would make sense to add some formatting too
10:04 moritz JimmyZ: yes
10:04 moritz JimmyZ: but in practice, it's mostly used for debugging
10:04 moritz not for serialization
10:04 JimmyZ and gist too?
10:05 CurtisOvidPoe Thanks.
10:05 bjz joined #perl6
10:06 bjz joined #perl6
10:12 lizmat moritz: disagree, .perl *should* be for serialization of data structure, in my opinion
10:12 lizmat we cannot use precomp for that, as we cannot carry that between Perl 6 versions
10:12 moritz lizmat: in principle, I agree. In practice, that's not how it tends to be used.
10:13 moritz I mean yes, it should still support that use case
10:13 moritz but we should be aware that it's not the only use case
10:18 lizmat moritz: fair
10:19 lumimies I'm wondering if it might return an AST at some point
10:25 jnthn CurtisOvidPoe: If you don't .lines first, and just .slurp the file and .match with the regex, you're looping over a bunch of matches.
10:25 jnthn m: my $a = "x=1\ny=2\n"; for $a.match(/$<key>=\w+ '=' $<value>=\w+/, :g) { say .<key> }
10:25 camelia rakudo-moar 80b912: OUTPUT«「x」␤␤「y」␤␤»
10:25 jnthn m: my $a = "x=1\ny=2\n"; for $a.match(/$<key>=\w+ '=' $<value>=\w+/, :g) { say .<key> ~ ' is ' ~ .<value> }
10:25 camelia rakudo-moar 80b912: OUTPUT«x is 1␤y is 2␤»
10:26 CurtisOvidPoe jnthan: I didn’t slurp because I was showing the common newbie mistake of confusing for/while on filehandles, but since they’re lazy in Perl 6, it’s not a disaster.
10:26 jnthn Ah
10:26 brrt joined #perl6
10:27 jnthn m: my $a = "x=1\ny=2\n"; for $a.lines>>.match(/$<key>=\w+ '=' $<value>=\w+/, :g) { say .<key> ~ ' is ' ~ .<value> } # works, though is back in the category of "more than I want to have to explain"
10:27 camelia rakudo-moar 80b912: OUTPUT«x is 1␤y is 2␤»
10:27 brrt \o
10:28 CurtisOvidPoe You mean “back in the category of “more than Ovid could explain”
10:28 CurtisOvidPoe Wait, no, that’s actually not too bad.
10:28 Patterner joined #perl6
10:29 jnthn To be honest, though, I'd probably have just written the imperative solution here
10:30 jnthn m:  my $a = "x=1\ny=2\n"; for $a.lines { next unless /$<key>=\w+ '=' $<value>=\w+/; say "$<key> is $<value>" }
10:30 camelia rakudo-moar 80b912: OUTPUT«x is 1␤y is 2␤»
10:30 btyler_ well, there's also something akin to what moritz said: for $fh.lines.map({ /$<key>=\w+ ',' $<value>=\w+ /; $/}) { say ~$<key>, ~$<value>; }
10:30 CurtisOvidPoe That’s what I want to convey to the audience: don’t worry about the tricks people show in *any* language: it’s still easy to get your job done.
10:30 jnthn 'cus most mre mortals I know find loops easier than greps :)
10:31 CurtisOvidPoe And quite often, the for loop is better if I’ve too much logic.
10:31 btyler_ seeing the match object referenced is probably not very newbie friendly though
10:32 jnthn Maybe also nice
10:32 jnthn m:  my $a = "x=1\ny=2\n"; for $a.lines { when /$<key>=\w+ '=' $<value>=\w+/ { say "$<key> is $<value>" } }
10:32 camelia rakudo-moar 80b912: OUTPUT«x is 1␤y is 2␤»
10:32 jnthn Extra block, but reads clearly.
10:32 jnthn Heck, so does if :)
10:33 CurtisOvidPoe btyler_: Agreed. I suspect that always having to remember to force string context is going to irritate people.
10:33 jnthn Depends what else is going on.
10:33 pecastro joined #perl6
10:34 lizmat CurtisOvidPoe: fwiw, that is something that [Tux] also ran into when working on Text::CSV for perl 6
10:35 CurtisOvidPoe lizmat: Didn’t know that. Thanks. Having the common cases accomodated is a good thing. Not seeing that here.
10:36 CurtisOvidPoe (though I hate saying it that way because it sounds harsh. My apologies)
10:37 dalek Inline-Perl5: 0df0f3d | ab5tract++ | README.md:
10:37 dalek Inline-Perl5: Clarify that you might need -Dusemultiplicity
10:37 dalek Inline-Perl5:
10:37 dalek Inline-Perl5: If you want to play with interpreter pools or anything like that, you need to be able to create a re-entrant-safe version of libperl. This option is leveraged by the likes of nginx/uwsgi, so it seems to be one of the "safe options" you can enable in Perl 5.
10:37 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/0df0f3d4b0
10:37 dalek Inline-Perl5: 769ce38 | niner++ | README.md:
10:37 dalek Inline-Perl5: Merge pull request #9 from ab5tract/patch-1
10:37 dalek Inline-Perl5:
10:37 dalek Inline-Perl5: Clarify that you might need -Dusemultiplicity
10:37 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/769ce38c0f
10:37 jnthn Well, in the example I showed, the interpolation puts the thing in string context, meaning it's not required to force it.
10:39 jnthn But yes, sometimes I find myself needing to prefix ~ it also.
10:39 CurtisOvidPoe jnthn: that’s true, but for larger systems, we’re typically reading data and shoving it into variables/objects, and so on, and not printing it.
10:45 fwilson joined #perl6
10:45 jnthn CurtisOvidPoe: Yes, though even there you may be doing other things that enforce a string context. And even if match live longer than they need to by being stored, it's likely to manifest as a memory inefficiency rather than a correctness issue.
10:46 jnthn *matches
10:47 bjz joined #perl6
10:49 vendethiel joined #perl6
10:56 jnthn lunch &
10:57 [TuxCM] joined #perl6
11:01 sqirrel_ joined #perl6
11:03 TuxCM joined #perl6
11:03 chenryn joined #perl6
11:05 pdcawley joined #perl6
11:07 virtualsue joined #perl6
11:15 vendethiel joined #perl6
11:21 masak question of the day: you're the designer in a team tasked with building a language that compiles down to JavaScript. due to some weird glitch in planning, the team is supposed to build *your* ideal language that targets JS. what design do you hand them?
11:21 cognominal joined #perl6
11:24 donaldh joined #perl6
11:29 chenryn joined #perl6
11:39 cognominal joined #perl6
11:43 lizmat masak: Perl 6 with a JS backend ?
11:43 denis_boyun_ joined #perl6
11:44 masak that's certainly a valid answer, and one I guess I should have expected from #perl6 ;)
11:49 bjz joined #perl6
11:57 FROGGS[mobile] joined #perl6
11:59 pecastro joined #perl6
11:59 vendethiel joined #perl6
12:01 nwc10 masak: if your bonus is based on how fast they complete the job - Ook! ? :-)
12:01 nwc10 (was it specified as needing to be useful, rather than simply Turing complete)
12:05 moritz nwc10: I guess javascript as input language would be even simpler :-)
12:05 moritz "javascript to ecmascript compiler"
12:05 moritz (usually delivered as /bin/cat)
12:05 xfix joined #perl6
12:08 lizmat masak: wouldn't that be the ultimate dogfooding for you and the team ?
12:17 FROGGS[mobile] will the Team get payed well? do they still search for people?
12:17 moritz FROGGS[mobile]++ # asking the right questions :-)
12:19 FROGGS[mobile] :o)
12:20 bjz joined #perl6
12:21 masak the team gets paid ridiculously well. the also get free food and infinite backrubs.
12:21 moritz where do I apply? :-)
12:24 FROGGS[mobile] consider me signed! /o/
12:24 masak I guess in this hypothetical scenario, the positions have already been filled.
12:25 masak but Iäll let you know if something opens up.
12:25 masak I'll*
12:27 FROGGS[mobile] Hulk is sad
12:28 moritz SMASH!
12:29 rindolf joined #perl6
12:43 denis_boyun_ joined #perl6
12:43 sqirrel_ joined #perl6
12:44 vendethiel joined #perl6
12:50 pecastro joined #perl6
12:53 bjz joined #perl6
12:58 denis_boyun_ joined #perl6
13:01 nwc10 moritz++
13:04 kaleem joined #perl6
13:17 donaldh joined #perl6
13:19 vendethiel joined #perl6
13:28 rindolf joined #perl6
13:31 bjz joined #perl6
13:32 raiph joined #perl6
13:38 lizmat is there a reason why we can't optimize method dispatch:<!> away ?
13:38 lizmat .tell jntnn is there a reason why we can't optimize method dispatch:<!> away ?
13:38 yoleaux lizmat: I'll pass your message to jntnn.
13:39 dalek specs: 518438a | (Stéphane Payrard)++ | S99-glossary.pod:
13:39 dalek specs: laziness and other entries
13:39 dalek specs: review: https://github.com/perl6/specs/commit/518438a93f
13:39 lizmat .tell jnthn I was under the impression that it could basically become a sub call internally ?
13:39 yoleaux lizmat: I'll pass your message to jnthn.
13:44 bjz joined #perl6
13:45 zakharyas joined #perl6
13:51 moritz tadzik: could you please merge https://github.com/tadzik/synopsebot/pull/4 and then restart synopsebot? thanks
13:53 masak as a followup to my question about compile-to-JS before -- what's the status of pmurias++' work on the NQP/Rakudo JS backend?
13:54 masak I also noticed that https://twitter.com/rakudoperl besides not showing any R* release messages for a while, still describes itself as "The Perl 6 compiler for Parrot".
13:54 masak who owns that account? pmichaud?
13:54 moritz I think so
13:54 [Coke] is there a ticket open for R* hanging on parrot?
13:54 [Coke] R* build, that is.
13:55 moritz and iirc nqp-js was (mostly?) bootstrapped, and then pmurias++ decided to re-work some codegen stuff
13:55 moritz [Coke]: no; I've wanted to track it down a bit further before ticketing it (and then my laptop's power supply broke)
13:56 [Coke] ok, but sounds like you're on it. moritz++
13:56 vendethiel joined #perl6
13:56 moritz well, I would be :-)
14:03 synopsebot joined #perl6
14:03 tadzik moritz: should be okay, thanks
14:04 * [Coke] has the compiler release this month, he thinks.
14:05 pdcawley_ joined #perl6
14:06 masak sudden thought: instead of trying to fit a square peg in a sqround hole with the <foo 5 1/2> syntax and allomporhic types, perhaps it would make more sense to have <foo 5 1/2> be completely non-magical and just give a list of three Str, but then also provide a really short primitive to do the conversion? a listop, or an adverb, or something. make it opt-in.
14:06 masak this is the kind of idea that I suspect sounds good in my head but that TimToady will reject with some reason I cannot predict :)
14:07 moritz masak: the reason for IntStr and the likes is to satisfy type constraints from MAIN subs
14:08 colomon a reason, rather
14:08 masak ...and there are good reasons to unify the type conversion on cmdline args, and the type conversion of <foo 5 1/2>. got it.
14:08 spider-mario joined #perl6
14:10 chenryn joined #perl6
14:10 colomon There was also an idea that (say) RatStr would allow you to default to a reasonable numeric approximation, while not throwing away additional Str information that could be used to construct a FatRat.
14:13 dalek rakudo/nom: f6efe05 | coke++ | docs/release_guide.pod:
14:13 dalek rakudo/nom: stub in release dates for 2015
14:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f6efe050b9
14:14 [Coke] ^^ after january, no compiler releases are claimed.
14:14 skids joined #perl6
14:16 moritz [Coke]: I hope you used tools/release-dates.pl to generate those? :-)
14:17 dalek rakudo/nom: 6a19d45 | lizmat++ | / (2 files):
14:17 dalek rakudo/nom: Add some copyrights
14:17 dalek rakudo/nom:
14:17 dalek rakudo/nom: Did I miss any?
14:17 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6a19d4572d
14:24 [Coke] moritz: no, I did it the old fashioned way.
14:24 [Coke] because I've never heard of that program.
14:25 lizmat can someone explain me why the first ACCEPTS in Regex.pm is assigning to $dollar_slash ?
14:25 lizmat feels like a copy-pasto
14:25 dalek rakudo/nom: 2542c3d | moritz++ | docs/release_guide.pod:
14:25 dalek rakudo/nom: Mention tools/release-dates.pl in the release guide
14:25 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2542c3d46a
14:26 moritz lizmat: as opposed to doing what?
14:27 lizmat well, for one, I don't see why the last $dollar_slash assignment is done
14:27 moritz lizmat: inlining the nqp::getlexrelcaller() call?
14:27 moritz so that $/ is set?
14:27 moritz lizmat: note that the first line is a binding, not an assignment
14:27 lizmat ah, duh
14:30 bjz joined #perl6
14:32 KCL joined #perl6
14:35 vendethiel joined #perl6
14:41 pmurias joined #perl6
14:42 abraxxa jnthn: I need help with NativeCall to get on with DBDish::Oracle, do you have time to help me and if yes when?
14:42 abraxxa especially passing utf16 encoded strings and their length in bytes
14:45 pmurias masak: after gsoc it was at the almost bootstrapping point. It was running at sub-parrot speeds which was embarassing. The code quality was horrible. I then set on a rewrite of the code-gen and a cleanup.
14:45 pmurias masak: currently the next thing will be multis
14:46 pmurias masak: progress is currently stalled as I'm busy with other things
14:47 pmurias github.com/pmurias/nqp-js/blob/​master/src/vm/js/bin/run_tests contains the current list of passing tests
14:48 pmurias ...broken link.. (fixing)
14:53 pmurias http://github.com/pmurias/nqp-js/b​lob/master/src/vm/js/bin/run_tests
14:55 masak pmurias++ # work so far
14:55 masak pmurias++ # status update for the curious
14:58 [particle]1 joined #perl6
15:03 cognominal joined #perl6
15:04 pdcawley joined #perl6
15:10 chenryn joined #perl6
15:12 Ugator joined #perl6
15:17 kjs_ joined #perl6
15:17 chenryn joined #perl6
15:22 mr-foobar joined #perl6
15:25 kjs__ joined #perl6
15:30 kurahaupo joined #perl6
15:31 amkrankruleuen joined #perl6
15:31 raiph joined #perl6
15:35 hoelzro morning #perl6
15:36 masak \o
15:36 tinyblak joined #perl6
15:46 treehug88 joined #perl6
15:53 masak maybe now that it's 2015, we should start asking people what, if any, future point they're still waiting for when Perl 6 gains some capability, after which they would start adopting Perl 6, or adopt it more?
15:54 dalek perl6-roast-data: 44f39b7 | coke++ | / (5 files):
15:54 dalek perl6-roast-data: today (automated commit)
15:54 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/44f39b7888
15:55 [Coke] my ideal six would be a nice DB interface and me actually doing something useful with mojo6.
15:56 masak that does sound rather wonderful.
15:56 masak it also aligns well with my goal of (re-)building November using a modern Rakudo stack.
15:56 hoelzro mojo6++
15:57 hoelzro [Coke]: do you have a repo started for that?
15:58 colomon masak: personally, my impression is the biggest issue is making what we have now work
15:58 [Coke] hoelzro: aye. haven't touched it in a while: https://github.com/coke/mojo6 stuff that is there is only the cleaned up utils.
15:59 colomon having module precomp and threading unreliable is disheartening
15:59 [Coke] well, I have a personal focus this year of trying to make $dayjob more fun, so here we go.
15:59 masak colomon: that's very true.
15:59 masak colomon: how can we get better at that in the short term? in the long term?
16:00 hoelzro I would also like to see a more reliable precomp
16:00 colomon masak: I don't know
16:00 colomon if I knew, I probably would have made time in my schedule to fix it.  ;)
16:00 hoelzro although I think the problem with colomon's ABC is the only outstanding issue, but the circumstances are so bizarre and convoluted, that it probably indicates a deeper problem =/
16:01 colomon hoelzro: I fear the only reason it's the "only" outstanding issue here is that it's one of the more complex p6 projects out there.
16:01 bjz joined #perl6
16:01 hoelzro oh, I completely agree
16:03 hoelzro I have tried several times to find out the reason for it =/
16:03 hoelzro I think that task is for someone with far greater Moar fu than I
16:03 colomon anyway, if you'd ask me a year ago I'd have said performance, performance, performance.  There's still lots of room for improvement here, but "making it work" has a higher priority IMO
16:05 skids precomp and threading stability/performance definitely at the top of the list.  For me native sized int and uint support also pretty high.  Remaining diamond composition problems are a pain but not a blocker.
16:06 skids I tried to do some work scripting in P6/Inline-P5 but the async stuff was causing segfaults and it topped out at 1KHz passing emits between asyncs, too slow.
16:07 liztormato joined #perl6
16:08 liztormato skids: afaik, diamond precomp issue only exists on jvm
16:08 skids No, with roles they are on all backends.
16:09 liztormato Are there tests for that?
16:09 skids r: role A { has $.a }; role B does A { }; role C does A { }; role D does C does B { }; D.new
16:09 camelia rakudo-parrot 80b912: OUTPUT«Attribute '$!a' conflicts in role composition␤  in any apply at gen/parrot/Metamodel.nqp:1727␤  in any compose at gen/parrot/Metamodel.nqp:1817␤  in any specialize_with at gen/parrot/Metamodel.nqp:2249␤  in any specialize at gen/parrot/Metamodel.…»
16:09 camelia ..rakudo-moar 80b912: OUTPUT«Attribute '$!a' conflicts in role composition␤  in any apply at src/gen/m-Metamodel.nqp:1662␤  in any compose at src/gen/m-Metamodel.nqp:1752␤  in any specialize_with at src/gen/m-Metamodel.nqp:2184␤  in any specialize at src/gen/m-Metamodel.nqp:22…»
16:10 skids r: role A { method foo }; role B does A { }; role C does A { }; role D does C does B { }; D.new
16:10 camelia rakudo-{parrot,moar} 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Missing block�at /tmp/tmpfile:1�------> [32mrole A { method foo [33m�[31m}; role B does A { }; role C does A { };[0m�»
16:10 skids oops.
16:10 jnthn Roles are *flattening* composition.
16:10 yoleaux 13:39Z <lizmat> jnthn: I was under the impression that it could basically become a sub call internally ?
16:11 btyler_ skids: async + Inline::P5 stability at least partially involves the programmer not trying to access a single perl5 interpreter's guts from multiple p6 threads
16:12 jnthn And we decided that attributes declared in a role should be visible in the composing class.
16:12 skids btyler_: thanks I'll see if that helps/
16:12 btyler_ there was a PR merged into Inline::P5 today that mentions the need for a perl with -Dusemultiplicity if you want to go that direction
16:12 btyler_ basically: make sure you've got a different I:P5 object for each thread
16:12 jnthn .tell lizmat The optimizer (Perl6::Optimizer) already has logic for optimizing away the dispatch:<!> call in most cases.
16:12 yoleaux jnthn: I'll pass your message to lizmat.
16:13 skids jnthn: so that means...?  I'm no CS major.
16:14 sjn \o
16:16 vendethiel skids: that's not CS-related. basically, "does"-ing a role is like copy-pasting its content
16:16 vendethiel so you effectively end up with `role D { has $.a; has $.a; }`
16:16 skids Right, but last time I looked, there was language explicitly permitting crony roles to do that in the spec.
16:16 vendethiel (first one from A, second one from B)
16:16 vendethiel there's no shadowing possible, because it's shallowly "pasted" into the class
16:20 sqirrel_ joined #perl6
16:21 raiph I have a question about my hack.perl6.org account
16:21 raiph When I first got it I ran `rakudobrew build moar` and it worked
16:21 raiph I reran `rakudobrew build moar` a few days later and it worked again
16:21 raiph Now I get `fatal: could not create work tree dir 'moar-HEAD'.: Permission denied`
16:22 raiph My question: anyone know of some relevant system thing that changed?
16:23 skids So if the above is "functioning as intended" then the spec is out of sync.  Basically the way the spec views it no matter how many paths a role gets put into another role, it just goes in once and so can never self-conflict.
16:25 raiph moritz: Any ideas? ^^
16:31 chenryn joined #perl6
16:32 Mso150 joined #perl6
16:33 psch hi #perl6 \o
16:33 psch raiph: did you source ~rakudobrew/rakudobrew-bash or did you clone your own rakudobrew?
16:34 bjz joined #perl6
16:34 psch i'd think either you did have your own or permissions for ~rakudobrew used to be different
16:34 psch if the former than i don't have any other ideas
16:35 raiph psch: Before I ran `rakudobrew` back in Dec, I added the `source ...` line to my ~/.profile per https://github.com/perl6/infrastructure-doc/b​lob/master/hosts/hack.p6c.org.pod#rakudobrew
16:36 kaleem joined #perl6
16:36 skids Also IIRC a separate issue I ran into along those lines is that when you do want to resolve a real conflict between roles, there was no syntax to do so if those roles were two different parameterizations of the same role; though I guess you could do that through a couple shim roles.
16:40 psch raiph: in that case i suppose the permissions for ~rakudobrew changed.  moritz will probably be able to tell you more though...
16:40 raiph psch: Coincidentally the reason I'm on hack is to install latest jvm to test your latest interop stuff before writing an SO answer about it :)
16:41 japhb masak: There are a number of things I want in Rakudo for 2015, but the only one that's really critical is stability, because crashes and/or wrong answers are absolutely killing my carefully crafted creations.  Performance is a close second, because I can't scale up to decent-sized data sets without getting too slow for interactive use.
16:42 psch raiph: maybe just get a local copy of rakudobrew for now
16:43 raiph psch: I'll wait to see moritz's response but local rakudobrew will be plan B, thx
16:43 japhb masak: After that I'd say I want spec stability in the language core and setting, so I can focus on the stuff at the fringe.  To whit, I'd like to see GLR done (with its related semantic changes), IO get to a sane state that really handles all the use cases well so we don't have to keep changing it, and so on.
16:45 TimToady NFG is also a semantic hit, NSA probably not so much
16:45 japhb masak: And only after all that do I really get to language and setting *features*, which I do believe need to be filled out more before 6.0.0, but actually turn out to be well down my heirarchy of needs.
16:46 MARTIMM joined #perl6
16:46 japhb TimToady: Completely granted.  It happens I'm not working on problems that expose NFG right now, but I assume others are.  And it's pretty darned core.
16:52 rindolf joined #perl6
16:53 rindolf joined #perl6
16:54 rindolf joined #perl6
16:55 * sjn wonders if perl6 has some easy-to-use method modifers (before/after/around)
16:58 rindolf joined #perl6
16:59 rindolf joined #perl6
16:59 bjz joined #perl6
16:59 PerlJam sjn: My brain latches onto wrap, callsame, nextsame, callwith, and nextwith  when I think about "method modifiers"
17:00 rindolf joined #perl6
17:00 * sjn found Method::Modifiers
17:01 rindolf joined #perl6
17:04 [Sno] joined #perl6
17:05 [Coke] if you're using ~rakudobrew, should you be building your own rakudobrew?
17:06 [Coke] I would kind of expect that to fail unless you sudo'd.
17:10 telex joined #perl6
17:17 client_11045 joined #perl6
17:20 client_11045 sub aaa{} aaa();
17:22 psch m: sub aaa{}; aaa
17:22 camelia rakudo-moar 80b912: ( no output )
17:24 psch m: sub foo { say &?ROUTINE.name }; foo
17:24 camelia rakudo-moar 80b912: OUTPUT«foo␤»
17:25 tony-o sergot: i couldn't find anywhere that the socket listens
17:25 moritz raiph: the shared rakudobrew on hack is meant to provide a stable rakudo executable, not for you to build your own stuff with it
17:25 moritz raiph: if you want that, use a local rakudobrew
17:28 psch m: class Foo { has $!bar; method setBar($b) { $!bar = $b }; method getBar() { $!bar }; method bar { Proxy.new( STORE => method ($b) { self.setBar($b) }, FETCH => method () { self.getBar } }; my Foo $f .= new; $f.bar = 5; say $f.bar # i think this is what i'd need in the JavaHOW for field accessors...
17:28 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/pxTbnXr5PP�Unable to parse expression in argument list; couldn't find final ')' �at /tmp/pxTbnXr5PP:1�------> [32m) }, FETCH => method () { self.getBar } [33m�[31m}; my Foo $f .= new; $f.…»
17:28 raiph moritz: Thanks, gotchya.
17:29 psch m: class Foo { has $!bar; method setBar($b) { $!bar = $b }; method getBar() { $!bar }; method bar { Proxy.new( STORE => method ($b) { self.setBar($b) }, FETCH => method () { self.getBar } ) } }; my Foo $f .= new; $f.bar = 5; say $f.bar
17:29 psch mem alloc :/
17:29 camelia rakudo-moar 80b912: OUTPUT«Memory allocation failed; could not allocate 1048576 bytes␤»
17:29 psch works locally on -j
17:29 psch hm, probably did something wrong there
17:30 Mouq joined #perl6
17:30 psch m: class Foo { has $!bar; method setBar($b) { $!bar = $b }; method getBar() { $!bar }; method bar(Foo:D $self:) { Proxy.new( STORE => method ($b) { $self.setBar($b) }, FETCH => method () { $self.getBar } ) } }; my Foo $f .= new; $f.bar = 5; say $f.bar  # this i what work :l
17:30 camelia rakudo-moar 80b912: OUTPUT«5␤»
17:30 psch *is *works
17:31 psch now, if someone has an idea how i can get that into a HOW that doesn't do MethodContainer and tell it the methods from the backend, that would be great... ;)
17:33 raiph m: my $s = 'a,b'; my $*M; for $s.lines.grep({ $*M = m/ $<key>=\w+ ',' $<value>=\w+ / }) { say ~$*M<key> => ~$*M<value>; } # CurtisOvidPoe yawtdi
17:33 camelia rakudo-moar 80b912: OUTPUT«"a" => "b"␤»
17:33 moritz psch: like, delegation?
17:33 moritz raiph: what an exceptionally bad idea :-)
17:34 psch moritz: it's about java class fields.  adaptor generation currently gives me the methods "field/set_$field/$desc" and "field/get_$field/$desc", which clearly don't lvalue
17:34 psch moritz: wrapping them in Proxys is about the only workable idea i had up to now
17:35 moritz psch: you could expose getters and setters
17:35 psch that's the point of setBar and getBar in the example above, to emulate the setters and getters i get
17:35 CurtisOvidPoe raiph: that’s somewhat less magical than some other ideas I’ve seen, but not sure that it’s better, given the use of a global variable :)
17:35 psch moritz: those exist, $javaClass."field/get_someField/I"() gets the int someField from the java side
17:35 raiph moritz: yes, I meant it as a sort of "you could use globals, here's how, but don't do that" :)
17:37 bjz joined #perl6
17:38 Mouq CurtisOvidPoe: Your original example/gist actually should work
17:38 pmurias masak: I hope to get back to $perl6-stuff in like a week but I think I'll work a bit on panda/module infrastructure a bit before getting back to nqp-js
17:38 raiph CurtisOvidPoe: yeah, though it's a P6 global, ie a dynamic, so, imo, can be much less bad than typical globals
17:38 Mouq CurtisOvidPoe: It's a Perl 6 bug
17:38 Mouq Use the regex / $<key>=\w+ \, $<value>=\w+ {}/ instead
17:40 CurtisOvidPoe Mouq: Why is it a bug? The block enforces lexical scope, hiding the match variable, right?
17:40 CurtisOvidPoe Or am I misunderstanding?
17:40 CurtisOvidPoe (For those missing the context: https://gist.github.com/Ovid/fc552949223750349a8b)
17:41 moritz m: my $s = "a,b\nc,d\ne,f"; my $*M; for $s.lines.grep({ $*M = m/ $<key>=\w+ ',' $<value>=\w+ / }) { say ~$*M<key> => ~$*M<value>; }
17:41 camelia rakudo-moar 80b912: OUTPUT«"a" => "b"␤"c" => "d"␤"e" => "f"␤»
17:41 moritz Mouq: but even if it sets the outer scope'
17:41 moritz erm
17:42 moritz Mouq: but even if it sets the outer scope's $/, it relies on strict lazyiness of .grep and for
17:42 Mouq moritz: True
17:42 TimToady btw, just backlogging, => should not be stringifying the key by default
17:42 moritz Mouq: because as soon as there is batch processing involved, the two blocks don't always get the corresponding $/
17:43 TimToady m: say (42 => 43).key.WHAT
17:43 camelia rakudo-moar 80b912: OUTPUT«(Int)␤»
17:43 TimToady m: say (42 => 43).value.WHAT
17:43 camelia rakudo-moar 80b912: OUTPUT«(Int)␤»
17:43 Mouq CurtisOvidPoe: I don't know about that, but // regexes don't always populate $/ unless there's a {} in the regex :/
17:44 Mouq CurtisOvidPoe: I honestly haven't looked into it as much as I should have
17:44 CurtisOvidPoe Not fun. Certainly not an example I’d want in a talk showing that Perl 6 doesn’t have to be scary!
17:45 jnthn Mouq: That's - as far as I know - only an issue if you're using $/ *inside* of the regex.
17:46 moritz CurtisOvidPoe: even it works, it would be a very bad example to rely on a lexical to transport the right list element
17:46 Mouq m: for "a,b\nc,d\ne,e".lines.grep({ / $<key>=\w+ ',' $<value>=\w+ / }) { say ~$<key> => ~$<value>; }
17:46 camelia rakudo-moar 80b912: OUTPUT«"" => ""␤"" => ""␤"" => ""␤»
17:46 Mouq m: for "a,b\nc,d\ne,e".lines.grep({ / $<key>=\w+ ',' $<value>=\w+ {}/ }) { say ~$<key> => ~$<value>; }
17:46 camelia rakudo-moar 80b912: OUTPUT«"a" => "b"␤"c" => "d"␤"e" => "e"␤»
17:47 PerlJam That's an interesting example.  Maybe .grep should have an option to return the result of the block  (or maybe .grep-map should exist)
17:47 TimToady this seems like kind of an XY problem to me; why are you using grep instead of an if inside the loop?
17:47 moritz PerlJam: map can already do it
17:48 CurtisOvidPoe TimToady: I’m using an if now. I just thought it would be nice to have something like “for lines | filter { do … }”
17:48 CurtisOvidPoe But obviously that doesn’t do what I want.
17:48 CurtisOvidPoe (pseudo-code, obviously)
17:48 PerlJam moritz: aye, but then you get the problem of "why are you using map to do a grep?"
17:49 CurtisOvidPoe In other words, having a quick, declartive filter on the for loop rather than messing with it in the body.
17:49 CurtisOvidPoe That’s just me, though. Feel free to ignore :)
17:50 kjs_ joined #perl6
17:51 TimToady grep can't add info, and you're trying to piggyback info down through a list for free, and no scoping on earth is gonna give you that
17:51 TimToady map can add info easily
17:51 PerlJam CurtisOvidPoe: it seems to me that the filter isn't the problem, it's just that you want it to do 2 things.
17:52 TimToady map to a pair of match and original data, for instance
17:53 moritz match would be enough
17:53 moritz (which I already suggested earlier, but was dismissed as scary :-)
17:55 b2gills moritz: well that did rely on Perl6 not doing any processing of the grep ahead of time
17:55 Mouq Could also: my @result = do for $fh.lines { if /…/ { ~$<key> => ~$<value> } }
17:55 psch m: "16" ~~ /($<num>=\d+) { say make $<num>.sqrt }/ # NYI..?
17:56 camelia rakudo-moar 80b912: OUTPUT«No such method 'sqrt' for invocant of type 'Any'␤  in block <unit> at /tmp/z7D6PJMrTf:1␤␤»
17:56 psch m: "16" ~~ /(\d+) { say make $0.sqrt }/ # positional works
17:56 camelia rakudo-moar 80b912: OUTPUT«4␤»
17:56 psch oh, the parens in the named example aren't neccessary i suppose
17:58 moritz b2gills: not the @list.map({/regex/}).grep(*.so)
17:59 moritz b2gills: http://irclog.perlgeek.de/​perl6/2015-01-07#i_9899052
18:00 n0den1te joined #perl6
18:01 b2gills Right the first one not the last one
18:02 bjz joined #perl6
18:10 b2gills CurtisOvidPoe: You could simplify opening the file and getting the lines to just ` 'plans.csv'.IO.lines `
18:10 moritz that's shorter, but not simpler
18:12 Mso150 joined #perl6
18:14 Sir_Ragnarok_ joined #perl6
18:21 bjz joined #perl6
18:23 ssutch joined #perl6
18:25 ugexe https://github.com/rakudo/rakudo/blob​/9e1849cd8b9a5b4bdc29419439bfcb01343d​8903/src/Perl6/ModuleLoader.nqp#L217 <- should this be ever be reached if it would otherwise (which is is for me) say "use of uninitialized value of type Any in string context"?
18:26 ugexe thats with RAKUDO_MODULE_DEBUG=1
18:30 psch ugexe: the unitialized warning is one of the values in %chosen, returning $UNIT should still happen
18:30 psch ugexe: at least i assume you don't get the uninit warning without RAKUDO_MODULE_DEBUG=1
18:31 ugexe correct
18:32 psch well, at least as long as the if block is entered in the first place
18:32 ugexe just couldnt figure out why the outer conditional does 'return {}' compared to 'return $UNIT' where $UNIT would be (Any)
18:33 psch m: say {} ~~ PseudoStash
18:33 camelia rakudo-moar 80b912: OUTPUT«False␤»
18:34 masak japhb: stability, performance, features.
18:34 masak japhb: I agree.
18:35 masak japhb: I don't know if it's as clear as that, but I think for many, stability and performance has changed places to what you describe.
18:42 PerlJam we should still be prepared for the people who will say things like "They call this production?!? It's slower than <insert some other technology>!"
18:45 masak how would this "being prepared" you're talking about have a measurable impact on things? :)
18:45 masak I mean, I'm assuming you're talking about something more than a mental state...
18:46 PerlJam mental state is quite important :)
18:46 masak ok, so just brace ourselves for people being mean. got it.
18:46 PerlJam But even still, I don't that there would be a measurable impact, but "chance favors the prepared mind"
18:46 ugexe yea speed really held php back
18:47 ugexe is what id say
18:50 bjz joined #perl6
18:53 PerlJam masak:  or to frame "being prepared" slightly differently, it only helps us if we have a consistent narrative for our ideas on the growth of Perl 6.  Not being prepared, we may all have slightly different stories which could foment more discontent rather than the idea that "those Perl 6 guys have got a plan"
18:58 masak that framing I can get behind.
19:00 spider-mario_ joined #perl6
19:03 kaare__ joined #perl6
19:12 bjz joined #perl6
19:13 virtualsue joined #perl6
19:15 breinbaas joined #perl6
19:17 Sqirrel joined #perl6
19:20 kjs_ joined #perl6
19:27 zakharyas joined #perl6
19:30 Mso150 joined #perl6
19:36 sirdancealot joined #perl6
19:36 dalek rakudo/nom: c5dcdfb | Mouq++ | src/core/ (5 files):
19:36 dalek rakudo/nom: Make sure .gist/.perl on type objects work
19:36 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c5dcdfb564
19:38 raiph joined #perl6
19:45 brrt joined #perl6
19:53 tgt joined #perl6
19:54 HaraldJoerg joined #perl6
20:01 colomon doesn't map already allow returning something ( () or Nil, former I think ) when effectively makes the resulting list skip the current item?
20:04 ugexe if i want to test changes to rakudo source, so i just need to rerun Configure.pl && make && make install, or do I need to rebuild the backend as well?
20:05 ugexe s/so/do/
20:16 kjs_ joined #perl6
20:21 lizmat thank you, jnthn
20:21 yoleaux 16:12Z <jnthn> lizmat: The optimizer (Perl6::Optimizer) already has logic for optimizing away the dispatch:<!> call in most cases.
20:25 TimToady colomon: you can use next in a map, supposedly
20:25 colomon TimToady: that too
20:26 colomon m: say (1..30).map({ next if .is-prime; $_ })
20:26 camelia rakudo-moar 80b912: OUTPUT«1 4 6 8 9 10 12 14 15 16 18 20 21 22 24 25 26 27 28 30␤»
20:26 colomon m: say (1..30).map({ next if .is-prime; $_ }).perl
20:26 camelia rakudo-moar 80b912: OUTPUT«(1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30).list␤»
20:26 TimToady for (), there'd have to be a flat somewhere for it to disappear
20:26 colomon so, not even  just supposedly
20:27 lizmat m:  say (1..30).map({ $_ unless .is-prime }).perl
20:27 camelia rakudo-moar 80b912: OUTPUT«(1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30).list␤»
20:27 [Coke] ugexe: if you're changing rakudo source, make and make install
20:27 TimToady note that's probably depending on the obsolescent semantics of Nil turning into ()
20:27 lizmat this was an opt I did for Text::CSV earlier today, which gave 20%
20:27 jnthn I'm not sure that last one survives the GLR...
20:28 lizmat so, next is the better way of doing that ?
20:28 [Coke] ugexe: if you're changing one of the vms, or the version of the vm you're working on, then you need to re Configure.pl
20:28 jnthn lizmat: Why not .grep(!*.is-prime) or so?
20:28 TimToady lizmat: unlikely to break
20:28 ugexe [Coke]: thanks
20:28 TimToady jnthn: we had a matcher earlier that needed map
20:28 lizmat m:  say (1..30).map({ 2 * $_ unless .is-prime }).perl   # better example
20:28 camelia rakudo-moar 80b912: OUTPUT«(2, 8, 12, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42, 44, 48, 50, 52, 54, 56, 60).list␤»
20:29 jnthn TimToady: Ah, I see
20:29 lizmat jnthn: doing a map and a grep at the same time
20:29 Mouq joined #perl6
20:29 TimToady jnthn: I had a note for you at http://irclog.perlgeek.de/​perl6/2015-01-07#i_9898453 and following
20:29 jnthn I'd probably have written a loop by that point, but my first language was BASIC so I'm damaged for life. :)
20:29 lizmat m:  say (1..30).map({ .is-prime ?? 2 * $_ !! () }).perl   # better example
20:29 camelia rakudo-moar 80b912: OUTPUT«((), 4, 6, (), 10, (), 14, (), (), (), 22, (), 26, (), (), (), 34, (), 38, (), (), (), 46, (), (), (), (), (), 58, ()).list␤»
20:30 TimToady m: say «a b c 'x'»[0]
20:30 jnthn TimToady: Looking
20:30 camelia rakudo-moar 80b912: OUTPUT«a b c␤»
20:30 lizmat TimToady: so in that case, () should disappear after GLR ???
20:30 TimToady hmm, not recompiled since last night
20:30 jnthn TimToady: Hmm, I'm *sure* when I orginally put that in, it worked
20:30 jantore_ joined #perl6
20:30 TimToady probably parcels no longer flattening
20:30 jnthn TimToady: Ohhh...but [0] on a Parcel used to flatten.
20:30 jnthn Right.
20:30 * jnthn wonders how it got fixed
20:31 jnthn ah, it's right there where you lunk...
20:31 TimToady basically just inlined the _words code into the walk
20:31 jnthn Hmm...
20:31 TimToady to do away with the comma
20:32 jnthn Yeah, I mighta been tempted to just call .flat at the end ;)
20:32 TimToady coulda walked the _words tree, but seemed wasteful :)
20:32 jnthn yeah
20:32 TimToady this is differently wasteful :)
20:32 * jnthn reminds himself what postprocess_words does
20:32 TimToady but also breaks sub circumfix:<<` `>> parsing
20:33 TimToady that's just <> rahter than <<>>
20:33 TimToady m: say «a b c 'x'».perl
20:33 camelia rakudo-moar 80b912: OUTPUT«(("a", "b", "c"), "x")␤»
20:33 TimToady my patch gets rid of those inner parens
20:33 jnthn Right.
20:34 TimToady but breaks circumfix, which doesn't like the list, and is getting a string with a space-separated ` ` somehow
20:34 H2O1 joined #perl6
20:35 TimToady I don't see anything in there that evals it to a string though
20:35 TimToady hence my question
20:35 jnthn m: say <<` `>>.perl
20:35 camelia rakudo-moar 80b912: OUTPUT«("`", "`")␤»
20:35 TimToady is fine there
20:35 TimToady it's just in circumfix:<<` `>>
20:35 jnthn m: say :<<` `>>.perl
20:35 camelia rakudo-moar 80b912: OUTPUT«("`", "`")␤»
20:35 virtualsue joined #perl6
20:37 TimToady haven't recompiled since Dec 29
20:37 TimToady (camelia's)
20:38 TimToady moritz: ^^ ?
20:39 lizmat jnthn: if dispatch:<!> is optimized away, should it still show in a --ll-exception stacktrace ?
20:40 H2O1 regex. I have a page with 3 columns of numbers. it's easy to figure a regex to extract columns 1, 2, 3 and print them one after the other.  however I don't know how to extract an arbitrary number of columns. does that require something more powerful than a regular expression? is that context sensitive, such as a^n b^n ?
20:41 jnthn lizmat: No; maybe that's a case the optimizer doesn't get for some reason or other.
20:41 lizmat H2O1: how are the columns delimited
20:41 lizmat fg
20:41 H2O1 just with blanks
20:41 lizmat jnthn: ok, investigating  :-)
20:42 colomon H2O1: if you know the columns are relatively clean (no non-numeric characters in the middle of numbers), you should be able to do it with comb, I'd think
20:42 lizmat H2O1: S05:1085
20:42 synopsebot Link: http://perlcabal.org/syn/S05.html#line_1085
20:43 jnthn TimToady: Recreated the issue here and am investigating.
20:43 lizmat H2O1: or what colomon said  :-)
20:43 TimToady H2O1: unless, of course, you're actually asking about Perl 5; we only do Perl 6 here...
20:43 H2O1 perl6
20:44 TimToady m: "12 34 56 78".comb(/\d+/).perl.say
20:44 camelia rakudo-moar 80b912: OUTPUT«("12", "34", "56", "78").list␤»
20:45 TimToady but technically, "extracting" is not the job of regular expressions, unless you apply one repeatedly
20:45 ugexe skids: your test reports marked PASSED that actually fail appears to be a bug with pipe() on freebsd, not panda or cpandatesters
20:45 TimToady real regexes only tell you "yes, this matched from here to there."
20:45 skids ugexe: Thanks, good to know.
20:45 TimToady Perl's regexes are far from "real" though :)
20:46 jnthn TimToady: Think I got a fix.
20:46 TimToady I thought it would be pretty easy for you :)
20:47 jnthn Seems we accidentally depended on the nested parcel structure there.
20:47 TimToady oh, those [0] things?
20:47 jnthn Yeah
20:47 jnthn Well, but we need them in some other cases
20:47 tony-o is github:mrhdias in here?
20:47 jnthn So just doing an AST unwrapping at the start now if needed, and getting rid of the [0]s.
20:48 TimToady for something like a decl, you probably just want to evaluate the list, whether or not it's officially compile-time
20:48 TimToady then you get :[@stuff] for free
20:48 TimToady assuming @stuff has a compile-time value
20:49 jnthn Yeah, it's how we give good errors when it doesn't, perhaps mixed in with a bit of circularity sawing...
20:49 tony-o or jnthn have you used NativeCall & librarymake together?  i can get my C compiled and linked with NativeCall but the stub never actually executes the native code and instead tries to execute the stub..https://gist.github.com/to​ny-o/89a82e385f5c31ba1ffa
20:49 TimToady well, if circumfix doesn't get two values, it's pretty clear what the problem is
20:49 jnthn True
20:50 brrt joined #perl6
20:50 H2O1 left #perl6
20:51 TimToady interestingly, nothing in the compiler uses circumfix:<<foo bar>> notation, just test suite
20:51 lizmat jnthn: update on private methods op: looks like none of them are optimized atm
20:52 jnthn lizmat: What if you --optimize=3 ?
20:52 TimToady it uses << >> but only for ops containing < or >
20:52 * lizmat checks
20:52 TimToady which are all single tokens
20:52 jnthn m: class A { method m() { self!foo() } }
20:52 camelia rakudo-moar 80b912: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/32Pmm9jlAt�No such private method 'foo' for invocant of type 'A'�at /tmp/32Pmm9jlAt:1�------> [32mclass A { method m() { self!foo([33m�[31m) } }[0m�»
20:52 jnthn I'm pretty sure it's the opt that throws that error.
20:54 lizmat jnthn: yeah, but if it exists, it internally throws an error on $*W.get_ref($meth) that is hidden by a rtry
20:54 lizmat $try
20:54 lizmat *try
20:54 lizmat *sigh*
20:55 jnthn lizmat: Ah, then it got regressed at some point
20:55 lizmat hmm... there is no method get_ref in World ??
20:56 jnthn lizmat: That...would rather explain it ;)
20:56 lizmat well, maybe in inherits from HLL::World ?
20:56 jnthn Maybe; it sounds familiar.
20:57 jnthn But also maybe old
20:57 jnthn I mean, I think it's what QAST::WVal replaced in the end.
20:57 CurtisOvidPoe Any chance we can get a version of .perl which forces string context? https://gist.github.com/Ovid/e0778e99f188341726df
20:57 lizmat HLL::World also doesn't have the string "get_ref"
20:57 moritz git grep get_ref # comes out empty in nqp
20:57 dalek rakudo/nom: 748b2ad | jnthn++ | src/Perl6/World.nqp:
20:57 dalek rakudo/nom: Unbust circumfix:<<` `>> declarations.
20:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/748b2ad98f
20:58 CurtisOvidPoe .perl is for serialization and sometimes that’s great, but more often than not, I’m finding it obscures debugging.
20:58 lizmat jnthn: you changed that on August 1st, 2014  :-)
20:59 TimToady CurtisOvidPoe: we call that a DIHWIDT
21:00 snoqualmie joined #perl6
21:00 PerlJam S99:DIHWIDT  (in case you want to know what that means :)
21:00 synopsebot Link: http://perlcabal.org/syn/S99.html#DIHWIDT
21:00 lizmat CurtisOvidPoe: do you have any suggestions making it better ?
21:01 jnthn TimToady: 748b2ad doesn't seem to break anything in spectest.
21:01 jnthn TimToady: And seems to fix the issue.
21:01 CurtisOvidPoe It would be nice that anything which can be “stringified” be stringified. It would be a “smart” dumper that is used for debugging. People would understand that it’s slow, but human-readable.
21:01 TimToady well, roast has that case fudged
21:01 TimToady I can unfudge it
21:02 CurtisOvidPoe The problem is that if I have $0 => ~$1, I don’t want to *force* stringification prior to the hash, but I also don’t want to run a map over a data structure (possibly a very deep data structure) just so I can read the output of .perl.
21:02 lizmat CurtisOvidPoe: do you realize that .perl is a distributed thing?  each object (potentially) has its own .perl method
21:02 CurtisOvidPoe Anyone who loves the debugger as much as I do can tell you horror stories of x $resultset :)
21:03 lizmat which makes it hard to make something that looks good  :-(
21:03 rindolf joined #perl6
21:03 CurtisOvidPoe lizmat: of course, and I’m fine with that. I think that serializing the data and presenting it for debugging are subtly different use cases.
21:03 PerlJam CurtisOvidPoe: I think we've (#perl6) talked about modules for making preittier output before ... maybe you could write one?   :)
21:03 TimToady for debugging we usually use .gist rather than .perl
21:04 jnthn Is there not one already?
21:04 PerlJam dunno
21:04 * jnthn sees Data::Pretty
21:04 skids .gist seems to .perl Match objects....
21:04 skids at least when they are hash values.
21:05 jnthn I'm a bit surprised .gist does .perl on Match objects...
21:05 skids r: my %pairs = gather for "foo,bar\nfoo2,bar2\nfoo3,bar3".lines { if /^^ (\w+) ',' (\w+) $$/ { take $0 => $1; } } ; say %pairs.gist;
21:05 lizmat perhaps because there is no method gist for match objects ?
21:05 CurtisOvidPoe I expect that many Perl 5 devs moving to Perl 6 are going to want the barrier to entry lowered as much as possible. It’s like people coming to Perl 5 for the first time and not wanting to hear “install Moose” :)
21:05 camelia rakudo-{parrot,moar} 80b912: OUTPUT«"foo" => Match.new(orig => "foo,bar", from => 4, to => 7, ast => Any, list => ().list, hash => EnumMap.new()), "foo2" => Match.new(orig => "foo2,bar2", from => 5, to => 9, ast => Any, list => ().list, hash => EnumMap.new()), "foo3" => Match.new(or…»
21:05 jnthn If it didn't, then CurtisOvidPoe would probably be the output he's wanting...
21:05 xfix joined #perl6
21:06 CurtisOvidPoe jnthn++
21:06 skids No, gist on the bare Match object works right.
21:06 jnthn m: 'abc' ~~ /(\w)/; say $0;
21:06 camelia rakudo-moar 80b912: OUTPUT«「a」␤␤»
21:06 snoqualmie left #perl6
21:06 jnthn m: 'abc' ~~ /(\w)/; my %h = a => $0; say %h
21:06 camelia rakudo-moar 80b912: OUTPUT«"a" => Match.new(orig => "abc", from => 0, to => 1, ast => Any, list => ().list, hash => EnumMap.new())␤»
21:06 dalek roast: 73acbc6 | TimToady++ | S06-operator-overloading/sub.t:
21:06 dalek roast: unfudge test for circumfix:<<` `>>, jnthn++
21:06 dalek roast: review: https://github.com/perl6/roast/commit/73acbc6c5d
21:07 jnthn So, what's going on in Hash.gist... :)
21:07 CurtisOvidPoe Yeah, if .gist walked the data structure, it sounds like it would be much closer to what I’m looking for.
21:08 jnthn Odd. It *looks* in the code like it should be.
21:08 jnthn oh, wait..
21:08 jnthn m: 'abc' ~~ /(\w)/; my $p = a => $0; say $p
21:08 camelia rakudo-moar 80b912: OUTPUT«"a" => Match.new(orig => "abc", from => 0, to => 1, ast => Any, list => ().list, hash => EnumMap.new())␤»
21:08 jnthn That's the guilty party.
21:08 TimToady I thing gist gives up and reverts to .perl in a few too many spots
21:09 jnthn Yeah. Well, here, Pair doesn't define .gist
21:10 TimToady not quite as earth-shaking as List not declaring cmp
21:10 TimToady m: say [1,10] cmp [1,9]
21:10 camelia rakudo-moar 80b912: OUTPUT«Less␤»
21:11 TimToady fixed after Dec 29, last compile
21:12 TimToady sez More locally
21:12 lizmat jnthn: it really feels like $*W.get_ref is NYI
21:12 jnthn OK, spectesting a patch to add a .gist that makes say %hash-of-matches prettier, and an attempt to fix the regressed optimization lizmat found.
21:12 jnthn lizmat: No, it's dead and burried. :)
21:13 lizmat that's why  :-)
21:14 Mso150 joined #perl6
21:19 TimToady m: 'abc' ~~ /(\w)/; say $0
21:19 camelia rakudo-moar 80b912: OUTPUT«「a」␤␤»
21:19 TimToady should probably lose the ␤ on a single-liner
21:22 skids I dunno that sounds quirky.
21:23 skids Though I guess if I use gist and then feed it back to a program it's my own fault.
21:25 dalek rakudo/nom: 5fa55f6 | lizmat++ | src/core/Match.pm:
21:25 dalek rakudo/nom: Remove superfluous NL on Match.gist
21:25 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5fa55f6c00
21:28 * lizmat is wondering where tests for the optimizer would live
21:31 jnthn Turns out that adding a gist for Pair breaks some spectests that rely on it .perl-ing
21:31 lizmat jnthn: then we'll fix those
21:31 colomon joined #perl6
21:31 jnthn oh no, just one
21:31 jnthn bare-say.t
21:31 lizmat ok, will fix
21:31 jnthn It wants the key to be quoted, and since I .gist the key now it ain't.
21:32 jnthn Well, I don't mind fixing it, just wanted to get some consensus. :)
21:33 lizmat didn't TimToady say earlier today that a Pair should not stringify its key ?
21:33 TimToady it doesn't
21:33 jnthn I didn't stringify it, I just .gist intead of .perl
21:33 TimToady m: say (42 => 43).key.WHAT
21:33 camelia rakudo-moar c5dcdf: OUTPUT«(Int)␤»
21:33 jnthn and .gist doesn't put the "..." around like .perl does.
21:34 lizmat TimToady: I'm confused as to whether that is ok or not
21:34 jnthn Well, TimToady earlier was talking about the Pair constructor
21:34 jnthn I'm talking now about Pair.gist :)
21:34 skids .oO(silly robot.  .gist is for kids.)
21:36 dalek rakudo/nom: 4e67634 | jnthn++ | src/core/Enum.pm:
21:36 dalek rakudo/nom: Add a gist method for pairs.
21:36 dalek rakudo/nom:
21:36 dalek rakudo/nom: Before, we fell back to .perl, which gave ugly output in some cases.
21:36 dalek rakudo/nom: CurtisOvidPoe++ and TimToady++ for discussion that led to this patch.
21:36 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4e67634993
21:37 dalek roast: 1d6ab03 | jnthn++ | S16-io/bare-say.t:
21:37 dalek roast: Update test now that Pair has a nicer gist method.
21:37 dalek roast: review: https://github.com/perl6/roast/commit/1d6ab03555
21:42 lizmat jnthn: looking at 2 other spectest fails
21:42 jnthn lizmat: Which, ooc?
21:43 lizmat t/spec/S02-names-vars/list_array_perl.t
21:43 lizmat t/spec/S05-metasyntax/longest-alternative.t
21:43 jnthn They were clean on my latest run, fwiw.
21:43 kjs_ joined #perl6
21:44 lizmat ah, maybe they're caused by *my* patch
21:46 lizmat yup
21:46 lizmat ok, fixing
21:48 jack_rabbit joined #perl6
21:50 denis_boyun_ joined #perl6
21:52 Mso150 joined #perl6
21:56 dalek rakudo/nom: 68aafcd | jnthn++ | src/core/Promise.pm:
21:56 dalek rakudo/nom: Make Promise.[anyof|allof] reporting more robust.
21:56 dalek rakudo/nom:
21:56 dalek rakudo/nom: Passing an extra arg is a cheap, and it gets rid of some introspection
21:56 dalek rakudo/nom: that was not so reliable.
21:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/68aafcdb7f
21:56 dalek rakudo/nom: 32c774f | jnthn++ | src/Perl6/Optimizer.nqp:
21:56 dalek rakudo/nom: Fix private method call optimization.
21:56 dalek rakudo/nom:
21:56 dalek rakudo/nom: Regression noticed by lizmat++.
21:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/32c774ffc1
21:57 jnthn Time for some sleep. 'night
21:57 masak 'night, jnthn
21:59 colomon \o
22:01 lizmat gnight, jnthn
22:10 CurtisOvidPoe Good night, jnthn!
22:10 CurtisOvidPoe Is there a built-in equivalent to memoize? I’ve tried to find one and failed.
22:12 masak "is cached"?
22:14 CurtisOvidPoe sub foo(…) is cached?
22:15 masak yeah.
22:15 CurtisOvidPoe Cheers. I’ll try it.
22:15 masak src/core/Routine.pm:multi sub trait_mod:<is>(Routine $r, :$cached!) {
22:15 masak (if you want the implementation)
22:15 raiph joined #perl6
22:16 raydiak m: sub r () is cached { say rand }; r for ^3
22:16 camelia rakudo-moar c5dcdf: OUTPUT«0.532184563537695␤»
22:16 raydiak m: sub r () is cached { rand }; say r for ^3
22:16 camelia rakudo-moar c5dcdf: OUTPUT«0.771876052841543␤0.7718​76052841543␤0.771876052841543␤»
22:17 raydiak afternoon #perl6
22:17 CurtisOvidPoe Works like a charm. Thanks :)
22:17 masak \o/
22:19 dalek rakudo/nom: e192c6c | lizmat++ | src/core/Match.pm:
22:19 dalek rakudo/nom: Only remove newline on outer Match.gist
22:19 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e192c6c999
22:20 dalek roast: c403f1d | lizmat++ | S05-metasyntax/longest-alternative.t:
22:20 dalek roast: Match.gist doesn't end with a newline anymore
22:20 dalek roast: review: https://github.com/perl6/roast/commit/c403f1da61
22:20 Mouq joined #perl6
22:20 * lizmat sometimes wishes q:to// would have a .chop function, so that it wouldn't need to be done at runtime
22:20 raydiak warning: 'is cached' seems to be broken for precomp
22:21 lizmat raydiak: in what way ?
22:21 lizmat is it serializing the cache?
22:21 raydiak lizmat: segfault on a precomped exported cached sub
22:21 lizmat will look at it tomorrow
22:22 lizmat pretty tired (and said) having lost one of her favourite cartoonists
22:22 lizmat *sad
22:22 raydiak aw
22:22 CurtisOvidPoe Yeah, that was a horrifying thing.
22:23 CurtisOvidPoe Already have a neighbor saying  we need to deport “all of them.” I don’t know what “them” meant, but I knew I didn’t want to hear the answer.
22:23 lizmat yeah  :-(
22:23 CurtisOvidPoe Is there an easy way to expire a cache?
22:24 CurtisOvidPoe lizmat: Leïla’s pretty upset. She basically grew up reading that cartoonist.
22:24 lizmat as did I  :-(
22:25 lizmat good night, #perl6!
22:25 CurtisOvidPoe g’night.
22:25 raydiak idk about explicit expiring, but istr some way to tell it to key the cache in specific ways wrt the passed params, if that helps
22:26 raydiak g'night lizmat o/
22:26 CurtisOvidPoe Having an expiry time might help. Right now, “is cached” seems only appropriate for pure function. Won’t work very well for “get_customer()”
22:27 masak sounds like the job for another more complicated trait :)
22:27 masak note that "is cached" is in pure Perl 6, and nothing prevents someone from writing their own, in Perl 6.
22:28 raydiak reminds me of a thought I had...not entirely sure what the difference is semantically, between "is pure" and "is cached"...naively, seems like either would imply the other should work there too
22:35 colomon joined #perl6
22:36 virtualsue joined #perl6
22:36 Rounin joined #perl6
22:37 masak 'night, #perl6
22:37 raydiak good night, masak
22:39 colomon \o
22:39 raydiak .tell lizmat the cached precomp bug is #122896, the only difference between october and now being that it segfaults instead of giving the reported error message
22:39 yoleaux raydiak: I'll pass your message to lizmat.
22:39 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=122896
22:42 telex joined #perl6
22:43 denis_boyun_ joined #perl6
22:50 ashleydev joined #perl6
22:52 Mso150_y joined #perl6
22:56 timo joined #perl6
22:57 CurtisOvidPoe Would it be fair to say that floating point comparisons in Perl 6 are more likely to work because .3, internally, is represented as a Rat?
23:04 Mouq CurtisOvidPoe: I'm not sure calling them "floating point comparisons" is really right, since Perl 6 has those too
23:05 Mouq m: say .3e0 == 1.3e0 - 1
23:05 camelia rakudo-moar c5dcdf: OUTPUT«False␤»
23:05 Mouq m: say 1.3e0 - 1 - .3e0
23:05 camelia rakudo-moar c5dcdf: OUTPUT«5.55111512312578e-17␤»
23:05 HaraldJoerg left #perl6
23:07 raydiak from the standpoint of a heckler, Mouq's argument is the first that springs to my mind too
23:08 raydiak though imo, it's actually a totally fair statement, as the exact same example but without the explicit Nums (.3 == 1.3-1) succeeds in p6 and fails in p5
23:10 * Mouq admits to being a decent heckler
23:17 raydiak if you can think of something less specifc to say than "floating point comparisons" so it's less tied to a specific datatype, but doesn't sound amateurish like "comparing decimals/fractions" might, then you could circumvent the mouqs of the world in this instance :)
23:17 CurtisOvidPoe Mouq: thank you. That’s a great counter-example.
23:17 raydiak "non-integer" is the furthest I got...
23:18 CurtisOvidPoe I don’t want to circumvent them. With a talk aimed at showing areas of Perl 6 which are easier than most dynamic languages, I need to know the pitfalls, too.
23:18 CurtisOvidPoe m: say .1 + .2 - .3
23:18 camelia rakudo-moar c5dcdf: OUTPUT«0␤»
23:18 CurtisOvidPoe That’s something that most languages get wrong.
23:19 CurtisOvidPoe Perl 5, for example, returns 5.55111512312578e-17
23:19 jercos I mean, the advantages of using rationals are numerous in various applications, but they're kind of mostly expressed to anyone who cares by "decimal literals in their simplest form are handled as rational literals rather than float literals"
23:19 CurtisOvidPoe Multiply that “zero” by the weight of the sun and the result is roughly the weight of Mount Everest. Mount Everest becomes an error in floating point math.
23:20 raydiak well yes, I mean a way to word it such that your meaning is made clear, without undue exposure to people who just want to word-spar in endless circles for non-technical reasons
23:21 CurtisOvidPoe But mostly it’s correct in Perl 6
23:21 CurtisOvidPoe m: say 1.3 - 1 - .3
23:21 camelia rakudo-moar c5dcdf: OUTPUT«0␤»
23:21 CurtisOvidPoe Again, Perl 5 gives 5.55111512312578e-17
23:22 jercos You can pitch rationals as a replacement for fixed-point and decimal-base-float types in other languages I guess (*cough* C#)
23:22 timotimo joined #perl6
23:23 CurtisOvidPoe Ironically, I just listened to someone demonstrating that floating point math is faster than integer math on many modern CPUs. My counter-argument is that they’ll arrive at the wrong answer faster.
23:23 jercos But it's not like rational number types are a new concept, the same advantages apply to the rational type in haskell. Perl 6 just does the more accurate thing and uses a precise type to represent decimal-printable numbers.
23:26 CurtisOvidPoe g’night all. Time for bed. Thanks for all the fish! Er, help!
23:26 raydiak I just think that if you say "floating-point", that's where the consistency crack exists...someone who wants to understand you will get what you are saying and move on in the conversation...someone who wants to argue will say "well that isn't really floating-point", which in most real-world cases is *entirely* beside the point from user-facing perl code
23:26 raydiak g'night CurtisOvidPoe o/
23:28 jercos raydiak: it's both literally and spiritually floating-point, I don't see how you could hold up an arguement that "floating-point" only ever refers to IEEE 754...
23:30 raydiak jercos: perhaps it's just subjective, I'm used to people jumping on half-baked excuses to argue a point (especially if the point regards perl 6)
23:30 * jercos nods
23:30 raydiak so I tend to dance a little with my wording when I care, especialy if there's an audience of multiple people
23:32 jercos I can see how one of my perceived positive end-results (typing math problems naïvely into a perl 6 interpreter can give more accurate results than some other languages) could be seen as negative... "must be a language for people who can't program"
23:32 timotimo joined #perl6
23:36 raydiak well yeah there's that too, although at that point you know you've completely lost them, and probably did so before you ever spoke :)
23:38 raydiak if people apply carte blanche reasoning to that extent, you can't really do much unless you want to try to point out that they have ceased reasoning entirely and are now only applying logical-sounding words to their emotions :)
23:39 raydiak "it's better?  that's terrible.  all the awesome stuff is written in the terrible way, so it must be better."
23:41 timotimo wellllll
23:41 timotimo if you use rat arithmetic, you end up slower, using more memory and you're no longer compatible with floating point implementations of the same algorithm
23:43 jercos is it really slower to e.g., approximate 2/3 as a float and multiply another float by that than to multiply the same float by integer 2, then divide by integer 3?
23:44 jercos I guess if you have to promote the integers to floats anyway to use the FPU for those calculations :|
23:45 timotimo FPU is ridiculously fast, i expect
23:46 jercos well, using the FPU either way. I'm assuming something needing speed is say, working on an audio sample that's already an IEEE float
23:47 timotimo raydiak, are you using rat math in your raytracer? :)
23:48 raydiak timotimo: maybe? :) I don't worry about such things when writing perl...is why I write perl instead of, say, C
23:48 raydiak is also why I keep hoping someone who enjoys that will swoop in and make it more awesome, but I'm likely to break down and optimize it this year
23:49 timotimo %)
23:51 raydiak I was actually just looking at it and working on it silghtly in the last few days...hadn't touched it for close to a year until recently, except to keep up with spec changes
23:53 timotimo i hope it got a bit faster during that time :)
23:54 raydiak suffered from me being caught in a large metacircularity loop...worked on math::threed mainly for pray, worked on math::symbolic thinking of pray as its main example of use, still haven't tied any of it together
23:54 timotimo mhm
23:54 raydiak oh yes, it is certainly faster...esp since moar didn't exist (or at least wasn't stable) when I began
23:55 skids joined #perl6
23:55 raydiak moar beats the tar out of jvm for Pray these days
23:55 timotimo oh!?
23:55 raydiak yeah, even disregarding startup time
23:55 timotimo i hadn't realized you last tried pre-moar
23:56 timotimo that just means we should port more of the cool tech we have in moar onto rakudo-jvm, too
23:56 raydiak I made sure it at least ran without error on moar when everyone started using moar, but yeah that's about it until this week
23:56 raydiak it's a good 50% faster or so when I tried on hack
23:57 timotimo hmm
23:58 timotimo is there a workload of pray that doesn't create a huge code call graph?
23:58 raydiak hack is a cool resource too...I might end up doing more dev on it than my own machine, andjsut using my personal machines for the long-running renderings so I'm not a nuissance
23:58 timotimo you could --profile it
23:58 raydiak good question...tried --profile at one point, wasn't at all usable, but I could probably cut a lot of the crap out ust by commenting stuff
23:59 raydiak hadn't considered that approach before, timotimo++ making me think and try and stuff :)

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

Perl 6 | Reference Documentation | Rakudo