Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-01-22

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

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

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

Perl 6 | Reference Documentation | Rakudo