pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
00:06 polettix left 00:07 icwiener_ joined, chris2 left
TimToady 'the native capture have a new important method called "may_recurse"' 00:09
things you test with "if" are usually slower than depending on dispatch if you already are doing a dispatch
ruoso TimToady, but the thing is, it's not a different type.. 00:10
I mean... 00:11
it can be seen as a different type...
but capture is too basic to that 00:12
it's not really part of the dispatching 00:16
I mean... the capture is a constant part in the dispatch...
00:18 japhb left
mncharity runs fib function call microbenchmarks... 00:18
ruoso not something that can be evaluated 00:19
00:21 icwiener left
ruoso later & 00:21
00:22 ruoso left 00:28 xinming_ left 00:30 Andy__ joined
meppl good night 00:39
00:39 meppl left 00:43 japhb joined 00:48 DarkWolf84 joined 00:53 nipotaway is now known as nipotan
mncharity is anyone around who could convert a fib() which runs on kp6 into something which mp6 is happy with? 00:53
01:01 Andy__ left 01:05 istarex joined 01:06 riffraff left 01:08 istarex left
mncharity hmm. on fib(), a fake kp6/ruby-backend is showing 50x faster than kp6/p5. 10x faster than pugs. 100-1000x slower than p5/rb. Even if sustainable, I'm not sure that's good enough to win? hmm, perhaps the key missing number is mp6 speed. 01:10
01:19 lyokato_ joined 01:21 cnhackTNT joined 01:24 Auzon joined 01:25 Daveman left 01:27 devogon left
pugs_svn r19627 | putter++ | [kp6] ruby backend: A reality check of the current design's performace. 01:29
r19627 | putter++ | A fib() microbenchmark using hand-written fake emitted ruby code.
r19627 | putter++ | But an important number is missing: need a p6 fib() which works on mp6.
mncharity I would find it very helpful if someone who understands mp6 could write a p6 fib() implementation which it can parse. thanks. 01:30
Auzon Is that a Fibonacci sequence, out of curosity? 01:31
mncharity yes 01:33
pasteling "mncharity" at 76.24.28.215 pasted "p6 fib() - kp6 and pugs run it. but not mp6. need an mp6 one." (8 lines, 143B) at sial.org/pbot/29974 01:34
01:35 cspencer left
mncharity (aside: no, I don't understand the 10x faster than pugs. I was expecting it to be slightly slower.) 01:37
maybe ruby 1.9's jit is managing to optimize more than just the bare + and - ops.
s/good enough to win?/good enough to run kp6-in-kp6 at (kp6-in-mp6 or pugs)-like speeds?/ 01:40
bbl& 01:42
02:04 Daveman joined 02:09 Andy_ joined 02:13 thoughtpolice left 02:20 nex6 joined 02:21 cmarcelo left
TimToady maybe it recognizes fib() specially and optimizes it so their benchmarks look good :) 02:24
agentzh lol 02:28
TimToady certainly an optimizer could recognize a signature of (Int --> Int) and memoize the first 50 or 100 integers at compile time 02:33
assuming no side effects, of course
hard to prove the absence of side effects in Ruby though 02:38
avar mncharity: if you need a mp6 one can't you use the mp6 code kp6 generates? 02:47
03:35 Limbic_Region left 04:03 Schwern left 04:13 wknight8111 left 04:43 thoughtpolice joined 04:57 Jamtech joined 05:09 nothingmuch left
diakopter TimToady: did you get any snow? 05:35
05:40 shachaf joined 05:44 kanru joined
TimToady no, I think the freezing level is a couple thousand feet above us 05:53
looks like Mt Hamilton east of San Jose is getting snow according to the radar
05:55 [particle] joined
diakopter the AP says Saratoga got snow today 05:57
which LP side is the flipside? the bottom, or the top? or A or B? 05:59
spinclad the flipside is the otherside. whichever side you're, flip it over to get to the flipside. 06:00
s/,/ on,/
diakopter but that means you can never actually get to the flipside
spinclad o/~ Tomorrow, tomorrow, it's never tomorrow; it's always a day away. o/~ 06:01
diakopter: true dat.
diakopter refers to orphan-killing as Annie-killing. processes, that is. 06:03
06:04 ChanServ sets mode: +o diakopter
spinclad 'you can have jam tomorrow.' 'but you said that yesterday!' 06:04
06:04 diakopter sets mode: +o TimToady, diakopter sets mode: -o diakopter
spinclad jam yesterday, jam tomorrow, but never jam today. 06:05
diakopter except yesterday 06:06
spinclad no, that was yesterday.
diakopter but the requestor never had jam yesterday 06:07
06:07 _sprocket_ left 06:09 DarkWolf84 left
spinclad no, she had jam yesterday, back when it _was_ yesterday. (but it _wasn't_ yesterday then? yes it was! wasn't!) 06:09
sometimes time sux.
06:11 SCalimlim left
spinclad @tell ruoso never mind me. now i know what DESTROYALL does, i didn't then. 06:15
lambdabot Consider it noted.
diakopter in the frame of reference of the dialogue, I assumed the quote to mean she'd never had any jam. If she had been given jam the prior day, she wouldn't have a reason to complain that she was told she couldn't have jam that day, but was told she could the next (this) day.
pugs_svn r19628 | lwall++ | [STD] missing <alias=rule> syntax 06:16
spinclad i believe you're right. i vaguely remember (and refer to) the Red Queen explaining to Alice the principle by which she can never have jam on her bread: she could have jam on her bread every *other* day. 06:21
TimToady I suppose there's a way to work it out as long as you keep yourself and the bread in different time zones, and don't mind eating when it's dark. 06:23
spinclad or along the Date Line (and there you _can't_ have jam at midnight) 06:25
TimToady hmm, actually, if you're willing to forego the eating, you can pretty easily have jam on your bread tomorrow or yesterday
wait, then we still don't have it today, doh! 06:26
spinclad that sound like the cake principle, not the jam one 06:27
diakopter you can have your jam and not eat it too?
spinclad *sounds
TimToady actually, the correct way to go about it is to put the jam on someone else's bread and eat it, which you can easily do without having jam on your bread today 06:28
diakopter so instead of consubstantiation, it's conownership! 06:29
spinclad well, then they have jam today.
can't have that. 06:30
06:30 nex6 left
TimToady silly, you put it on the bread that belongs to someone in a different timezone 06:30
then they're having jam on their bread yesterday, and you're having it on their bread today 06:31
(or tomorrow)
diakopter great scott. the bread must get heavier when it moves [west] over the dateline. 06:33
spinclad thus the popularity of the Restaurant at the End of the Earth, where people go to have jam.
diakopter er, I guess that'd be transubstantiation::transownership 06:34
06:34 devogon joined
Auzon pugs: ().length 06:34
exp_evalbot OUTPUT[*** No such method in class Array: "&length"ā¤ at /tmp/vJJiDq6220 line 1, column 1 - line 2, column 1ā¤]
Auzon pugs: my @a = (); length(@a) 06:35
TimToady pugs: ().elems
exp_evalbot OUTPUT[*** No such subroutine: "&length"ā¤ at /tmp/dyXd5ir4PG line 1, column 13 - line 2, column 1ā¤]
spinclad pugs: [].length
exp_evalbot RESULT[0]
OUTPUT[*** No such method in class Array: "&length"ā¤ at /tmp/KuwOZJUb6i line 1, column 1 - line 2, column 1ā¤]
diakopter pugs: ().cons(())
exp_evalbot OUTPUT[*** No such subroutine: "&cons"ā¤ at /tmp/ssJhMGDYk8 line 1, column 1 - line 2, column 1ā¤]
TimToady pugs: (1,2,3).elems
exp_evalbot RESULT[3]
spinclad TimToady wins
Auzon pugs: ((1 .. 10) X (1 .. 10) X (1 .. 10)).elems 06:36
exp_evalbot RESULT[1000]
TimToady pugs: (^10 X ^10 X ^10).elems
exp_evalbot RESULT[1000]
Auzon Wow.
I am speechless.
spinclad no yer not 06:37
Auzon I can type :P
TimToady anyhoo, "length" is taboo in p6 06:38
you have to be more specific about the units
Auzon Makes sense. 06:39
diakopter pugs: $trustLevel.distances_I_can_throw_you
exp_evalbot OUTPUT[*** ā¤ Unexpected "."ā¤ expecting "::"ā¤ Variable "$trustLevel" requires predeclaration or explicit package nameā¤ at /tmp/V8huKJEBUD line 1, column 12ā¤]
06:48 Andy_ left, xinming joined
spinclad diakopter: after all that, silly me, i should have just said 'the bottom side'. 06:52
not that that changes anything.
07:00 mncharit1 joined 07:01 mncharity left 07:16 thoughtpolice left 07:22 jjore joined 07:42 Aankhen`` joined 07:52 SCalimlim joined 07:54 alc joined 08:15 iblechbot joined 08:37 Grrrr left 08:47 smtms joined 08:52 jjore left, araujo left 08:54 Grrrr joined, alc left 08:56 pmurias joined
pugs_svn r19629 | pmurias++ | fib benchmark in mp6 08:57
pmurias mncharit1: mp6 version of fib is ~7 times slower then the perl5 on
e
09:04 njbartlett left 09:15 pmurias left 09:22 Jamtech_ joined, Jamtech left 09:34 dolmans joined 09:59 njbartlett joined 10:04 meppuru joined, meppuru is now known as meppl 10:07 ebassi joined 10:11 dolmans left 10:17 cnhackTNT left 10:34 IRSeekBot left 10:36 IRSeekBot joined 10:49 nipotan is now known as nipotaway 11:02 nothingmuch joined 11:09 Juerd_ is now known as Juerd 11:17 meppl left 11:19 macae joined 11:21 njbartlett left 11:24 njbartlett joined 11:29 overlast_ left 11:33 jferrero joined 11:42 lyokato_ left
moritz_ am I right in assuming that the regex modifiers :exhaustive and :x($times) can be combined? 11:58
so "abb" ~~ m:2x:ex/ab+/ matches, right?
12:02 lyokato joined 12:53 lyokato left 12:56 ebassi is now known as ebassi|lunch 13:17 cmarcelo joined 13:20 njbartlett left 13:33 mncharit1 left 13:36 icwiener_ left 13:50 macae left, Lorn joined 14:00 ispy_ joined 14:01 jhorwitz joined 14:08 [particle1 joined 14:20 ebassi|lunch is now known as ebassi 14:25 jferrero left 14:26 [particle] left 14:27 kanru left 14:36 macae joined 14:39 masak joined 14:41 [particle] joined 14:45 [particle2 joined 14:46 pbuetow left 14:51 pbuetow joined 14:52 [particle1 left, Auzon left 14:53 [particle] left 14:55 rdice joined, icwiener joined 14:56 cognominal_ left 14:57 [particle] joined 14:58 zf8 joined, zf8 left 14:59 zf8 joined, zf8 left 15:00 zf8 joined 15:05 kanru joined 15:14 [particle2 left 15:23 Jamtech_ left 15:27 TJCRI joined 15:31 cognominal_ joined 15:56 cognominal_ left 16:01 araujo joined 16:02 alester left 16:08 ntgrl joined, alester joined 16:12 cmarcelo left, Grrrr left, ashleyb left, jql left, lisppaste3 left, buubot left, kane_ left, Khisanth left, kattana_ left, pugs_svn left, diakopter left 16:15 cmarcelo joined, Grrrr joined, ashleyb joined, jql joined, lisppaste3 joined, buubot joined, kane_ joined, Khisanth joined, kattana_ joined, diakopter joined, pugs_svn joined 16:16 rdice left 16:20 integral left 16:21 manfred joined 16:29 njbartlett joined 16:33 ilogger2_ joined 16:57 BinGOs_ joined 16:59 [particle1 joined 17:04 chris2 joined 17:05 icwiener joined 17:18 chris2 joined 17:24 njbartlett joined 17:25 icwiener joined
TimToady moritz_: yes, that's correct 17:30
17:31 meppuru joined 17:32 jjore joined 17:34 barney joined
moritz_ TimToady: ok, then I'll write a few tests 17:34
TimToady moritz_++ 17:37
moritz_ TimToady: not in advance... pugs_svn will do that once I've commited them ;) 17:38
TimToady that was for thinking of testing, not for doing it :) 17:41
moritz_ ok ;) 17:42
17:50 cognominal_ joined, [particle] joined 17:53 ilogger2 joined 17:58 IllvilJa joined 18:00 bwisti joined 18:20 [particle1 joined 18:34 DarkWolf84 joined 18:39 atobey joined 18:54 jisom joined 19:07 jisom left 19:13 njbartlett joined
moritz_ what is the value of $/ for a match with the :x($count) modifier? 19:13
"ababb" ~~ m:x(2)/ab+/; # what's $/ now? 19:14
pugs: ababb" ~~ m:x(2)/ab+/; say $/.perl
exp_evalbot OUTPUT[*** ā¤ Unexpected "\""ā¤ expecting "::", dot, ":", "(", term postfix or operatorā¤ at /tmp/ZhD3FYdQw9 line 1, column 6ā¤]
19:25 njbartlett left
TimToady It's just a Match object that contains all the submatches as a list 19:26
any of the multiplicative options :x :ex :g etc just put an extra indirection at the top
moritz_ so ~$/ will be - what? a concatenation of the sub objects? or a disjunction? 19:27
19:28 devogon_ joined
TimToady probably concat 19:28
you can always say any($/) to get the disjunction 19:29
moritz_ and that will align properly?
TimToady align what properly? it's just a list of strings as far as concat is concerned
align implies whitespace to me 19:30
I don't see any whitespace here
moritz_ align implies $/.from to me
if you use :ex
TimToady well, you could argue that it should just give you .substr($/.from, $/.to) 19:31
Juerd Hi
moritz_ hi Juerd
TimToady that's more or less what [...]* does, I think
moritz_ TimToady: but that's not the same as concatenation
TimToady howdy doody
nope
Juerd TimToady: Are there macros for regexes?
TimToady depends on what you mean by "macros" 19:32
Juerd I'd want to include another rule, without the outer capture that this would normally cause
19:32 njbartlett joined
moritz_ "abcab" ~~ m:x(2)/ab/; # is ~$/ now "abab" or "abcab"? or not sure yet? 19:32
Juerd If I understand correctly, <.foo> would not-capture foo, but also the captures within it.
19:32 njbartlett left
TimToady moritz_: not sure 19:32
moritz_ TimToady: ok 19:33
TimToady can argue it either way
19:33 njbartlett joined
moritz_ or should I just stop writing tests about areas that are yet to be explored? ;-) 19:33
[particle1 TimToady: please do. tell us who wins.
TimToady one can add a grammar rule that does that, but I'm not sure it's desirable 19:34
19:34 [particle1 is now known as [particle]
TimToady at least, likely not for numbered captures 19:34
or you have the same problem as p5 there
named captures you could make a better case for
Juerd TimToady: I have a grammar (entirely untested) for parsing wiki syntax 19:36
TimToady: And at certain points you'd have a number of block level elements
TimToady: I have a rule <block_element>, that is just a name for a group of alternatives. Its definition is like <heading> | <paragraph> | ... 19:37
It'd be nicer, in the resulting tree, if heading or paragraph was a child of wikitext directly, without block_element in between 19:38
pugs_svn r19630 | moritz++ | added test file for combined :exhaustive and :x($count) modifiers
Juerd The only reason for having the intermediate <block_element> rule is code reuse.
TimToady your reduction action could hoist them
Juerd I don't know how to read "hoist" in this context 19:39
TimToady just have block_element return its alternative's match instead of creating its own node 19:40
19:40 bwisti_ joined, bwisti left
Juerd The name is important here though 19:40
The name "heading", for example 19:41
But "block_level" not
<heading> { make :heading($<heading>) }
? :)
Can make override the rules name like that? :) 19:42
[particle] rakudo does it like this: 19:44
TimToady you more or less want a subrule to act like [...] rathe than (...)
[particle] rule block_level { | <heading> #= heading \n | ... }
method block_level($/, $key) { make( $/, $key ) } 19:45
where what's after the '#= ' is passed in as $key
so although 'block_level' is in the parse tree, it's not in the ast
Juerd TimToady: Yes 19:48
[particle]: Hmm
I'm not at all familiar with using grammars for syntax trees yet.
I'm not sure if that would even make sense for wiki syntax :) 19:49
TimToady it might warrant some sugar on one end or the other
Juerd macro regex:<block_element> { ... }? :) 19:50
I mostly just like how that uses <> in the syntax. :D 19:51
TimToady with the current STD grammar it'd have to be regex_metachar:Ā«<block_element>Ā» 19:53
19:54 mj41 joined
TimToady (since regex is the top level regex, and regex_atom is what you're really looking at, but neither of those is declared multi) 19:54
(yet)
19:55 abbyz joined
Tene TimToady: what's the reason for allowing non-multi functions? 19:56
TimToady performance mainly
19:56 BinGOs_ joined
TimToady so you can know in a particular lexical scope that you don't have to do any fancy dispatch 19:56
any you can maybe even inline things 19:57
*and
or inline a memoization because you know the actual call doesn't have side effects
lots of possibilities if you know exactly which function you're going to call 19:58
and maybe even maps directly to a C call if you're trying to write in the C-ish subset
to a lesser extent, installing a lexically scoped proto has the same benefits 19:59
because then you can at least know the set of multies defined in the lexical scope 20:00
even if you don't know which one will be called
that's for proto subs; proto methods get you even less 20:01
(unless you happen to have a closed class, which we discourage) 20:02
er, finalized, I should say
still, a global optimizer could finalize classes that haven't been extended, and you might be able to optimize some proto methods on that basis 20:03
Tene: does this make sense to you?
Tene nods.
TimToady I've actually been thinking for a while about whether the various regex_* methods should be multi 20:04
Tene I was just reminded of discussions about Java, where people complain about Java's classes being closed. 20:05
20:05 Jamtech joined
Tene It's not feasible to do the nice performance tricks whenever multiple implementations happen to not have been set? 20:05
TimToady depends on whether you can rule out the creation of new things at run time 20:06
with a lexically scoped sub or proto, you can 20:07
since lexical scopes close down to insertions after compiling
Tene Would it be possible for the declaration of a lexically scoped sub or proto to modify things to disable optimizations?
More work for declaration at runtime in exchange for faster running when it's not done? 20:08
20:08 [particle1 joined
TimToady possibly, but we don't want to assume something like :pure because we're not trying to enforce FP here... :) 20:09
after a "use FP;" anything is fair though :) 20:10
well, anything that everyone can agree on that "FP" means in the particular case... 20:11
it's a bit like getting people to agree on what "strict" means
20:11 tjp joined 20:12 BinGOs_ is now known as BinGOs
TimToady Juerd: it's also possible that most of what you want can be done with <.block_element> if we assume that the block_element method has access to its parent node and can poke things into it 20:13
[particle1 i'd like to be able to get at the name of the parent rule from a subrule 20:15
heck, i'd like to be able to get at the name of the current rule
it'd make parser error messages much easier 20:16
moritz_ regex-introspection ftw!
PerlJam <sym> is almost like that.
TimToady caller probably already gives you that, much like in p5
'course, there's no guarantee your caller even HAS a name 20:17
Juerd $<../pathlike/hehe> = ... :D
TimToady anyway, wouldn't be hard to write a <carp "..."> rule :)
Juerd If regexes are made powerful enough, we don't need the rest of Perl 6 :) 20:18
TimToady and it would still look (slightly) better than XSL
moritz_ Juerd: no! Regexes are logic programming, and we don't want to enforce one paradigm ;-) 20:19
Juerd "We need a ecommerce web site with secure checkout" "Hold on, I'll write a nice regex"
moritz_: With sequential execution in them? Nah, can't say it is :)
moritz_ ;)
20:20 [particle2 joined
tjp I was just poking around in pugs/docs/Perl6 to see what perl6 is up to these days, and I noticed a few typos in Overview.pod. 20:24
20:24 [particle] left
Juerd --> home 20:25
moritz_ tjp: in case of doubt send a diff to p6l 20:26
I think most of the specs are maintained somewhere else (svn.perl.org), and are mirrored to the pugs repo
tjp Well, I don't know anything about how the development is set up... 20:28
PerlJam tjp: if you've got a commit bit, feel free to commit the appropriate changes. (that's typically how the pugs repo goes) 20:30
tjp Well, I don't, seeing as this is the first time I've played with perl6.
PerlJam tjp: then you should ask for a commit bit first :)
If I remembered the appropriate magic, I'd set you up. 20:31
tjp Okay then. How do I get a commit bit? ;)
PerlJam you need to give your email address to someone who remembers the magic
Tene the magic is commitbit.pugscode.org/ 20:32
lambdabot Title: Welcome to CommitBit for PugsCode
TimToady I can do it
PerlJam Tene: shows how long it's been since I tried doing that eh? 20:33
TimToady anyhoo, msg me your email and desired nick (tjp?) and I can do it 20:34
tjp This nick isn't registered yet, so messaging you directly is a problem. 20:35
moritz_ you can just say it here, and start your line with [off] 20:36
TimToady tim at arwen dot com?
moritz_ then it will not be publicly logged
TimToady and what svn nick do you want? 20:37
tjp tjp is fine.
20:37 [particle2 is now known as [off]
[off] is this thing on? 20:38
20:38 [off] is now known as [particle]
[particle] did that get logged? 20:38
tjp It would appear so.
TimToady commitbit sent
tjp Not to mention my [off] line as well. 20:39
[particle] heh
TimToady it's customary to add yourself to AUTHORS as first checkin to make sure things work
tjp I'll do that.
TimToady btw svn status will tell you which specs come from elsewhere
tjp I did "svn info" and it didn't show the docs in question as being from elsewhere. 20:40
moritz_ then I'm probably wrong ;) 20:41
20:42 [particle2 joined
TimToady I should say, "svn status *" will tell you 20:43
20:43 [particle1 left 20:48 [particle1 joined
pugs_svn r19631 | tjp++ | Added myself, and sorted other new additions. 20:53
20:59 [particle] left 21:07 [particle2 left 21:10 thoughtpolice joined 21:17 pcbuetow joined 21:36 Lorn_ joined 21:44 pmurias joined 21:49 Lorn_ left
pugs_svn r19632 | lwall++ | [STD] regex_metachar:<$> doesn't need to allow itself before $ 21:51
22:00 tjp left 22:08 szbalint joined 22:17 thoughtpolice left 22:34 cmarcelo joined 22:39 pmurias left 23:23 mncharity joined
mncharity avar: re "if you need a mp6 one can't you use the mp6 code kp6 generates?", hmm... kp6 compiled and run by mp6 runs fairly fast, kp6 compiled and run by kp6 is said to be quite slow. I'm still fuzzy on how the two differ, but I think no? 23:27
avar a mp6 factorial was commited by someone so nevermind 23:28
mncharity pmurias: re "mp6 version of fib is ~7 times slower then the perl5 on\n e", ? could you paste a copy? 7x slower than kp6/perl5, or 7x slower than native perl5?
avar: oh, great. looking... 23:29
pmurias: thanks for the fib 23:31
TimToady factorial or fib? 23:33
23:33 Jamtech left
mncharity v6/v6-KindaPerl6/examples/fib.mp6 23:35
in answer to my question, the mp6 fib is ~10x slower than raw native perl5. eep. hmm, so what does that mean... 23:38
gbacon we need a good optimizer? :-) 23:42
mncharity :) 23:44
TimToady probably means that mp6 is doing some things in Perl 5 that Perl 5 itself would do in C instead. 23:48
23:51 snearch joined 23:55 __Ace__ joined 23:59 snearch left