»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
cognominal src/utils/ in rakudo seems to contain fossil code. According to git blame, It has not been touched since Feb 2008 and does not appear anywhere in the Makefile 02:50
it's old code for generating doc from parsed Perl code 02:51
moritz n: say times.new(:roman) 05:30
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Cannot unbox a Variable[] from an object of repr P6opaque␤ at /home/p6eval/niecza/lib/CORE.setting line 1534 (Parcel.raw_elems @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1584 (Parcel.gist @ 10) ␤ at /home/p6eval/niecza/lib/C…
jnthn morning, #perl6 07:00
brrt \o perl6 07:04
sorear o/ 07:09
tadzik oh hello 07:11
arnsholt o/ 07:37
brrt is there stuff other than parcels that can flatten on the callee-side? 08:23
kresike hello all you happy perl6 people 08:27
tadzik oh hey kresike 08:28
brrt \o kresike
basically
my question is
should callee-side flattening be polymorphic 08:29
kresike tadzik, brrt o/
jnthn brrt: I still think the thing you are calling callee-side flattening is really all handled in Array/List and not really much to do with calling conventions.
brrt jnthn: i kind of agree, the point being 08:35
the prototypical example of a p6 function being called with a javascript array 08:36
and, not having pmcs
wait… i have to think about this a bit
brrt at any rate, that is a case of data compatibility 08:51
brrt is an aggegrate (cqrs terminology) a bit like a document 12:08
i.e, it contains the 'full graph' of some domain object
jnthn I don't really see it like a document. Mostly I see it as a representation of the current state of some domain entity, ideal for validating further changes to it. Yes, it may encapsulate a fairly complex object graph if needed. 12:13
brrt right….
jnthn If you're doing event sourcing, then I find the aggregate best thought of as "a model of the past, useful for making decisions about a requested change now" 12:14
brrt hmm, in a note taking application, would the full list be an aggegrate, or a single item on the list? 12:14
btw, that is how i understood it at first, but the cqrs.nu site has me a bit confused 12:15
jnthn A note taking application feels like a curious domain to apply CQRS to. :) The way I've found easiest to figure out aggregate boundaries is to work out my events, then commands, then look at what invariants need to be enforced. The invariants you need tend to give a good clue to the aggregate boundaries. 12:21
What confused you on cqrs.nu, ooc? I do have a commit bit there... :) 12:22
brrt less curious than it seems when you have multiple users applying changes to the same data :-) 12:25
brrt but thats good advice 12:26
well, basically it isn't that confusing, its just me still 'thinking' in the foreign-key-model
jnthn brrt: Oh, if you're in a collaborative domain then yes, it's good. :) 12:27
brrt well, the internet inherently makes everything collaborative :-) even if its just 1 person using multiple devices 12:28
also, i have many 'eventish' things happening to this system 12:30
'if not answered in n days send it to <x>' etc
jnthn aha 12:31
moritz sounds to me a bit like a ticket system 12:37
brrt yeah, thats a bit what it is 12:39
but its vague at this point
[Coke] rn: say.HOW.say 12:49
p6eval niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/C2uy1Dkr86 line 1:␤------> say⏏.HOW.say␤␤Unhandled exception: Check failed␤␤ at /ho…
..rakudo 870d18: OUTPUT«␤Null PMC access in get_bool()␤ in attributes at src/stage2/gen/nqp-mo.pm:1151␤ in method perl at src/gen/CORE.setting:791␤ in method gist at src/gen/CORE.setting:786␤ in sub say at src/gen/CORE.setting:7250␤ in method say at src/gen/CORE.setting:781␤ in bloc…
[Coke] \o/
brrt what is a saga, by the way? 12:51
oh, nm
masak brrt: a saga is an old '70s notion of dividing a big transaction into many reversible steps, so as not to globally lock an entire database for a large batch job, which was a problem at the time. 14:28
brrt … thanks :-) 14:29
moritz
.oO( an epic tale )
14:30
brrt thought epic was a noun 14:38
jnthn Can be a noun also.
.oO( It was an epic epic... )
14:39
[Coke] it's especially nouny when used agily.
brrt as in epicly, or is that forbidden? 14:40
arnsholt epically perhaps?
[Coke] epicac? 14:44
kresike bye folks 15:33
colomon phenny: tell sorear Rakudo absolutely murders Niecza for timing when parsing a 1.3 meg STEP file -- Niecza takes over 100x as long to parse it. 17:36
phenny colomon: I'll pass that on when sorear is around.
jnthn How long does Rakudo take, ooc? 17:40
colomon jnthn: on the machine in question, just under 6 minutes 17:50
jnthn That's...hardly fast.
colomon I certainly wouldn't object to a 100x speedup for Rakudo. :) 17:51
jnthn :)
Well, it all starts with --profile... :) 17:52
colomon perl6 --profile ?
jnthn yeah
And redirect stderr to callgrind.foobar
colomon doh!
perl6 --profile blah 2> callgrind.foobar ? 17:53
jnthn *nod*
colomon now running 17:54
colomon jnthn++ 17:55
PerlJam what's a STEP file? 17:58
and rakudo++ for beating niecza in a speed race ;-) 17:59
sorear colomon: can you send me the code and the file? I bet this is a bug 18:06
phenny sorear: 17:36Z <colomon> tell sorear Rakudo absolutely murders Niecza for timing when parsing a 1.3 meg STEP file -- Niecza takes over 100x as long to parse it.
colomon sorear: grab github.com/colomon/perl6-ISO_10303-21 and then run mono /path/to/niecza/run/Niecza.exe -Ilib bin/step-scan.pl t/CAx/clamp.stp 18:08
jnthn: profile run is done... but I need be running a fresh outfit to the library for my wife (some sort of horrible tea accident has happened) 18:09
Ulti how can parising just 1.3MB take 6 minutes, are you doing something ontop of just parsing?
this is floppy era amounts of data :/ 18:10
sorear Ulti: welcome to #perl6
[Coke] w e l c o m e t o # (timeout)
colomon Ulti: nope, I'm just checking to make sure the file can be parsed. I don't actually do anything with the parse yet.
Ulti I dunno the perl6 I've been running hasn't made me feel like the IO is slow, but I guess I haven't done too much
colomon Ulti: it's not the I/O, it's the parsing. 18:11
afk # emergency library run
Ulti also 6x100 minutes for parsing a 1.3MB file :'( 18:12
one thing that might be cool is having some form of segmenting or chuncking tocken so that a parser can run in parallel 18:13
*token 18:14
Ulti so the first top level chunk token is matched a few times then a thread starts up to parse the internals of it whilst another one deals with the next chunk 18:15
plenty of computers are hexacore so your 6 minutes goes down to 1 for free
colomon jnthn: ping? 19:11
kevouze Hi. I am conducting a survey about newcommer experience in the Perl community. 19:13
jnthn colomon: pong
tadzik hello
kevouze blogs.perl.org/users/kevin_carillo/...urvey.html
Are there people here who would be keen to fill in the survey? It would interesting be able compare Perl6 practices with other perl projects.
You just need to have joined Perl within the last 2 years.
tadzik I like survey, I'll do it
kevouze thanks
colomon jnthn: so, I've got a 121K callgrind profile output file. (Seems small?) What do I do with it?
tadzik unless I'm longer in the community, hm 19:14
kevouze you are too old :)
tadzik hey! I'm young! :P
my first yapc was last year, but I've been in Perl Mongers group for about 3-4 years
kevouze It have been told Perl6 is very newcomer oriented, it would be nice to have some data about PErl 6
tadzik I know someone to give the survey to 19:15
jnthn colomon: Look at it with kcachegrind
kevouze Would people here mind telling other Perl contributors about the survey? The dataset wil be released under CC license and available to Perl.
thanks 19:16
colomon jnthn: installing kcachegrind on my Linux box. :) 19:19
colomon jnthn: 90% of the time is spent in parse 19:31
jnthn Does any particular rule stand out? 19:32
Feel free to mail me the profile output also. 19:33
colomon Okay, just e-mailed it. Sorry, trying to do two things at once here. 19:34
Looks like MATCH is taking a lot of the time? 19:35
I'm not really sure what to look for in grammar profiles.
sirrobert colomon try stepping through it in the debugger... I find that super useful. 19:37
jnthn colomon: Yes, MATCH is taking up a huge amount of time 19:39
But also !reduce...hmm
Do you have any action methods?
colomon but that's to be expected, right? I mean, MATCH is most of what the program is doing, I'd think....
jnthn: no
jnthn Whoa. 19:41
Yeah, something is really up.
This is a very useful find.
_edwin rosettacode.org/wiki/Formal_power_series#Perl_6 19:44
colomon real-world-applications++
jnthn: have you grabbed my source code yet? 19:46
jnthn Not yet 19:47
colomon colomon: sorear: grab github.com/colomon/perl6-ISO_10303-21 and then run mono /path/to/niecza/run/Niecza.exe -Ilib bin/step-scan.pl t/CAx/clamp.stp 19:49
:)
sorear fwiw, I conjecture that a missing :: is causing quadratic behavior in LTM 19:50
but I haven't had a chance to confirm this
colomon sorear: missing in my code, or in Niecza? 19:51
sorear colomon: in your code 19:56
colomon sorear: you have a place in mind? it's easy enough to test. 19:57
sorear but, if it is something up with your code, what is Rakudo doing to not be so affected?
sjn _edwin: that code just looks.... nice!
sorear colomon: no, this is just based on this being the problem the last 2-3 times I wrote a parser that was a hundred times slower than expected 19:58
_edwin sjn, thanks. it's glacially slow, though :/ 20:00
sjn can imagine 20:02
_edwin std: gist.github.com/3861090 20:06
p6eval std 77327a4: OUTPUT«ok 00:02 65m␤»
_edwin phew
niecza does not like it, though 20:07
colomon _edwin: probably is the infix:<+>, etc. 20:08
I've never gotten extending arithmetic operators to work well in niecza. 20:09
_edwin: why does class FPS have @.coeffs?
_edwin niecza wants me to predeclare the multi infixes, it seems 20:10
colomon, shouldn't it? do you mean has vs. is?
colomon _edwin: actually, I see the issue now. 20:11
_edwin i got past the multi complain of niecza, but then niecza hangs :( 20:12
colomon I think perhaps it would be better organized if it was "role FPS" (with no @.coeffs) and then there was an "explicit coeffs FPS" class which (like all the practical FPS classes) "does FPS"
tadzik :)
colomon still, that's a really neat piece of code you've got there!
_edwin colomon, I see your point. maybe going to tweak it a bit 20:13
colomon _edwin: I'm delighted with your code! I think it compares really nicely to the other versions I've looked at there. 20:15
_edwin I also like the Haskell solution 20:17
yes, most of the others are not nice, and worse I think some miss the point of the mutual definition of sine and cosine 20:18
and Ada calls the formal power series a "Taylor series" which makes my mathematical parts cringe ;) 20:20
colomon _edwin: btw, I am (slowly) working at getting gamma into Niecza. And hopefully once we've got a proof-of-concept implementation it can sneak over to the spec and Rakudo. 20:21
_edwin from an abstract point-of-view I like the prospect of the gamma function in the spec. however, it is hard to get right numerically, isn't it? 20:23
colomon _edwin: errr, I dunno. You may well may know more about it than I do. 20:24
_edwin trying to find it in the gsl source 20:26
gamma.c in libgsl has 1685 lines :} 20:31
no idea how much of this numerical math-fu is needed to get a gamma implementation that is "good enough" for CORE 20:32
colomon hmm, I didn't realize there was a complex version... 20:33
or is there? 20:34
colomon vainly tries to remember if he did anything significant with gamma in his college career...
_edwin yes, it can be analytically continued 20:34
I think to everything except the non-positive integers 20:35
dalek kudo/nom: f0acedf | jnthn++ | src/Perl6/Metamodel/ (3 files):
Make the method cache authoritative in some cases.

