»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
timotimo lizmat: half a second 00:02
er
yes, that's right
well, "slurp '100mb.json'" really
2.3 seconds, 720 megabytes
now i have a 17mb json file 00:05
well, what can i say. our performance still sucks in a few areas ... 00:06
00:10 grettis left 00:11 PZt left
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
timotimo the 6mb json file parses in 1:22min 00:14
colomon timotimo: what does the "Top 100 reports" mean? 00:16
afk # "Honey, come up here for a second."
timotimo i think it should be "recent 100 reports" 00:18
00:23 SevenWolf left
Tekk_ masak: is there any plan to have Text::Markdown actually fully implement markdown? 00:24
00:24 SevenWolf joined
Tekk_ given that it doesn't really do much at all atm it seems 00:25
colomon Turns out "Honey, come up here for a second" === School taught 6yo hand motions to go with a Christmas song 00:26
timotimo d'aaw 00:28
we're already jitting a crapton of stuff to go with json parsing
a gigantic amount of Int objects get allocated inside MATCH 00:31
00:33 ajr_ left 00:35 vike joined
colomon should PANDA_SUBMIT_TESTREPORTS=1 panda install ABC actually submit something that shows up on …. oh, it did! 00:40
\o/
FROGGS++
00:40 tinyblak joined 00:41 vendethiel left
timotimo are you running your ABC stuff on rakudo-moar these days? or still on niecza for speed? 00:43
00:44 vendethiel joined
timotimo i just kicked out the second-highest allocator of Scalar values for the json parse workload 00:46
japhb timotimo: Which is? 00:47
timotimo m: say "the number of scalar allocations went down to { 8874207 / 10155740 } of what it was"
camelia rakudo-moar 315ec6: OUTPUT«the number of scalar allocations went down to 0.873811953 of what it was␤»
timotimo well, that's ... not terrible
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
timotimo: These days I run ABC on rakudo-moar 00:49
it is more than adaquately fast for anything I've tried to do with it recently.
just add --profile to get a rakudo profile, right?
00:50 thou left
japhb is happy that rakudo-moar is now fast enough to take over from niecza for that 00:50
colomon is too 00:51
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"
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 -
Tekk_ tony-o: okay? 00:54
timotimo i've got another little change that i'd like to test before pushing stuff
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..
oh no 00:55
code, strong, em
that's it
tony-o what are you looking to do?
japhb timotimo: Ah, yes, multis make sense for that
timotimo colomon: yes, --profile is right
Tekk_ tony-o: I have a blog generator that takes markdown posts and converts them to html for display :P
colomon timotimo: yes, I'm uploading a profile for you right now
Tekk_ which relies on Text::Markdown
timotimo i had to do a double-take when comparing the overview of before my change and after my change
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
The profiled code ran for 88814.33ms. Of this, 10227.97ms were spent on garbage collection and dynamic optimization (that's 11.52%).
the time spent in GC went *up* even though i made the code allocate less stuff
well, the time spent *running* went down
so that's nice :)
m: say "down to { 88814.33 / 94180.04 } of what it was"
camelia rakudo-moar 315ec6: OUTPUT«down to 0.94302710 of what it was␤»
tony-o Tekk_: ahh, what i'm working on is converting pod to markdown :-)
Tekk_ tony-o: yeah, so you're the step before :) 00:57
colomon timotimo: harmonyware.com/perl/profile-141506...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.
timotimo yes, i know
that's what my double-take was for :)
japhb Ah, gotcha, misunderstood. :-) 00:59
m: say 10227.97 / 88814.33; say 10583.86 / 94180.04; 01:00
camelia rakudo-moar 315ec6: OUTPUT«0.11516126␤0.11237901␤»
timotimo what si that for? 01:02
dalek kudo/nom: 32959f6 | (Timo Paulssen)++ | src/core/Capture.pm:
avoid creating some scalars in capture methods
01:04
kudo/nom: 2b6e9e7 | (Timo Paulssen)++ | src/core/Attribute.pm:
perhaps avoid one unbox_s per attribute access?
timotimo i would be glad if somebody could spectest this -^
colomon timotimo: I'll see what I can do here 01:13
in S04-phasers now.... 01:19
01:22 xenoterracide joined
colomon …S17.... 01:23
japhb timotimo: I was checking that my brain was screwed on properly.
*in 01:24
01:33 yeahnoob joined
colomon timotimo: 01:36
t/spec/S02-literals/version.rakudo.moar (Wstat: 1024 Tests: 28 Failed: 4)
Failed tests: 2, 6, 13, 15
Non-zero exit status: 4
guessing that might be lizmat's work? 01:39
01:41 BenGoldberg joined 01:49 xenoterracide left, xenoterracide joined, grettis left 01:50 vendethiel left 01:53 vendethiel joined 02:00 nebuchadnezzar left 02:09 anocelot_ left, anocelot joined, xenoterracide left, xenoterracide_ joined
timotimo could be 02:15
i get a todo passed in minmax, too
colomon right, me too 02:16
timotimo good 02:17
well, i made json::tiny a tiny bit better
we're very far from a wicked fast json::tiny
02:18 xenoterracide_ left, xenoterracide_ joined
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")
japhb: i think i'll go ahead and do a full benchmark run of moar/moar-jit again tomorrow
haven't done so in a long-ish time 02:19
but now i'm off to bed
o/
japhb Good night!
colomon \o
02:24 erkan joined 02:27 immortal left 02:36 rurban left, vendethiel left 02:37 xenoterracide_ left
colomon FROGGS: PANDA_SUBMIT_TESTREPORTS=1 panda --exclude=Panda smoke got me a segmentation fault (eventually) 02:46
oh, possibly should have been --exclude=panda
02:49 vendethiel joined 02:56 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 02:57 SevenWolf left 02:58 SevenWolf joined
dj_goku [Coke]: so how could I start the process to get things added to stresstest and rosettacode? 03:02
03:09 chenryn joined 03:13 vendethiel left 03:15 vendethiel joined 03:20 baest_ joined 03:22 baest left, xenoterracide_ joined 03:33 xenoterracide_ left 03:37 vendethiel left 03:39 vendethiel joined 03:40 xenoterracide_ joined 03:43 bjz left 03:44 bjz joined 03:59 xenoterracide_ left 04:00 vendethiel left 04:01 rmgk_ joined, rmgk left, rmgk_ is now known as rmgk, vendethiel joined 04:14 PZt joined 04:20 xenoterracide_ joined 04:29 kaleem joined 04:34 SevenWolf left 04:39 aborazmeh joined 04:42 kaleem left 04:45 vendethiel left 04:47 vendethiel joined 04:58 BenGoldberg left 05:01 priyal joined
priyal hello 05:02
05:04 priyal left, chenryn left 05:16 chenryn joined 05:34 Alina-malina joined 06:10 labster_ joined 06:13 xenoterracide_ left, exixt_ joined 06:14 cosimo_ joined, btyler_ joined, tinyblak_ joined 06:18 tinyblak left, btyler left, TuxCM left, labster left, oetiker left, exixt left, cosimo left, Alula left, labster_ is now known as labster 06:21 chenryn left, chenryn joined 06:22 chenryn_ joined, chenryn left 06:24 notfix is now known as xfix, oetiker joined 06:25 TuxCM joined 06:29 kaleem joined 06:31 Alina-malina left, Alina-malina joined 06:38 Alina-malina left, newb13427 joined 06:45 jfredett left 06:54 ptc_p6 joined
FROGGS colomon: right, the dist is called 'panda' 06:59
07:00 newb13427 left
FROGGS timotimo: we'd have to record the git hash first in the Panda::Project, but yeah, that's on my todo 07:00
even osx reports are there: cpandatesters.org/dist/ABC - or - testers.perl6.org/dist/ABC 07:03
damn is that thingy slow
it runs at least five times as fast on my i5 laptop
07:04 Alina-malina joined 07:06 gfldex joined 07:08 Akagi201 left, fhelmberger joined 07:12 fhelmberger left
Woodi hallo today :) 07:17
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:23
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:25
07:25 FROGGS left 07:27 ClarusCogitatio left
Woodi btw. do (in UNIX) user should be allowed to change his/her HOME env ? :) 07:28
sory for my terrible English... 07:29
07:30 ClarusCogitatio joined 07:33 gfldex left 07:38 [Tux] left, ClarusCogitatio left 07:39 ClarusCogitatio joined 07:42 azawawi joined
azawawi hi #perl6 07:42
timotimo: ping 07:43
07:46 telex left 07:48 telex joined 07:49 Mso150_z left 07:51 FROGGS joined 07:55 Mso150 joined
Woodi hmm, we package executed code with vm object... do we want to mimic proceses behaviour or create our own ? 07:55
07:55 [Tux] joined
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 stackoverflow.com/questions/6023821...ay-vs-list 08:06
08:07 ClarusCogitatio left
Woodi lists are not a datatype... but in Perl6 spec we have Array is List { ... } 08:07
moritz Perl 6 isn't Perl 5
also, I disagree with the statement that Lists aren't data structures in Perl 5
Woodi just trying to understand, not enforce any design
moritz if they weren't, (sub { 1, 2, 3})->()[1] wouldn't work 08:08
Woodi but they have such "use case"
08:08 aborazmeh left, rindolf joined 08:09 xfix is now known as notfix 08:10 ClarusCogitatio joined
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
... except that they turned out to be very visible
08:11 abraxxa joined
Woodi moritz: I think underneth is something undiscovered (or jus un-understud by me..) 08:12
lists are used to morph code probably, in Lisp sense... 08:14
08:14 ptc_p6 left 08:15 ptc_p6 joined 08:16 chenryn__ joined, chenryn_ left, tinyblak_ left
moritz not in Perl. 08:17
08:19 tinyblak joined, darutoko joined 08:21 virtualsue joined
dalek kudo/nom: 49874e1 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
Test can be false even if we want to test
08:22
kudo/nom: a49a556 | (Elizabeth Mattijsen)++ | src/core/IO/Dir.pm:
Correctly create IO::Dir.dirname
kudo/nom: 8edbf14 | (Elizabeth Mattijsen)++ | src/core/Version.pm:
Fix + breakage

