Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-11-04

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:02 timotimo lizmat: half a second
00:02 timotimo er
00:02 timotimo yes, that's right
00:02 timotimo well, "slurp '100mb.json'" really
00:02 timotimo 2.3 seconds, 720 megabytes
00:05 timotimo now i have a 17mb json file
00:06 timotimo well, what can i say. our performance still sucks in a few areas ...
00:13 colomon huh, now seeing cpandatesters but it has no information, just a list of modules?
00:13 timotimo check the recent reports
00:14 grettis joined #perl6
00:14 timotimo the 6mb json file parses in 1:22min
00:16 colomon timotimo: what does the "Top 100 reports" mean?
00:16 colomon afk # "Honey, come up here for a second."
00:18 timotimo i think it should be "recent 100 reports"
00:24 Tekk_ masak: is there any plan to have Text::Markdown actually fully implement markdown?
00:24 SevenWolf joined #perl6
00:25 Tekk_ given that it doesn't really do much at all atm it seems
00:26 colomon Turns out "Honey, come up here for a second" === School taught 6yo hand motions to go with a Christmas song
00:28 timotimo d'aaw
00:28 timotimo we're already jitting a crapton of stuff to go with json parsing
00:31 timotimo a gigantic amount of Int objects get allocated inside MATCH
00:35 vike joined #perl6
00:40 colomon should PANDA_SUBMIT_TESTREPORTS=1 panda install ABC actually submit something that shows up on …. oh, it did!
00:40 colomon \o/
00:40 colomon FROGGS++
00:40 tinyblak joined #perl6
00:43 timotimo are you running your ABC stuff on rakudo-moar these days? or still on niecza for speed?
00:44 vendethiel joined #perl6
00:46 timotimo i just kicked out the second-highest allocator of Scalar values for the json parse workload
00:47 japhb timotimo: Which is?
00:47 timotimo m: say "the number of scalar allocations went down to { 8874207 / 10155740 } of what it was"
00:47 camelia rakudo-moar 315ec6: OUTPUT«the number of scalar allocations went down to 0.873811953 of what it was␤»
00:47 timotimo well, that's ... not terrible
00:48 japhb That depends on how many nodes there are in the source JSON (meaning, what our blowup factor is)
00:48 colomon timotimo: I … actually, I don't know
00:49 colomon timotimo: These days I run ABC on rakudo-moar
00:49 colomon it is more than adaquately fast for anything I've tried to do with it recently.
00:49 colomon just add --profile to get a rakudo profile, right?
00:50 * japhb is happy that rakudo-moar is now fast enough to take over from niecza for that
00:51 * colomon is too
00:52 japhb timotimo: What did you actually change to get that Scalar allocation improvement?
00:52 timotimo there were methods on Capture that had "$name is copy" and then "$name = $name.Str" as well as "$position is copy" followed by "$position = $position.Int"
00:53 timotimo i turned those into multi methods if the type given is already Str or Int
00:53 tony-o Tekk_: i have a pod -> markdown module half completed -
00:54 Tekk_ tony-o: okay?
00:54 timotimo i've got another little change that i'd like to test before pushing stuff
00:54 Tekk_ you'll probably have to improve Text::Markdown after that. It just seems to be a basic test for grammars basically. Only supports bold, underline, em, and something else..
00:55 Tekk_ oh no
00:55 Tekk_ code, strong, em
00:55 Tekk_ that's it
00:55 tony-o what are you looking to do?
00:55 japhb timotimo: Ah, yes, multis make sense for that
00:55 timotimo colomon: yes, --profile is right
00:55 Tekk_ tony-o: I have a blog generator that takes markdown posts and converts them to html for display :P
00:55 colomon timotimo: yes, I'm uploading a profile for you right now
00:55 timotimo i had to do a double-take when comparing the overview of before my change and after my change
00:55 Tekk_ which relies on Text::Markdown
00:56 timotimo The profiled code ran for 94180.04ms. Of this, 10583.86ms were spent on garbage collection and dynamic optimization (that's 11.24%).
00:56 timotimo The profiled code ran for 88814.33ms. Of this, 10227.97ms were spent on garbage collection and dynamic optimization (that's 11.52%).
00:56 timotimo the time spent in GC went *up* even though i made the code allocate less stuff
00:56 timotimo well, the time spent *running* went down
00:56 timotimo so that's nice :)
00:56 timotimo m: say "down to { 88814.33 / 94180.04 } of what it was"
00:56 camelia rakudo-moar 315ec6: OUTPUT«down to 0.94302710 of what it was␤»
00:56 tony-o Tekk_: ahh, what i'm working on is converting pod to markdown :-)
00:57 Tekk_ tony-o: yeah, so you're the step before :)
00:58 colomon timotimo: http://harmonyware.com/perl/profile-1415062291.21424.html # more than just a JSON::Tiny read, but JSON::Tiny is a ton of it.
00:58 japhb timotimo: The time went down, only the percentage went up.
00:58 timotimo yes, i know
00:58 timotimo that's what my double-take was for :)
00:59 japhb Ah, gotcha, misunderstood.  :-)
01:00 japhb m: say 10227.97 / 88814.33; say 10583.86 / 94180.04;
01:00 camelia rakudo-moar 315ec6: OUTPUT«0.11516126␤0.11237901␤»
01:02 timotimo what si that for?
01:04 dalek rakudo/nom: 32959f6 | (Timo Paulssen)++ | src/core/Capture.pm:
01:04 dalek rakudo/nom: avoid creating some scalars in capture methods
01:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/32959f6cc2
01:04 dalek rakudo/nom: 2b6e9e7 | (Timo Paulssen)++ | src/core/Attribute.pm:
01:04 dalek rakudo/nom: perhaps avoid one unbox_s per attribute access?
01:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2b6e9e75cf
01:04 timotimo i would be glad if somebody could spectest this -^
01:13 colomon timotimo: I'll see what I can do here
01:19 colomon in S04-phasers now....
01:22 xenoterracide joined #perl6
01:23 colomon S17....
01:23 japhb timotimo: I was checking that my brain was screwed on properly.
01:24 japhb *in
01:33 yeahnoob joined #perl6
01:36 colomon timotimo:
01:36 colomon t/spec/S02-literals/version.rakudo.moar                     (Wstat: 1024 Tests: 28 Failed: 4)
01:36 colomon Failed tests:  2, 6, 13, 15
01:36 colomon Non-zero exit status: 4
01:39 colomon guessing that might be lizmat's work?
01:41 BenGoldberg joined #perl6
01:49 xenoterracide joined #perl6
01:53 vendethiel joined #perl6
02:09 anocelot joined #perl6
02:09 xenoterracide_ joined #perl6
02:15 timotimo could be
02:15 timotimo i get a todo passed in minmax, too
02:16 colomon right, me too
02:17 timotimo good
02:17 timotimo well, i made json::tiny a tiny bit better
02:17 timotimo we're very far from a wicked fast json::tiny
02:18 xenoterracide_ joined #perl6
02:18 japhb Which makes it a very good benchmark.  :-)
02:18 timotimo though i must admit i've been wanting to write a non-grammar-based json parser in pure perl6 and see how much performance i can squeeze out by "being clever" (aka "being terrible")
02:18 timotimo japhb: i think i'll go ahead and do a full benchmark run of moar/moar-jit again tomorrow
02:19 timotimo haven't done so in a long-ish time
02:19 timotimo but now i'm off to bed
02:19 timotimo o/
02:19 japhb Good night!
02:19 colomon \o
02:24 erkan joined #perl6
02:46 colomon FROGGS: PANDA_SUBMIT_TESTREPORTS=1 panda --exclude=Panda smoke got me a segmentation fault (eventually)
02:46 colomon oh, possibly should have been --exclude=panda
02:49 vendethiel joined #perl6
02:56 Ben_Goldberg joined #perl6
02:58 SevenWolf joined #perl6
03:01 dj_goku [Coke]: so how could I start the process to get things added to stresstest and rosettacode?
03:09 chenryn joined #perl6
03:15 vendethiel joined #perl6
03:20 baest_ joined #perl6
03:22 xenoterracide_ joined #perl6
03:39 vendethiel joined #perl6
03:40 xenoterracide_ joined #perl6
03:44 bjz joined #perl6
04:01 rmgk_ joined #perl6
04:01 vendethiel joined #perl6
04:14 PZt joined #perl6
04:20 xenoterracide_ joined #perl6
04:29 kaleem joined #perl6
04:39 aborazmeh joined #perl6
04:47 vendethiel joined #perl6
05:01 priyal joined #perl6
05:02 priyal hello
05:16 chenryn joined #perl6
05:34 Alina-malina joined #perl6
06:10 labster_ joined #perl6
06:13 exixt_ joined #perl6
06:14 cosimo_ joined #perl6
06:14 btyler_ joined #perl6
06:14 tinyblak_ joined #perl6
06:21 chenryn joined #perl6
06:22 chenryn_ joined #perl6
06:24 oetiker joined #perl6
06:25 TuxCM joined #perl6
06:29 kaleem joined #perl6
06:31 Alina-malina joined #perl6
06:38 newb13427 joined #perl6
06:53 ptc_p6 joined #perl6
06:59 FROGGS colomon: right, the dist is called 'panda'
07:00 FROGGS timotimo: we'd have to record the git hash first in the Panda::Project, but yeah, that's on my todo
07:03 FROGGS even osx reports are there: http://cpandatesters.org/dist/ABC - or - http://testers.perl6.org/dist/ABC
07:03 FROGGS damn is that thingy slow
07:03 FROGGS it runs at least five times as fast on my i5 laptop
07:03 Alina-malina joined #perl6
07:05 gfldex joined #perl6
07:08 fhelmberger joined #perl6
07:17 Woodi hallo today :)
07:23 Woodi so, what "*$CWD in async-world is not so simple means" ? we still package executed code in processes with threads so what standard library guarantees need to be planned and documented, eg. "std lib creates env vars on startup, changing eg. *$CWD in child thread and consequences of that are on programmer head". with such gurantees convenient user wrappers can be designed...
07:25 Woodi we should declare: "we have one CWD per proces and threads are free to mess with it" or "changing CWD in thread have COW semantic"
07:28 Woodi btw. do (in UNIX) user should be allowed to change his/her HOME env ? :)
07:29 Woodi sory for my terrible English...
07:30 ClarusCogitatio joined #perl6
07:39 ClarusCogitatio joined #perl6
07:42 azawawi joined #perl6
07:42 azawawi hi #perl6
07:43 azawawi timotimo: ping
07:48 telex joined #perl6
07:51 FROGGS joined #perl6
07:55 Mso150 joined #perl6
07:55 Woodi hmm, we package executed code with vm object... do we want to mimic proceses behaviour or create our own ?
07:55 [Tux] joined #perl6
08:06 Woodi about lists: in Perl5: "Lists in Perl are not data structures, they are positions in the source code, determined by the context around them. Lists are basically the transient structures that Perl uses to move data around. You interact with them with all of Perl's syntax, but you can not work with them as a data type."  from  http://stackoverflow.com/questions/6023821/perl-array-vs-list
08:07 Woodi lists are not a datatype...   but in Perl6 spec we have  Array is List { ... }
08:07 moritz Perl 6 isn't Perl 5
08:07 moritz also, I disagree with the statement that Lists aren't data structures in Perl 5
08:07 Woodi just trying to understand, not enforce any design
08:08 moritz if they weren't,  (sub { 1, 2, 3})->()[1] wouldn't work
08:08 Woodi but they have such "use case"
08:08 rindolf joined #perl6
08:10 ClarusCogitatio joined #perl6
08:11 Woodi that is additional "responsibility", like in Lisp. I wonder if other shapes can be used as such ether-like carrier...
08:11 moritz fwiw, the previous Perl 6 list design had Parcel as a kinda "invisible" type, like lists are in p5
08:11 moritz ... except that they turned out to be very visible
08:11 abraxxa joined #perl6
08:12 Woodi moritz: I think underneth is something undiscovered (or jus un-understud by me..)
08:13 Woodi lists are used to morph code probably, in Lisp sense...
08:15 ptc_p6 joined #perl6
08:16 chenryn__ joined #perl6
08:17 moritz not in Perl.
08:19 tinyblak joined #perl6
08:19 darutoko joined #perl6
08:21 virtualsue joined #perl6
08:22 dalek rakudo/nom: 49874e1 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
08:22 dalek rakudo/nom: Test can be false even if we want to test
08:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/49874e1d63
08:22 dalek rakudo/nom: a49a556 | (Elizabeth Mattijsen)++ | src/core/IO/Dir.pm:
08:22 dalek rakudo/nom: Correctly create IO::Dir.dirname
08:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a49a55635e
08:22 dalek rakudo/nom: 8edbf14 | (Elizabeth Mattijsen)++ | src/core/Version.pm:
08:22 dalek rakudo/nom: Fix + breakage
08:22 dalek rakudo/nom:
08:22 dalek rakudo/nom: I still don't understand why the previous fix did not work.  But this fixes it.
08:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8edbf1437c
08:23 sqirrel__ joined #perl6
08:25 dalek roast: c3c8571 | (Elizabeth Mattijsen)++ | S02-literals/version.t:
08:25 dalek roast: Add tests for empty string Version
08:25 dalek roast: review: https://github.com/perl6/roast/commit/c3c8571199
08:28 lizmat good *, #perl6!
08:28 FROGGS morning lizmat
08:29 moritz \o lizmat, FROGGS
08:29 lizmat FROGGS moritz \o
08:29 lizmat re the passing todo in minmax: I think that test is fauilty, actually.
08:29 FROGGS hi moritz
08:29 lizmat It's passing for the wrong reason
08:30 lizmat m: my @a=1,2,3; say @a min 4  # what is this supposed to say ?
08:30 camelia rakudo-moar 315ec6: OUTPUT«1␤»
08:31 moritz m: my @a=11,12,13; say @a min 4
08:31 camelia rakudo-moar 315ec6: OUTPUT«4␤»
08:31 lizmat so is min() supposed to flatten the array ?
08:31 lizmat m: my @a=1,2,3; say @a max 4  # what is this supposed to say ?
08:31 moritz lizmat: actually I'd expect it to return 3
08:31 camelia rakudo-moar 315ec6: OUTPUT«4␤»
08:32 moritz (that is, coerce to Numeric)
08:32 moritz oh wait, min is one of those weird operators that work on strings too
08:32 moritz m: say 4 min ~<1 2 3>
08:33 camelia rakudo-moar 315ec6: OUTPUT«1 2 3␤»
08:33 moritz maybe that's the "correct" answer?
08:34 lizmat I have *no* idea, really, perhaps the GLR will bring a solution
08:34 lizmat meanwhile, I would like to mark these tests as "skip", to prevent noise
08:34 chenryn__ joined #perl6
08:35 moritz skipping is fine
08:35 moritz maybe the GLR will tell us whether it flattens
08:35 moritz but if it doesn't flatten, the behavior is still badly defined
08:35 moritz m: say 4 min [1, 2, 3]
08:35 camelia rakudo-moar 315ec6: OUTPUT«1 2 3␤»
08:36 dalek roast: af40fcd | (Elizabeth Mattijsen)++ | S03-operators/minmax.t:
08:36 dalek roast: Mark test as skip to prevent false TODO passing
08:36 dalek roast: review: https://github.com/perl6/roast/commit/af40fcd065
08:36 moritz currently cmp (and thus min) compares (number, non-number) pairs as Str, because that's the safest option
08:36 vendethiel #perl6, o/.
08:37 Mso150_x joined #perl6
08:37 lizmat vendethiel \o
08:39 Woodi I think one-level flattening like in "@a min 4" is good. but if @a contains something that is programmer error to passing it to general-purpose operators...
08:44 molaf_ joined #perl6
08:46 lizmat Woodi: although there are threads in rakudo on Moar and JVM, they're mostly hidden
08:47 lizmat so saying there's a $*CWD per thread, doesn't make much sense in code where you can't really see in which thread you are anymore
08:47 lizmat you have a $*CWD visible in your scope
08:47 lizmat and anything in your scope (in any thread working in that scope) can change it
08:48 lizmat we've provided the means to make that change only visible in a scope:
08:49 lizmat m: .say for dir()
08:49 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia/rakudo-inst-2".IO␤"/home/camelia/evalbot".IO␤"/home/camelia/.viminfo".IO␤"/home/camelia/rakudo-inst-1".IO␤"/home/camelia/.bashrc".IO␤"/home/camelia/.ssh".IO␤"/home/camelia/std".IO␤"/home/camelia/rakudo-star-2014.09.tar.gz".IO…»
08:49 lizmat m: .say for dir(:Str,:!absolute)
08:49 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia/rakudo-inst-2".IO␤"/home/camelia/evalbot".IO␤"/home/camelia/.viminfo".IO␤"/home/camelia/rakudo-inst-1".IO␤"/home/camelia/.bashrc".IO␤"/home/camelia/.ssh".IO␤"/home/camelia/std".IO␤"/home/camelia/rakudo-star-2014.09.tar.gz".IO…»
08:50 lizmat m: .relative.say for dir()
08:50 camelia rakudo-moar 315ec6: OUTPUT«rakudo-inst-2␤evalbot␤.viminfo␤rakudo-inst-1␤.bashrc␤.ssh␤std␤rakudo-star-2014.09.tar.gz␤rakudo-star-2014.09␤niecza␤p2␤.cpanm␤rakudo-inst␤bin␤rakudo2␤perl5␤p1␤.local␤.perlbrew␤rakudo1␤.bash_history␤log␤Perlito␤…»
08:51 lizmat m: say $*CWD; { temp $*CWD = chdir('bin'); say $*CWD }; say $*CWD
08:51 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤"/home/camelia/bin".IO␤"/home/camelia".IO␤»
08:51 lizmat Woodi: so any wellbehaving code should do that if it thinks it needs to change the CWD
08:52 lizmat m: say $*CWD; { temp $*CWD; chdir('bin'); say $*CWD }; say $*CWD
08:52 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤"/home/camelia/bin".IO␤"/home/camelia".IO␤»
08:56 rindolf joined #perl6
08:56 ghostlines joined #perl6
08:56 kjs_ joined #perl6
08:59 ibo2perl6 joined #perl6
09:02 ibo2perl6 o/
09:03 ibo2perl6 say (^10 xx 100 ).gist.chars
09:03 ibo2perl6 m: say (^10 xx 100 ).gist.chars
09:03 camelia rakudo-moar 315ec6: OUTPUT«203␤»
09:03 ibo2perl6 is it intended that gist only accepts 100 elements?
09:04 FROGGS ibo2perl6: yes
09:04 FROGGS it only *shows* 100 elements, followed by ...
09:04 FROGGS so you get the gist of what it is
09:05 ibo2perl6 but then how can I say a longer list?
09:05 FROGGS don't .gist it... .Str it for example, or print() it
09:05 Alina-malina joined #perl6
09:06 FROGGS m: print (^10 xx 100 )
09:06 camelia rakudo-moar 315ec6: OUTPUT«0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345…»
09:06 FROGGS camelia cuts it here for irc
09:06 FROGGS m: say (^10 xx 100 ).Str.chars
09:06 camelia rakudo-moar 315ec6: OUTPUT«1999␤»
09:08 ibo2perl6 FROGGS: yes print works. FROGGS++
09:09 FROGGS the rule is: say() is for humans, print() for machines
09:11 lizmat sometimes I forget the "perl6 -e" in front of my code, so I do:
09:11 lizmat $ say "foo".IO
09:12 lizmat and on OS X your computer then actually speaks to you  :-)
09:12 FROGGS *g*
09:14 FROGGS my Amiga did that too back then
09:16 slavik joined #perl6
09:17 ibo2perl6 FROGGS: is this rule documented somewhere? I couldn't find it
09:17 kaare_ joined #perl6
09:20 FROGGS ibo2perl6: I expected to find something in the synopsis, but failed....
09:21 FROGGS but I read that often here on channel in the past
09:24 ClarusCogitatio joined #perl6
09:25 Woodi lizmat: code where you can't really see in which thread you are anymore
09:25 Woodi ... should not have side effects like changing proces/vm CWD
09:26 FROGGS Woodi: that's why you can declare $*CWD lexically, right?
09:26 FROGGS s/can/should/ perhaps
09:27 dakkar joined #perl6
09:27 ghostlines joined #perl6
09:27 Woodi FROGGS: if we want to have" CWD is lexical" as  point where we starting design...
09:27 Woodi then it's ok :)
09:28 FROGGS I actually don't understand that sentence
09:28 Woodi lexical means 'per scope' ?
09:29 Woodi { CWD1 { cwd2 } } ?
09:29 FROGGS if you know that you don't want to fiddle with $*CWD process wide, you just declare it 'mc $*CWD' and you are done
09:29 FROGGS my*
09:29 Alina-malina joined #perl6
09:29 Alina-malina joined #perl6
09:30 FROGGS m: say $*CWD; { say my $*CWD = OUTER::<$*CWD>; $*CWD = 'hurz'; say $*CWD }; say $*CWD
09:30 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤(Any)␤hurz␤"/home/camelia".IO␤»
09:30 FROGGS m: say $*CWD; { say my $*CWD = PROCESS::<$*CWD>; $*CWD = 'hurz'; say $*CWD }; say $*CWD
09:30 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤(Any)␤hurz␤"/home/camelia".IO␤»
09:30 FROGGS hmmm
09:30 FROGGS m: say $*CWD; { say my $*CWD = PROCESS::<$CWD>; $*CWD = 'hurz'; say $*CWD }; say $*CWD
09:30 camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤"/home/camelia".IO␤hurz␤"/home/camelia".IO␤»
09:30 FROGGS well, not ideal but it works
09:33 sqirrel__ joined #perl6
09:34 lizmat FROGGS: please don't assign to $*CWD like that
09:35 Woodi do two threads are allowed to be in same scope ? what if one thread do chdir ?
09:35 FROGGS lizmat: shall I do: my $*CWD; chdir 'foo' ?
09:35 lizmat using chdir will at least ensure the directory exists and create a correct absolute path
09:35 lizmat yup
09:35 lizmat afk for a few hours&
09:35 FROGGS ahh, gotcha
09:36 kaleem joined #perl6
09:36 FROGGS Woodi: I don't this is possible with our model
09:36 FROGGS think*
09:36 FROGGS damn, I am distracted
09:36 azawawi joined #perl6
09:36 ibo2perl6 joined #perl6
09:37 Woodi then I must say I have no idea what was orginal problem...
09:38 FROGGS *g*
09:42 Alina-malina joined #perl6
09:43 Woodi if we start design from "user view", by happily scoping varible, then things gets complicated later :)
09:52 rurban joined #perl6
09:54 virtualsue joined #perl6
09:55 masak ahoya, #perl6
09:56 pecastro joined #perl6
09:57 masak Tekk_: yes.
09:57 masak Tekk_: are you interested in helping?
09:58 masak Tekk_: I'm going to need a full-ish Text::Markdown fairly soon as a dependency, so I have a stake in implementing it.
10:04 masak pretty cool: an implementation of a parser/interpreter, in 450 lines of JavaScript: http://jsfiddle.net/osfnzyfd/
10:05 masak HN discussion: https://news.ycombinator.com/item?id=8554084
10:11 virtualsue joined #perl6
10:16 daxim joined #perl6
10:19 vendethiel :o)
10:22 moritz I've got the OK from my employer, they'll sponsor Perl 6 development by housing a 1U server for us
10:23 masak \o/
10:23 masak moritz.employer++
10:23 moritz noris.de++
10:23 FROGGS moritz.^employer++
10:25 * masak .oO( and .HOW )
10:25 moritz FROGGS: you mean they employ a whole meta class of moritzen?
10:26 FROGGS moritz: they really should :o)
10:26 pnu joined #perl6
10:29 * masak .oO( but the moritzen start to compete, and sometimes it all turns into a big morathon )
10:29 grondilu is brad gilbert someone here?
10:29 vendethiel moritz.*++
10:31 * grondilu was reading http://blogs.perl.org/users/brad_gilbert/2012/05/perl6-and-d.html and wondered if D also has performance issues, and if not what does it do that rakudo does not.
10:32 masak ...be a static language? :)
10:32 grondilu oh well, I guess there is that indeed.
10:33 grondilu though Perl6 is not much faster when all variables are strongly typed, is it?
10:34 masak as in, Perl 6 is "mostly interpreted", to an extent that D isn't (at all, to my knowledge).
10:34 FROGGS rurban: I know now what goes on with parrot 6.9.0, and where the regression comes from
10:34 masak grondilu: AFAIK, using e.g. native types can have quite an effect on performance.
10:41 FROGGS rurban: when you upgrade from an older version to 6.9.0, unlink the parrot binary, reconfigure and make install, the following file will be modified: https://gist.github.com/FROGGS/9cf72ef4ab48a02d8a8b
10:42 FROGGS rurban: when you then git checkout that file, unlink parrot binary again and make install, nqp passes (and rakudo should do too, but not tested yet)
10:43 FROGGS rurban: that's how I test `nqp-p t/qregex/01-qregex.t`: https://gist.github.com/FROGGS/df8766923f709efe3651
10:47 FROGGS rurban: my guess is that something in parrots regenerates that encoding table at build time when it should not
10:47 grondilu this is, when I consider performance, I often think of how slow is somethng like the Mandelbrot set (http://rosettacode.org/wiki/Mandelbrot_set#Perl_6), and if I think about ways to improve it, I realise it could use the native complex type, which is NYI.  Is there a particular reason for it to be NYI?
10:47 grondilu s/^this is/thing is/
10:48 FROGGS grondilu: just a matter of already full todo lists I suppose
10:51 grondilu I'll try to write a version
10:51 grondilu (an make a gist about it)
10:51 Woodi joined #perl6
10:52 FROGGS ohh cool!
10:55 grondilu don't get too excited, my naïve first attempt already failed miserably:  https://gist.github.com/grondilu/2bc1ad877352fca3aef9
10:56 grondilu that was very very naive for me to hope this simple version would work :-)
10:56 grondilu though in an ideal world it should have imho
10:59 grondilu I mean, to me Complex should be a role so that we could just write 'class complex does Complex { has num $.re = 0; has num $.im = 0 }' and be done with it.
11:00 grondilu and re and im being defined as virtual methods in Complex
11:06 chenryn__ joined #perl6
11:07 ugator joined #perl6
11:07 grondilu or even define Complex as a parametric type maybe
11:08 grondilu (class complex does Complex[num] {})
11:09 tinyblak joined #perl6
11:11 grondilu oh crap I'm just realizing Complex already has $.re and $.im defined as num
11:12 grondilu sorry guys
11:16 kjs_ joined #perl6
11:25 Ven joined #perl6
11:29 colomon that's actually a "bug".  Complex should have $.re and $.im defined as Real.  The one with num $.re and $.im is "complex".
11:29 masak was gonna say.
11:32 denis_boyun_ joined #perl6
11:32 immortal joined #perl6
11:35 virtualsue joined #perl6
11:37 H2O1 joined #perl6
11:43 colomon FROGGS: The Distributions page doesn't work yet?
11:47 FROGGS colomon: http://testers.perl6.org/dists works for me
11:47 FROGGS maybe it is an issue with your browser an HTTP::Easy?
11:48 FROGGS and*
11:48 FROGGS rurban: good news, rakudo just built
11:49 colomon I guess I should say, I get a giant table of distributions from the page.  it's just there's no info in the "PASS ratio" column
11:49 FROGGS colomon: I'll work on stability and performance the next days
11:49 FROGGS colomon: that's correct
11:50 FROGGS that needs to be computed, that's TODO
11:50 colomon another thing… I'm not convinced by the "Author" field
11:50 FROGGS in what way?
11:51 lizmat fg
11:51 lizmat :-)
11:51 FROGGS O.o
11:52 colomon for the module smoke results, we report the "owner" of the repo, just by going through the git(hub) URL.
11:52 colomon this is the person (presumably) currently maintaining the module, rather than its author.
11:53 FROGGS colomon: I take that information from the META.info
11:53 colomon for instance, IO::Prompter was written by Damian, but is maintained (such as it is) by me
11:53 FROGGS see https://github.com/perl6/cpandatesters.perl6.org/blob/master/app.pl#L215
11:54 colomon yes, I understand some modules have an Author in the META.info.  But what I'm saying is, there are cases where either that name is a lie or its not who you need to contact about issues.
11:55 colomon should the maintainer be single by authority?
11:55 colomon *signaled
11:56 DarthGandalf joined #perl6
11:59 fhelmberger joined #perl6
12:00 FROGGS hmmm
12:00 FROGGS what if we don't mix these two and (also) display the maintainer?
12:00 FROGGS from the github repository for example
12:03 colomon sure
12:03 colomon that works fine for me.
12:03 colomon I've got nothing against crediting the author.
12:03 colomon but the maintainer is important to know.
12:04 colomon and reports organized by maintainer are really useful
12:06 danaj joined #perl6
12:08 colomon BTW, Stage parse has gotten noticeably slower in the last week or two.  I actually saw 25.9 a few weeks back, but today was 27.1
12:10 lizmat fwiw, I think I'm at least partially to blame for that: settings now at 24359 lines
12:10 lizmat will get a lot less when IO::Spec and IO::Path can be ejected from the core
12:11 kjs_ joined #perl6
12:11 lizmat on that note: I just found that panda is actually recursing into .git directories
12:11 lizmat when trying to find files
12:11 colomon bad panda
12:12 lizmat would it make sense to *not* return any basenames that start with '.' ?
12:12 lizmat by default?
12:12 colomon in dir?
12:12 lizmat yes
12:12 lizmat it would also make the test a lot simpler  :-)
12:13 colomon …. I'm not sure what the default should be, but it definitely seems like it should be an option?
12:13 lizmat and it would make panda (and possibly other modules using File::Find) not recurse into e.g. .git
12:13 Alula joined #perl6
12:13 lizmat well, it is already an option: you can specify your own test
12:13 colomon :all versus :no-dotfiles
12:13 colomon or some such
12:13 lizmat currently, '.' and '..' are not returned by dir() by default
12:14 lizmat if you want all, specifying :test is enough
12:15 lizmat it will then simply return all paths it finds
12:15 lizmat m: dir().elems.say
12:15 camelia rakudo-moar 315ec6: OUTPUT«27␤»
12:15 lizmat m: dir(:true).elems.say
12:15 camelia rakudo-moar 315ec6: OUTPUT«27␤»
12:15 lizmat m: dir(:test).elems.say
12:15 camelia rakudo-moar 315ec6: OUTPUT«29␤»
12:18 colomon ah.
12:19 colomon yeah, sounds like not returning dotfiles would be a good default, then
12:25 dalek cpandatesters.perl6.org: 6eae39a | (Tobias Leich)++ | TODO.md:
12:25 dalek cpandatesters.perl6.org: added todo about maintainers, colomon++
12:25 dalek cpandatesters.perl6.org: review: https://github.com/perl6/cpandatesters.perl6.org/commit/6eae39a07e
12:28 dbane joined #perl6
12:32 brrt joined #perl6
12:33 [Sno] joined #perl6
12:34 dalek specs: 91c184f | (Elizabeth Mattijsen)++ | S32-setting-library/IO.pod:
12:34 dalek specs: Spec dir() default exclusion to all /^\./
12:34 dalek specs:
12:34 dalek specs: Instead of just '.' and '..'.  This move inspired after finding out File::Find
12:34 dalek specs: will gladly recurse into .git when used by panda to find files to install.
12:34 dalek specs: review: https://github.com/perl6/specs/commit/91c184fbb8
12:35 vendethiel m: dir(:test(True)) # does that work, lizmat?
12:35 camelia rakudo-moar 315ec6: ( no output )
12:35 fizzybanana joined #perl6
12:35 FROGGS vendethiel: yes
12:36 lizmat vendethiel: that's the same as dir(:test)
12:36 vendethiel true :-)
12:36 vendethiel but that one looks kind of weird
12:39 moritz FROGGS: testers.perl6.org works now, but shows 'cpandatesters.perl6.org' in the HTML <title>
12:39 lizmat maybe we need ":all" and ":none"
12:39 lizmat dir(:all)
12:39 lizmat dir(:none(/\.pod/))
12:40 lizmat dir(:all(/\.pod/))
12:40 lizmat first returns all, 2nd returns all but .pod files, 3rd returns .pod files only
12:40 moritz :any would be better for the 3rd
12:41 moritz but IMHO it's not necessary, you can always combine with grep
12:41 moritz :test only exists as a neat way to exclude . and .., which aren't really wanted in most listings
12:41 FROGGS moritz: yes, I also need to rename the git repository
12:41 moritz dir(:test(none /\.pod$/)) # also works
12:43 lizmat moritz: eh, but if you don't specify a test, you *are* excluding "." and ".." already ?
12:43 moritz lizmat: that's exactly the point
12:44 lizmat then I don't understand your line: ":test only exists as a neat way to exclude . and .."
12:44 moritz I wanted dir() to exclude . and ..
12:44 moritz but giving the user an option to override that
12:44 moritz hence :$test = none('.', '..') in the signature
12:45 lizmat ah, ok... :-)
12:45 moritz if that hadn't been the motivation, I'd not have implemented any :test or :any or :all or so
12:45 moritz because you can simply .grep
12:45 moritz and achieve the same thing
12:46 lizmat except matching on basename can be done faster on moar/parrot inside dir()
12:47 lizmat (JVM always returns full paths internally, so matching on basename is more involved there anyway)
12:49 dalek rakudo/nom: f7c7b06 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
12:49 dalek rakudo/nom: dir primitives exclude anything starting with "."
12:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f7c7b06a98
12:57 dalek nqp: 64ad02c | (Tobias Leich)++ | t/qregex/rx_charclass:
12:57 dalek nqp: add test for regression, see parrot #1119
12:57 dalek nqp: review: https://github.com/perl6/nqp/commit/64ad02cb2e
12:59 kaleem joined #perl6
13:06 mirjam joined #perl6
13:24 guru joined #perl6
13:36 * masak does a "" with a {} with a "" with a {} with a "" for the first time in production code
13:36 masak probably should factor some of this into their own variables, though... :)
13:37 masak this Perl 6 program also contains a Perl 5 program that it spurt()s and then executes.
13:41 tinyblak_ joined #perl6
13:42 arnsholt Nice!
13:42 arnsholt I recently wrote a shell script that generated Lisp code that it subsequently ran =)
13:42 Alina-malina joined #perl6
13:43 arnsholt Sadly the Lisp compiler didn't like the FIFO thing created by Bash's <(...) syntax
13:44 PerlJam masak: show the code!  :)
13:48 masak PerlJam: https://gist.github.com/masak/3fb4eb7a42ca8ee0f28d
13:49 masak planning to open-source this slide generation framework once we get far enough with it.
13:50 mirjam but then please without hardcoded paths
13:52 masak *nod*
13:52 masak yeah, that only works on Linux. I'm aware.
13:53 vendethiel masak: "y u no" inline::perl5 :)?
13:53 PerlJam vendethiel++
13:53 rurban1 calling out is much easier here
13:54 masak I guess I could sit down and rewrite that (working) solution in Inline::Perl5. but I don't really see the benefit.
13:55 masak also: someone please, *please* get up for 5 minutes next YAPC::EU and give a talk about how they implemented Inline::Perl6 (in Perl 6) in half an afternoon.
13:55 rurban1 Then you should write a perl6 pdf parser and emitter
13:55 masak preferably, nine++ should give this talk :D
13:56 masak rurban1: yes, I want to eliminate the Perl 5 dependency in the long run.
13:56 masak basically porting over the necessary parts of PDF::API2.
13:56 jfredett joined #perl6
13:56 rurban1 and inkscape is even worse
13:56 arnsholt Heh. Writing a typesetting engine in Perl 6 is a life project, I think
13:57 rurban1 htmldoc was pretty cool for my projects
13:57 ClarusCogitatio joined #perl6
13:57 masak I wish everyone else good luck with their bikesheds.
13:57 rurban1 much smaller than inkscape and generates nice pdf's
13:57 * masak goes back to $work
13:58 arnsholt masak: Sounds like a good plan
13:58 * arnsholt has annoying equations to cope with
14:00 Alula joined #perl6
14:01 brrt :-)
14:10 pmichaud FWIW, having dir() exclude all dotfiles by default feels really wrong.
14:10 yoleaux 29 Oct 2014 20:09Z <lizmat> pmichaud: re http://irclog.perlgeek.de/perl6/2014-10-28#i_9577937 , I think that would be an excellent plan
14:10 lizmat pmichaud: would you care to elaborate on that ?
14:11 lizmat pmichaud: about excluding . and .. by default, that's ok ?
14:12 pmichaud lizmat: I wasn't entirely comfortable about excluding . and .. either
14:12 lizmat .oO( perhaps we need an "ls()" )
14:12 pmichaud it feels wrong in a "this is smelly" sense, not in a "I know exactly why we shouldn't do it" one.
14:12 pmichaud I have to take kids to school, bbi15
14:12 lizmat safe travels!
14:17 mirjam joined #perl6
14:19 JimmyZ joined #perl6
14:20 masak I agree that it is smelly.
14:20 Tekk_ masak: could be a fun way to learn grammars...
14:21 Tekk_ wrt: Text::Markdown
14:22 pmichaud back again
14:22 pmichaud here are my (unrefined) thoughts on why exclusion of dot is bad
14:22 pmichaud 1.  it's fairly unix-centric.  What about other OS's, like Windows?  We really should be excluding "hidden" files, FSVO "hidden"
14:23 pmichaud 2.  What's the motivation for excluding dot files in dir() when one can do the same thing with .grep?
14:23 Tekk_ masak: I have a paper to write atm, but once I've done some work on that I'll try to play around a bit, maybe shoot you a pull request :)
14:23 colomon pmichaud: you can do the same thing with dir, using the :test argument
14:23 Tekk_ unless you're rewriting Text::Markdown?
14:24 pmichaud :test is a poor name.
14:24 pmichaud it should be  :grep
14:24 pmichaud which then begs the question of...   why not just .grep the results?
14:25 Ven joined #perl6
14:25 JimmyZ the sencod loop?
14:27 haroldwu joined #perl6
14:28 nebuchadnezzar joined #perl6
14:29 xinming joined #perl6
14:30 pmichaud after looking at the synopsis for .grep, I can accept :test as the named argument to dir.  But I'm still not sure about exclude all dot files by default.
14:30 JimmyZ or about exclude hidden files?
14:31 JimmyZ :test=!hidden
14:31 pmichaud (and :test still feels like the wrong name for .grep, too :)
14:32 JimmyZ :grep
14:32 masak Tekk_: I think I would rewrite it, more or less.
14:32 pmichaud I wouldnt' want to see    @list.grep(:grep( ... something ...))   though
14:32 pmichaud *n't
14:33 masak Tekk_: nowadays it feels like the best approach would be to start from http://commonmark.org/
14:34 Tekk_ masak: yeah, but as it is doesn't Text::Markdown implement a subset of commonmark?
14:34 lizmat pmichaud: fwiw, I didn't invent :test
14:34 JimmyZ :by=!hidden
14:34 masak Tekk_: I think it does.
14:34 timotimo azawawi: i'm here now (but backlogging)
14:34 lizmat I can live with it completely dying
14:34 * Tekk_ will look it over quickly
14:34 masak Tekk_: I'm not 100% a complete rewrite is necessary.
14:34 Tekk_ but I'm sure that they didn't change the 3 or so "tags" you defined
14:34 JimmyZ I think :by is better
14:35 JimmyZ and shorter
14:35 lizmat commute to Amsterdam.PM meeting&
14:35 cognominal joined #perl6
14:36 JimmyZ or :with ?
14:38 masak Tekk_: I remember the strategy I/we decided to follow when porting Markdown, was to stay as close as possible to the original Perl 5 script.
14:38 masak Tekk_: nowadays it feels better to simply conform to the CommonMark spec.
14:38 masak Tekk_: that's what I think would trigger a near-complete rewrite.
14:39 Tekk_ ah
14:40 Tekk_ yeah, I suppose that the grammar doesn't look very grammarish
14:40 Tekk_ seems to roughly be "foreach paragraph apply this bunch of regexen" :/
14:41 flussence fwiw, "be the same as Perl 5" was what Text::Tabs/Wrap does, and it'd also probably be much nicer code if it didn't try to behave exactly the same
14:42 masak I think the end result will often be better if the port happens by way of "let's spec the behavior we actually want here"
14:43 pmichaud just scanning the IO design a bit more... it feels to me like the :test argument to chdir() ought to be a Matcher also, instead of a string.
14:43 pnu Hi! We warmly welcome everybody here to join the Nordic Perl Workshop 2014 in Helsinki: http://act.yapc.eu/npw2014/ (note: that's in about two weeks)
14:43 masak pnu: \o/
14:43 pnu This is a kind of short notice, but we also have a great preconference hackathon venue available, and all p6 topics would be extremely welcome.
14:43 JimmyZ pmichaud: how do you think about :by or :with :P
14:43 pmichaud i.e.,   chdir($path, :test(.*))
14:43 pmichaud JimmyZ: I don't like :by or :with
14:44 pmichaud the argument to .grep is a matcher
14:44 masak waitwait, chdir has a :test argument?
14:44 JimmyZ OK
14:44 pmichaud masak: according to S16 it does.
14:44 pmichaud except S16 lists it as a string.
14:44 pmichaud (or list of strings)
14:44 * masak tries to figure out why it would need one
14:45 pmichaud and my chdir example was *supposed* to read
14:45 pmichaud chdir($path, :test(*.r))
14:45 pmichaud (I'm sure that's what I wrote.)
14:48 pmichaud masak: but yes, I"m not sure that :test is warranted on chdir.  Feels like one could just do    chdir($path) if $path.r;
14:48 pmichaud although I guess one wants to throw the Failure
14:48 pmichaud s/throw/return
14:50 pmichaud anyway, I'd prefer a true Matcher there over a list of strings
14:50 pmichaud even   chdir($path, :test(:r)) would work.
14:51 pnu masak: .. when ;-) coming to Helsinki, there is a huge startup event http://www.slush.org/ just after the NPW .. I think that might be of interest to some.
14:54 ugator_ joined #perl6
14:55 timotimo greetings pmichaud :)
14:55 pmichaud greetings timotimo
14:57 FROGGS btw, I'm in favour of excluding '.' and '..' by default (or whatever curdir/updir is), because these have nathing to do with the actual content of a directory
14:57 FROGGS these are just workarounds to display information in a shell
14:57 pmichaud I'm okay with '.' and '..'.
14:57 timotimo pmichaud: it is (or was) remarkably hard to create a file that starts in a . on a windows machine
14:57 pmichaud timotimo: Oh, I manage to run across them quite a lot, especially with network-mounted drives.
14:58 timotimo that makes sense
14:58 timotimo hm, perhaps my experience was limited to explorer.exe and notepad.exe or something :)
14:58 timotimo "you need to supply a filename!" - "but .htaccess *is* a filename!"
14:58 FROGGS timotimo: you can't create a dot file easily on windows, but you can rename a file and prepend a dot
14:59 FROGGS either that worked or I don't remember correctly and you had to use cmd.exe to rename
14:59 masak pmichaud: it is my strong opinion that :test does not belong on chdir.
14:59 pmichaud in some sense I'd almost wish that there's a .hidden filetest method on Path objects
15:00 pmichaud which then returns true if the file is "hidden", mapped to the OS's understanding of that term.
15:00 pmichaud then    dir can default to     dir(:test(:!hidden))
15:00 pmichaud which could be hot-pathed appropriately
15:00 masak +1
15:02 pmichaud given that .grep  uses $test for its matcher argument, I find :test less objectionable as a named argument to dir()
15:02 pmichaud I'd still prefer something other than "test" to better describe its smart-matching nature
15:04 PerlJam "match"?
15:04 Juerd What does :test do?
15:05 thou joined #perl6
15:05 pmichaud Juerd: short answer:   in    @list.grep( foo )     the "foo" is the test to be applied to each element of @list
15:06 pmichaud in fact, it can be written explicitly as    @list.grep( :test( foo ) )
15:06 Juerd And dir implicitly greps?
15:06 pmichaud Juerd: as currently defined, yes.
15:06 Juerd :where
15:06 pmichaud (that's part of what is being discussed)
15:06 pmichaud I'm worried about "match" because of the punning with "Match" (type) and ".match" (method)
15:07 Juerd :having
15:07 pmichaud I'd be worried about "where" punning with the "where" keyword in signatures
15:07 Juerd Both borrowed from sql :)
15:07 pmichaud and perhaps the  .WHERE  macro, too.
15:07 Juerd Or, on a different layer, :select :-)
15:08 pmichaud oooh, :select has potential
15:08 PerlJam :filter  (though, lots of potential for confusion  :)
15:08 pmichaud :choose   and :comb  also work
15:08 Juerd :only
15:09 pmichaud :take   (puns with "take" keyword, sigh)
15:09 PerlJam :with/:without
15:09 Juerd :iff
15:14 PerlJam btw, are there other "file attributes" that may be relevant on specific file systems?  so far we have all the unixy ones, (:r,:w,:x, etc) but also "hidden".  Don't other filesystems have attributes like "system file" or "compressed" or some such?  Would we have file tests for those as well?  (:hidden, :system, :compressed)
15:15 pmichaud PerlJam: that's an area where I'd prefer to wait for actual use cases
15:15 pmichaud in the case of :hidden, we clearly have a use case
15:20 geekosaur some of them are candidates for system dependent support loaded afterward / not in the core
15:21 geekosaur e.g. bsd/os x file flags (schg, nodump, etc.)
15:22 masak I'd take `chdir($path) if $path.r` over `chdir($path, :test(*.r))` any day.
15:22 masak why would we want to put an ad-hoc if statement into chdir?
15:22 PerlJam geekosaur: I was thinking that maybe a generic mechanism to get/set attributes could handle it so that you could say something like  dir(:with(*.attributes ~~ "blah"))
15:22 pmichaud masak: except it might not be just an "if" (more)
15:23 pmichaud looking at it more generally, there are a number of things that could cause a chdir() to fail
15:23 pmichaud for example,   chdir("foo.txt")   # not a directory
15:23 pmichaud or changing to a directory for which 'x' permissions aren't present
15:24 pmichaud since chdir() is already doing a lot of those checks, it's not too hard a stretch to have it fail if other checks aren't available
15:24 masak a lot of operations do checks but don't have a :test parameter.
15:24 pmichaud and getting a Failure is sometimes more advantageous than doing a test
15:25 liztormato joined #perl6
15:25 pmichaud so, the equivalent is more of
15:25 pmichaud $path.r ?? chdir($path) !! fail(blah blah)
15:25 guru joined #perl6
15:25 masak I'd rather have that code than :test.
15:25 * JimmyZ wonders the timestamp of GLR ;)
15:26 pmichaud (I'm simply arguing my guess as to why :test was added, I'm not advocating it should remain.  I personally don't know the use case that caused it to be included in the design.)
15:26 JimmyZ *timeline
15:26 Woodi tested C: while(f = readdir(d)) { printf(...  and it shows . and ..   on the other hand Java http://docs.oracle.com/javase/7/docs/api/java/io/File.html#list%28%29  docs says: Pathnames denoting the directory itself and the directory's parent directory are not included in the result.   someone could test what java.nio.file.newDirectoryStream do...
15:26 liztormato The naming of :test on chdir is confusing
15:26 liztormato It's intended to check for access rights
15:27 pmichaud liztormato: did you see my notes above about how it ought to be smartmatch instead of string?
15:27 liztormato Default chdir will check for read access
15:27 masak I posit that there is no use case for :test that couldn't be written more clearly with if-else or ?? !!
15:27 pmichaud yeah, "check for read access" felt weird to me also.
15:27 geekosaur typically higher level stuff than C just excludes . and .. explicitly
15:27 liztormato Yes
15:27 pmichaud because what normally determines success of a chdir is execute access, not read access
15:28 timotimo mumble mumble race condition mumble mumble
15:28 liztormato Well. Then maybe the default is wrong
15:28 pmichaud and if the default is wrong, then perhaps the use case isn't clearly understood.  :)
15:28 * masak .oO( ceterum censeo chdir(:test) delendam esse )
15:29 liztormato Gesundheit
15:29 pmichaud lol
15:29 Woodi after some thinking what I wrote before I think that chdir is changing application state. and setting cwd is in same  "transaction"
15:30 * liztormato waits for consensus to build
15:30 PerlJam liztormato: +! to removing :test on chdir from me
15:30 PerlJam er, +1 even
15:30 masak +1
15:30 pmichaud what about the other places where :test appears in the design?
15:30 pmichaud (S16)
15:30 * PerlJam reads S16
15:31 timotimo 1 + 5 :test(6)
15:31 pmichaud at some level we need to take a global view, too.
15:31 moritz burn them to pieces
15:31 dalek Perlito: aa23811 | (Flavio S. Glock)++ | TODO-perlito5:
15:31 dalek Perlito: Perlito5 - js - TODO update
15:31 dalek Perlito: review: https://github.com/fglock/Perlito/commit/aa238111df
15:32 Woodi moritz: ashes :)
15:32 moritz really, we have composable features to do list selections
15:32 moritz we don't need to stuff them into everything else
15:32 moritz Woodi: hack them to ashes!
15:32 PerlJam :test appears in chdir, tmpdir, homedir, and indir looks like.
15:32 chenryn joined #perl6
15:32 Woodi yea, pieces probably indicate reuse :)
15:32 pmichaud PerlJam: and (undocumented)  dir()
15:33 masak PerlJam: o.O
15:33 masak PerlJam: that's crazy.
15:33 PerlJam what masak sais
15:33 PerlJam er, said
15:33 Woodi what indir is ?
15:33 masak foreign prime minister of India.
15:33 PerlJam Woodi: something I'm not sure should exist either, but that's another topic  :)
15:33 masak former*
15:34 PerlJam Woodi: indir $dir, { ... do some stuff .. }   # It's like a temporary chdir
15:34 masak ok, revised opinion: if it builds on chdir, it shouldn't have a :test
15:35 liztormato Indir ececutes a block with a specific $*CWD and restores when done
15:35 pmichaud and I'm a little concerned about tmpdir() and homedir()... are these just sugar for things like  $*HOME = $dir; { tests }   ?
15:35 masak liztormato: so it's like `{ $*CWD = $newpath; ... }` ?
15:35 liztormato With a temp thrown in
15:35 PerlJam masak: but with a temp
15:35 masak er, right.
15:35 moritz more like  { my $*CWD = $newpath, ... }
15:36 moritz well, temp on a dynamic variable is basically the same as a new dynamic variable in that scope
15:36 masak right.
15:36 masak I'd probably do that with `my $*CWD`
15:36 timotimo it would kind of be interesting to have the RHS of a temp's assignment be thunked and have the old/outer value available to it
15:36 liztormato Wont work
15:38 liztormato Well. It will. But do we really want to just ditch chdir() in favour of just assigning $*CWD
15:38 liztormato ?
15:38 timotimo if we don't have chdir, people may be confused :)
15:38 liztormato Chdir at least takes realtive paths
15:39 pmichaud sure, but chdir() also works with an existing $*CWD, it doesn't create a new one
15:39 liztormato And makes sure the dir actually exists
15:39 PerlJam exists and is readable, right?
15:40 pmichaud NONONONONO
15:40 pmichaud not "is readable"
15:40 timotimo it'd kinda be good to have "indir" instead of chdir
15:40 pmichaud it's entirely possible to change to a directory that doesn't have read permissions set
15:40 timotimo should be "is enterable" aka "has +x"
15:40 PerlJam pmichaud: I'm saying that's what it currently does
15:40 pmichaud PerlJam: okay then.
15:40 liztormato So change the default test to .x
15:41 liztormato_ joined #perl6
15:42 pmichaud I don't think I can comment on  "chdir()" versus "assign to $*CWD" until I know a bit more about what happens behind the scenes at a process level for each
15:42 Woodi hey, 'chdir' is system call... $*CWD = ... is "shellism", IMO
15:42 timotimo the thing is: we can't do anything with the process
15:42 timotimo right?
15:43 liztormato_ Right
15:43 geekosaur and there's complexities like windows' version of chdir is per drive letter
15:43 timotimo all we can do is turn the fake $*CWD into a "real" cwd when we shell out or something
15:43 timotimo geekosaur: a program has one CWD per drive letter? :\
15:43 liztormato_ Indeed. And even then
15:43 masak I don't think the default :test on chdir should be changed to anything. I think it should be removed.
15:44 masak either you can change into the dir or you can't. that's the test.
15:44 pmichaud masak: so, you're saying that chdir() should check for path existence and that a system-level chdir() will succeed?
15:44 pmichaud (and set $*CWD)
15:44 masak if you want another level of dying/failing, just catch the failure/throw that comes out of chdir, and throw/fail a new, better one.
15:45 PerlJam Is the surmised purpose for :test better error reporting and some efficiency advantage?
15:45 liztormato_ Yes
15:45 masak is there a story for avoiding race conditions?
15:45 masak (between the :test and the actual dir change)
15:46 pmichaud actually, that race condition extends even longer than that.
15:46 liztormato I think we should never ever do a low level os chdir()
15:46 pmichaud liztormato: what happens for qx(), then?
15:47 pmichaud er,  qx{}
15:47 liztormato_ joined #perl6
15:47 Woodi but we actually live behind vm, we can pre-read dir and do everything virtually... do we such thing ?
15:48 liztormato_ Flaky connection while driving
15:48 Woodi *want...
15:48 PerlJam .oO( liztormato_ IRCs and drives at the same time?!? ;)
15:48 pmichaud .oO( woolfy drives :)
15:48 liztormato_ Indeed
15:49 liztormato_ The os dir is the one at startup
15:49 liztormato_ Changing it is a recipe for race conditions
15:50 Woodi but then we need to sync to fs and sometimes users will lost work...
15:50 liztormato_ There's a reason the JVM doesn't have the concept of a current directory, afaik
15:51 pmichaud liztormato:  so, in other words      chdir("path");  shell($expression);     wouldn't do what the programmer expects?
15:52 liztormato Indeed
15:52 moritz uhm, then we need to fix shell()
15:52 pmichaud liztormato: so, there's no way to run an external program in a different working directory?  That sounds wrong.
15:53 pmichaud actually, shell already has a :cwd param, so we're good there.
15:53 liztormato Imagine that code with 2 start blocks and 2 different dirs
15:53 moritz so have shell's :dir default to $*CWD?
15:53 pmichaud presumably   shell()'s   :cwd should default to  $*CWD instead of $CWD as listed now in S29
15:53 masak +1
15:53 masak &
15:54 liztormato pmichaud: That is probably a typo
15:54 pmichaud then   chdir("path"); shell($expression)   would dwim   *if*  there's some way to change the working directory for the externally executed shell
15:55 pmichaud (similar arguments hold for   run(), too.)
15:55 liztormato There's a race condition there
15:56 pmichaud when is there *not* a race condition for this stuff?   Are we saying that we won't ever allow operations that might lead to race conditions?!
15:57 liztormato If we can help it, yes
15:57 Woodi "externally executed shell" is other proces, it have his own CWD...
15:57 pmichaud That doesn't sound very swiss-army-knife to me.
15:58 pmichaud I'm somewhat presuming that shell/run could be written to minimize or detect a cwd race condition.
15:59 pmichaud or, put another way, how would     chdir("path");   dir();   exhibit any less of a race condition?
16:00 liztormato Because dir only looks at $*CWD and does everything in absolute paths
16:00 Woodi @args = ("/dest/inat/ion","command", "arg1", "arg2");  system(@args)
16:00 pmichaud liztormato: why wouldn't system() only look at $*CWD, then?
16:00 pmichaud sorry, shell()
16:02 pmichaud in other words, you're trying to avoid the race between the system-level chdir(2) and exec(2) ?
16:02 liztormato Yes
16:02 liztormato Murphy lives!
16:02 pmichaud because that's so evil it should never be done, even though every shell script does it?
16:02 Woodi becouse we are multi-threading and we have no idea what other threads do...
16:03 liztormato Woodi: ++
16:03 pmichaud Woodi: I'm presuming that shell() forks a separate process.
16:03 PerlJam I think it's a noble goal to make the bias such that a programmer must work to encounter a race condition (rather than work to avoid them).
16:03 Woodi pmichaud: sorry, it was general rant...
16:03 pmichaud the standard approach would be      fork(2), chdir(2), exec(2)
16:04 pmichaud note that the chdir() is changing the cwd of the about-to-be-executed shell command, not the cwd of the perl program process
16:04 liztormato Not sure we can do that with libuv
16:04 pmichaud if we're talking about trying to execute a shell command inside of a thread instead of a forked process.... that's completely new territory to me
16:05 liztormato Wel
16:05 geekosaur exec in a thread still replaces the whole process, not the thread
16:05 timotimo we'd need a new "fork + chdir + exec" primitive %)
16:05 liztormato But multiple threads may fork at any time
16:06 pmichaud liztormato: and each fork creates a new process, yes?
16:06 geekosaur yes
16:06 liztormato Yes
16:06 pmichaud and the new process has its own cwd, yes?
16:06 geekosaur yes
16:06 liztormato Yes
16:06 telex joined #perl6
16:06 pmichaud and so we could then do   chdir(2)  using the current $*CWD value, then exec(2) on the program and there's no race condition
16:07 liztormato If we can do that with libuv
16:07 pmichaud why are we limited to what libuv can do?
16:07 araujo joined #perl6
16:07 liztormato Afaik. Fork is handled by libuv
16:07 timotimo how do the nodejs people do it?
16:07 pmichaud you mean for windows clients
16:07 pmichaud ?
16:08 liztormato Libuv offers an abstraction layer. When we firk
16:08 pmichaud I posit that being able to do shell() and run() of programs in other cwd's is strong enough use case to say "we shouldn't limit ourselves to only what libuv provides"
16:09 pmichaud I mean, I just can't imagine "Perl" without the ability to shell()/run()
16:09 liztormato Fork we don't want the threads to keep running in the forked process
16:09 pmichaud (I also have difficulty imagining that libuv provides fork() without chdir()/exec(), but I'm not familiar with libuv)
16:10 pmichaud Also, as of a year ago, libuv was considered to be "stepping stone", not "we're tied to it permanently"
16:10 FROGGS[mobile] joined #perl6
16:10 cognominal joined #perl6
16:10 pmichaud We've never designed Perl 6 based on "this is what our 3rd party libraries support today"
16:10 pmichaud well, at least not when I was more active :)
16:11 timotimo have you tortured your implementors today?
16:11 timotimo sometimes i torment my implementors five times before breakfast!
16:12 liztormato I'm just very worried that we don't create another Perl 5.005 threads fiasco
16:12 FROGGS[mobile] I dont understand that discussion here... we already pass a cwd string down to the VM that spawns a process (like /bin/sh)
16:12 FROGGS[mobile] what's the issue?
16:12 sqirrel__ joined #perl6
16:12 pmichaud FROGGS[mobile]: that's what I'm trying to figure out.
16:14 liztormato What cwd string? $*CWD?
16:14 timotimo FROGGS[mobile]: no, that's just the argv[0]
16:14 pmichaud FROGGS[mobile]: I'm hearing   "We can't support shell()/run() because of race conditions" and that strikes me as being very un-Perlish
16:14 timotimo there's still the cwd that the spawned process will inherit from the moarvm process
16:15 FROGGS[mobile] let me grab my laptop
16:15 liztormato Huh?  Not support? Did I say that?
16:16 timotimo we are not going to not support this
16:16 liztormato I
16:16 timotimo it's massively important.
16:16 pmichaud 15:56 <pmichaud> when is there *not* a race condition for this stuff?   Are we saying that we won't ever allow operations that might lead to  race conditions?!
16:17 pmichaud 15:57 <liztormato> If we can help it, yes
16:17 liztormato I'm was just saying that we cannot reliably provide a cwd to the forked process
16:17 timotimo we could maybe have a little lock that'll protect us for the time between chdir and fork+exec
16:17 pmichaud timotimo: that's backwards
16:17 pmichaud the point is to do the chdir _after_ the fork
16:17 pmichaud so you don't have to touch the cwd of the parent process
16:17 timotimo i'd say we ought to ask the libuv people for that feature
16:18 timotimo as in: to put a chdir between fork and exec
16:18 FROGGS joined #perl6
16:19 * liztormato can't keeps up&
16:20 liztormato left #perl6
16:20 PerlJam timotimo: Are you saying you want libuv to provide another "primitive" that combines those 3 operations?
16:20 treehug88 joined #perl6
16:20 timotimo yes
16:20 FROGGS timotimo: we pass the _cwd to MVM_proc_shell and then set process_options.cwd to it
16:20 timotimo i don't think we can get in between these two operations
16:20 timotimo oh?
16:21 timotimo well, then everything is already just fine!
16:21 FROGGS timotimo: src/io/procops.c:141
16:21 timotimo cool
16:22 Ven joined #perl6
16:25 Woodi we probably assume that automatically spawned threads do something with side effects on whole process...
16:26 FROGGS Woodi: I'd need an example
16:26 Woodi eg. chdir after other thread reads cwd and tries to spawn shell with relative path
16:26 pmichaud if libuv is handling a lot of fork/exec/chdir stuff, I'm okay with assuming it gets it "right" fsvo of "right"
16:27 pmichaud I'm just concerned that "we cannot reliably provide X" is coming out as "therefore we shouldn't allow it _ever_"  and that strikes me as unPerlish
16:27 FROGGS Woodi: so when another thread is changing $*CWD between entering the shell() sub and calling nqp::shell(), right?
16:28 FROGGS Woodi: I guess this could be reduced to a minimum when we had 'as Str' in signatures
16:28 pmichaud FROGGS:  that part confuses me
16:29 pmichaud looking
16:29 timotimo aaw. it kind of seems like all the traffic i got last week was one-time traffic and almost nobody came back so far :\
16:29 timotimo seems like i need to make some better content %)
16:29 brrt left #perl6
16:29 pmichaud doesn't nqp::shell() include a cwd argument?
16:30 pmichaud (ops.markdown seems to indicate "yes")
16:30 Woodi pmichaud: dir/shell/chdir here are high level wrappers for user convenience, we should keep them race free. any race allowing things should be allowed by using low level constructs (or middle level)
16:30 FROGGS pmichaud: we need a Str anyway to pass that to nqp::shell(), so creating the string as early as possible minimizes the gap for the race condition
16:31 * PerlJam has trouble imagining chdir() as a "high level wrapper"
16:31 FROGGS but anyway, when another thread changes "our" $*CWD before we call shell(), we also have a problem
16:31 Woodi maybe we should start thinking bottom up ? not start from "user view"...
16:31 pmichaud I'm not saying that    chdir("path"); run("foo");   should be race-free
16:31 timotimo seems like the way we have it now is this:
16:32 Woodi that makes thing simpler :)
16:32 timotimo we can reliably spawn any process with any cwd we want
16:32 pmichaud run("foo", :cwd("path"))   should be race-free, however.
16:32 timotimo rakudo's core setting provided routines use $*CWD to give a sensible view of what happens where
16:32 pmichaud but that has nothing to do with $*CWD whatsoever
16:32 timotimo run("foo", :cwd("path")) should be very easy to do
16:32 pmichaud right
16:32 timotimo with what we have right now
16:33 pmichaud right
16:33 pmichaud that's what I've been (apparently badly) saying
16:33 pmichaud and I keep hearing "race condition!"
16:33 timotimo i'm sorry
16:33 timotimo i said that and i was wrong to do that
16:34 timotimo i do think there's the possibility of a race condition with chdir and testing stuff ... like chdiring and some other process changing permisisons at the same time
16:34 pmichaud yes, and that has existed in unix systems since.... forever
16:34 timotimo but that doesn't seem as terrible as things like "a malicious user is replacing a file with a symlink from under your feet"
16:38 FROGGS timotimo: it would be even more terrible if it was PHP :P
16:38 FROGGS (sorry)
16:38 timotimo FROGGS: we're trying to be among the best, we shouldn't compare ourselves with the worst ;)
16:38 pmichaud and yes, I see where the questions I posed above were leading things astray.  My apologies to the group, and to liztormato.
16:38 FROGGS *g*
16:38 timotimo pmichaud: what else is on your mind today?
16:39 FROGGS timotimo: it is just that I read pretty terrible PHP code today (parts of it were done by me)
16:39 timotimo oh, we started with dir() and tests and exclusion
16:39 pmichaud timotimo: eh, you probably don't want to know.  I probably should just go hide in bed most of the day and not make any major decisions.  :)
16:39 timotimo what i've been thinking is: since dir itself doesn't recurse, a .grep following .dir would be good enough
16:39 kaare_ joined #perl6
16:40 pmichaud it sure feels as though my stars have been misaligned since about 5p CDT on Saturday.
16:40 PerlJam timotimo: dir() should have an option to recurse though  :)
16:41 timotimo in that case we would want a .test, too
16:41 * pmichaud flogs PerlJam.
16:44 pmichaud I'm even hesitant to go vote, because I suspect all of the candidates I vote for will end up losing.  1/2  :-)
16:44 PerlJam oh, then you should *definitely* vote ... just not for who you really want to win  :)
16:45 [Coke] dj_goku: fork roast. add some tests. preferably with a way to bring in the latest copies of code/output from RC.
16:45 [Coke] have people review the changes in the fork. ask here for help if you have any questions.
16:45 * geekosaur notes that there are candidates who depend on the defeatist reaction...
16:46 pmichaud geekosaur: oh, I'm not defeatist, I'm just realistic.  But yes, I will vote nonetheless.
16:46 pmichaud geekosaur: I mean, I live in the state that elected Ted Cruz.
16:47 PerlJam [Coke]: the other day you were asking about creating temp files.   I wrote a p6y File::Temp if you want to use it.   I didn't do anything special to avoid race conditions though, so caveat emptor and all that.
16:49 FROGGS PerlJam: I think there was some consensus that that should be in core
16:50 FROGGS err, a built-in
16:50 timotimo was that the one i taught about flattening a list so that it doesn't generate hugely long names? :)
16:50 PerlJam timotimo:  aye :)
16:50 timotimo tee hee
16:51 PerlJam It was good enough when I wanted it, so I didn't do too much to make it "right"
16:51 PerlJam FROGGS: that would be nice.
16:52 colomon pmichaud: I find that about 95% of the candidates I vote for end up loosing, and I end up regretting most of the ones who win.
16:52 FROGGS though I fear lizmat is in favour of moving stuff to module space... like the routine that gives you the tempdir IIRC
16:53 kaleem joined #perl6
16:56 Ven lol, we proved P!=NP: http://pastebin.com/Wzfv5ajU
16:56 Ven (sorry, I'm kidding :P. It's full of holes)
16:56 pmichaud jeepers, I can provie that already in Rakudo.
16:57 pmichaud r: say "P" eq "NP"
16:57 camelia rakudo-{parrot,moar} 315ec6: OUTPUT«False␤»
16:57 pmichaud There ya go.  :)
16:57 timotimo there's a difference between !eq and != though :P
16:57 pmichaud r: say "P" != "NP"
16:57 camelia rakudo-moar 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏P' (indicated by ⏏)␤  in method Numeric at src/gen/m-CORE.setting:13670␤  in sub infix:<==> at src/gen/m-CORE.setting:4522␤  in sub infix:<==> at src/gen/m-C…»
16:57 camelia ..rakudo-parrot 315ec6: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏P' (indicated by ⏏)␤  in method Numeric at gen/parrot/CORE.setting:13609␤  in sub infix:<==> at gen/parrot/CORE.setting:4526␤  in sub infix:<==> at gen/par…»
16:57 pmichaud There ya go.  :)
16:57 timotimo pmichaud: do you have a hot tip for me? i'm hoping to find something that'd make JSON::Tiny faster at parsing json documents :\
16:58 pmichaud timotimo: I'd need to look at JSON::Tiny
16:58 timotimo maybe you haven't been deep enough in the internals to know something
16:58 pmichaud timotimo: which internals?  ;-)
16:58 timotimo it's the most straightforward way to implement json with a grammar, i think
16:58 timotimo moarvm in this case, i'd think
16:58 pmichaud where's JSON::Tiny at?
16:58 timotimo moritz/json on github
16:59 pmichaud looking
16:59 timotimo in the actions it's doing >>.ast for some things; using .map(*.ast) yielded quite a performance penalty iirc
16:59 FROGGS timotimo: well, it basically is about profiling our grammar engine, no?
17:00 timotimo perhaps, yeah
17:00 pmichaud which part is slower, the parse or the building of the structure?
17:00 pmichaud actually, do you have a test/benchmark input?
17:00 timotimo oh, yeah i do
17:00 * pmichaud builds an up-to-date rakudo
17:00 timotimo http://mtgjson.com/json/AllCards.json
17:00 timotimo on my laptop this one took about 1:22
17:01 timotimo a 100mb json file caused my system to slow down to an absolute crawl for quite a few minutes
17:02 PerlJam timotimo: use smaller json files ;)
17:02 timotimo 1:22 minutes, not hours ;)
17:02 Ven *g*
17:02 FROGGS star-m: use HTTP::UserAgent :simple; say from-json get 'http://mtgjson.com/json/AllCards.json'
17:02 camelia star-m 2014.09: OUTPUT«===SORRY!===␤Could not find HTTP::UserAgent in any of: /home/camelia/star-2014.09/languages/perl6/lib, /home/camelia/star-2014.09/languages/perl6␤»
17:02 FROGGS :/
17:02 timotimo in the profiler, i noticed we're allocating a gigantic amount of Int objects in the MATCH method of src/core/Cursor.pm::Cursor
17:03 FROGGS star might be too old :o(
17:03 FROGGS ahh wait, it is not even in star
17:03 timotimo there's a huge amount of Scalar objects we're allocating, i was able to cut that down by a little with a simple patch
17:03 timotimo and the amount of frames we're jitting is already pretty darn good
17:04 timotimo if we could get a 10x speed improvement with something simple, i'm definitely not seeing it :P
17:04 FROGGS timotimo: unlikely
17:05 timotimo well, we do need more than just 10x to attract attention
17:05 FROGGS timotimo: how well do others?
17:05 FROGGS (others that do not use a C lib)
17:06 timotimo well, other implementations are specialized rather than using a general grammar parsing thing
17:06 pmichaud so, my first suggestion is to try parsing the grammar with and without the actions
17:06 pmichaud s/grammar/json data/
17:06 timotimo right, i have a benchmark in perl6-bench that does it with and then without
17:07 pmichaud so, what's the speed difference?
17:07 timotimo gimme a sec, i'll find you a benchmark
17:07 timotimo http://t.h8.lv/p6bench/2014-09-20-post_release_rakudo_2.html - all the way at the bottom you'll find the results
17:08 timotimo used to be 1.7 times per second to 2.7 times per second
17:08 timotimo but we've somehow regressed quite strongly at that benchmark
17:08 timotimo actually, like three screen pages up from the bottom
17:09 pmichaud yeah, it looks to me as though obj creation is taking up about 40% of the time
17:10 pmichaud my first guess is that token string may be pretty slow in the aggregate
17:10 timotimo hmm, that could be
17:10 timotimo do you see something obvious to make that better?
17:10 pmichaud looking
17:10 PerlJam timotimo: what if he sees something non-obvious?  :)
17:11 timotimo i don't want to take up too much of his time :)
17:11 timotimo if he does see something non-obvious i better hope i'll be able to understand and make it better :)
17:12 kaleem joined #perl6
17:12 timotimo we could have a look at what a json document that is just an array with a single string entry will parse like
17:13 pmichaud well, parsing escaped sequences of characters is often slow... but in this case I'm not sure I see a significant speed up here, at least not for typical inputs.
17:14 timotimo yeah, scanning for a / isn't simple to optimize; like with boyer-moore or something
17:15 [Coke] .tell lizmat https://github.com/perl6/roast/commit/af40fcd065 - when marking a test skip because the todo pass is bogus, document that in the skip message, or some helpful roast cleaner will unskip it when they see it passes.
17:15 yoleaux [Coke]: I'll pass your message to lizmat.
17:16 pmichaud if possible, I'd profile the grammar without object creation and see where it's spending most of its time
17:16 timotimo OK, will do that
17:17 * pmichaud does that, or tries it.
17:18 timotimo perl6 --profile -e 'use JSON::Tiny::Grammar; JSON::Tiny::Grammar.parse(slurp("/home/timo/Downloads/AllCards.json"))'
17:22 [Sno] joined #perl6
17:22 timotimo damn, seems like i didn't have enough memory for that
17:25 pmichaud yeah, without profiling it's alreadying using up 10G on my system to do a basic parse
17:25 Ven m: my $a = 'foo bar'; my $b = 'huehue'; say << foo $b blurch($a) >>
17:25 camelia rakudo-moar 315ec6: OUTPUT«foohuehueblurch(foo bar)␤»
17:25 pmichaud *already
17:25 Ven m: my $a = 'foo bar'; my $b = 'huehue'; say << foo $b blurch($a) >>.perl
17:25 camelia rakudo-moar 315ec6: OUTPUT«("foo", "huehue", "blurch(", ("foo", "bar"), ")")␤»
17:25 timotimo oh wow
17:25 timotimo 10 gig?
17:26 pmichaud yes.
17:26 timotimo i don't have that much on my machine here
17:26 pmichaud I have 8G ram + 8G swap
17:26 pmichaud it's the first time I've hit the swap space in a long time :)
17:26 timotimo yeah, rakudo'll do that to you
17:27 timotimo i wonder how many unnecessary copies of the source string we're building - rather than having ropes that'll reference the substrings
17:27 timotimo i think we're using flattenropes many times all around the source code, but i didn't see the C function show up in the profile (which of course is only for time spent, not memory allocated)
17:27 timotimo AllCards.json just finished parsing with 3483664maxresident
17:28 dalek perl6-roast-data: 5c42aff | coke++ | / (5 files):
17:28 dalek perl6-roast-data: today (automated commit)
17:28 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/5c42affaf0
17:28 [Coke] jvm: 7 fails, parrot: 0. moar: nojit 196, jit: 1842.
17:29 [Coke] Guess we're switching back to parrot. :)
17:29 timotimo the three most time-consuming parts are from the MATCH sub
17:29 timotimo 16% + 15% + 9%
17:29 pmichaud I'm not surprised it's MATCH that is eating up the time
17:29 timotimo the top two aren't jitted or spesh'd, interestingly
17:30 timotimo but these frames aren't "called", just entered. shouldn't that give us a guaranteed internable callsite? :\
17:31 pmichaud oh, here's another *very* useful benchmark, perhaps.
17:31 pmichaud try parsing the grammar in NQP instead of Rakudo
17:31 pmichaud that avoids Rakudo's Cursor.MATCH
17:32 timotimo mhm, nqp has its own .MATCH, though, right?
17:32 pmichaud and uses NQP's (lighter) version, which is what is used to compile Rakudo
17:32 isBEKaml joined #perl6
17:33 pmichaud just note that even if Rakudo's Cursor.MATCH can be made twice as fast, that's only a savings of 20% on the parse, or a savings of 15% on parse+object creation
17:33 grondilu my somewhat improved version of mandelbrot.  With separated threads for computation and IO.  https://gist.github.com/grondilu/a5d200996b2d6f09dbaa
17:33 timotimo mhm :|
17:34 pmichaud (actually, savings of 13% on parse+object creation)
17:34 timotimo without the object creation, we're hardly allocating any scalars
17:34 timotimo just 2060618
17:34 pmichaud right
17:34 pmichaud so that means it's the action methods that are tending to create scalars
17:34 timotimo (as opposed to the somewhat more hefty 15012543 Int objects)
17:34 timotimo that would make sense; we're passing $/ around in a scalar, wouldn't we?
17:35 pmichaud probably.
17:35 pmichaud hmmm.... my system still hasn't finished a parse, so I'm guessing I did something wrong.
17:35 liztormato joined #perl6
17:36 timotimo m: say "MATCH itself is responsible for { (6386244 + 3368327 + 2231330 + 1137000) / 15012543 } Int allocations"
17:36 camelia rakudo-moar 315ec6: OUTPUT«MATCH itself is responsible for 0.874129120 Int allocations␤»
17:36 timotimo m: say "(that is { 6386244 + 3368327 + 2231330 + 1137000 } Int objects allocated)"
17:36 camelia rakudo-moar 315ec6: OUTPUT«(that is 13122901 Int objects allocated)␤»
17:36 pmichaud how many times was MATCH called?
17:36 timotimo m: say "(and there are { 15012543 - (6386244 + 3368327 + 2231330 + 1137000) } Int objects allocated otherwise)"
17:36 camelia rakudo-moar 315ec6: OUTPUT«(and there are 1889642 Int objects allocated otherwise)␤»
17:37 timotimo 2231330 times
17:37 lizmat joined #perl6
17:37 timotimo m: say "allocates about { (6386244 + 3368327 + 2231330 + 1137000) / 2231330 } allocations per MATCH frame entered"
17:37 camelia rakudo-moar 315ec6: OUTPUT«allocates about 5.88120135 allocations per MATCH frame entered␤»
17:38 timotimo not excessively many
17:39 timotimo m: say "{ 2546714 / 2231330 } BootIntArray allocated per MATCH method called"
17:39 camelia rakudo-moar 315ec6: OUTPUT«1.14134350 BootIntArray allocated per MATCH method called␤»
17:40 pmichaud how many times is .push being called?
17:40 timotimo 548737 times "push" from the core setting
17:40 timotimo 1094327 times !cursor_push_cstack
17:41 pmichaud !cursor_push_cstack is likely not very slow.
17:41 pmichaud .push is likely very slow.
17:41 timotimo cursor push takes 0.15% exclusive time
17:41 timotimo but push takes 1.81%
17:42 timotimo ~half as many times called, about 10x time taken
17:44 guru joined #perl6
17:45 timotimo i'll go grab a speshlog and jitlog to see what push ends up looking like from the inside
17:45 pmichaud apparently that's not a big contributor either, though.
17:46 pmichaud I mean. only 1.81%
17:46 timotimo right
17:46 timotimo it's quite a bit bigger than it perhaps ought to be
17:46 pmichaud well, .push might also be where the Int allocations are coming from.
17:46 timotimo see how the method push does its own type checking? maybe it'd be better toh ave multi candidates do the checks?
17:47 timotimo i don't see push in the allocation list for Int at all
17:47 timotimo could be that they are allocated to make the call
17:47 timotimo and thus show up in the caller of push, rather than push?
17:47 timotimo infinite seems to allocate 377908 Int objects
17:47 pmichaud no, probably not.
17:48 pmichaud method infinite() {
17:48 pmichaud self.DEFINITE && $!nextiter.defined && $!nextiter.infinite;
17:48 pmichaud }
17:49 pmichaud method infinite() {
17:49 pmichaud $!rest
17:49 pmichaud ?? nqp::istype(nqp::atpos($!rest, 0), Iterable)
17:49 pmichaud && nqp::atpos($!rest,0).infinite
17:49 pmichaud || Nil
17:49 pmichaud !! Bool::False
17:49 pmichaud }
17:49 pmichaud (second one is from ListIter)
17:49 * lizmat is sort of online again
17:49 yoleaux 17:15Z <[Coke]> lizmat: https://github.com/perl6/roast/commit/af40fcd065 - when marking a test skip because the todo pass is bogus, document that in the skip message, or some helpful roast cleaner will unskip it when they see it passes.
17:50 lizmat will backlog re chdir() later
17:50 lizmat question at Amsterdam.PM:
17:50 lizmat suppose I have a class with 30 public attributes
17:50 FROGGS_ joined #perl6
17:50 lizmat and 1 private attribute which depends on the 30 public ones
17:51 lizmat how can I create a BUILD for that which wouldn't need to list all of the 30 public attributes
17:51 lizmat (This is about porting Text::CSV to Perl 6)
17:52 lizmat tried to do something with "callsame" in a local BUILD
17:53 lizmat but apparently there is no Mu.BUILD
17:53 lizmat m: class A { }; A.new.can("BUILD").say
17:53 camelia rakudo-moar 315ec6: OUTPUT«␤»
17:54 pmichaud submethods don't show up in the inheritance chain anyway
17:55 raydiak maybe initialize the private attr by declaring a default rather than in BUILD?
17:56 denis_boyun_ joined #perl6
17:56 pmichaud I like raydiak++ 's suggestion
17:57 pmichaud S12 also says:
17:57 lizmat raydiak++  that works!
17:57 pmichaud Whether you write your own BUILD or not, at the end of the BUILD, any default attribute values are implicitly copied into any attributes that haven't otherwise been initialized.
17:58 grettis joined #perl6
17:58 raydiak \o/ <- goes and gets a cookie :)
17:58 pmichaud so you could perhaps write    submethod BUILD(*%_) { $!private_attr = ... }
18:01 pmichaud I'm afk
18:01 raydiak when it says "default attribute values are implicitly copied into...", does it mean copied from the declared defaults, or copied from the values passed in to %_?
18:03 raydiak declaring a BUILD seems to prevent all other attrs from being initialized to the passed values, so that doesn't work
18:04 raydiak but I think you could also write your own constructor, and do the logic in there, then pass the result along with |%_ into bless
18:04 pmichaud yeah, I'm wondering if .new is the place to do this.
18:05 pmichaud but the attribute default value really seems like the right way to do it.
18:05 pmichaud afk
18:06 timotimo if the individual parts are already optimal, we'll have to find a different composition of parts
18:08 timotimo i'm guessing there may be a bit of an opportunity for saving stuff if we prune the sub-matches after each little piece of matching has been done
18:08 timotimo as we never refer to a matches sub-things again after we match them
18:08 timotimo that might let us get less stuff into the old generation during gc runs
18:08 ruoso joined #perl6
18:10 lizmat $ ls -lsh CORE.setting.moarvm
18:10 lizmat 26080 -rw-r--r--  1 liz  501    13M Nov  4 19:05 CORE.setting.moarvm   # reality check, is that a normal value for the settings ?
18:10 lizmat 13M ?
18:10 lizmat I seem to recall it being a *lot* smaller?
18:10 timotimo i think we've been near that value for quite some time
18:11 colomon 13M here
18:11 lizmat food on the table&
18:11 timotimo 14mb on 2014.05
18:23 raydiak how complete/stable should a module be before being added to the ecosystem?
18:24 raydiak (by stable I mean the API, not the runtime)
18:25 colomon raydiak: just add it
18:25 colomon make a note that it is unstable if that makes you feel better.  ;)
18:25 raydiak you talked me in to it :) thanks
18:26 timotimo :)
18:27 timotimo doooo iiiiiit
18:27 timotimo math::symbolic!
18:27 raydiak haha okay, it's coming in a few minutes
18:28 colomon I hope you mean Math::Symbolic.  ;)
18:28 raydiak adding touches to the readme...as a substitute for actually fixing things :)
18:28 timotimo mATH::sYMBOLIC?
18:28 raydiak oh noes
18:28 * raydiak shakes head
18:33 dalek ecosystem: 32d1f4c | raydiak++ | META.list:
18:33 dalek ecosystem: Add Math::Symbolic
18:33 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/32d1f4c517
18:35 rindolf joined #perl6
18:37 kjs_ joined #perl6
18:42 spider-mario joined #perl6
18:45 PerlJam raydiak++
18:47 colomon raydiak++
18:49 raydiak thanks!
18:51 V_S_C joined #perl6
18:52 raydiak wow something is very wrong with panda's --help
18:52 FROGGS_ about the descriptions?
18:52 raydiak ya
18:52 FROGGS_ pull
18:52 raydiak off-by-1
18:52 raydiak ah yeah, no idea how old my panda is
18:52 avuserow m: my $a = "qwerty"; $a ~~ s:g//_/; say $a
18:52 camelia rakudo-moar 315ec6: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/aWGJwj1q4kâ�¤Null regex not allowedâ�¤at /tmp/aWGJwj1q4k:1â�¤------> [32mmy $a = "qwerty"; $a ~~ s:g/[33mâ��[31m/_/; say $a[0mâ�¤    expecting any of:â�¤        colon pair (restricted)â�¤Â»
18:52 raydiak thanks FROGGS_++
18:53 FROGGS_ the patch is just a few days old
18:54 raydiak I forget, how long does it take for a new module in the ecosystem to be installable via panda?
18:54 * avuserow .oO( but what if I WANT to replace all the nothings with somethings )
18:54 avuserow raydiak: not that long when I last tried
18:55 FROGGS_ not more than an hour IIRC
18:55 FROGGS_ m: my $a = "qwerty"; $a ~~ s:g/''/_/; say $a
18:55 camelia rakudo-moar 315ec6: OUTPUT«_q_w_e_r_t_y_␤»
18:55 raydiak okay cool, for some reason I remembered it being like minutes and was starting to wonder if I b0rked something
18:56 FROGGS_ avuserow: explicit nothingness ftw!
18:56 avuserow thanks FROGGS_++ :)
18:59 moritz http://www.unicode.org/reports/tr51/#Diversity
19:01 * raydiak didn't know color was within the scope of unicode
19:01 * moritz neither
19:02 rindolf joined #perl6
19:02 moritz also when I read stuff from Unicode, I occasinally wonder if the authors live in a time zone where every other day is April 1st
19:03 raydiak that'd be sweet...it's my birthday :)
19:04 raydiak but yeah I had the same reaction, scanned to the top and bottom looking for evidence of a joke
19:09 FROGGS_ timotimo: the cpandatesters app takes 2.0s on my box to deliver the dist page, and 1.8s of these are due to Template::Mojo
19:09 FROGGS_ I guess I drop templates for now
19:10 tadzik keep in mind that Template::Mojo by default (or only?) compiles the template on every render()
19:11 FROGGS_ tadzik: I worked around that already: https://github.com/perl6/cpandatesters.perl6.org/blob/master/app.pl#L22
19:11 FROGGS_ :o)
19:11 tadzik a-ha :)
19:11 tadzik and still so slow? Hmm
19:11 tadzik perhaps due to string concat
19:12 FROGGS_ yeah
19:12 tadzik sadface
19:12 FROGGS_ 2s on my box would be okay-ish, but the sever it runs on feels like 5 times slower
19:12 FROGGS_ server*
19:13 FROGGS_ so I'll create modules per page/template, an these generate the html from snippets I guess
19:14 FROGGS_ and*
19:14 FROGGS_ sorry, only got one hand to type
19:14 timotimo https://gist.github.com/timo/843626a4aedd9fd6b411
19:15 FROGGS_ (I've got a fat U+1F424 on my other arm...)
19:15 FROGGS_ wow
19:21 lizmat timotimo: I don't see why that is unfortunate?
19:21 timotimo lizmat: well, the code gets a constant 0, creates a False from that, unboxes an int from False (which gives 0) and then checks if that's true or false
19:22 lizmat ah. LTA
19:22 timotimo that whole block should turn into a static goto
19:23 timotimo which ought to kick out a basic block, too
19:23 lizmat yup, does that happen often ?
19:23 FROGGS_ timotimo: can you spesh that case?
19:23 timotimo i'm looking at it
19:23 timotimo this is inside push, which takes about 2% of time in the json benchmark
19:23 pierrot left #perl6
19:23 timotimo it should be possible to prevent the p6bool from being created, though
19:24 timotimo i don't immediately recall how that works, though
19:24 timotimo i'm thinking about adding a fact "known to box the value of register blah in version blubb"
19:24 timotimo that way, unbox_* could turn into a set from the boxing's source register
19:25 timotimo and the boxing + unboxing may be thrown out completely from usage analysis
19:25 timotimo List.pm:233 if you want to look at it, FROGGS_?
19:27 timotimo having line annotations for the basic blocks would be SO good ...
19:28 FROGGS_ I am looking but I'm not sure I understand
19:29 timotimo me neither :(
19:29 * lizmat is looking as well and concurs
19:30 lizmat why isn't list_push a private method ?
19:30 lizmat wouldn't that optimize better ?
19:31 lizmat ah, it's actually an active MMD candidate
19:31 timotimo oh, is that why it's getting assigned there?
19:31 timotimo so that refering to it from push itself is easier?
19:32 lizmat I guess bypassing dispatch that way
19:33 lizmat doesn't feel like that is very optimisable :-(
19:37 grondilu joined #perl6
19:37 PerlJam why is list_push a MMD candidate?  It looks like it's only used in the one place.
19:37 * grondilu is kind of amazed that http://rosettacode.org/wiki/Window_creation/X11#Perl_6 actualy works and considers starting a proper X11 library.
19:38 FROGGS_ PerlJam: it is still available as List.push me thinks
19:38 timotimo PerlJam: because "multi method push" inserts it into the candidates list for "push"
19:38 lizmat PerlJam: it's the MMD candidate for List.push(a,b,c)
19:39 timotimo i wonder if the multiple dispatch handles having a candidate for a single argument and a candidate for slurpy positionals?
19:39 lizmat yes, it does afaik
19:39 FROGGS_ timotimo: jnthn profiled and optimized push just a month ago
19:39 timotimo ÓK
19:40 lizmat m: multi a(\a) { say "one" }; multi a(*@a) { say "more" }; a(1); a(1,2,3)
19:40 camelia rakudo-moar 315ec6: OUTPUT«one␤more␤»
19:42 timotimo good
19:42 ugexe m: my @a = 1,2; @a[1] = Nil; say @a.map({ $_ });
19:42 camelia rakudo-moar 315ec6: OUTPUT«1 (Any)␤»
19:42 ugexe m: my @a = 1,Nil; say @a.map({ $_ });
19:42 camelia rakudo-moar 315ec6: OUTPUT«1␤»
19:43 timotimo i found another instance where we had a constant_i, a not_i and then an unless_i
19:43 ugexe why do those not equal the same thing?
19:43 timotimo so i started an optimization for constant folding integer arithmetic
19:44 lizmat m: my @a=1,Nil; say @a.elems
19:44 camelia rakudo-moar 315ec6: OUTPUT«1␤»
19:44 lizmat I guess the Nil at the end of the list is optimized away at compile time
19:44 lizmat at runtime, assiging Nil will just revert it
19:44 Brad-Gilbert grondilu: Perl6 and D both break backwards compatibility with Perl4/5 and C/C++ in similar ways for similar reasons
19:44 lizmat to its original value
19:45 lizmat m: my @a = 1,2; say @a.elems; @a[1]:delete; say @a.elems
19:45 camelia rakudo-moar 315ec6: OUTPUT«2␤1␤»
19:46 lizmat use the :delete adverb to really remove a value from the array: if it is at the end, it will reduce the length of the array
19:46 lizmat m: my @a = 1,2; say @a.elems; @a[0]:delete; say @a.elems
19:46 camelia rakudo-moar 315ec6: OUTPUT«2␤2␤»
19:48 FROGGS_ I am stoooooopääääääd
19:49 FROGGS_ tadzik: I forgot to precompile on template >.<
19:49 * lizmat hugs FROGGS_
19:49 FROGGS_ now it seems to be fast...
19:54 dalek cpandatesters.perl6.org: d48006c | (Tobias Leich)++ | / (2 files):
19:54 dalek cpandatesters.perl6.org: get rid of the last template we evaluate at runtime
19:54 dalek cpandatesters.perl6.org: review: https://github.com/perl6/cpandatesters.perl6.org/commit/d48006c91b
19:58 Mso150 joined #perl6
19:58 ugexe i dont want to delete elements. rather im creating rows/columns, so undefined values are ok for the first or last elements for aligning indexes between arrays
19:58 lizmat then what is the problem?   that Nil doesn't create an element in the array if it is the last one?
19:59 pecastro joined #perl6
19:59 ugexe and i noticed .map({ // '' }); wasn't doing what i thought
19:59 timotimo FROGGS_: how fast does it seem to be?
19:59 ugexe it doesnt create it in the array if its the first either i think
19:59 masak m: (1, 2, 3).map({ // '' })
19:59 camelia rakudo-moar 315ec6: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/4XgZlgd_B6�Null regex not allowed�at /tmp/4XgZlgd_B6:1�------> [32m(1, 2, 3).map({ //[33m�[31m '' })[0m�»
19:59 * masak thought so
19:59 TimToady and if not that, TTIAR
19:59 masak ugexe: you need a left-hand-side of the operator ;)
20:00 ggoebel111111111 joined #perl6
20:00 FROGGS_ timotimo: judge on your own http://testers.perl6.org/dist/Acme::Meow
20:00 ugexe i mistype, its $_ // ''
20:00 timotimo oh
20:00 timotimo that is fast
20:00 TimToady at the moment, Nil will disappear from the list even before map gets to it
20:01 FROGGS_ timotimo: it takes .2s to deliver a single site on my box, and note that we do not let the browser cache css/js (bootstrap+jquery)
20:01 FROGGS_ +fonts
20:01 masak ugexe: don't change your program to a less interesting one! :P
20:01 masak problem*
20:03 ugexe i had to because i got the error you got when i originally did it that way heh
20:04 masak m: say ("1", "2", Str, 3).map({ $_ // '' }).perl
20:04 camelia rakudo-moar 315ec6: OUTPUT«("1", "2", "", 3).list␤»
20:04 timotimo FROGGS_: sounds good to me
20:04 masak ugexe: works for me.
20:05 timotimo now we only need to port it to HTTP::Server::Async :)
20:05 FROGGS_ :o)
20:05 timotimo recent takes kinda long, though
20:05 timotimo like 10 seconds
20:05 FROGGS_ or implement the server side in HTTP::UserAgent (including async stuff)
20:05 ugexe masak: im thinking if those values are generated from a subroutine which may return numbers
20:06 FROGGS_ timotimo: nothing is precalculated, which is the problem there
20:06 FROGGS_ timotimo: it takes *all* reports into account to generate the stats table at the top
20:06 masak ugexe: well, what your map *does* is default elements to the empty string.
20:07 masak ugexe: specifically, it doesn't convert numbers to strings.
20:07 ugexe for my purposes that is fine though
20:07 masak so, in short, it *does* work? :)
20:09 ugexe its for column/rows. if i have a header that is generated from a list of numbers which can possibly be Nil, a valid header might be (in perl 5) undef, 1, 2, 3, 4 where the first rows values are a,b,c,d,e
20:09 raydiak ugexe: until the GLR happens, Nil in a list still disappears under some circumstances...why not use some other undefined value like Any?
20:09 dalek cpandatesters.perl6.org: d6f5ee6 | (Tobias Leich)++ | app.pl:
20:09 dalek cpandatesters.perl6.org: s/darwin/macosx/
20:09 dalek cpandatesters.perl6.org: review: https://github.com/perl6/cpandatesters.perl6.org/commit/d6f5ee643a
20:10 timotimo ah, i see, FROGGS_
20:10 timotimo yeah, i suppose that could be done upon report submission
20:10 timotimo and with a start block, too :)
20:11 moritz also, caching :-)
20:11 FROGGS_ timotimo: or with cronjobs and extra tables...
20:12 masak I'm still very wary of mixing type objects with instance objects in the same collection.
20:12 FROGGS_ timotimo: btw, good that I once implemented ETags in PHP... so I can steal from that knowledge :P
20:12 ugexe raydiak: im not supplying the values, the user would. and even then maybe they are just passing in an array generated from a subroutine which might use Nil
20:13 ugexe i mean i could just make the user figure out how to do that stuff but thats no fun
20:13 raydiak ugexe: the user should not be using Nil in lists right now, either
20:13 raydiak m: [[1, Nil, 3], [1, Any, 3]].perl.say
20:13 camelia rakudo-moar 315ec6: OUTPUT«[[1, 3], [1, Any, 3]]␤»
20:14 ugexe m: my @a = 1,2; @a[1] = Nil; say @a;
20:14 camelia rakudo-moar 315ec6: OUTPUT«1 (Any)␤»
20:14 ugexe but they can theoretically work like that
20:14 timotimo somehow my extra optimization causes some register's usage count to drop down to -1, which makes the instruction that sets it re-appear %)
20:14 raydiak m: my @a = 1,2; @a[1] := Nil; say @a;
20:14 camelia rakudo-moar 315ec6: OUTPUT«1␤»
20:15 raydiak they still have weird effects under various circumstances
20:15 ugexe but im not crazy, its just not implemented yet right
20:16 raydiak there was a time when that was spec, I think
20:16 raydiak but yeah it's troubling, and will be changed by the GLR methinks
20:17 timotimo yes, the way Nil works is going to change
20:17 Mso150_l joined #perl6
20:18 raydiak in the mean time you could just ensure that any nil they pass in is converted to any, and document it and/or add a warning
20:18 timotimo FROGGS_: what is "top 100 reports" supposed to mean? :)
20:18 FROGGS_ timotimo: latest... I change it
20:18 timotimo OK
20:20 FROGGS_ timotimo++
20:20 dalek cpandatesters.perl6.org: fc58a9e | (Tobias Leich)++ | app.pl:
20:20 dalek cpandatesters.perl6.org: s/Top 100/Latest 1000/
20:20 dalek cpandatesters.perl6.org: review: https://github.com/perl6/cpandatesters.perl6.org/commit/fc58a9ebac
20:21 Mso150_l_m joined #perl6
20:21 raydiak FROGGS_: "Lates 1000" :)
20:21 FROGGS_ grrr
20:21 timotimo now i'm wondering ... should i dig further into why the hell this operand gets used "-1 times", or should i just change the code to remove operands used less than 0 times as well?
20:22 dalek cpandatesters.perl6.org: 7df2bfa | (Tobias Leich)++ | app.pl:
20:22 dalek cpandatesters.perl6.org: fixed typo, timotimo++
20:22 dalek cpandatesters.perl6.org: review: https://github.com/perl6/cpandatesters.perl6.org/commit/7df2bfa502
20:25 virtualsue joined #perl6
20:27 Ven joined #perl6
20:31 bowtie joined #perl6
20:32 ptc_p6 joined #perl6
20:34 Woodi I think orginal problem with IO:: and races was that some things done shell-way are not atomic. eg. first reading $*CWD and then doing something with it. + async stuff or invisible threads...
20:35 Mso150 joined #perl6
20:35 timotimo something seems to be wrong with the usage tracking or something ... :\
20:39 kjs_ joined #perl6
20:49 * lizmat will get back to chdir() / $*CWD / async issues in about 12 hours from now
20:50 timotimo lizmat: there are no issues!
20:50 timotimo we are happy :)
20:50 lizmat ah, could you give me a recap ?
20:50 timotimo we can simply pass whatever cwd we want when we spawn stuff
20:50 timotimo and we're already doing just that
20:50 lizmat ok, so no problem there
20:50 lizmat *phew*
20:50 timotimo we don't have to be afraid of races
20:50 timotimo :)
20:51 lizmat so chdir() not changing the OS cwd is not a problem either ?
20:51 timotimo right
20:51 lizmat and dir() not returning dotfiles by default ?
20:51 lizmat and chdir() checking permissions ?
20:52 timotimo i forgot about the dir thing
20:52 timotimo chdir wants to only check for .x
20:52 timotimo because entering directories you're not allowed to read is fine and happens often
20:52 lizmat if you're using it for a tmpdir, you want rwx, I would think  :-)
20:52 timotimo yes
20:53 timotimo with my latest moarvm patch, what used to be "const_i + not_i" now turns into a single const_i
20:53 Mso150 joined #perl6
20:53 timotimo but that makes almost no difference in the json benchmark ;(
20:53 timotimo like, it only happens twice; in the push method
20:54 lizmat :-(
20:56 timotimo now i'll try to do the boxing tracking if i can
20:59 bowtie_ joined #perl6
20:59 lizmat timotimo++
21:04 Mso150 joined #perl6
21:04 pmichaud good afternoon, #perl6
21:04 colomon \o
21:05 pmichaud consensus seemed to be:
21:05 pmichaud -   dir()  can ignore '.' and '..', but all other filtering ought to take place via .grep
21:05 grettis joined #perl6
21:06 pmichaud -   the :test parameter on tmpdir(), chdir(), homedir(), etc.  should go away
21:06 lizmat not renamed, but gone?
21:06 masak +1 to gone
21:06 pmichaud it's a weak consensus, but yes, gone
21:06 lizmat I mean, on chdir you want "x", on tmpdir you want "rwx"
21:07 lizmat on homedir probably also rwx
21:07 pmichaud this isn't to say that the functions shouldn't check for perms, just not exposed as an argument
21:07 masak right.
21:07 lizmat ah, ok
21:08 lizmat so I rename :test to :youmaynotknowthenameofthisnamedparameter
21:08 pmichaud I can see where having it exposed could be useful, but personally I'd prefer to wait for use cases to arise to justify their inclusion
21:08 masak lizmat: that's not what "gone" means :(
21:08 pmichaud i.e., it's easier to add it when we see it's clearly needed, then to put it in by default and try to take it out later
21:09 lizmat ok, I will do it some other way  :-)
21:09 pmichaud when/if it is ever added, I'd prefer it to be a smartmatch test over string values
21:09 [Coke] what was the point of :test?
21:10 lizmat in the case of chdir, what permissions you want to have on the dir in question
21:10 [Coke] to test for explicit permissions before doing something? if so, IMO it's always better to do the thing, and then report on the error you get if you didn't have privs.
21:10 pmichaud [Coke]: the function would return failure if the target didn't have the requested permissions
21:11 [Coke] given how complicated OS level permissions are, this seems like a bad idea.
21:11 lizmat [Coke]: I guess it then comes down to whether chdir() could be considered "doing a thing"
21:11 masak [Coke]: that was my argument exactly.
21:11 [Coke] depends on the VM>
21:12 lizmat [Coke] ??
21:12 pmichaud chdir() as currently designed seems to be a "set $*CWD and fail if there's likely to be a problem later"
21:12 [Coke] JVM doesn't have a cwd, relies entirely on $*CWD.
21:12 [Coke] should, in my mind, just be "set $*CWD". if the thing later fails because you don't have privs, it fails.
21:13 pmichaud one might want to test for failure earlier than that
21:13 pmichaud (not instead of)
21:13 lizmat hence my approach to chdir()
21:14 [Coke] pmichaud: what are you testing for failure?
21:14 masak 'night, #perl6
21:15 pmichaud chdir("some/other/dir");  $fh = open("somefile", :w);
21:15 pmichaud if some/other/dir has a problem, I'm not sure that open() has as much context as chdir() did.
21:15 [Coke] don't fail the chdir if the problem is that you don't have write privs in that dir, is what I'm saying.
21:15 lizmat Amsterdam.PM shutting down&
21:16 pmichaud [Coke]: what if the dir doesn't exist?
21:16 pmichaud I guess that's implicit in the chdir()
21:16 [Coke] if your checking to see if you can do the equiv of a 'cd some/other/dir', yes, that's good.
21:16 [Coke] *you're
21:16 pmichaud but yes, that checking is what makes chdir() do more than just "set $*CWD"
21:17 pmichaud (iiuc)
21:17 [Coke] that amount of checking is fine with me, yes. thank you for clarifying.
21:17 [Coke] I assume that on vms that support a cwd outside of $*CWD we can do a system call that will tell us if it worked. on the JVM, we probably have to cheat.
21:19 pmichaud in general, I'd say that the pattern for checking if a chdir target is readable/writable should perhaps be:
21:19 pmichaud chdir($path) ~~ :r & :w  or fail "$path is not readable and writable"
21:20 [Coke] path doesn't need to be readable and writable to cd to it.
21:20 pmichaud I know.
21:20 tinyblak joined #perl6
21:20 [Coke] ah, I see. yes, if that's what you're checking for, be explicit.
21:21 pmichaud the :test argument was intended to be a way to ask for chdir() to check for other attributes beyond "will it work"?  But I think doing the smartmatch on the IO::Path result is a more orthogonal way to do it
21:22 pmichaud it's even shorter:
21:22 pmichaud chdir($path, :test(:r))
21:22 pmichaud versus
21:22 pmichaud chdir($path) ~~ :r
21:31 pmichaud I'm afk again, meetings
21:34 grettis joined #perl6
21:52 woshty joined #perl6
21:54 Ven joined #perl6
21:58 woshty joined #perl6
22:06 bowtie joined #perl6
22:07 grondilu joined #perl6
22:08 grondilu m: say ~"a".match: /<![b]>/;
22:08 camelia rakudo-moar 315ec6: OUTPUT«␤»
22:08 * grondilu was expecting "a"
22:09 [Coke] m: say ~("a".match: /<![b]>/)
22:09 camelia rakudo-moar 315ec6: OUTPUT«␤»
22:09 kjs_ joined #perl6
22:09 PerlJam <!> is a zero-width assertion
22:09 grondilu indeed
22:10 grondilu just checked it in S05
22:10 [Coke] m: say ~("a".match: /<-[b]>/)
22:10 camelia rakudo-moar 315ec6: OUTPUT«a␤»
22:10 [Coke] PerlJam++
22:12 grondilu that also explains why I almost crashed my shell earlier running 'perl6 -e 'say "a" ~~ /<![b]>*/;'
22:12 grondilu quantifiers should be forbidden with zero-width assertions, shouldn't they?
22:12 PerlJam heh
22:19 PerlJam I don't know about "forbidden".  That seems a little strong to me.
22:19 PerlJam (I don't have a rationale about why other than "it seems antithetical to my perly sense")
22:20 timotimo can you folk still build rakudo on lastest moar?
22:20 PerlJam But a pragma that causes the compiler to  inspect the regex a little deeper and warn about potential pitfalls sounds nice.
22:21 timotimo Stage parse      : Cannot find method 'ast'
22:21 timotimo at src/Perl6/Grammar.nqp:2288  (blib/Perl6/Grammar.moarvm:needs_args:0)
22:21 timotimo :(
22:23 ugator joined #perl6
22:23 timotimo seems like my changes to moarvm caused that
22:25 woshty joined #perl6
22:34 bowtie_ joined #perl6
22:46 telex joined #perl6
22:48 chenryn joined #perl6
23:00 jack_rabbit joined #perl6
23:07 BenGoldberg joined #perl6
23:17 grondilu PerlJam: yeah, forbidding is a bit excessive.  And it works fine if the quantifier is non-greedy.  Still, having the program just hang and gobble CPU and memory is not great.  It deserves at least a warning.
23:19 * grondilu just checked.  "a" ~~ /<![b]>*/  does indeed explode in memory and CPU.
23:20 grondilu (somehow that remind me of my thoughts on 'loop {}'
23:20 grondilu )
23:30 timotimo wow ... is that ... clean spectests!?
23:37 timotimo and one quite big explosiong
23:39 timotimo it seems like t/spec/S17-lowlevel/thread.t just exploded with a double free
23:40 bowtie joined #perl6
23:40 timotimo i'd like some people to try out rakudo with moarvm/spesh_box_tracking and the patch i'm about to push to rakudo/spesh_box_tracking
23:42 dalek rakudo/nom: 4e146c5 | (Timo Paulssen)++ | src/vm/moar/ops/perl6_ops.c:
23:42 dalek rakudo/nom: optionally support FACT_KNOWN_BOX_SRC
23:42 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4e146c5b25
23:42 timotimo actually, this can go in nom already with just a tiny amount of ifdef
23:46 grettis joined #perl6
23:58 timotimo panda update now gives me no projects at all :(
23:58 timotimo i wonder if i broke it somehow?

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

Perl 6 | Reference Documentation | Rakudo