This makes it much cheaper for things that are doing can style checks, which is the case for grammars without any actions, .? and so forth.
  colomon++ for the profile that led to this.
20:44
jnthn colomon: I'd be interested to know how much that helps.
colomon jnthn: pulling...
_edwin colomon++, I followed the first part of your advice already (ExplicitFPS) 20:47
jnthn colomon: On memory usage, note taht: 20:51
token standard_keyword { <upper> [ <upper> | <digit> ]* }
This will make match objects for every single character, since <upper> captures. If you won't need to get at the actual individual characters, do
token standard_keyword { <.upper> [ <.upper> | <.digit> ]* }
_edwin hm, as long as FPS is a class, implementing its method coeffs { ... } in a derived class by an attribute @.coeffs works 20:52
jnthn Which calls the rule but won't capture.
colomon jnthn++ jnthn++
jnthn Maybe similar for character
And some of the others :)
_edwin when I change to "role FPS" I get an error that ExplicitFPS does not implement the method coeffs
it seems the implicit accessor method does not count towards the role 20:53
colomon _edwin: you can easily explicitly define it, obviously, but I am surprised, I admit.
_edwin is it a bug or a feature? :}
jnthn Well, things at composition time have to happen in some order.
colomon _edwin: I think you need jnthn for that question. :) 20:54
jnthn At the moment roles are composed *then* we compose attributes.
iirc, it has to be that way because roles can contribute attributes that need accessors generating too 20:55
Is the issue that the role has a required method?
_edwin yes
jnthn Yeah...
I don't think we can fix that by swapping around the order compose does things.
But I agree it's icky
_edwin and the derived class just "has @.coeffs" and not "method coeffs { @.coeffs }" 20:56
jnthn Yeah
I suspect it's possible for the role applier to give back a list of things that are required
But not complain about them immediately
And then we check if they're there later 20:57
sirrobert is there a way in code to know whether I'm in the debugger or not?
I have a small bit of code that breaks if I'm in the debugger and not if I'm not. I want it to auto-disable when I'm debugging.
_edwin oh, when I switch to a role FPS and supply the require method, I get "maximum recursion depth exceeded"
jnthn sirrobert: Er, I'd whine at the guy who wrote the debugger to fix it :) 20:58
sirrobert ok =) who wrote it?
jnthn _edwin: I think you want method coeffs { @!coeffs }
_edwin: I think the requirement/accessor thing should really be fixed. Please file a ticket.
sirrobert: That'd be me :)
sirrobert jnthn: heh ok 20:59
jnthn sirrobert: I need to sleep rather soon, but if you can file a github issue at github.com/jnthn/rakudo-debugger/issues I'll be happy to look at in in the next day or so.
colomon jnthn: the change to p6 shaved a minute off the time -- now 4m54s instead of ~6m
sirrobert let me put together the golfiest script I can to show you the problem.
colomon jnthn: I'll run another profile and see what's up this time. 21:00
_edwin jnthn, thanks, the @!coeffs helps
colomon and try your suggested changes to the grammar as well.
jnthn colomon: Shaving a minute off with a patch I did in half an hour ain't bad. :)
colomon jnthn: agreed! 21:01
jnthn Also around 15% - 20% gain is the upper bound of what I expected, so seems it hit about there.
colomon jnthn: it is much appreciated.
jnthn: but I'd love to get it down to, say, one minute. :)
jnthn Well, it spends a huge amount of time creating match objects, which is not only memory but also time. 21:02
PerlJam jnthn: just add some code to preallocate them ;) 21:03
colomon jnthn: yes, I'm doing a prelim timing on my Mac before trying that change (while I run another profile on the linux box)
sirrobert jnthn: gist.github.com/3861432 (breaks the debugger but not rakudo) 21:05
sirrobert jnthn: btw, great job on the debugger =) made my life much easier (jnthn++) 21:05
looking forward to when some key features get in =) 21:06
grondilu my @a = 1 .. *; say (@a »*» 2)[^3] 21:06
rn: my @a = 1 .. *; say (@a »*» 2)[^3]
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
..rakudo 870d18: OUTPUT«␤»
jnthn grondilu: hyperops are eager 21:07
sirrobert: ah, I see what's going on...
grondilu there is no lazy alternative?
sirrobert do tell =)
colomon grondilu: @a X* 2 21:08
grondilu rn: my @a = 1 .. *; say (@a X* 2)[^3]
colomon or @a.map(* * 2)
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
..rakudo 870d18: OUTPUT«2 4 6␤»
sirrobert jnthn: is the debugger trying to flush stdout, but I've redefined the class without a flush?
jnthn sirrobert: Yeah, but I think I'm gonna fix the debugger to tie itself to the normal $*OUT.
grondilu rn: my @a = 1 .. *; say (map * *2, @a)[^3] 21:09
sirrobert good idea =)
jnthn sirrobert: So people debugging things that do IO capturing won't run into this.
p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)»
..rakudo 870d18: OUTPUT«2 4 6␤»
jnthn sirrobert: While I have a debugger user to hand: what features do you miss most?
sirrobert ++jnthn: great. Also, I should probably make that bit o' code into an ecosystem module that's robust.
jnthn: 1) ability to add breakpoints from within code (rather than just within the debugger) 21:10
colomon grondilu: in niecza, the timeout is from @a = 1..*, I think.
n: my @a := 1 .. *; say (@a X* 2)[^3]
sirrobert jnthn: 2) ncurses stuff =)
p6eval niecza v22-7-g7df6137: OUTPUT«2 4 6␤»
sirrobert jnthn: 3) step over/in/out
those are the huge three 21:11
jnthn: (in no particular order)
grondilu colomon: ok, thanks
sirrobert jnthn: I think I would want step to be step over by default, then step into/out by specific command
jnthn: (or maybe "si" for step into, "so" for step out, and "s/<enter>" for step over 21:12
jnthn sirrobert: Step over/step in/step out should be quite doable. 21:13
sirrobert jnthn: OH! and 4) make 'self' available. debugging currently doesn't let me see object properties.
jnthn: thanks =) 21:14
jnthn Oh!
sirrobert jnthn: I use the debugger almost daily =)
jnthn sirrobert: Thanks for the ideas, I've turned them into GitHub issues :) 21:15
sirrobert woot =) thanks
jnthn I've got a 40 min slot at Nordic Perl Workshop at the weekend to show/talk about the debugger. :) 21:16
sirrobert heh nice
I use it a LOT
jnthn So I've been hoping to get some new things in to talk about :)
sirrobert heh nod
_edwin jnthn, I will file a rakudobug tomorrow. needing some sleep now, bye
jnthn _edwin: Thanks, see you o/
colomon jnthn: using <.digit> instead of <digit> in a few places there shaved another 10% off the runnining time. 21:17
jnthn++
sirrobert jnthn: fwiw, I would order them 4,3,1,2 probably. 21:18
jnthn sirrobert: I know shamefully little about ncurses so that's probably wise :)
colomon jnthn: though that's with the older rakudo 21:19
sirrobert jnthn: heh 21:20
jnthn colomon: Yeah. Doing similar with <upper> may yield a another such improvement. 21:21
colomon you mean internally (in token upper) or where upper is used? 21:23
jnthn Where it's used
token standard_keyword { <upper> [ <upper> | <digit> ]* }
Like in that one
Suppose there's a keyword like foobar then at the moment this will create six match objects, one per character.
[Coke] colomon: boingboing.net/2012/10/09/sheet-mus...io-br.html 21:24
jnthn Whereas in reality you probably only care about the keyword as a whole.
colomon jnthn: right, I already got keyword (based on your previous suggestion)
[Coke] wonders if it would make sense to flip the sense of what gets a match object.
jnthn [Coke]: Probably not; you only tend to care about this in your handful of tokenizer-y things. 21:25
Most of the rest of the time you do care about that pieces. 21:26
colomon jnthn: ah, so in (for instance) token page I might as well add the dot to <reverse_solidus>
because I never care about that value at all.
jnthn colomon: Yes
non_q_char may be another example
(where you don't care)
I don't know the thing you're parsing well enough to guess these :)
token special may or may not be cheaper if written as a char class 21:27
The code probably gets more readable though :)
<[ ! " * ... ]> instead of '!' | '"' | '*' | ... 21:28
Time for some sleep & 21:29
sirrobert wave 21:30
colomon is littering dots throughout his grammar...
jnthn++ and good night 21:31
jnthn: sleep well and dream of large speedups
sirrobert what bot handles karma?
colomon karma jnthn 21:32
aloha jnthn has karma of 2766.
sirrobert colomon: thanks =) 21:35
ok, I'm out. wave 21:36
grondilu r: say (1, 2) Z+ (10, 20, 30); 21:56
p6eval rakudo f0aced: OUTPUT«11 22␤»
grondilu would have liked to get 11 22 30 21:57
I mean, isn't there a simple way to do vectorial addition in arbitrary dimension? 21:59
colomon nr: say (1, 2) >>+<< (10, 20, 30) 22:00
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Ran off end of non-dwimmy left␤ at /home/p6eval/niecza/lib/CORE.setting line 1437 (die @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3126 (ANON @ 32) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3133 (_hyper_posi @ 11) ␤ at …
..rakudo f0aced: OUTPUT«Lists on both side of non-dwimmy hyperop of infix:<+> are not of the same length␤left: 2 elements, right: 3 elements␤ in sub hyper at src/gen/CORE.setting:12184␤ in block at src/gen/CORE.setting:12163␤ in block at /tmp/WMPGy1AzyL:1␤␤»
colomon nr: say (1, 2) <<+>> (10, 20, 30)
p6eval rakudo f0aced, niecza v22-7-g7df6137: OUTPUT«11 22 31␤»
colomon still no 11 22 30 22:01
*not
grondilu r: say (1, 2, 0, 0 ... *) Z+ (10, 20, 30); # but that's kind of cheating
p6eval rakudo f0aced: OUTPUT«11 22 30␤»
grondilu r: sub infix:<V+>(@a, @b) { my @z := 0, 0 ... *; @a > @b ?? (@a Z+ (@b, @z)) !! ((@a, @z) Z+ @b) }; say (1, 2) V+ (10, 20, 30) 22:05
p6eval rakudo f0aced: OUTPUT«11 22 30␤»
supernovus Uhg, I wish rakudo used github's bug tracker instead of the monstrosity that is rt.
supernovus Two quick questions. 1.) Anyone with a rakudo commit bit want to look at rt.perl.org/rt3/Public/Bug/Display...?id=115120 it's a small easy patch that adds an important feature to the pack function. 2.) How does one go about getting a commit bit on rakudo? 22:11
supernovus gotta run, bbl 22:13
TimToady grondilu: 0, 0, ... * is better spelled 0 xx * 22:17
TimToady also, spec has , * meaning that on the end of a list, but I don't know if anyone implements that 22:18
[Coke] supernovus: submit a TPF CLA. 22:31
www.perlfoundation.org/contributor_..._agreement 22:32
[Coke] supernovus - is there a test in roast that patch makes pass? 22:34
[Coke] (If no one beats me to it, I'll try to apply that patch tonight after $kidstuff. 22:37