I still don't understand why the previous fix did not work. But this fixes it.
08:23 sqirrel__ joined
dalek ast: c3c8571 | (Elizabeth Mattijsen)++ | S02-literals/version.t:
Add tests for empty string Version
08:25
lizmat good *, #perl6! 08:28
FROGGS morning lizmat
moritz \o lizmat, FROGGS 08:29
lizmat FROGGS moritz \o
re the passing todo in minmax: I think that test is fauilty, actually.
FROGGS hi moritz
lizmat It's passing for the wrong reason
m: my @a=1,2,3; say @a min 4 # what is this supposed to say ? 08:30
camelia rakudo-moar 315ec6: OUTPUT«1␤»
moritz m: my @a=11,12,13; say @a min 4 08:31
camelia rakudo-moar 315ec6: OUTPUT«4␤»
lizmat so is min() supposed to flatten the array ?
m: my @a=1,2,3; say @a max 4 # what is this supposed to say ?
moritz lizmat: actually I'd expect it to return 3
camelia rakudo-moar 315ec6: OUTPUT«4␤»
08:32 chenryn__ left
moritz (that is, coerce to Numeric) 08:32
oh wait, min is one of those weird operators that work on strings too
08:32 baest_ is now known as baest
moritz m: say 4 min ~<1 2 3> 08:33
camelia rakudo-moar 315ec6: OUTPUT«1 2 3␤»
moritz maybe that's the "correct" answer?
lizmat I have *no* idea, really, perhaps the GLR will bring a solution 08:34
meanwhile, I would like to mark these tests as "skip", to prevent noise
08:34 chenryn__ joined
moritz skipping is fine 08:35
maybe the GLR will tell us whether it flattens
but if it doesn't flatten, the behavior is still badly defined
m: say 4 min [1, 2, 3]
camelia rakudo-moar 315ec6: OUTPUT«1 2 3␤»
dalek ast: af40fcd | (Elizabeth Mattijsen)++ | S03-operators/minmax.t:
Mark test as skip to prevent false TODO passing
08:36
moritz currently cmp (and thus min) compares (number, non-number) pairs as Str, because that's the safest option
vendethiel #perl6, o/.
08:37 rindolf left, Mso150_x joined
lizmat vendethiel \o 08:37
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:39
08:40 Mso150 left 08:44 molaf_ joined
lizmat Woodi: although there are threads in rakudo on Moar and JVM, they're mostly hidden 08:46
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
you have a $*CWD visible in your scope
08:47 molaf left
lizmat and anything in your scope (in any thread working in that scope) can change it 08:48
we've provided the means to make that change only visible in a scope:
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…»
lizmat m: .say for dir(:Str,:!absolute)
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…»
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␤…»
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␤»
lizmat Woodi: so any wellbehaving code should do that if it thinks it needs to change the CWD
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, ghostlines joined, kjs_ joined 08:59 ibo2perl6 joined
ibo2perl6 o/ 09:03
say (^10 xx 100 ).gist.chars
m: say (^10 xx 100 ).gist.chars
camelia rakudo-moar 315ec6: OUTPUT«203␤»
09:03 slavik left
ibo2perl6 is it intended that gist only accepts 100 elements? 09:03
FROGGS ibo2perl6: yes 09:04
it only *shows* 100 elements, followed by ...
so you get the gist of what it is
ibo2perl6 but then how can I say a longer list? 09:05
09:05 Alina-malina left
FROGGS don't .gist it... .Str it for example, or print() it 09:05
09:05 Alina-malina joined
FROGGS m: print (^10 xx 100 ) 09:06
camelia rakudo-moar 315ec6: OUTPUT«0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345…»
FROGGS camelia cuts it here for irc
m: say (^10 xx 100 ).Str.chars
camelia rakudo-moar 315ec6: OUTPUT«1999␤»
09:08 jack_rabbit left
ibo2perl6 FROGGS: yes print works. FROGGS++ 09:08
FROGGS the rule is: say() is for humans, print() for machines 09:09
lizmat sometimes I forget the "perl6 -e" in front of my code, so I do: 09:11
$ say "foo".IO
and on OS X your computer then actually speaks to you :-) 09:12
FROGGS *g*
09:14 [Sno] left
FROGGS my Amiga did that too back then 09:14
09:16 slavik joined, sqirrel__ left
ibo2perl6 FROGGS: is this rule documented somewhere? I couldn't find it 09:17
09:17 kaare_ joined
FROGGS ibo2perl6: I expected to find something in the synopsis, but failed.... 09:20
but I read that often here on channel in the past 09:21
09:23 ClarusCogitatio left 09:24 ClarusCogitatio joined
Woodi lizmat: code where you can't really see in which thread you are anymore 09:25
... should not have side effects like changing proces/vm CWD
09:25 ghostlines left
FROGGS Woodi: that's why you can declare $*CWD lexically, right? 09:26
s/can/should/ perhaps
09:27 dakkar joined, ghostlines joined
Woodi FROGGS: if we want to have" CWD is lexical" as point where we starting design... 09:27
then it's ok :)
FROGGS I actually don't understand that sentence 09:28
Woodi lexical means 'per scope' ?
{ 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 Alina-malina left
FROGGS my* 09:29
09:29 Alina-malina joined, Alina-malina left, Alina-malina joined
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␤»
FROGGS m: say $*CWD; { say my $*CWD = PROCESS::<$*CWD>; $*CWD = 'hurz'; say $*CWD }; say $*CWD
camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤(Any)␤hurz␤"/home/camelia".IO␤»
FROGGS hmmm
m: say $*CWD; { say my $*CWD = PROCESS::<$CWD>; $*CWD = 'hurz'; say $*CWD }; say $*CWD
camelia rakudo-moar 315ec6: OUTPUT«"/home/camelia".IO␤"/home/camelia".IO␤hurz␤"/home/camelia".IO␤»
FROGGS well, not ideal but it works
09:33 sqirrel__ joined
lizmat FROGGS: please don't assign to $*CWD like that 09:34
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 virtualsue left
lizmat using chdir will at least ensure the directory exists and create a correct absolute path 09:35
yup
afk for a few hours&
FROGGS ahh, gotcha
09:36 kaleem left, kaleem joined
FROGGS Woodi: I don't this is possible with our model 09:36
think*
damn, I am distracted
09:36 azawawi left, azawawi joined 09:37 ibo2perl6 left, ibo2perl6 joined
Woodi then I must say I have no idea what was orginal problem... 09:37
FROGGS *g* 09:38
09:40 danaj left 09:41 Alina-malina left 09:42 Alina-malina joined, kjs_ left
Woodi if we start design from "user view", by happily scoping varible, then things gets complicated later :) 09:43
09:50 ibo2perl6 left, Alina-malina left 09:52 rurban joined 09:54 virtualsue joined
masak ahoya, #perl6 09:55
09:56 pecastro joined
masak Tekk_: yes. 09:57
Tekk_: are you interested in helping?
Tekk_: I'm going to need a full-ish Text::Markdown fairly soon as a dependency, so I have a stake in implementing it. 09:58
10:03 virtualsue left
masak pretty cool: an implementation of a parser/interpreter, in 450 lines of JavaScripdt: jsfiddle.net/osfnzyfd/ 10:04
HN discussion: news.ycombinator.com/item?id=8554084 10:05
10:06 yeahnoob left 10:11 virtualsue joined 10:16 daxim joined
vendethiel :o) 10:19
moritz I've got the OK from my employer, they'll sponsor Perl 6 development by housing a 1U server for us 10:22
masak \o/ 10:23
moritz.employer++
moritz noris.de++
FROGGS moritz.^employer++
masak .oO( and .HOW ) 10:25
moritz FROGGS: you mean they employ a whole meta class of moritzen?
FROGGS moritz: they really should :o) 10:26
10:26 pnu joined
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?
vendethiel moritz.*++
grondilu was reading blogs.perl.org/users/brad_gilbert/2...and-d.html and wondered if D also has performance issues, and if not what does it do that rakudo does not. 10:31
masak ...be a static language? :) 10:32
grondilu oh well, I guess there is that indeed.
though Perl6 is not much faster when all variables are strongly typed, is it? 10:33
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
masak grondilu: AFAIK, using e.g. native types can have quite an effect on performance.
10:34 tinyblak left
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: gist.github.com/FROGGS/9cf72ef4ab48a02d8a8b 10:41
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:42
rurban: that's how I test `nqp-p t/qregex/01-qregex.t`: gist.github.com/FROGGS/df8766923f709efe3651 10:44
10:46 Woodi left
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 (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?
s/^this is/thing is/
FROGGS grondilu: just a matter of already full todo lists I suppose 10:48
grondilu I'll try to write a version 10:51
(an make a gist about it)
10:51 Woodi joined 10:52 virtualsue left
FROGGS ohh cool! 10:52
grondilu don't get too excited, my naïve first attempt already failed miserably: gist.github.com/grondilu/2bc1ad877352fca3aef9 10:55
that was very very naive for me to hope this simple version would work :-) 10:56
though in an ideal world it should have imho
10:57 sqirrel__ left
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. 10:59
and re and im being defined as virtual methods in Complex 11:00
11:05 chenryn__ left 11:06 chenryn__ joined 11:07 ugator joined
grondilu or even define Complex as a parametric type maybe 11:07
(class complex does Complex[num] {}) 11:08
11:09 tinyblak joined
grondilu oh crap I'm just realizing Complex already has $.re and $.im defined as num 11:11
sorry guys 11:12
11:16 kjs_ joined 11:25 Ven joined 11:27 Ven left
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, immortal joined 11:34 erkan left, kjs_ left 11:35 virtualsue joined 11:37 H2O1 joined 11:39 Mso150_x left 11:40 kaleem left, H2O1 left
colomon FROGGS: The Distributions page doesn't work yet? 11:43
FROGGS colomon: testers.perl6.org/dists works for me 11:47
maybe it is an issue with your browser an HTTP::Easy? 11:48
and*
rurban: good news, rakudo just built
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
colomon: that's correct
that needs to be computed, that's TODO 11:50
colomon another thing… I'm not convinced by the "Author" field
FROGGS in what way? 11:51
lizmat fg
:-)
FROGGS O.o
11:51 DarthGandalf left
colomon for the module smoke results, we report the "owner" of the repo, just by going through the git(hub) URL. 11:52
this is the person (presumably) currently maintaining the module, rather than its author.
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
FROGGS see github.com/perl6/cpandatesters.per...pp.pl#L215
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:54
should the maintainer be single by authority? 11:55
*signaled
11:56 DarthGandalf joined 11:59 fhelmberger joined
FROGGS hmmm 12:00
what if we don't mix these two and (also) display the maintainer?
from the github repository for example
colomon sure 12:03
that works fine for me.
I've got nothing against crediting the author.
but the maintainer is important to know. 12:04
and reports organized by maintainer are really useful
12:06 danaj joined
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:08
lizmat fwiw, I think I'm at least partially to blame for that: settings now at 24359 lines 12:10
will get a lot less when IO::Spec and IO::Path can be ejected from the core 12:11
12:11 kjs_ joined
lizmat on that note: I just found that panda is actually recursing into .git directories 12:11
when trying to find files
colomon bad panda 12:12
lizmat would it make sense to *not* return any basenames that start with '.' ?
by default?
colomon in dir?
lizmat yes
12:12 chenryn__ left
lizmat it would also make the test a lot simpler :-) 12:12
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
lizmat well, it is already an option: you can specify your own test 12:13
colomon :all versus :no-dotfiles
or some such
lizmat currently, '.' and '..' are not returned by dir() by default
if you want all, specifying :test is enough 12:14
it will then simply return all paths it finds 12:15
m: dir().elems.say
camelia rakudo-moar 315ec6: OUTPUT«27␤»
lizmat m: dir(:true).elems.say
camelia rakudo-moar 315ec6: OUTPUT«27␤»
lizmat m: dir(:test).elems.say
camelia rakudo-moar 315ec6: OUTPUT«29␤»
colomon ah. 12:18
yeah, sounds like not returning dotfiles would be a good default, then 12:19
12:24 Sqirrel left
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: 6eae39a | (Tobias Leich)++ | TODO.md:
added todo about maintainers, colomon++
12:25
12:28 dbane joined 12:32 brrt joined 12:33 [Sno] joined
dalek ecs: 91c184f | (Elizabeth Mattijsen)++ | S32-setting-library/IO.pod:
Spec dir() default exclusion to all /^\./

Instead of just '.' and '..'. This move inspired after finding out File::Find will gladly recurse into .git when used by panda to find files to install.
12:34
vendethiel m: dir(:test(True)) # does that work, lizmat? 12:35
camelia ( no output )
12:35 fizzybanana joined
FROGGS vendethiel: yes 12:36
lizmat vendethiel: that's the same as dir(:test)
vendethiel true :-)
but that one looks kind of weird
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"
dir(:all)
dir(:none(/\.pod/))
dir(:all(/\.pod/)) 12:40
first returns all, 2nd returns all but .pod files, 3rd returns .pod files only
moritz :any would be better for the 3rd
but IMHO it's not necessary, you can always combine with grep 12:41
:test only exists as a neat way to exclude . and .., which aren't really wanted in most listings
FROGGS moritz: yes, I also need to rename the git repository
moritz dir(:test(none /\.pod$/)) # also works
12:43 notfix is now known as xfix
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
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 ..
but giving the user an option to override that
hence :$test = none('.', '..') in the signature
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
because you can simply .grep
and achieve the same thing
lizmat except matching on basename can be done faster on moar/parrot inside dir() 12:46
(JVM always returns full paths internally, so matching on basename is more involved there anyway) 12:47
dalek kudo/nom: f7c7b06 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
dir primitives exclude anything starting with "."
12:49
p: 64ad02c | (Tobias Leich)++ | t/qregex/rx_charclass:
add test for regression, see parrot #1119
12:57
12:59 kaleem joined 13:06 mirjam joined 13:08 dbane left 13:24 guru joined, guru is now known as ajr_
masak does a "" with a {} with a "" with a {} with a "" for the first time in production code 13:36
probably should factor some of this into their own variables, though... :)
this Perl 6 program also contains a Perl 5 program that it spurt()s and then executes. 13:37
13:41 tinyblak_ joined
arnsholt Nice! 13:42
I recently wrote a shell script that generated Lisp code that it subsequently ran =)
13:43 Alina-malina joined
arnsholt Sadly the Lisp compiler didn't like the FIFO thing created by Bash's <(...) syntax 13:43
13:44 tinyblak left
PerlJam masak: show the code! :) 13:44
13:46 Alula left, fizzybanana left
masak PerlJam: gist.github.com/masak/3fb4eb7a42ca8ee0f28d 13:48
planning to open-source this slide generation framework once we get far enough with it. 13:49
mirjam but then please without hardcoded paths 13:50
13:50 mirjam is now known as rurban1
masak *nod* 13:52
yeah, that only works on Linux. I'm aware.
vendethiel masak: "y u no" inline::perl5 :)? 13:53
PerlJam vendethiel++
rurban1 calling out is much easier here
13:54 ClarusCogitatio left
masak I guess I could sit down and rewrite that (working) solution in Inline::Perl5. but I don't really see the benefit. 13:54
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
masak preferably, nine++ should give this talk :D
rurban1: yes, I want to eliminate the Perl 5 dependency in the long run. 13:56
basically porting over the necessary parts of PDF::API2.
13:56 jfredett joined
rurban1 and inkscape is even worse 13:56
arnsholt Heh. Writing a typesetting engine in Perl 6 is a life project, I think
rurban1 htmldoc was pretty cool for my projects 13:57
13:57 ClarusCogitatio joined
masak I wish everyone else good luck with their bikesheds. 13:57
rurban1 much smaller than inkscape and generates nice pdf's
masak goes back to $work 13:58
arnsholt masak: Sounds like a good plan
arnsholt has annoying equations to cope with
14:00 Alula joined
brrt :-) 14:01
pmichaud FWIW, having dir() exclude all dotfiles by default feels really wrong. 14:10
yoleaux 29 Oct 2014 20:09Z <lizmat> pmichaud: re irclog.perlgeek.de/perl6/2014-10-28#i_9577937 , I think that would be an excellent plan
lizmat pmichaud: would you care to elaborate on that ?
pmichaud: about excluding . and .. by default, that's ok ? 14:11
pmichaud lizmat: I wasn't entirely comfortable about excluding . and .. either 14:12
lizmat
.oO( perhaps we need an "ls()" )
14:12 rurban1 left
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
I have to take kids to school, bbi15
14:12 kaare_ left
lizmat safe travels! 14:12
14:17 mirjam joined 14:19 JimmyZ joined
masak I agree that it is smelly. 14:20
Tekk_ masak: could be a fun way to learn grammars...
wrt: Text::Markdown 14:21
pmichaud back again 14:22
here are my (unrefined) thoughts on why exclusion of dot is bad
1. it's fairly unix-centric. What about other OS's, like Windows? We really should be excluding "hidden" files, FSVO "hidden"
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 :)
colomon pmichaud: you can do the same thing with dir, using the :test argument
Tekk_ unless you're rewriting Text::Markdown?
pmichaud :test is a poor name. 14:24
it should be :grep
which then begs the question of... why not just .grep the results?
14:25 Ven joined
JimmyZ the sencod loop? 14:25
14:26 haroldwu left, xinming left 14:27 haroldwu joined 14:28 nebuchadnezzar joined 14:29 xinming joined
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?
:test=!hidden 14:31
pmichaud (and :test still feels like the wrong name for .grep, too :)
JimmyZ :grep 14:32
masak Tekk_: I think I would rewrite it, more or less.
pmichaud I wouldnt' want to see @list.grep(:grep( ... something ...)) though
*n't
masak Tekk_: nowadays it feels like the best approach would be to start from commonmark.org/ 14:33
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
JimmyZ :by=!hidden
masak Tekk_: I think it does.
timotimo azawawi: i'm here now (but backlogging)
lizmat I can live with it completely dying
Tekk_ will look it over quickly
masak Tekk_: I'm not 100% a complete rewrite is necessary.
Tekk_ but I'm sure that they didn't change the 3 or so "tags" you defined
JimmyZ I think :by is better
and shorter 14:35
lizmat commute to Amsterdam.PM meeting&
14:35 cognominal joined, lizmat left
JimmyZ or :with ? 14:36
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
Tekk_: nowadays it feels better to simply conform to the CommonMark spec.
Tekk_: that's what I think would trigger a near-complete rewrite.
Tekk_ ah 14:39
yeah, I suppose that the grammar doesn't look very grammarish 14:40
seems to roughly be "foreach paragraph apply this bunch of regexen" :/
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:41
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:42
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: act.yapc.eu/npw2014/ (note: that's in about two weeks)
masak pnu: \o/
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.
JimmyZ pmichaud: how do you think about :by or :with :P
pmichaud i.e., chdir($path, :test(.*))
JimmyZ: I don't like :by or :with
the argument to .grep is a matcher 14:44
masak waitwait, chdir has a :test argument?
JimmyZ OK
pmichaud masak: according to S16 it does.
except S16 lists it as a string.
(or list of strings)
masak tries to figure out why it would need one
pmichaud and my chdir example was *supposed* to read 14:45
chdir($path, :test(*.r))
(I'm sure that's what I wrote.)
14:47 azawawi left
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
although I guess one wants to throw the Failure
s/throw/return
anyway, I'd prefer a true Matcher there over a list of strings 14:50
even chdir($path, :test(:r)) would work.
pnu masak: .. when ;-) coming to Helsinki, there is a huge startup event www.slush.org/ just after the NPW .. I think that might be of interest to some. 14:51
14:53 cognominal left 14:54 ugator_ joined
timotimo greetings pmichaud :) 14:55
pmichaud greetings timotimo
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
these are just workarounds to display information in a shell
pmichaud I'm okay with '.' and '..'.
timotimo pmichaud: it is (or was) remarkably hard to create a file that starts in a . on a windows machine
pmichaud timotimo: Oh, I manage to run across them quite a lot, especially with network-mounted drives.
timotimo that makes sense 14:58
hm, perhaps my experience was limited to explorer.exe and notepad.exe or something :)
"you need to supply a filename!" - "but .htaccess *is* a filename!"
FROGGS timotimo: you can't create a dot file easily on windows, but you can rename a file and prepend a dot
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.
pmichaud in some sense I'd almost wish that there's a .hidden filetest method on Path objects
which then returns true if the file is "hidden", mapped to the OS's understanding of that term. 15:00
then dir can default to dir(:test(:!hidden))
which could be hot-pathed appropriately
masak +1
pmichaud given that .grep uses $test for its matcher argument, I find :test less objectionable as a named argument to dir() 15:02
I'd still prefer something other than "test" to better describe its smart-matching nature
PerlJam "match"? 15:04
Juerd What does :test do? 15:05
15:05 thou joined
pmichaud Juerd: short answer: in @list.grep( foo ) the "foo" is the test to be applied to each element of @list 15:05
in fact, it can be written explicitly as @list.grep( :test( foo ) ) 15:06
Juerd And dir implicitly greps?
pmichaud Juerd: as currently defined, yes.
Juerd :where
pmichaud (that's part of what is being discussed)
I'm worried about "match" because of the punning with "Match" (type) and ".match" (method) 15:07
Juerd :having
pmichaud I'd be worried about "where" punning with the "where" keyword in signatures
Juerd Both borrowed from sql :)
pmichaud and perhaps the .WHERE macro, too.
Juerd Or, on a different layer, :select :-)
pmichaud oooh, :select has potential 15:08
PerlJam :filter (though, lots of potential for confusion :)
pmichaud :choose and :comb also work
Juerd :only
pmichaud :take (puns with "take" keyword, sigh) 15:09
PerlJam :with/:without
Juerd :iff
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:14
pmichaud PerlJam: that's an area where I'd prefer to wait for actual use cases 15:15
in the case of :hidden, we clearly have a use case
geekosaur some of them are candidates for system dependent support loaded afterward / not in the core 15:20
e.g. bsd/os x file flags (schg, nodump, etc.) 15:21
masak I'd take `chdir($path) if $path.r` over `chdir($path, :test(*.r))` any day. 15:22
why would we want to put an ad-hoc if statement into chdir?
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"))
pmichaud masak: except it might not be just an "if" (more) 15:23
looking at it more generally, there are a number of things that could cause a chdir() to fail
for example, chdir("foo.txt") # not a directory
or changing to a directory for which 'x' permissions aren't present
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 ajr_ left
pmichaud and getting a Failure is sometimes more advantageous than doing a test 15:24
15:25 liztormato joined
pmichaud so, the equivalent is more of 15:25
$path.r ?? chdir($path) !! fail(blah blah)
15:25 guru joined
masak I'd rather have that code than :test. 15:25
JimmyZ wonders the timestamp of GLR ;)
15:25 guru is now known as Guest24974 15:26 Guest24974 is now known as ajr_
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
Woodi tested C: while(f = readdir(d)) { printf(... and it shows . and .. on the other hand Java docs.oracle.com/javase/7/docs/api/j...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...
liztormato The naming of :test on chdir is confusing
It's intended to check for access rights
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
masak I posit that there is no use case for :test that couldn't be written more clearly with if-else or ?? !!
pmichaud yeah, "check for read access" felt weird to me also.
geekosaur typically higher level stuff than C just excludes . and .. explicitly
liztormato Yes
pmichaud because what normally determines success of a chdir is execute access, not read access 15:28
timotimo mumble mumble race condition mumble mumble
liztormato Well. Then maybe the default is wrong
pmichaud and if the default is wrong, then perhaps the use case isn't clearly understood. :)
masak .oO( ceterum censeo chdir(:test) delendam esse )
liztormato Gesundheit 15:29
pmichaud lol
Woodi after some thinking what I wrote before I think that chdir is changing application state. and setting cwd is in same "transaction"
liztormato waits for consensus to build 15:30
PerlJam liztormato: +! to removing :test on chdir from me
er, +1 even
masak +1
pmichaud what about the other places where :test appears in the design?
(S16)
PerlJam reads S16 15:31
timotimo 1 + 5 :test(6)
pmichaud at some level we need to take a global view, too.
moritz burn them to pieces
dalek rlito: aa23811 | (Flavio S. Glock)++ | TODO-perlito5:
Perlito5 - js - TODO update
Woodi moritz: ashes :) 15:32
moritz really, we have composable features to do list selections
we don't need to stuff them into everything else
Woodi: hack them to ashes!
PerlJam :test appears in chdir, tmpdir, homedir, and indir looks like.
15:32 chenryn joined
Woodi yea, pieces probably indicate reuse :) 15:32
pmichaud PerlJam: and (undocumented) dir()
masak PerlJam: o.O 15:33
PerlJam: that's crazy.
PerlJam what masak sais
er, said
Woodi what indir is ?
15:33 FROGGS left
masak foreign prime minister of India. 15:33
PerlJam Woodi: something I'm not sure should exist either, but that's another topic :)
masak former*
15:34 chenryn left
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
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 } ?
masak liztormato: so it's like `{ $*CWD = $newpath; ... }` ?
liztormato With a temp thrown in
PerlJam masak: but with a temp
masak er, right.
moritz more like { my $*CWD = $newpath, ... } 15:36
well, temp on a dynamic variable is basically the same as a new dynamic variable in that scope
masak right.
I'd probably do that with `my $*CWD`
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
liztormato Wont work
Well. It will. But do we really want to just ditch chdir() in favour of just assigning $*CWD 15:38
?
timotimo if we don't have chdir, people may be confused :)
liztormato Chdir at least takes realtive paths
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
PerlJam exists and is readable, right?
pmichaud NONONONONO 15:40
not "is readable"
timotimo it'd kinda be good to have "indir" instead of chdir
pmichaud it's entirely possible to change to a directory that doesn't have read permissions set
timotimo should be "is enterable" aka "has +x"
PerlJam pmichaud: I'm saying that's what it currently does
pmichaud PerlJam: okay then.
liztormato So change the default test to .x
15:42 liztormato_ joined
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
timotimo the thing is: we can't do anything with the process
right?
liztormato_ Right 15:43
geekosaur and there's complexities like windows' version of chdir is per drive letter
timotimo all we can do is turn the fake $*CWD into a "real" cwd when we shell out or something
geekosaur: a program has one CWD per drive letter? :\
liztormato_ Indeed. And even then
masak I don't think the default :test on chdir should be changed to anything. I think it should be removed.
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?
(and set $*CWD)
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.
PerlJam Is the surmised purpose for :test better error reporting and some efficiency advantage? 15:45
liztormato_ Yes
15:45 kaleem left, liztormato left, liztormato_ is now known as liztormato
masak is there a story for avoiding race conditions? 15:45
(between the :test and the actual dir change)
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()
pmichaud liztormato: what happens for qx(), then?
er, qx{} 15:47
15:47 liztormato_ joined
Woodi but we actually live behind vm, we can pre-read dir and do everything virtually... do we such thing ? 15:47
liztormato_ Flaky connection while driving 15:48
Woodi *want...
PerlJam
.oO( liztormato_ IRCs and drives at the same time?!? ;)
pmichaud
.oO( woolfy drives :)
liztormato_ Indeed
The os dir is the one at startup 15:49
Changing it is a recipe for race conditions
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 liztormato left, liztormato_ is now known as liztormato
pmichaud liztormato: so, in other words chdir("path"); shell($expression); wouldn't do what the programmer expects? 15:51
15:51 [Sno] left
liztormato Indeed 15:52
moritz uhm, then we need to fix shell()
pmichaud liztormato: so, there's no way to run an external program in a different working directory? That sounds wrong.
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
moritz so have shell's :dir default to $*CWD?
pmichaud presumably shell()'s :cwd should default to $*CWD instead of $CWD as listed now in S29
masak +1
&
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
(similar arguments hold for run(), too.) 15:55
liztormato There's a race condition there
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:56
liztormato If we can help it, yes 15:57
Woodi "externally executed shell" is other proces, it have his own CWD...
pmichaud That doesn't sound very swiss-army-knife to me. 15:58
I'm somewhat presuming that shell/run could be written to minimize or detect a cwd race condition.
or, put another way, how would chdir("path"); dir(); exhibit any less of a race condition? 15:59
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)
pmichaud liztormato: why wouldn't system() only look at $*CWD, then?
sorry, shell() 16:01
in other words, you're trying to avoid the race between the system-level chdir(2) and exec(2) ? 16:02
liztormato Yes
Murphy lives!
pmichaud because that's so evil it should never be done, even though every shell script does it?
Woodi becouse we are multi-threading and we have no idea what other threads do...
liztormato Woodi: ++ 16:03
pmichaud Woodi: I'm presuming that shell() forks a separate process.
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).
Woodi pmichaud: sorry, it was general rant...
pmichaud the standard approach would be fork(2), chdir(2), exec(2)
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
16:04 telex left
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
liztormato Wel 16:05
geekosaur exec in a thread still replaces the whole process, not the thread
timotimo we'd need a new "fork + chdir + exec" primitive %)
liztormato But multiple threads may fork at any time
pmichaud liztormato: and each fork creates a new process, yes? 16:06
geekosaur yes
liztormato Yes
pmichaud and the new process has its own cwd, yes?
16:06 araujo left
geekosaur yes 16:06
liztormato Yes
16:06 telex joined
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:06
liztormato If we can do that with libuv 16:07
pmichaud why are we limited to what libuv can do?
16:07 araujo joined
liztormato Afaik. Fork is handled by libuv 16:07
timotimo how do the nodejs people do it?
pmichaud you mean for windows clients
?
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"
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
pmichaud (I also have difficulty imagining that libuv provides fork() without chdir()/exec(), but I'm not familiar with libuv)
Also, as of a year ago, libuv was considered to be "stepping stone", not "we're tied to it permanently" 16:10
16:10 FROGGS[mobile] joined, cognominal joined
pmichaud We've never designed Perl 6 based on "this is what our 3rd party libraries support today" 16:10
well, at least not when I was more active :)
timotimo have you tortured your implementors today? 16:11
sometimes i torment my implementors five times before breakfast!
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)
what's the issue?
16:12 sqirrel__ joined
pmichaud FROGGS[mobile]: that's what I'm trying to figure out. 16:12
16:14 denis_boyun_ left
liztormato What cwd string? $*CWD? 16:14
timotimo FROGGS[mobile]: no, that's just the argv[0]
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
timotimo there's still the cwd that the spawned process will inherit from the moarvm process
FROGGS[mobile] let me grab my laptop 16:15
liztormato Huh? Not support? Did I say that?
timotimo we are not going to not support this 16:16
liztormato I
timotimo it's massively important.
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?!
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
timotimo we could maybe have a little lock that'll protect us for the time between chdir and fork+exec
pmichaud timotimo: that's backwards
the point is to do the chdir _after_ the fork
so you don't have to touch the cwd of the parent process
timotimo i'd say we ought to ask the libuv people for that feature
as in: to put a chdir between fork and exec 16:18
16:18 JimmyZ left, FROGGS joined
liztormato can't keeps up& 16:19
16:20 liztormato left
PerlJam timotimo: Are you saying you want libuv to provide another "primitive" that combines those 3 operations? 16:20
16:20 treehug88 joined
timotimo yes 16:20
FROGGS timotimo: we pass the _cwd to MVM_proc_shell and then set process_options.cwd to it
timotimo i don't think we can get in between these two operations
oh? 16:21
well, then everything is already just fine!
16:21 Ven left
FROGGS timotimo: src/io/procops.c:141 16:21
timotimo cool 16:22
16:22 Ven joined
Woodi we probably assume that automatically spawned threads do something with side effects on whole process... 16:25
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
pmichaud if libuv is handling a lot of fork/exec/chdir stuff, I'm okay with assuming it gets it "right" fsvo of "right"
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?
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
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 :\
seems like i need to make some better content %)
16:29 brrt left
pmichaud doesn't nqp::shell() include a cwd argument? 16:29
(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)
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
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
Woodi maybe we should start thinking bottom up ? not start from "user view"...
pmichaud I'm not saying that chdir("path"); run("foo"); should be race-free
timotimo seems like the way we have it now is this: 16:32
Woodi that makes thing simpler :)
timotimo we can reliably spawn any process with any cwd we want
pmichaud run("foo", :cwd("path")) should be race-free, however.
timotimo rakudo's core setting provided routines use $*CWD to give a sensible view of what happens where
pmichaud but that has nothing to do with $*CWD whatsoever
timotimo run("foo", :cwd("path")) should be very easy to do
pmichaud right
timotimo with what we have right now
pmichaud right 16:33
that's what I've been (apparently badly) saying
and I keep hearing "race condition!"
timotimo i'm sorry
i said that and i was wrong to do that
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
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"
FROGGS timotimo: it would be even more terrible if it was PHP :P 16:38
(sorry)
timotimo FROGGS: we're trying to be among the best, we shouldn't compare ourselves with the worst ;)
pmichaud and yes, I see where the questions I posed above were leading things astray. My apologies to the group, and to liztormato.
FROGGS *g*
timotimo pmichaud: what else is on your mind today?
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
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. :)
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
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 :)
timotimo in that case we would want a .test, too 16:41
pmichaud flogs PerlJam.
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 :)
[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
16:45 ghostlines left
[Coke] have people review the changes in the fork. ask here for help if you have any questions. 16:45
16:45 sqirrel__ left
geekosaur notes that there are candidates who depend on the defeatist reaction... 16:45
pmichaud geekosaur: oh, I'm not defeatist, I'm just realistic. But yes, I will vote nonetheless. 16:46
geekosaur: I mean, I live in the state that elected Ted Cruz.
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:47
FROGGS PerlJam: I think there was some consensus that that should be in core 16:49
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? :)
PerlJam timotimo: aye :)
timotimo tee hee
PerlJam It was good enough when I wanted it, so I didn't do too much to make it "right" 16:51
FROGGS: that would be nice.
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 16:56 FROGGS[mobile] left
Ven lol, we proved P!=NP: pastebin.com/Wzfv5ajU 16:56
(sorry, I'm kidding :P. It's full of holes)
pmichaud jeepers, I can provie that already in Rakudo.
r: say "P" eq "NP" 16:57
camelia rakudo-{parrot,moar} 315ec6: OUTPUT«False␤»
pmichaud There ya go. :)
timotimo there's a difference between !eq and != though :P
pmichaud r: say "P" != "NP"
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…»
..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…»
pmichaud There ya go. :)
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 :\
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
pmichaud timotimo: which internals? ;-)
timotimo it's the most straightforward way to implement json with a grammar, i think
moarvm in this case, i'd think
pmichaud where's JSON::Tiny at?
timotimo moritz/json on github
pmichaud looking 16:59
timotimo in the actions it's doing >>.ast for some things; using .map(*.ast) yielded quite a performance penalty iirc
FROGGS timotimo: well, it basically is about profiling our grammar engine, no?
timotimo perhaps, yeah 17:00
pmichaud which part is slower, the parse or the building of the structure?
actually, do you have a test/benchmark input?
timotimo oh, yeah i do
pmichaud builds an up-to-date rakudo
timotimo mtgjson.com/json/AllCards.json
on my laptop this one took about 1:22
a 100mb json file caused my system to slow down to an absolute crawl for quite a few minutes 17:01
PerlJam timotimo: use smaller json files ;) 17:02
timotimo 1:22 minutes, not hours ;)
Ven *g*
FROGGS star-m: use HTTP::UserAgent :simple; say from-json get 'mtgjson.com/json/AllCards.json'
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␤»
FROGGS :/
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
FROGGS star might be too old :o( 17:03
ahh wait, it is not even in star
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
and the amount of frames we're jitting is already pretty darn good
if we could get a 10x speed improvement with something simple, i'm definitely not seeing it :P 17:04
FROGGS timotimo: unlikely
timotimo well, we do need more than just 10x to attract attention 17:05
FROGGS timotimo: how well do others?
(others that do not use a C lib)
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
s/grammar/json data/
timotimo right, i have a benchmark in perl6-bench that does it with and then without
pmichaud so, what's the speed difference? 17:07
timotimo gimme a sec, i'll find you a benchmark
t.h8.lv/p6bench/2014-09-20-post_rel...udo_2.html - all the way at the bottom you'll find the results
used to be 1.7 times per second to 2.7 times per second 17:08
but we've somehow regressed quite strongly at that benchmark
actually, like three screen pages up from the bottom
pmichaud yeah, it looks to me as though obj creation is taking up about 40% of the time 17:09
my first guess is that token string may be pretty slow in the aggregate 17:10
timotimo hmm, that could be
do you see something obvious to make that better?
pmichaud looking
PerlJam timotimo: what if he sees something non-obvious? :)
timotimo i don't want to take up too much of his time :) 17:11
if he does see something non-obvious i better hope i'll be able to understand and make it better :)
17:11 kaleem left 17:12 kaleem joined
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:12
17:13 kaleem left
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:13
timotimo yeah, scanning for a / isn't simple to optimize; like with boyer-moore or something 17:14
[Coke] .tell lizmat 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.
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
pmichaud does that, or tries it. 17:17
17:18 ajr_ left
timotimo perl6 --profile -e 'use JSON::Tiny::Grammar; JSON::Tiny::Grammar.parse(slurp("/home/timo/Downloads/AllCards.json"))' 17:18
17:22 [Sno] joined
timotimo damn, seems like i didn't have enough memory for that 17:22
17:24 firefish5000 left
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) >>
camelia rakudo-moar 315ec6: OUTPUT«foohuehueblurch(foo bar)␤»
pmichaud *already
Ven m: my $a = 'foo bar'; my $b = 'huehue'; say << foo $b blurch($a) >>.perl
camelia rakudo-moar 315ec6: OUTPUT«("foo", "huehue", "blurch(", ("foo", "bar"), ")")␤»
timotimo oh wow
10 gig?
pmichaud yes. 17:26
timotimo i don't have that much on my machine here
pmichaud I have 8G ram + 8G swap
it's the first time I've hit the swap space in a long time :)
timotimo yeah, rakudo'll do that to you
17:26 fhelmberger left
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
17:27 kjs_ left
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
AllCards.json just finished parsing with 3483664maxresident
dalek rl6-roast-data: 5c42aff | coke++ | / (5 files):
today (automated commit)
17:28
[Coke] jvm: 7 fails, parrot: 0. moar: nojit 196, jit: 1842.
Guess we're switching back to parrot. :) 17:29
timotimo the three most time-consuming parts are from the MATCH sub
16% + 15% + 9%
pmichaud I'm not surprised it's MATCH that is eating up the time
timotimo the top two aren't jitted or spesh'd, interestingly
but these frames aren't "called", just entered. shouldn't that give us a guaranteed internable callsite? :\ 17:30
pmichaud oh, here's another *very* useful benchmark, perhaps. 17:31
try parsing the grammar in NQP instead of Rakudo
that avoids Rakudo's Cursor.MATCH
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
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. gist.github.com/grondilu/a5d200996b2d6f09dbaa
timotimo mhm :|
pmichaud (actually, savings of 13% on parse+object creation) 17:34
timotimo without the object creation, we're hardly allocating any scalars
just 2060618
pmichaud right
so that means it's the action methods that are tending to create scalars
timotimo (as opposed to the somewhat more hefty 15012543 Int objects)
that would make sense; we're passing $/ around in a scalar, wouldn't we?
pmichaud probably. 17:35
hmmm.... my system still hasn't finished a parse, so I'm guessing I did something wrong.
17:35 liztormato joined
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␤»
timotimo m: say "(that is { 6386244 + 3368327 + 2231330 + 1137000 } Int objects allocated)"
camelia rakudo-moar 315ec6: OUTPUT«(that is 13122901 Int objects allocated)␤»
pmichaud how many times was MATCH called?
timotimo m: say "(and there are { 15012543 - (6386244 + 3368327 + 2231330 + 1137000) } Int objects allocated otherwise)"
camelia rakudo-moar 315ec6: OUTPUT«(and there are 1889642 Int objects allocated otherwise)␤»
timotimo 2231330 times 17:37
17:37 lizmat joined
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␤»
timotimo not excessively many 17:38
17:38 liztormato left
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:39 grondilu left
pmichaud how many times is .push being called? 17:40
timotimo 548737 times "push" from the core setting
1094327 times !cursor_push_cstack
pmichaud !cursor_push_cstack is likely not very slow. 17:41
.push is likely very slow.
timotimo cursor push takes 0.15% exclusive time
but push takes 1.81%
~half as many times called, about 10x time taken 17:42
17:44 guru joined, guru is now known as ajr_
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.
I mean. only 1.81% 17:46
timotimo right
it's quite a bit bigger than it perhaps ought to be
pmichaud well, .push might also be where the Int allocations are coming from.
timotimo see how the method push does its own type checking? maybe it'd be better toh ave multi candidates do the checks?
i don't see push in the allocation list for Int at all 17:47
could be that they are allocated to make the call
and thus show up in the caller of push, rather than push?
infinite seems to allocate 377908 Int objects
pmichaud no, probably not.
method infinite() { 17:48
self.DEFINITE && $!nextiter.defined && $!nextiter.infinite;
}
method infinite() { 17:49
$!rest
?? nqp::istype(nqp::atpos($!rest, 0), Iterable)
&& nqp::atpos($!rest,0).infinite
|| Nil
!! Bool::False
}
(second one is from ListIter)
lizmat is sort of online again
yoleaux 17:15Z <[Coke]> lizmat: 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.
lizmat will backlog re chdir() later 17:50
question at Amsterdam.PM:
suppose I have a class with 30 public attributes
17:50 FROGGS_ joined
lizmat and 1 private attribute which depends on the 30 public ones 17:50
how can I create a BUILD for that which wouldn't need to list all of the 30 public attributes 17:51
(This is about porting Text::CSV to Perl 6)
tried to do something with "callsame" in a local BUILD 17:52
but apparently there is no Mu.BUILD 17:53
m: class A { }; A.new.can("BUILD").say
camelia rakudo-moar 315ec6: OUTPUT«␤»
17:54 FROGGS left
pmichaud submethods don't show up in the inheritance chain anyway 17:54
raydiak maybe initialize the private attr by declaring a default rather than in BUILD? 17:55
17:56 denis_boyun_ joined
pmichaud I like raydiak++ 's suggestion 17:56
S12 also says: 17:57
lizmat raydiak++ that works!
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
raydiak \o/ <- goes and gets a cookie :) 17:58
17:58 exixt_ is now known as exixt
pmichaud so you could perhaps write submethod BUILD(*%_) { $!private_attr = ... } 17:58
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:01 dakkar left
raydiak declaring a BUILD seems to prevent all other attrs from being initialized to the passed values, so that doesn't work 18:03
18:03 virtualsue left
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.
but the attribute default value really seems like the right way to do it. 18:05
afk
timotimo if the individual parts are already optimal, we'll have to find a different composition of parts 18:06
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
as we never refer to a matches sub-things again after we match them
18:08 ruoso left
timotimo that might let us get less stuff into the old generation during gc runs 18:08
18:08 ruoso joined
lizmat $ ls -lsh CORE.setting.moarvm 18:10
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 ?
13M ?
I seem to recall it being a *lot* smaller?
timotimo i think we've been near that value for quite some time
colomon 13M here 18:11
lizmat food on the table&
18:11 isBEKaml left
timotimo 14mb on 2014.05 18:11
18:20 rindolf left
raydiak how complete/stable should a module be before being added to the ecosystem? 18:23
(by stable I mean the API, not the runtime) 18:24
colomon raydiak: just add it 18:25
make a note that it is unstable if that makes you feel better. ;)
raydiak you talked me in to it :) thanks
18:26 pecastro left
timotimo :) 18:26
doooo iiiiiit 18:27
math::symbolic!
raydiak haha okay, it's coming in a few minutes
colomon I hope you mean Math::Symbolic. ;) 18:28
raydiak adding touches to the readme...as a substitute for actually fixing things :)
timotimo mATH::sYMBOLIC?
raydiak oh noes
raydiak shakes head
dalek osystem: 32d1f4c | raydiak++ | META.list:
Add Math::Symbolic
18:33
18:35 rindolf joined 18:37 kjs_ joined 18:39 kjs_ left, mirjam left 18:42 spider-mario joined
PerlJam raydiak++ 18:45
colomon raydiak++ 18:47
raydiak thanks! 18:49
18:50 Ven left 18:51 V_S_C joined
raydiak wow something is very wrong with panda's --help 18:52
FROGGS_ about the descriptions?
raydiak ya
FROGGS_ pull
raydiak off-by-1
avuserow m: my $a = "qwerty"; $a ~~ s:g//_/; say $a
raydiak ah yeah, no idea how old my panda is
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/aWGJwj1q4k␤Null regex not allowed␤at /tmp/aWGJwj1q4k:1␤------> my $a = "qwerty"; $a ~~ s:g/⏏/_/; say $a␤ expecting any of:␤ colon pair (restricted)␤»
raydiak thanks FROGGS_++
FROGGS_ the patch is just a few days old 18:53
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 )
raydiak: not that long when I last tried
FROGGS_ not more than an hour IIRC 18:55
18:55 rindolf left
FROGGS_ m: my $a = "qwerty"; $a ~~ s:g/''/_/; say $a 18:55
camelia rakudo-moar 315ec6: OUTPUT«_q_w_e_r_t_y_␤»
raydiak okay cool, for some reason I remembered it being like minutes and was starting to wonder if I b0rked something
FROGGS_ avuserow: explicit nothingness ftw! 18:56
avuserow thanks FROGGS_++ :)
moritz www.unicode.org/reports/tr51/#Diversity 18:59
18:59 exixt is now known as exixt_
raydiak didn't know color was within the scope of unicode 19:01
19:01 V_S_C left
moritz neither 19:01
19:02 rindolf joined
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:02
raydiak that'd be sweet...it's my birthday :) 19:03
but yeah I had the same reaction, scanned to the top and bottom looking for evidence of a joke 19:04
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
I guess I drop templates for now
19:10 exixt_ is now known as exixt
tadzik keep in mind that Template::Mojo by default (or only?) compiles the template on every render() 19:10
FROGGS_ tadzik: I worked around that already: github.com/perl6/cpandatesters.per...app.pl#L22 19:11
:o)
tadzik a-ha :)
and still so slow? Hmm
perhaps due to string concat
FROGGS_ yeah 19:12
tadzik sadface
FROGGS_ 2s on my box would be okay-ish, but the sever it runs on feels like 5 times slower
server*
so I'll create modules per page/template, an these generate the html from snippets I guess 19:13
and* 19:14
sorry, only got one hand to type
timotimo gist.github.com/timo/843626a4aedd9fd6b411
FROGGS_ (I've got a fat U+1F424 on my other arm...) 19:15
wow
19:16 exixt is now known as exixt_
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
lizmat ah. LTA 19:22
timotimo that whole block should turn into a static goto
which ought to kick out a basic block, too 19:23
lizmat yup, does that happen often ?
FROGGS_ timotimo: can you spesh that case?
timotimo i'm looking at it
this is inside push, which takes about 2% of time in the json benchmark
19:23 pierrot left
timotimo it should be possible to prevent the p6bool from being created, though 19:24
i don't immediately recall how that works, though
i'm thinking about adding a fact "known to box the value of register blah in version blubb"
that way, unbox_* could turn into a set from the boxing's source register
and the boxing + unboxing may be thrown out completely from usage analysis 19:25
List.pm:233 if you want to look at it, FROGGS_?
having line annotations for the basic blocks would be SO good ... 19:27
FROGGS_ I am looking but I'm not sure I understand 19:28
timotimo me neither :( 19:29
lizmat is looking as well and concurs
why isn't list_push a private method ? 19:30
wouldn't that optimize better ?
ah, it's actually an active MMD candidate 19:31
timotimo oh, is that why it's getting assigned there?
so that refering to it from push itself is easier?
lizmat I guess bypassing dispatch that way 19:32
doesn't feel like that is very optimisable :-( 19:33
19:37 grondilu joined
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 rosettacode.org/wiki/Window_creation/X11#Perl_6 actualy works and considers starting a proper X11 library.
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"
lizmat PerlJam: it's the MMD candidate for List.push(a,b,c)
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
FROGGS_ timotimo: jnthn profiled and optimized push just a month ago
timotimo ÓK
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␤»
timotimo good 19:42
19:42 grondilu left
ugexe m: my @a = 1,2; @a[1] = Nil; say @a.map({ $_ }); 19:42
camelia rakudo-moar 315ec6: OUTPUT«1 (Any)␤»
ugexe m: my @a = 1,Nil; say @a.map({ $_ });
camelia rakudo-moar 315ec6: OUTPUT«1␤»
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?
timotimo so i started an optimization for constant folding integer arithmetic
lizmat m: my @a=1,Nil; say @a.elems 19:44
camelia rakudo-moar 315ec6: OUTPUT«1␤»
lizmat I guess the Nil at the end of the list is optimized away at compile time
19:44 b2gills is now known as Brad-Gilbert
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
lizmat to its original value
19:45 Brad-Gilbert is now known as b2gills
lizmat m: my @a = 1,2; say @a.elems; @a[1]:delete; say @a.elems 19:45
camelia rakudo-moar 315ec6: OUTPUT«2␤1␤»
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
m: my @a = 1,2; say @a.elems; @a[0]:delete; say @a.elems
camelia rakudo-moar 315ec6: OUTPUT«2␤2␤»
FROGGS_ I am stoooooopääääääd 19:48
tadzik: I forgot to precompile on template >.< 19:49
lizmat hugs FROGGS_
FROGGS_ now it seems to be fast...
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: d48006c | (Tobias Leich)++ | / (2 files):
get rid of the last template we evaluate at runtime
19:54
19:58 Mso150 joined, slavik left
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
19:59 pecastro joined
ugexe and i noticed .map({ // '' }); wasn't doing what i thought 19:59
timotimo FROGGS_: how fast does it seem to be?
ugexe it doesnt create it in the array if its the first either i think
masak m: (1, 2, 3).map({ // '' })
camelia rakudo-moar 315ec6: OUTPUT«===SORRY!=== Error while compiling /tmp/4XgZlgd_B6␤Null regex not allowed␤at /tmp/4XgZlgd_B6:1␤------> (1, 2, 3).map({ //⏏ '' })␤»
masak thought so
TimToady and if not that, TTIAR 20:00
masak ugexe: you need a left-hand-side of the operator ;)
20:00 ggoebel111111111 joined
FROGGS_ timotimo: judge on your own testers.perl6.org/dist/Acme::Meow 20:00
ugexe i mistype, its $_ // ''
timotimo oh
that is fast
20:00 darutoko left
TimToady at the moment, Nil will disappear from the list even before map gets to it 20:00
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
+fonts
masak ugexe: don't change your program to a less interesting one! :P
problem*
20:02 ggoebel111111119 left
ugexe i had to because i got the error you got when i originally did it that way heh 20:03
masak m: say ("1", "2", Str, 3).map({ $_ // '' }).perl 20:04
camelia rakudo-moar 315ec6: OUTPUT«("1", "2", "", 3).list␤»
timotimo FROGGS_: sounds good to me
masak ugexe: works for me.
timotimo now we only need to port it to HTTP::Server::Async :) 20:05
FROGGS_ :o)
timotimo recent takes kinda long, though
like 10 seconds
FROGGS_ or implement the server side in HTTP::UserAgent (including async stuff)
ugexe masak: im thinking if those values are generated from a subroutine which may return numbers
FROGGS_ timotimo: nothing is precalculated, which is the problem there 20:06
timotimo: it takes *all* reports into account to generate the stats table at the top
masak ugexe: well, what your map *does* is default elements to the empty string.
ugexe: specifically, it doesn't convert numbers to strings. 20:07
ugexe for my purposes that is fine though
masak so, in short, it *does* work? :)
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?
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: d6f5ee6 | (Tobias Leich)++ | app.pl:
s/darwin/macosx/
timotimo ah, i see, FROGGS_ 20:10
yeah, i suppose that could be done upon report submission
and with a start block, too :)
moritz also, caching :-) 20:11
20:11 ptc_p6 left
FROGGS_ timotimo: or with cronjobs and extra tables... 20:11
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
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
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
m: [[1, Nil, 3], [1, Any, 3]].perl.say
camelia rakudo-moar 315ec6: OUTPUT«[[1, 3], [1, Any, 3]]␤»
ugexe m: my @a = 1,2; @a[1] = Nil; say @a; 20:14
camelia rakudo-moar 315ec6: OUTPUT«1 (Any)␤»
ugexe but they can theoretically work like that
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 %)
raydiak m: my @a = 1,2; @a[1] := Nil; say @a;
camelia rakudo-moar 315ec6: OUTPUT«1␤»
raydiak they still have weird effects under various circumstances 20:15
ugexe but im not crazy, its just not implemented yet right
raydiak there was a time when that was spec, I think 20:16
but yeah it's troubling, and will be changed by the GLR methinks
timotimo yes, the way Nil works is going to change 20:17
20:17 Mso150_l joined, grettis left
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? :)
FROGGS_ timotimo: latest... I change it
20:18 Mso150 left
timotimo OK 20:18
FROGGS_ timotimo++ 20:20
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: fc58a9e | (Tobias Leich)++ | app.pl:
s/Top 100/Latest 1000/
20:21 Mso150_l_m joined
raydiak FROGGS_: "Lates 1000" :) 20:21
FROGGS_ grrr
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?
dalek href="https://cpandatesters.perl6.org:">cpandatesters.perl6.org: 7df2bfa | (Tobias Leich)++ | app.pl:
fixed typo, timotimo++
20:22
20:22 Mso150_l left 20:25 virtualsue joined, Mso150_l_m left 20:26 Guest93762 left 20:27 Ven joined 20:31 bowtie joined 20:32 bowtie is now known as Guest64582, ptc_p6 joined
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:34
20:35 Mso150 joined
timotimo something seems to be wrong with the usage tracking or something ... :\ 20:35
20:39 kjs_ joined 20:40 Mso150 left, Guest64582 left
lizmat will get back to chdir() / $*CWD / async issues in about 12 hours from now 20:49
timotimo lizmat: there are no issues! 20:50
we are happy :)
lizmat ah, could you give me a recap ?
timotimo we can simply pass whatever cwd we want when we spawn stuff
and we're already doing just that
lizmat ok, so no problem there
*phew*
timotimo we don't have to be afraid of races
:)
lizmat so chdir() not changing the OS cwd is not a problem either ? 20:51
timotimo right
20:51 cognominal left
lizmat and dir() not returning dotfiles by default ? 20:51
and chdir() checking permissions ?
timotimo i forgot about the dir thing 20:52
chdir wants to only check for .x
because entering directories you're not allowed to read is fine and happens often
lizmat if you're using it for a tmpdir, you want rwx, I would think :-)
timotimo yes
with my latest moarvm patch, what used to be "const_i + not_i" now turns into a single const_i 20:53
20:53 Mso150 joined
timotimo but that makes almost no difference in the json benchmark ;( 20:53
like, it only happens twice; in the push method
lizmat :-( 20:54
20:54 Ven left
timotimo now i'll try to do the boxing tracking if i can 20:56
20:59 bowtie_ joined
lizmat timotimo++ 20:59
21:03 bowtie_ left 21:07 Mso150 left, Mso150 joined
pmichaud good afternoon, #perl6 21:07
colomon \o
pmichaud consensus seemed to be:
- dir() can ignore '.' and '..', but all other filtering ought to take place via .grep
21:07 grettis joined
pmichaud - the :test parameter on tmpdir(), chdir(), homedir(), etc. should go away 21:07
lizmat not renamed, but gone?
masak +1 to gone
pmichaud it's a weak consensus, but yes, gone
lizmat I mean, on chdir you want "x", on tmpdir you want "rwx"
on homedir probably also rwx
pmichaud this isn't to say that the functions shouldn't check for perms, just not exposed as an argument
masak right.
lizmat ah, ok
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
masak lizmat: that's not what "gone" means :(
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
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
[Coke] what was the point of :test?
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.
pmichaud [Coke]: the function would return failure if the target didn't have the requested permissions
[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 ugator left
masak [Coke]: that was my argument exactly. 21:11
[Coke] depends on the VM>
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"
[Coke] JVM doesn't have a cwd, relies entirely on $*CWD.
should, in my mind, just be "set $*CWD". if the thing later fails because you don't have privs, it fails.
pmichaud one might want to test for failure earlier than that 21:13
(not instead of)
lizmat hence my approach to chdir()
[Coke] pmichaud: what are you testing for failure? 21:14
masak 'night, #perl6
pmichaud chdir("some/other/dir"); $fh = open("somefile", :w); 21:15
if some/other/dir has a problem, I'm not sure that open() has as much context as chdir() did.
[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.
lizmat Amsterdam.PM shutting down&
21:15 lizmat left, tinyblak_ left
pmichaud [Coke]: what if the dir doesn't exist? 21:16
I guess that's implicit in the chdir()
[Coke] if your checking to see if you can do the equiv of a 'cd some/other/dir', yes, that's good.
*you're
pmichaud but yes, that checking is what makes chdir() do more than just "set $*CWD"
(iiuc) 21:17
[Coke] that amount of checking is fine with me, yes. thank you for clarifying.
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.
pmichaud in general, I'd say that the pattern for checking if a chdir target is readable/writable should perhaps be: 21:19
21:19 grettis left
pmichaud chdir($path) ~~ :r & :w or fail "$path is not readable and writable" 21:19
[Coke] path doesn't need to be readable and writable to cd to it. 21:20
pmichaud I know.
21:20 tinyblak joined
[Coke] ah, I see. yes, if that's what you're checking for, be explicit. 21:20
21:20 ugator_ left
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:21
it's even shorter: 21:22
chdir($path, :test(:r))
versus
chdir($path) ~~ :r
21:26 rurban left 21:27 xfix is now known as notfix
pmichaud I'm afk again, meetings 21:31
21:34 grettis joined 21:39 kaare_ left 21:42 denis_boyun_ left 21:47 ptc_p6 left 21:48 rindolf left 21:51 woshty left 21:52 woshty joined 21:54 Ven joined 21:56 woshty left 21:58 woshty joined 21:59 Ven left 22:04 kjs_ left 22:05 woshty left 22:06 bowtie joined, bowtie is now known as Guest70045 22:07 grondilu joined
grondilu m: say ~"a".match: /<![b]>/; 22:08
camelia rakudo-moar 315ec6: OUTPUT«␤»
grondilu was expecting "a"
[Coke] m: say ~("a".match: /<![b]>/) 22:09
camelia rakudo-moar 315ec6: OUTPUT«␤»
22:09 kjs_ joined
PerlJam <!> is a zero-width assertion 22:09
grondilu indeed
just checked it in S05 22:10
22:10 spider-mario left
[Coke] m: say ~("a".match: /<-[b]>/) 22:10
camelia rakudo-moar 315ec6: OUTPUT«a␤»
[Coke] PerlJam++
grondilu that also explains why I almost crashed my shell earlier running 'perl6 -e 'say "a" ~~ /<![b]>*/;' 22:12
quantifiers should be forbidden with zero-width assertions, shouldn't they?
PerlJam heh
I don't know about "forbidden". That seems a little strong to me. 22:19
(I don't have a rationale about why other than "it seems antithetical to my perly sense")
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.
timotimo Stage parse : Cannot find method 'ast' 22:21
at src/Perl6/Grammar.nqp:2288 (blib/Perl6/Grammar.moarvm:needs_args:0)
:(
22:22 Guest70045 left 22:23 ugator joined
timotimo seems like my changes to moarvm caused that 22:23
22:25 woshty joined 22:34 bowtie_ joined, kjs_ left 22:45 telex left 22:46 virtualsue left, telex joined 22:48 chenryn joined 22:56 ugator left 23:00 jack_rabbit joined 23:07 BenGoldberg joined 23:08 araujo left, treehug88 left
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:17
grondilu just checked. "a" ~~ /<![b]>*/ does indeed explode in memory and CPU. 23:19
(somehow that remind me of my thoughts on 'loop {}' 23:20
)
23:21 Mso150 left, huf left 23:28 bowtie_ left
timotimo wow ... is that ... clean spectests!? 23:30
23:36 ajr_ left 23:37 grettis left
timotimo and one quite big explosiong 23:37
it seems like t/spec/S17-lowlevel/thread.t just exploded with a double free 23:39
23:40 bowtie joined, bowtie is now known as Guest48053
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:40
dalek kudo/nom: 4e146c5 | (Timo Paulssen)++ | src/vm/moar/ops/perl6_ops.c:
optionally support FACT_KNOWN_BOX_SRC
23:42
timotimo actually, this can go in nom already with just a tiny amount of ifdef
23:43 chenryn left 23:46 grettis joined
timotimo panda update now gives me no projects at all :( 23:58
i wonder if i broke it somehow?