Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-09-02

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 Psyche^ joined #perl6
00:03 masak left #perl6
00:07 Patterner left #perl6
00:07 Psyche^ is now known as Patterner
00:07 dalek book: ed5a622 | chromatic++ | src/preface.pod:
00:07 dalek book: Edited the preface; minor changes.
00:07 dalek book: review: http://github.com/perl6/book/commit/ed​5a6224517acdd6cb55110a088fbf37226f941d
00:07 dalek book: ed1c156 | chromatic++ | src/operators.pod:
00:07 dalek book: Edited operators chapter.
00:07 dalek book: review: http://github.com/perl6/book/commit/ed​1c156660cee41a86aaee1a70b8dbed9b3df0bc
00:10 Italian_Plumber1 joined #perl6
00:11 HarryS joined #perl6
00:12 Italian_Plumber left #perl6
00:17 HarryS left #perl6
00:21 awwaiid joined #perl6
00:26 lue afk
00:36 dream joined #perl6
00:38 araujo left #perl6
00:41 HarryS joined #perl6
00:43 bluescreen joined #perl6
00:43 bluescreen is now known as Guest31804
00:44 meppl left #perl6
00:47 HarryS left #perl6
00:47 Sanitoeter joined #perl6
00:49 TimToady j
00:49 TimToady pmichaud: the lack of big Ints was also a recurring theme
00:49 masak joined #perl6
00:52 TimToady and binary data
00:53 TimToady and slices and matrices
00:53 TimToady and sets
00:54 awwaiid and tostadas
00:54 TimToady I'm allergic to those, so you can do 'em
00:55 TimToady oh, and state
00:55 TimToady though that's usually pretty easy to workaround, it sometimes requires you to name something that doesn't really need a name
00:57 awwaiid you're alergic to tostadas? My condolences.
00:57 TimToady lack of list associativity tended to force extra parens on Z and X, too
00:58 colomon phenny: tell smash "Ruined the server"?  (Heh.  In 1992 I once brought UMich's math dept's computer network to its knees doing distributed fractal calculations.)
00:58 phenny colomon: I'll pass that on when smash is around.
00:58 masak I should make those "features whose absence are felt" list more often.
00:59 masak s/list/lists/
01:01 colomon masak++
01:01 masak TimToady: we have Set. could you be more specific as to what's missing?
01:04 colomon Is Set actually up and running?
01:04 masak rakudo: say Set.new(1..5, 3..7).elems
01:04 p6eval rakudo dc9900: OUTPUT«7␤»
01:04 colomon rakudo: my $a = Set.new(1, 3, 6).perl
01:04 p6eval rakudo dc9900:  ( no output )
01:05 colomon rakudo: my $a = Set.new(1, 3, 6); say $a.perl
01:05 p6eval rakudo dc9900: OUTPUT«Set.new(1, 3, 6)␤»
01:05 masak \o/
01:05 colomon sweet!  I completely missed that one.
01:05 TimToady rakudo: my $a = Set.new(1, 3, 6); say $a{3}
01:05 p6eval rakudo dc9900: OUTPUT«get_pmc_keyed() not implemented in class 'Set'␤  in 'at_key' at line 27:CORE.setting␤  in 'Any::postcircumfix:<{ }>' at line 1694:CORE.setting␤  in main program body at line 1␤»
01:08 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a ∩ $b;
01:08 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "say $a \u2229 $"␤»
01:08 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a (+) $b;
01:08 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "say $a (+)"␤»
01:09 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a (|) $b;
01:09 p6eval rakudo dc9900: OUTPUT«Set()<0x60f4ed0>␤»
01:09 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a (&) $b;
01:09 p6eval rakudo dc9900: OUTPUT«Set()<0x5e01fc0>␤»
01:10 masak I put the Unicode variants in the Set.pm module, but I don't recall them ever working.
01:10 TimToady rakudo: use Set; my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a ∩ $b;
01:10 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Unable to find module 'Set' in the @*INC directories.␤(@*INC contains:␤  lib␤  /home/p6eval/.perl6/lib␤  /home/p6eval//p2/lib/parrot/2.​7.0-devel/languages/perl6/lib␤  .)␤»
01:11 masak nono, it's already part of the core setting.
01:11 HarryS joined #perl6
01:11 masak sorry for the confusion.
01:11 TimToady and it's probably worth a set() composer
01:12 whiteknight left #perl6
01:12 TimToady funny that there are bag brackets but no set brackets
01:13 TimToady rakudo: my $bag ⟅1,2,2,2,3,4,5,5⟆;
01:13 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "my $bag \u27c51"␤»
01:13 TimToady rakudo: my $bag = ⟅1,2,2,2,3,4,5,5⟆;
01:13 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "my $bag = "␤»
01:14 masak seems I removed the Unicode variants because non-latin-1 doesn't belong in the setting: http://github.com/rakudo/rakudo/commit/e​759b5d9939747abfb18d187dfc4030199601a3d
01:17 HarryS left #perl6
01:17 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say $a (|) $b;  # doesn't do anything in list context, should default to .keys
01:17 p6eval rakudo dc9900: OUTPUT«Set()<0x63026f0>␤»
01:18 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say ~($a (|) $b).keys;
01:18 p6eval rakudo dc9900: OUTPUT«1 3 6 9␤»
01:19 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say ~($a (&) $b).keys;
01:19 p6eval rakudo dc9900: OUTPUT«3 6␤»
01:19 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say ~($a (-) $b).keys;
01:19 p6eval rakudo dc9900: OUTPUT«1␤»
01:19 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say ~($a (/) $b).keys;
01:19 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "say ~($a ("␤»
01:21 TimToady rakudo: my $a = Set.new(1, 3, 6); my $b = Set.new(3,6,9);  say ~($a (^) $b).keys;
01:21 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Confused at line 22, near "say ~($a ("␤»
01:21 masak I can define (/) if you want.
01:21 * TimToady wonders what symmetric difference is
01:21 masak it isn't in there.
01:21 masak but since I have (|) and (&), I guess we could have (^)
01:24 TimToady and what is the approved way to test for membership, if .{} doesn't work?
01:25 masak .exists($thingy)
01:25 masak I can add .{} too -- should it return a Bool?
01:26 TimToady it should return the value of the key-value pair :)
01:26 TimToady which for sets is boolean, but for bags is a number
01:27 TimToady as far as I recall, the only place where we break the Hash contract is that list context returns keys instead of pairs
01:27 masak ok.
01:28 TimToady not sure how that translates to bags though, unless its $key xx $value
01:28 masak seems fair.
01:28 TimToady $bag.pick(*) would then work fairly naturally to give you three red marbles and two white ones
01:29 TimToady er, .pick(5)
01:29 TimToady though that could be optimized I suspect
01:30 TimToady and a set listop could be quite handy
01:30 masak 'set'?
01:30 TimToady my %set := set 1,3,5;
01:30 drbean joined #perl6
01:31 masak I think some people on p6l will like that.
01:31 masak I think I might, too.
01:31 TimToady well, I would, I suspect
01:31 TimToady and being in the setting, the user can override it for other purposes
01:31 TimToady shadow it lexically, I mean
01:31 masak nod
01:41 HarryS joined #perl6
01:41 cdarroch left #perl6
01:44 araujo joined #perl6
01:47 masak araujo! \o/
01:47 HarryS left #perl6
01:50 colomon phenny: tell tadzik If you switch ABC to git://github.com/colomon/ABC.git, it should pass all tests.  :)
01:50 phenny colomon: I'll pass that on when tadzik is around.
02:02 lichtkind good night
02:02 masak 'night, lichtkind.
02:02 lichtkind :)
02:02 lichtkind left #perl6
02:07 araujo masak!
02:07 araujo :)
02:07 masak \o/
02:10 Italian_Plumber1 left #perl6
02:11 HarryS joined #perl6
02:14 dalek rakudo: d75c61d | masak++ | src/core/Set.pm:
02:14 dalek rakudo: [Set] implemented .symmetricdifference and (^)
02:14 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d​75c61d1c9d6b709dff9760ffdfba1b80098f908
02:17 guidjos joined #perl6
02:17 HarryS left #perl6
02:18 guidjos left #perl6
02:22 cjk101010 left #perl6
02:30 masak rakudo: say ([1, 3, 4] (^) [3, 4, 6]).keys.perl
02:30 p6eval rakudo dc9900: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
02:31 masak ETOOSOON
02:39 petdance joined #perl6
02:41 HarryS joined #perl6
02:43 feiquet joined #perl6
02:43 Sanitoeter left #perl6
02:44 dalek rakudo: 27d54dc | masak++ | src/core/Set.pm:
02:44 dalek rakudo: [Set] implemented postcircumfix:<{ }>
02:44 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/2​7d54dc145ffdcaa57ef9e8d4cbc1e91100349e5
02:46 masak TimToady: I don't know how to make Set give its keys in list context.
02:46 masak but the other things should be in place now.
02:47 masak I can add the 'set' listop too, if you spec it :)
02:48 HarryS left #perl6
02:53 jacob_applebaum left #perl6
02:58 Sanitoeter joined #perl6
02:59 masak rakudo: say ([1, 3, 4] (^) [3, 4, 6]).keys.perl
02:59 p6eval rakudo d75c61: OUTPUT«[1, 6]␤»
02:59 masak \o/
03:02 espadrine_ joined #perl6
03:02 espadrine left #perl6
03:02 espadrine_ is now known as espadrine
03:03 jacob_applebaum joined #perl6
03:07 masak rakudo: say ([1, 3, 4] (^) [3, 4, 6]){6}
03:07 p6eval rakudo d75c61: OUTPUT«get_pmc_keyed() not implemented in class 'Set'␤  in 'at_key' at line 27:CORE.setting␤  in 'Any::postcircumfix:<{ }>' at line 1694:CORE.setting␤  in main program body at line 1␤»
03:11 HarryS joined #perl6
03:17 HarryS left #perl6
03:20 cjk101010 joined #perl6
03:22 espadrine left #perl6
03:22 espadrine_ joined #perl6
03:36 mfollett joined #perl6
03:38 * masak reads 'Perl4 to Perl5 Traps' and goes 'eeeew!'
03:39 agentzh joined #perl6
03:40 masak rakudo: my @list = (1,2,3,4,5); my $n = shift @list + 2; say "n is $n"
03:40 p6eval rakudo d75c61: OUTPUT«Method 'shift' not found for invocant of class 'Num'␤  in 'shift' at line 2894:CORE.setting␤  in main program body at line 22:/tmp/sYT2bmCkRo␤»
03:40 masak used to work in Perl 4 :)
03:40 * masak shudders
03:41 HarryS joined #perl6
03:41 masak rakudo: my $a = 0; $_ = "foo"; /foo/ ?? $a += 2 !! $a -= 2; say $a
03:42 p6eval rakudo d75c61: OUTPUT«===SORRY!===␤Confused at line 22, near "/foo/ ?? $"␤»
03:42 masak rakudo: my $a = 0; $_ = "foo"; $_ ~~ /foo/ ?? $a += 2 !! $a -= 2; say $a
03:42 p6eval rakudo d75c61: OUTPUT«===SORRY!===␤Confused at line 22, near "$_ ~~ /foo"␤»
03:42 masak std: my $a = 0; $_ = "foo"; /foo/ ?? $a += 2 !! $a -= 2; say $a
03:42 p6eval std 32123: OUTPUT«[31m===[0mSORRY![31m===[0m␤Precedence of += is too loose to use between ?? and !!; please use parens around inner expression at /tmp/LpslE728ON line 1:␤------> [32mmy $a = 0; $_ = "foo"; /foo/ ?? $a +=[33m⏏[31m 2 !! $a -= 2; say $a[0m␤Parse failed␤FAILED 00:01 120m␤»
03:42 masak STD++
03:43 mfollett rakudo: my %hash; push(%hash<books>, 'Cooking for Geeks');
03:43 p6eval rakudo d75c61: OUTPUT«Method '!fill' not found for invocant of class ''␤  in 'List::push' at line 2639:CORE.setting␤  in main program body at line 22:/tmp/zcftSEWYZa␤»
03:43 mfollett Anyone know what I'm doing wrong there?
03:43 * masak submits rakudobug
03:44 masak mfollett: looks good to me.
03:44 tylercurtis masak: what did the "shift @list + 2" line do in Perl 4?
03:44 mfollett masak:  ok, good, I thought I was crazy
03:44 masak tylercurtis: shifted @list and added 2 to the result.
03:44 masak mfollett: as a general rule, you're not. :)
03:45 mfollett masak:  heheh, thanks.  How do I submit a bug?
03:45 masak mfollett: it's already been taken care of. see above.
03:45 masak but for next time, rakudobug@perl.org will do.
03:45 mfollett masak:  Thanks!
03:46 Guest31804 left #perl6
03:46 masak you're welcome. hope those geeks don't go hungry, now.
03:46 mfollett heheh
03:47 tylercurtis masak: I instinctively feel like that's scary, but I don't find Forth and related languages similarly scary, so I'm not sure it really is.
03:47 HarryS left #perl6
03:48 masak tylercurtis: shift was probably special-cased in some manner, only expecting one term.
03:48 masak rakudo: say abs -4 + 2
03:48 p6eval rakudo d75c61: OUTPUT«2␤»
03:51 tylercurtis rakudo: say abs -4, 2
03:51 p6eval rakudo d75c61: OUTPUT«42␤»
03:52 masak Perl 4 allowed whitespace (!) as a delimiter for quote constructs.
03:52 masak as in 'my $b = q baz ;'
03:54 \xF0 because perl 4 was off the hook
03:54 masak rakudo: if { 1 } { say "True!" } else { say "False!" }
03:54 p6eval rakudo d75c61: OUTPUT«True!␤»
03:54 masak well, we re-introduced that syntax :)
03:54 masak rakudo: if { 0 } { say "True!" } else { say "False!" }
03:55 p6eval rakudo d75c61: OUTPUT«True!␤»
03:55 masak but it always returns True, because closures are such positive creatures.
03:55 tylercurtis http://perlcabal.org/syn/S03​.html#Named_unary_precedence about named unary precedence, do all unary functions that have that precedence, or only ones in the setting, or only certain ones?
03:56 molaf joined #perl6
03:56 masak seems to me there's a small group of special-cased ones.
03:59 tylercurtis viv seems to indicate that is indeed the case.
04:00 bluescreen joined #perl6
04:00 masak I tried to check locally too, but my setup is b0rked.
04:00 bluescreen is now known as Guest10103
04:01 masak anyway, that means Rakudo is in the wrong with 'abs 4 - 2'
04:01 tylercurtis masak: why?
04:02 masak because if 'abs' is unary, it only expects one term, the 4.
04:02 masak whereas Rakudo prints '2', which means the abs ate the '4 - 2'.
04:03 masak rakudo: my $x = 'aaa'; print ++$x, ' : '; print -$x, ' : '; say ++$x;
04:03 p6eval rakudo d75c61: OUTPUT«aab : -0 : aac␤»
04:03 * masak submits rakudobug
04:03 tylercurtis rakudo: say abs 4 - 2
04:03 p6eval rakudo d75c61: OUTPUT«2␤»
04:04 tylercurtis rakudo: say abs 2 - 4
04:04 p6eval rakudo d75c61: OUTPUT«2␤»
04:04 masak this one is not spec'd, and Perl 5 prints '-aab' for the middle term.
04:04 masak buubot: eval my $x = 'aaa'; print ++$x, ' : '; print -$x, ' : '; say ++$x;
04:04 buubot masak: ERROR: Can't modify constant item in postincrement (++) at (eval 40) line 1, near "say ++" syntax error at (eval 40) line 1, near "++$x"
04:04 masak buubot: eval my $x = 'aaa'; print ++$x, ' : '; print -$x, ' : '; print ++$x, "\n";
04:04 buubot masak: aab : -aab : aac 1
04:05 masak buubot++
04:05 buubot masak: Couldn't match input.
04:05 masak buubot--
04:05 buubot masak: Couldn't match input.
04:05 tylercurtis "say abs 2 - 4" should parse as "say(abs(2 - 4))" since additive ops have tighter precedence than named unaries.
04:05 tylercurtis So, that rakudo example looks right to me.
04:06 mfollett One more question which I have posted on pastie.org here: http://pastie.org/1133033 the error is at the bottom.
04:07 masak tylercurtis: oh. all right then. :)
04:08 masak mfollett: try return self.bless(*, %params);
04:08 masak or maybe return self.bless(*, |%params);
04:09 mfollett masak:  thanks!  masak++
04:09 masak it worked? great! :)
04:11 HarryS joined #perl6
04:11 mfollett What is the asterisk in this case?
04:12 masak mfollett: it means "I want to use whatever's the standard underlying representation of an object"
04:13 mfollett ok
04:13 mfollett thanks
04:13 TimToady * means "I don't care, you pick." except when it means, "there an argument missing here in this curry expression"
04:14 TimToady which is still the same basic idea, someone else picks the value
04:14 masak right. the question had 'in this case' in it, so I went with the special case.
04:14 TimToady nod
04:15 mfollett thanks to both :)
04:15 TimToady was just waxing didactic
04:16 * masak goes offline for a while
04:17 masak left #perl6
04:17 HarryS left #perl6
04:32 redicaps joined #perl6
04:34 molaf left #perl6
04:35 redicaps left #perl6
04:39 cjk101010 left #perl6
04:41 HarryS joined #perl6
04:47 HarryS left #perl6
04:48 BaggioKwok joined #perl6
04:54 espadrine joined #perl6
04:54 espadrine_ left #perl6
04:58 cjk101010 joined #perl6
05:09 feiquet left #perl6
05:11 HarryS joined #perl6
05:15 BaggioKwok left #perl6
05:17 HarryS left #perl6
05:23 masak joined #perl6
05:40 kaare joined #perl6
05:40 kaare is now known as Guest3461
05:41 HarryS joined #perl6
05:41 masak buubot: sub foo { my $a = shift; sub bar { say $a } }; bar; foo(42); bar
05:41 buubot masak: No factoid found. Did you mean one of these: ['s penis]
05:42 masak buubot: eval sub foo { my $a = shift; sub bar { say $a } }; bar; foo(42); bar
05:42 buubot masak: ERROR: Can't call method "say" on an undefined value at (eval 40) line 1.
05:42 masak buubot: eval sub foo { my $a = shift; sub bar { print $a, "\n" } }; bar; foo(42); bar
05:42 buubot masak:  42 1
05:42 masak ooh, is buubot running without -w?
05:42 masak buubot: eval sub foo { my $a = shift; sub bar { print $a, "!" } }; bar; foo(42); bar
05:42 buubot masak: !42!1
05:43 petdance left #perl6
05:43 masak locally, I get the "Variable "$a" will not stay shared' warning.
05:43 kjeldahl joined #perl6
05:43 BinGOs try 'use warnings'
05:43 masak buubot: eval use warnings; sub foo { my $a = shift; sub bar { print $a, "!" } }; bar; foo(42); bar
05:43 buubot masak: Variable "$a" will not stay shared at (eval 40) line 1. Use of uninitialized value $a in print at (eval 40) line 1. !42!1
05:43 masak \o/
05:44 masak BinGOs++
05:44 * BinGOs takes a bow.
05:45 masak for some reason I got to thinking about the discussion at http://irclog.perlgeek.de/​perl6/2010-04-27#i_2269618
05:46 masak it's now almost half a year later, and I can read it and be a little less uncertain about what was said, due to having implemented some of the things discussed :)
05:46 HarryS left #perl6
05:47 wtw joined #perl6
05:49 masak alpha: for ^3 { state $x++ }; say $x
05:49 p6eval alpha 30e0ed: OUTPUT«Symbol '$x' not predeclared in <anonymous> (/tmp/DAYwFQgtKy:10)␤in Main (file <unknown>, line <unknown>)␤»
05:49 masak std: for ^3 { state $x++ }; say $x
05:49 p6eval std 32123: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $x is not predeclared at /tmp/jNoFRS4bCA line 1:␤------> [32mfor ^3 { state $x++ }; say $x[33m⏏[31m<EOL>[0m␤Check failed␤FAILED 00:01 117m␤»
05:49 masak oh right.
05:49 masak alpha: for ^3 { say state $x++ }
05:49 p6eval alpha 30e0ed: OUTPUT«Use of uninitialized value␤␤1␤2␤»
05:50 masak alpha: for ^3 { say ++state $x }
05:50 p6eval alpha 30e0ed: OUTPUT«1␤2␤3␤»
05:51 mfollett left #perl6
05:51 masak <TimToady> so, unless we put state variables somewhere special outside the active lexpad, we *must* reuse the same lexpad for re-invocation
05:52 masak fwiw, I talked to jnthn and he said (IIUC) that for the state implementation for alpha, he placed state variables in a special "block lexpad" that didn't get wiped upon block reactivation.
05:54 masak with that model, state vars and recursion would behave just like state vars and loop iterations. there's something to be said for that.
05:59 masak alpha: sub foo { my $a = shift; our sub bar { say $a } }; bar; foo(42); bar
05:59 p6eval alpha 30e0ed: OUTPUT«Confused at line 10, near "= shift; o"␤in Main (file <unknown>, line <unknown>)␤»
05:59 masak er.
05:59 masak alpha: sub foo($a) { our sub bar { say $a } }; bar; foo(42); bar
05:59 p6eval alpha 30e0ed: OUTPUT«Null PMC access in type()␤in Main (file <unknown>, line <unknown>)␤»
06:00 masak rakudo: sub foo($a) { our sub bar { say $a } }; bar; foo(42); bar
06:00 p6eval rakudo 27d54d: OUTPUT«Null PMC access in type()␤  in 'bar' at line 22:/tmp/pT5utjXSiF␤  in main program body at line 22:/tmp/pT5utjXSiF␤»
06:00 masak all Rakudo ng has is a better stack trace ;-)
06:01 TimToady left #perl6
06:02 masak here's how this oughta work, in an official, complete implementation: the lexpad of &foo contains a variable $a. in its tabula rasa state, the sub bar binds to this $a but in the static lexpad of &foo, because &foo hasn't run yet.
06:02 masak Perl 5 gets this right.
06:02 TimToady joined #perl6
06:02 masak the first time &foo runs, a dynamic (or runtime) lexpad is created for &foo.
06:03 masak it's created with the values copied from the static lexpad, so if &foo contained a BEGIN block, things still work out.
06:03 masak also, &bar is rebound, so that its $a no longer points to the static lexpad, but to the new one.
06:04 stepnem left #perl6
06:04 masak that way, when &bar is called after foo(42), it'll see the $a from that invocation of &foo where $a is 42.
06:04 masak and it'll print 42.
06:06 masak this all boils down to two simple rules: (1) closures in a block are cloned at block activation, so that they have their lexicals pointing always to the freshest outer lexpads. (2) if a block has never been activated, the closures in it (possibly visible through "our" scoping and the like) instead point to an outer static lexpad.
06:06 stepnem joined #perl6
06:07 jhuni left #perl6
06:07 masak I bet most of this looks like Greek to people who haven't thought about it much. but it's heady stuff, and amenable to longish blog posts with pretty diagrams :)
06:08 \xF0 you could make one
06:08 masak I'd like to, at some point.
06:08 masak though I'd prefer to have it working in Yapsi first.
06:08 feiquet joined #perl6
06:08 uniejo joined #perl6
06:09 sorear hello #perl6
06:09 \xF0 hello sorear :p
06:10 sorear masak: after much long and hard thinking, the implementation of static lexpads in niecza does NOT involve any copying
06:10 masak o/ sorear
06:10 sorear it simplifies things a lot
06:11 masak let's define 'copying' exactly here.
06:11 masak copying of what?
06:11 sorear values, from static lexpads, into nonstatic ones
06:11 HarryS joined #perl6
06:11 sorear niecza has an egalitarian model, no lexpad is priveleged that way
06:11 masak interesting.
06:12 masak in the absence of copying, I'm not sure how BEGIN works.
06:12 masak or any mechanism that leaves a value in the static lexpad for later use.
06:13 sorear I handle BEGIN my $x = 1; say $x; by only creating one mainline pad and using it for both BEGIN and runtime
06:13 sorear 1 never needs to be copied because it's in the right place all along
06:13 sorear (the real reason I did this was to avoid double initialization of classes, but it turned out to have huge ramifications on the static lexpad mechanism)
06:14 masak hm.
06:15 masak Occam called, and he wants your model.
06:15 masak I do too, now.
06:16 masak but I don't understand it fully yet, I think.
06:16 HarryS left #perl6
06:16 masak in 'for ^3 { my $a }', how many lexpads are ever created?
06:18 azert0x joined #perl6
06:18 moritz_ good morning
06:18 azert0x left #perl6
06:19 masak mornin', moritz_
06:23 feiquet hello, there
06:25 moritz_ hi
06:25 feiquet I have a question. I can cast Real value $r into Int using $r.Int but can't with Int($r). Is this type of casting still unimplemented?
06:25 moritz_ yes
06:25 feiquet Oh, with Rakudo Star.
06:26 feiquet thanks, moritz_.
06:26 feiquet and.. is there any unimplemented things list of Rakudo *?
06:27 moritz_ http://rakudo.org/status # end of page
06:27 masak std: / $0 (foo) /
06:27 p6eval std 32123: OUTPUT«ok 00:01 117m␤»
06:28 masak I think referring to capture variables in a regex when the corresponding pair of parentheses hasn't been seen yet, should be parse-time illegal.
06:29 moritz_ phenny: tell pmichaud if you turn perl6 into an organization account (github), I'm happy to delete perlsix to avoid confusion
06:29 phenny moritz_: I'll pass that on when pmichaud is around.
06:29 feiquet moritz_: Thank you. hm...
06:29 sorear masak: 4.  One root lexpad (static and dynamic are the same), 1 dynamic lexpad per block execution
06:30 sorear masak: there would be 5, but niecza can optimize out the static lexpad if there are no BEGIN blocks
06:30 moritz_ feiquet: our bug tracker also contains lots of small-scale things that aren't implement yet
06:30 sorear masak: this is possible *because* of the equality of the design - static lexpads are only used for static code, not cloning
06:30 masak sorear: ah, so the look would have one more lexpad if it had a BEGIN block?
06:30 sorear yes
06:30 masak s/look/loop/
06:31 masak sorear: in 'for ^3 { say my $a; BEGIN { $a = 42 } }' under your model, which three values get printed?
06:31 masak three Anys?
06:32 feiquet moritz_: I once get such a message, but I this time I can only get a message like "sub &int does not exist". so I asked.. Thanks, again.
06:32 sorear niecza: for 1, 2, 3 { say my $a; PRE-INIT { $a = 42 } }
06:32 p6eval niecza 33f66ad: OUTPUT«Any()␤Any()␤Any()␤»
06:32 moritz_ feiquet: int != Int
06:32 oatspeas joined #perl6
06:32 azert0x joined #perl6
06:32 azert0x left #perl6
06:32 masak right, $a gets set to 42 and then that value is never inherited to the dynamic lexpads.
06:32 moritz_ int the native type, which is also not yet implemented
06:32 sorear yes
06:33 sorear the really nice thing about the singleton pad model is that singleton pads don't need to exist as objects
06:33 masak please elaborate.
06:34 masak also, why did you call 'BEGIN' 'PRE-INIT'? :)
06:34 oatspeas left #perl6
06:34 azert0x joined #perl6
06:34 sorear before singleton pads, attempting to access a global in the setting's setting from a nested loop: th.outer.outer.outer.outer​.outer.outer.lex["&infix"]
06:34 Ross joined #perl6
06:34 sorear now: SAFE.F1_23_infix
06:34 azert0x left #perl6
06:34 feiquet moritz_: oh sorry I know. Because neither int() nor Int() moved, I ignored that.
06:34 sorear er, &infix:<+>
06:35 sorear I called it PRE-INIT because it's not really a BEGIN - it doesn't run at parse time
06:36 azert0x joined #perl6
06:36 azert0x left #perl6
06:36 masak the four things that tchrist wanted from regexes in his FMTEYEWTK post on regexes in 1996: (1) 1-st class regexes (2) user-defined charclasses (3) recursive matches with nesting (4) Unicode support.
06:37 mberends joined #perl6
06:37 masak sorear: hm. Yapsi does the '.outer' x $N thing right now. :/
06:38 masak sorear: does the SAFE.F1_23_infix<+> trick only work for things like the setting, which is never reactivated?
06:39 Mowah joined #perl6
06:40 justatheory left #perl6
06:41 HarryS joined #perl6
06:46 HarryS left #perl6
06:48 Ross left #perl6
06:50 azawawi joined #perl6
06:50 azawawi hi
06:50 masak azawawi: hi!
06:51 * azawawi prepares to release S:H:P6 0.85 which is based on cpan STD 32116 :)
06:52 mberends left #perl6
06:56 tylercurtis Is there some method that is called on objects in sink context?
06:58 Ross joined #perl6
06:59 masak not sure what you mean, but... no. probably not.
07:01 tylercurtis Well, an object can behave differently in some contexts by overriding methods (.Bool, .list, .Numeric, etc.). Turns out that now that I think about it, I don't need to behave differently in sink context, but I'm still a little curious about how that could be done.
07:01 azert0x_ joined #perl6
07:02 azawawi left #perl6
07:02 tylercurtis Or if it could be done at all.
07:02 tylercurtis Or if it should be possible.
07:02 feiquet left #perl6
07:03 feiquet joined #perl6
07:03 feiquet left #perl6
07:03 schpey joined #perl6
07:03 masak sink context tends to indicate the lack of interest in the return value. so there's not really a pressing need to call a conversion method in that case.
07:03 masak but I see your point, I think. would be nice to have an overridable hook.
07:04 Mowah left #perl6
07:05 tylercurtis Possible use case: an embedded language for writing blog posts.  You might have a bold function that either adds bold text as a top-level element of the post's body in sink context or returns an object that can be used as a child of other elements in non-sink context.
07:06 moritz_ tylercurtis: there is a method that's called in sink context
07:06 moritz_ it's .sink, unsurprisingly
07:06 moritz_ it's just NYI
07:06 tylercurtis moritz_: good to know.
07:06 moritz_ it's used for eagerly evaluating lazy lists, for example
07:07 tylercurtis moritz_++ thanks
07:08 masak I find mention of the 'sink' statement prefix in the spec, but nothing on a .sink method.
07:09 masak but if it's parallel to 'list' and 'hash', then maybe a method form is implied...
07:11 Ross left #perl6
07:11 HarryS joined #perl6
07:14 stepnem left #perl6
07:14 moritz_ it's been discussed here
07:15 sorear yes
07:16 HarryS left #perl6
07:16 sorear masak: conversion to C# globals works for any block which can be very easily proven to be entered exactly once - the setting, the mainline of every file, code in bare blocks in the mainline, code in classes/packages
07:16 stepnem joined #perl6
07:17 masak sorear: I definitely like that part of your model.
07:17 sorear sink context as agreed on here is rather problematic from an optimization standpoint
07:18 sorear niecza implements the following alternate model: a for look is run immediately if and only if a bare block in the same place would be
07:18 sorear i.e if it is the direct child of a statementlist node
07:19 masak ...except if it's last in a sub...
07:20 sorear that's the biggest point of difference between niecza's model and the proposed rakudo model, yes
07:21 sorear my $x; sub foo { temp $x = 5; for 1 { say $x } }; foo; # in niecza this will print 5 once I implement temp, in rakudo it will print Any()
07:22 * tylercurtis almost suggested 'do for ...' before realizing how counter-intuitive that would be.
07:22 Guest3461 is now known as kaare_
07:24 masak rakudo: my @foo = 'a'..'f'; my @bar = 1..10; @foo[0..3] = @bar[5..8]; say @foo.perl
07:25 p6eval rakudo 27d54d: OUTPUT«[6, 7, 8, 9, "e", "f"]␤»
07:25 masak rakudo: my @foo = 'a'..'f'; my @bar = 1..10; my @idx1 = 1, 6, 2; my @idx2 = 8, 1, 4; @foo[@idx1] = @bar[@idx2]; say @foo.perl
07:26 p6eval rakudo 27d54d: OUTPUT«["a", 9, 5, "d", "e", "f", 2]␤»
07:26 masak \o/
07:29 elekt left #perl6
07:30 * sorear wonders if renaming PRE-INIT to BEGIN would solve more confusion than it creates
07:33 sorear rakudo: say Any.flat.WHAT
07:33 p6eval rakudo 27d54d: OUTPUT«List()␤»
07:37 elekt joined #perl6
07:37 drbean left #perl6
07:39 stepnem left #perl6
07:39 stepnem joined #perl6
07:41 HarryS joined #perl6
07:46 stepnem left #perl6
07:46 prism is now known as daemon
07:47 stepnem joined #perl6
07:47 HarryS left #perl6
07:49 masak are there :c :d :s adverbs on the tr/// construct in Perl 6?
07:49 espadrine left #perl6
07:51 sorear std: tr///d
07:51 p6eval std 32123: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unsupported use of suffix transliteration modifiers; in Perl 6 please use prefix adverbs at /tmp/pehCUyOJAm line 1:␤------> [32mtr///d[33m⏏[31m<EOL>[0m␤Other potential difficulties:␤  Unsupported use of /g; in Perl 6 please use :d at
07:51 p6eval ../tmp/pehCUyOJ…
07:51 masak str: tr:d///
07:52 masak std: tr:d///
07:52 p6eval std 32123: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized quote modifier: d at /tmp/dPapJafcrK line 1:␤------> [32mtr[33m⏏[31m:d///[0m␤Check failed␤FAILED 00:01 114m␤»
07:52 masak guess not.
07:52 sorear in light of what came before, I would say that is a bug
07:53 masak hm, true.
07:53 masak does tr/X// still return the number of Xes in the string? the spec doesn't seem to have an opinion.
07:54 jedai_ left #perl6
07:54 sorear the spec is billed specifically as documenting all differences between Perl 6 and Perl 5
07:55 sorear rakudo: say (^10).WHAT
07:55 p6eval rakudo 27d54d: OUTPUT«Range()␤»
07:55 sorear rakudo: say (^10).Str
07:55 p6eval rakudo 27d54d: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
07:55 sorear rakudo: say (^10).perl
07:55 p6eval rakudo 27d54d: OUTPUT«0..^10␤»
07:55 jedai joined #perl6
07:56 sorear ..^ ?
07:57 masak sorear: yes, but sometimes it's hard to tell if an omission is deliberate or if no-one has thought of asking whether things should remain the same.
07:58 * sorear really doesn't like how niecza is trending towards replacing Perl 6 with C#
08:02 tylercurtis sorear: what is the CursorBase::_REDUCE stuff in Niecza::Actions for?
08:04 sorear tylercurtis: _REDUCE is the connection point between Cursor-based grammars and action classes; by overriding it, I can customize the handling of action methods
08:05 sorear IIRC I 1. make unimplemented action methods into sorries, instead of ignored 2. present a nicer naming convention for :sym<> mangling
08:05 sorear the "standard" way to do this is AUTOLOAD, I'm trying something different
08:05 sorear (note that AUTOLOAD makes typoes in Niecza/Actions.pm much harder to catch)
08:10 schpey left #perl6
08:10 schpey joined #perl6
08:10 timbunce joined #perl6
08:11 HarryS joined #perl6
08:12 Zapelius joined #perl6
08:16 svetlins left #perl6
08:16 HarryS left #perl6
08:18 jhuni joined #perl6
08:23 tylercurtis Good night, #perl6.
08:27 dakkar joined #perl6
08:27 masak 'night, tylercurtis.
08:32 tylercurtis left #perl6
08:34 daxim joined #perl6
08:40 schpey left #perl6
08:41 HarryS joined #perl6
08:47 HarryS left #perl6
08:56 * masak zzz
08:56 masak left #perl6
09:04 schpey joined #perl6
09:11 * sorear out
09:11 HarryS joined #perl6
09:15 foodoo joined #perl6
09:17 HarryS left #perl6
09:22 meppl joined #perl6
09:38 proller joined #perl6
09:41 HarryS joined #perl6
09:43 proller left #perl6
09:46 bbkr rakudo: say (^0).WHAT
09:46 proller joined #perl6
09:46 p6eval rakudo 27d54d: OUTPUT«Range()␤»
09:46 bbkr \o/
09:47 HarryS left #perl6
09:53 smash joined #perl6
09:53 smash hello everyone
09:53 phenny smash: 00:58Z <colomon> tell smash "Ruined the server"?  (Heh.  In 1992 I once brought UMich's math dept's computer network to its knees doing distributed fractal calculations.)
09:54 smash colomon: you also messed up the graph's scale :-)
09:58 bbkr The following code: use Test; eval_lives_ok "" for 1..10000 # is seriously leaking memory somewhere
09:59 moritz_ eval '' while 1; also leaks
09:59 moritz_ so I think it's eval() that leaks
09:59 smash on rakudo ?
09:59 moritz_ yes
10:00 bbkr yes, I've tested it on Star 2010.08
10:00 bbkr should I report or already known?
10:00 moritz_ please report
10:01 foodoo left #perl6
10:04 wamba joined #perl6
10:07 smash rakudo: eval "say 1" for 1..4;
10:07 p6eval rakudo 27d54d: OUTPUT«1␤Null PMC in copy␤  in 'eval' at line 1117:CORE.setting␤  in main program body at line 22:/tmp/kyKDs6lmfi␤»
10:08 smash !?
10:11 moritz_ rakudo: eval 'say 1' for 1..2
10:11 p6eval rakudo 27d54d: OUTPUT«1␤Null PMC in copy␤  in 'eval' at line 1117:CORE.setting␤  in main program body at line 22:/tmp/v6wffwm3tF␤»
10:11 moritz_ rakudo: eval 'say 1'; eval 'say 1'
10:11 HarryS joined #perl6
10:11 p6eval rakudo 27d54d: OUTPUT«1␤1␤»
10:11 moritz_ rakudo: sub e { eval 'say 1' }; e() for 1..2
10:11 p6eval rakudo 27d54d: OUTPUT«1␤1␤»
10:12 moritz_ rakudo: for 1..2 { eval 'say 1' }
10:12 p6eval rakudo 27d54d: OUTPUT«1␤1␤»
10:12 moritz_ this is most interesting
10:12 moritz_ rakudo: eval '' for 1..2
10:12 p6eval rakudo 27d54d: OUTPUT«Null PMC in copy␤  in 'eval' at line 1117:CORE.setting␤  in main program body at line 22:/tmp/Lspsx0wm8T␤»
10:13 moritz_ executing the same eval twice without an enclosing block triggers this error
10:13 moritz_ smash: care to submit?
10:14 smash moritz_: sure
10:17 moritz_ I've reduced the PIR output to just contain a single "&eval"($P0) in the loop, and that still leaks
10:17 HarryS left #perl6
10:17 smash moritz_: reported
10:18 moritz_ smash++
10:18 jhuni left #perl6
10:19 smash moritz_: (leak) GC ?
10:21 bbkr rakudo: use Test; eval_lives_ok '1<&1' # this is Test.pm bug, right? warning should not be emmited in case of eval_lives_ok?
10:21 p6eval rakudo 27d54d: OUTPUT«Use of uninitialized value in numeric context␤ok 1 - ␤»
10:23 bbkr rakudo: use Test; eval_lives_ok 'warn 666'; # like in this case - warning is not emitted
10:23 p6eval rakudo 27d54d: OUTPUT«not ok 1 - ␤»
10:26 dream left #perl6
10:28 bbkr hmm, I think there is another bug here: eval_lives_ok 'warn 666' should pass, as this is legal syntax and not dies during execution, right?
10:28 bbkr rakudo: warn 666; say "alive";
10:28 p6eval rakudo 27d54d: OUTPUT«666 at line 22:/tmp/dHXfETMIWs␤alive␤»
10:32 foodoo joined #perl6
10:32 cognominal left #perl6
10:33 agentzh left #perl6
10:35 cognominal joined #perl6
10:36 * bbkr reports both bugs
10:36 bbkr std: 1<&1
10:36 p6eval std 32123: OUTPUT«[31m===[0mSORRY![31m===[0m␤Whitespace required before < operator at /tmp/VhphRglbVX line 1:␤------> [32m1<[33m⏏[31m&1[0m␤    expecting escape␤Parse failed␤FAILED 00:01 114m␤»
10:37 bbkr rakudo: !1<&1; say "alive"
10:37 p6eval rakudo 27d54d: OUTPUT«Use of uninitialized value in numeric context␤alive␤»
10:41 xinming left #perl6
10:41 HarryS joined #perl6
10:44 broquaint joined #perl6
10:45 xinming joined #perl6
10:52 TiMBuS http://github.com/blog/712-pull-requests-2-0 ooo well there you go
11:04 broquaint left #perl6
11:06 broquaint joined #perl6
11:15 PacoLinux left #perl6
11:16 Italian_Plumber joined #perl6
11:16 dju left #perl6
11:17 dju joined #perl6
11:17 dju left #perl6
11:17 dju_ joined #perl6
11:17 PacoLinux joined #perl6
11:26 moritz_ http://nopaste.snit.ch/23213 # perl 5 from winxed via blizkost
11:27 broquaint left #perl6
11:27 broquaint joined #perl6
11:28 lamstyle left #perl6
11:30 envi^home joined #perl6
11:30 Trashlord left #perl6
11:31 Trashlord joined #perl6
11:33 lamstyle joined #perl6
11:42 stepnem left #perl6
11:43 stepnem joined #perl6
11:43 takadonet morning all
11:48 M_o_C joined #perl6
12:03 colomon \o
12:21 felipe joined #perl6
12:24 daxim latest rakudo-star packaged as RPM, enjoy   http://download.opensuse.org/reposit​ories/home:/ldieckow/openSUSE_11.3/
12:24 sftp joined #perl6
12:31 snearch joined #perl6
12:31 amkrankruleuen left #perl6
12:31 moritz_ daxim++
12:31 amkrankruleuen joined #perl6
12:32 jferrero joined #perl6
12:32 schpey left #perl6
12:35 cjk101010 left #perl6
12:38 awwaiid left #perl6
12:42 meteorjay left #perl6
12:42 meteorjay joined #perl6
12:44 alanm_ joined #perl6
12:46 alanm_ left #perl6
12:47 drbean joined #perl6
12:49 HarryS left #perl6
12:53 bluescreen joined #perl6
12:54 bluescreen is now known as Guest22756
12:59 ash_ joined #perl6
13:00 ash_ so... i did more improvements to my test instance of try.rakudo, http://75.143.73.208/ anyone want to break it now?
13:01 ash_ if you type exit, or if you cause the rakudo instance to die, it restarts it now
13:02 moritz_ \o/ seems to work
13:02 ash_ you loose your previous data (obviously) but it does better now
13:03 ash_ moritz_:  anymore suggestions for improvement?
13:03 moritz_ override exit() :-)
13:03 moritz_ well, not sure actually
13:03 ash_ hmm, alright i tried overriding it like we did with open
13:03 ash_ but it didn't work
13:04 ash_ rakudo: &GLOABAL::exit := sub { fail 'foo' }; exit;
13:04 p6eval rakudo 27d54d:  ( no output )
13:04 moritz_ rakudo: &GLOABAL::exit := sub { die 'foo' }; exit; say "alive"
13:04 p6eval rakudo 27d54d:  ( no output )
13:04 moritz_ you probably need the lexical manipulation again
13:05 ash_ well, i tried that too, but it says it can't find it in the lexpad
13:05 moritz_ huh
13:05 moritz_ well, then don't bother
13:06 drbean left #perl6
13:06 ash_ "Lexical '&exit' not found"
13:06 ash_ when i try to override it in pir like you did with open, etc.
13:06 xinming left #perl6
13:07 moritz_ ah hm, it's defined in PIR
13:07 ash_ ah
13:07 ash_ i don't know how to override that then
13:07 ash_ i'd like to, to give a message or something
13:07 xinming joined #perl6
13:08 moritz_ ash_: http://github.com/perlsix/Mu/blob/m​aster/misc/evalbot/evalbot.pl#L117 should work the same way as for !qx
13:10 orafu left #perl6
13:10 kaare_ left #perl6
13:10 ash_ ah, thanks tat got it
13:10 orafu joined #perl6
13:10 ash_ now... do i an exit and add a message saying your instance has been reset? or do i forbid 'exit'
13:12 moritz_ maybe add the message for now
13:12 ash_ i guess you could kinda use 'exit' to reset your repl
13:12 ash_ since it automatically re-starts the repl if it dies
13:14 svetlins joined #perl6
13:15 moritz_ maybe it would be more generic if the restart itself produced a message
13:15 Holy_Cow joined #perl6
13:15 moritz_ so that if you trigger a rakudobug that makes rakudo segfault or exit, you see what happens
13:16 stepnem left #perl6
13:18 ash_ ya, i am going with that optioin
13:19 ash_ in the event i detect a dead subprocess, i am adding a message
13:19 ash_ restarting server, so if your using it, it might be down for a sec
13:19 stepnem joined #perl6
13:27 ash_ now, if you crash the repl, it tells you "Rakudo REPL has closed... restarting"
13:27 ash_ or call exit
13:28 smash colomon: updated http://gil.di.uminho.pt/use​rs/smash/rakudo-bench.html (separated graphics based on values)
13:29 ash_ anymore comments on http://75.143.73.208/?
13:30 HarryS joined #perl6
13:30 uniejo left #perl6
13:32 macroron joined #perl6
13:34 smash ash_: is the 'up' key working ? i keep getting the 'no history' message
13:34 ash_ ya, i was thinking about implementing a command history
13:34 ash_ so you could scroll through it with up and down
13:34 smash oh, nice
13:34 ash_ but that might not play well with the multi-line text box
13:35 ash_ i am still considering it
13:35 ash_ i'll take those alerts out for now
13:35 ash_ if you refresh now, it should not alert you
13:36 smash yeap, no alerts.. it's the typical 'up arrow' on the multi-line box
13:38 ash_ i think i'll make it store the current command, and then cycle through the history if your cursor is at the top of the box and you press up, likewise down will cycle in the other direction
13:38 Axius joined #perl6
13:39 smash sounds sane
13:41 Guest22756 left #perl6
13:42 Guest22756 joined #perl6
13:45 ash_ left #perl6
13:46 Axius left #perl6
14:03 pmichaud good morning, #perl6
14:03 phenny pmichaud: 06:29Z <moritz_> tell pmichaud if you turn perl6 into an organization account (github), I'm happy to delete perlsix to avoid confusion
14:04 moritz_ good morning pmichaud. It seems phenny has a message for you almost every day now :-)
14:09 risou joined #perl6
14:09 patspam joined #perl6
14:10 pmichaud indeed, it does.  Not sure if that means I'm not around enough or ... :-)
14:11 moritz_ it might mean you're a focal point of rakudo development
14:11 moritz_ which is not very surprising, considering that you're the pumpking :-)
14:16 pmichaud okay, github perl6 is now an organization account
14:17 M_o_C left #perl6
14:17 moritz_ \o/
14:19 moritz_ pmichaud: any objections to adding a "dev" team, and giving it commit + admin rights for the pugs repo (which I'll clone into the perl6 account), perl6-examples and ecosystem?
14:19 moritz_ and add every current perl6 or pugs committer to it
14:20 pmichaud the name "dev" doesn't feel right.  But other than that, no objection.
14:20 moritz_ butterflies? bugs? hackers?
14:21 daxim have you applied my migration article?  I expect nothing less than a *superb* git repo conversion ;)
14:21 moritz_ lambdacamels?
14:21 moritz_ daxim: you're welcome to contribute a superb conversion
14:21 daxim hackers sounds fine
14:21 pmichaud committers
14:21 colomon smash: I was hoping you'd do that!
14:22 pmichaud I don't know.  It just feels like we should have something more flashy than "dev".  Plus some contributors might not consider themselves "developers"  (even though they are)
14:22 pmichaud "friends of camelia"  :-P
14:23 pmichaud we can go with "dev" for now, but I might want to change it someday :)
14:23 moritz_ no hurry, I won't do any work on it in the next few hours anyway
14:23 pmichaud for the parrot organization I just created a "Parrot" team
14:23 pmichaud so maybe it should just be a "Perl 6" team :-)
14:23 moritz_ good idea
14:25 ash_ joined #perl6
14:29 foodoo left #perl6
14:31 javs joined #perl6
14:32 javs left #perl6
14:32 Zapelius left #perl6
14:35 stepnem left #perl6
14:36 mfollett joined #perl6
14:36 stepnem joined #perl6
14:40 ash_ moritz_: do you have any complaints about the try.rakudo sample? if not i might move it over to replace the one thats live
14:40 [particle] whee! sign me up :)
14:41 [particle] "i'm a perl 6, and perl 6 was my idea"
14:41 ash_ http://75.143.73.208/ if anyone else wants to take a gander at it
14:42 bbkr hmm, why change of signature from "multi prefix:<so>($x)" to "multi prefix:<so>(Mu $x)" in 606c5fb prevents autothreading? I don't get this magic :P
14:42 moritz_ ash_: +1 to going live
14:43 wtw left #perl6
14:43 pmichaud bbkr: The "Mu $x" disables autothreading
14:43 moritz_ bbkr: autothreading over junctions it type based. Without a constraint, $x defaults to Any
14:43 ash_ its probably at least better than the current live :-x
14:43 pmichaud multi prefix:<so>($x)  is the same.... what moritz++ said
14:43 moritz_ and because Any !~~ Junction, it autothreads
14:43 pmichaud actually, because Junction !~~ Any  :-)
14:44 ash_ so... moritz_ if i need to have my daemon process running in the background of feather, do you have any suggestions for handling that?
14:44 daxim ash_, output    → 'hello world! ☕'.say            hello world! ���
14:44 bbkr moritz_: thanks for explanation. another bit of knowledge :)
14:44 ash_ oh... hm.... i haven't tested unicode yet... thanks daxim, i'll look into that
14:44 moritz_ ash_: I usually just start a screen process with the daemon running
14:45 ash_ moritz_: do i need to put anything in say /etc/init.d ? incase the server gets reset and i am not around to manually restart it?
14:45 moritz_ ash_: I have an @reboot line in my user crontab
14:45 ash_ to start the daemon you simply do "perl backend/persist.pl" (so no real magic there)
14:46 moritz_ ash_: though it's probably best to create a separate user for that
14:46 bbkr ash: say '<script>alert("666")</script>' # executes JS on your http://75.143.73.208/ page :)
14:46 ash_ alright
14:46 moritz_ su adduser tryrakudobackend   or so
14:48 ash_ thanks bbkr, i hadn't tested cross site scripting yet, i'll check into escaping javascript
14:49 bbkr ash: and unicode is garbled in output
14:50 patspam left #perl6
14:50 moritz_ daxim++ bbkr++ # breaking stuff
14:50 javs joined #perl6
14:51 ash_ bbkr: yup, daxim noticed that too, i am looking at it now
14:51 moritz_ and ash_++ # building stuff :-)
14:52 ash_ moritz_: if i make a user for tryrakudobackend can i increase the restrictions on the account any? (incase someone finds a security hole in the backend, which is probably easier than it should be)
14:52 bbkr ash: "use Test" prints 'P' char to output.
14:53 molaf joined #perl6
14:53 smash colomon: more updates on http://gil.di.uminho.pt/use​rs/smash/rakudo-bench.html (more ey-candy graphics)
14:53 ash_ weird, i have no idea why its printing P
14:54 ash_ smash++ # awesome graphs
14:54 moritz_ ash_: easist way is to call ulimit before starting the daemon
14:54 ash_ ah, k, i'll do that, i guess i need to make a startup script, that sets ulimit and launches the file
14:55 proller left #perl6
14:55 smash phenny: tell masak check the new colors on http://gil.di.uminho.pt/use​rs/smash/rakudo-bench.html better to read now i guess
14:55 phenny smash: I'll pass that on when masak is around.
14:58 proller joined #perl6
14:58 pmichaud (bench graphs)  wow
14:58 perlygatekeeper joined #perl6
14:59 pmichaud smash++ smash++
15:04 alksentrs joined #perl6
15:05 envi^home left #perl6
15:06 * sjn likes the rakudo bench page
15:06 sjn wish there was info % change though
15:07 sjn info on* % change
15:07 smash sjn: more info can be added
15:07 ruoso joined #perl6
15:07 sjn yay! \o/
15:08 [particle] smash: can you make the y-axis of those graphs 0-based?
15:08 sjn a row with mean % change from the previous version, perha5Dps? :)
15:08 envi^home joined #perl6
15:08 smash [particle]: i can try
15:08 [particle] as it is, it makes it look like there's been a 30% reduction in pascals_triangle.p6
15:08 ash_ btw, anyone using the try.rakudo test site, if it goes up an down, thats cause i am restarting it
15:09 [particle] ash_: it would be better if you could make that announcement *on* try.rakudo somehow :)
15:09 ash_ also, its running on a 1.66 ghz atom processor... so its really slow
15:09 ash_ [particle]: i mean http://75.143.73.208/ not the actual try.rakudo.org
15:10 smash sjn: sure, i can try to add that value
15:10 ruoso left #perl6
15:10 ash_ but yes, if i can figure out a reasonable way of displaying an announcement to web-clients, i'll add that
15:11 bbkr is there any switch to enable safe mode in Rakudo?
15:11 moritz_ no
15:12 moritz_ I've tried to implement it, and I couldn't figure it out
15:12 ash_ bbkr: http://github.com/moritz/try.rakudo​.org/blob/master/backend/p6safe.pl is the pseudo safe mode i stole from moritz_++
15:12 moritz_ both p6eval and try.rakudo.org use a hack that relies on code that we paste at the start of each evaluation
15:13 bbkr rakudo: say slurp '/etc/services' # curious
15:13 p6eval rakudo 27d54d: OUTPUT«Operation not permitted in safe mode␤  in 'Safe::forbidden' at line 2:/tmp/GTXQl_TPOa␤  in main program body at line 22:/tmp/GTXQl_TPOa␤»
15:13 bbkr rakudo: eval "say slurp '/etc/services'" # curious
15:13 p6eval rakudo 27d54d:  ( no output )
15:14 ash_ rakudo: say lines # it does have stuff fed to STDIN
15:14 p6eval rakudo 27d54d: OUTPUT«Land der Berge, Land am Strome,Land der Äcker, Land der Dome,Land der Hämmer, zukunftsreich!Heimat bist du großer Söhne,Volk, begnadet für das Schöne,vielgerühmtes Österreich,vielgerühmtes Österreich!Heiß umfehdet, wild umstrittenliegst dem Erdteil du inmitten,einem starken
15:14 p6eval ..Herzen …
15:14 smash [particle]: i can, but i don't like it very much
15:14 sjn smash++
15:14 [particle] smash: because you need more vertical space to display the results ?
15:15 smash [particle]: because i use the same vertical space and the lines get more over each other (worst on the sclower scripts graphic)
15:15 ash_ oh, btw, on my test try.rakudo site (the ip one) it resets your session if your inactive for more than 10 minutes, i might adjust that but its currently set to 10 minutes
15:16 smash [particle]: you can check it out: http://gil.di.uminho.pt/users/smash/test.html
15:16 [particle] smash: yes, i imagine in the mandlebrot script, they'd be very close to each other
15:16 [particle] ooh, actually, i like that
15:17 [particle] however, i'd drop 'rakudo-star-' from the x-axis labels, and make the title 'Rakudo Star Benchmarks by release'
15:17 [particle] then the charts could be made more vertical, and less horizontal
15:17 [particle] (to fit in a narrower browser)
15:18 [particle] also, s/ammount/amount/
15:18 [particle] :g
15:18 smash [particle]: i can do that sure, in 20m or so, right now i'm a bit busy
15:18 [particle] smash++
15:18 smash afk, even.. brb
15:20 Mowah joined #perl6
15:21 pugssvn r32126 | lwall++ | [S02] spec set and bag composers
15:22 pmichaud The 0-based graphs are much better.
15:23 pmichaud in the realm of extreme bikeshedding -- iwbni the legend in the "faster scripts" graph was in approximately the same order as the lines
15:23 pmichaud i.e., pascal's triangle first, then recursion, then iteration, then ...
15:24 pmichaud I suspect there's also an argument to be made that some of these bench mark scripts aren't all that illustrative (more)
15:24 pmichaud for example, "iteration.pl"  is only testing 5 iterations
15:24 pmichaud that tells us more about the cost of startup and setup than the cost of iteration itself  :-|
15:24 bbkr ash: when script dies on your page it should have all variables cleaned up.
15:25 ash_ what do you mean?
15:26 bbkr you can call "my $x = 1". then "die", then "say $x" and it will still print 1
15:26 pmichaud same for recursion; 12 subroutine calls doesn't really seem that heavy of a bench mark
15:26 moritz_ bbkr: it just wraps every line in a try block (the REPL does that implicitly) - I like it
15:27 hercynium left #perl6
15:27 bbkr moritz_: indeed, "die CATCH {say 1}" worked
15:28 bbkr "die; CATCH {say 1}"
15:28 ash_ bbkr, its the real repl that rakudo uses, so...
15:28 * moritz_ would hate to lose all variables, just because he made a small mistake
15:28 [particle] pmichaud: would you rather see the script names sorted by highest left-most value (2010.07 here) or highest right-most? i tend to think right-most
15:29 pmichaud right-most would be fine
15:31 ash_ http://75.143.73.208/?input=eval%20'fail%201'
15:32 ash_ i don't get why that causes it to crash
15:33 pmichaud ash_: I think it's a problem in the way that the REPL is trapping exceptions.  Feel free to file a rakudobug for it if one doesn't exist already.
15:33 ash_ alright, (the restarting twice message is my bad, its only restarting once)
15:34 ash_ rakudo: fail 'foo'
15:34 p6eval rakudo 27d54d:  ( no output )
15:34 ash_ rakudo: eval "fail 'foo'"
15:34 p6eval rakudo 27d54d:  ( no output )
15:35 ash_ doing: eval 'a'   in the repl (normal terminal repl) is that supposed to die?
15:36 pmichaud I guess 'no'.
15:37 ash_ saying just: a  says Could not find sub &a, but in an eval it causes the repl to die
15:38 ash_ guess i'll file that as a bug for rakudo, if i don't see it in the tracker
15:42 ash_ ah, ticket 77040 already address the issue
15:42 ash_ rakudo: Failure.new 'foo'
15:43 p6eval rakudo 27d54d: OUTPUT«===SORRY!===␤Confused at line 22, near "Failure.ne"␤»
15:43 ash_ Failure.new("OH NO!")
15:43 ash_ rakudo: Failure.new("OH NO!")
15:43 p6eval rakudo 27d54d: OUTPUT«Method 'handled' not found for invocant of class 'Str'␤current instr.: 'perl6;Failure;defined' pc 16376 (src/gen/Attribute.pir:16)␤»
15:49 ash_ does the repl override die?
15:50 ash_ just curious why using die in the repl doesn't cause it to stop but using fail does
15:51 colomon smash: bravo!
15:52 bbkr ash: your page should forbid "BEGIN { push @*INC, '/something/here'}", or modyfying @*INC in general
15:53 TimToady anyone know why my @array; @array.push($_) for 1..100000 segfaults?
15:54 ash_ bbkr: good point, i think i can make the variable read only
15:56 dual left #perl6
15:58 ash_ TimToady: to see where it crashes i am running for 1..100000 { .say; @array.push($_); }; its really slow after about 2500 iterations
16:00 patspam joined #perl6
16:01 TimToady well, it's probably tormenting the GC
16:02 ash_ just hit 4k, so far no crash
16:02 Ross joined #perl6
16:03 ash_ its fairly stable in terms of memory, its sitting at 180 MB, growing fairly slow
16:04 ash_ maybe .1 every 10 or so seconds
16:07 justatheory joined #perl6
16:08 smash [particle]: updated http://gil.di.uminho.pt/use​rs/smash/rakudo-bench.html change the title, and dropped 'rakudo-star-' from the x-axis labels
16:11 ash_ just hit 5k, still counting
16:13 smash ash_: Segmentation fault @ 54460 here
16:13 ash_ mine must be a lot slower than yours
16:13 ash_ i am not even to 6k yet ;P
16:15 pmichaud 15:53 <TimToady> anyone know why my @array; @array.push($_) for 1..100000 segfaults?
16:15 pmichaud I suspect it's an artifact fo the 1..100000
16:15 pmichaud *of
16:16 pmichaud in particular, http://trac.parrot.org/parrot/ticket/1723
16:16 smash pmichaud: you might be right because say $_ for 1..100000; also seg faults
16:17 pmichaud perhaps I can switch statement_modifier:for to use map (same as statement:for)
16:17 pmichaud that might resolve the issue
16:18 pmichaud or maybe I should look at ParrotIter and make sure it's not holding the entire chain of iterators
16:18 moritz_ when I do a set_hll_global without a first key argument, what's the default?
16:18 pmichaud the hll root
16:20 moritz_ how do I write that as a key?
16:20 pmichaud I don't think there's a way to write it as a key.
16:20 pmichaud if there is, it'd be []
16:21 moritz_ so I can't get shich it with get_hll_global?
16:21 hercynium joined #perl6
16:21 pmichaud I don't understand.
16:21 moritz_ when the source contains
16:21 moritz_ set_hll_global '@INC', $P2
16:21 moritz_ what's the appropriate get_hll_global line to obtain @INC again?
16:21 pmichaud get_hll_global '@INC'
16:21 pmichaud or
16:22 pmichaud $P2 = get_hll_global '@INC'
16:22 azert0x_ left #perl6
16:22 * moritz_ wrote the $P2 to the end. Stupid me
16:22 [particle] what do you think you're writing... assembler code?
16:22 pmichaud why would @INC be appearing in get_hll_global, ooc?
16:23 moritz_ because it was set with set_hll_global
16:23 pmichaud okay, why is it being set in the hll root, ooc?
16:23 pmichaud (that was my real question :-)
16:24 moritz_ because that's where contextuals end up being looked for?
16:24 pmichaud no
16:24 pmichaud contextuals look in PROCESS:: and GLOBAL::
16:25 moritz_ well, it seems to work anyway
16:25 moritz_ I see only one location, where INC is set up
16:25 pmichaud if so, I suspect it's a fossil/bug.
16:25 moritz_ (in src/Perl6/Compiler.pir, last touched by jnthn++)
16:25 amkrankruleuen left #perl6
16:25 amkrankruleuen joined #perl6
16:25 ajs joined #perl6
16:30 ajs Anyone know how you're supposed to return multiple, possibly lazy lists from a sub, and how you should go about recieving them so as not to flatten? I was trying to implement Python's itertools.tee in Perl 6, and couldn't figure out how to return the new lists.
16:31 pmichaud just return the lists as normal
16:31 pmichaud receive them into scalars, or bind them
16:31 ajs Hmm... ok, I must be doing something wrong. I was doing that, and Rakudo was flattening them in an odd way. Lemme see if I can manage a small test case.
16:32 pmichaud rakudo:  sub xyz() { gather { for 1..100 { say 'take'; take $_ } } };   my $a = xyz();  say $a[4];
16:32 p6eval rakudo 27d54d: OUTPUT«take␤take␤take␤take␤take␤5␤»
16:33 pmichaud rakudo:  sub xyz() { gather { for 1..100 { say 'take'; take $_ } } };   my $a = xyz();  say $a[4];  say $a[2];  say $a[6];
16:33 p6eval rakudo 27d54d: OUTPUT«take␤take␤take␤take␤take␤5␤3␤take␤take␤7␤»
16:33 azert0x joined #perl6
16:35 Holy_Cow left #perl6
16:35 ajs rakudo: sub a() { my @x = 1...3; my @y = 5..7; return @x, @y } ; my($x,$y) = a(); say $x.WHAT
16:35 p6eval rakudo 27d54d: OUTPUT«Int()␤»
16:35 ajs That's what I'm running into.
16:36 pmichaud need a space
16:36 patspam left #perl6
16:36 Holy_Cow joined #perl6
16:36 ajs a space?
16:36 pmichaud after 'my'
16:36 pmichaud but that's not the issue
16:36 pmichaud in this case you'll need to do a binding
16:36 pmichaud or use captures/references
16:37 pmichaud rakudo: sub a() { return 1..3, 5..7; };  my :($x, $y) := a();  say $x.WHAT;
16:37 p6eval rakudo 27d54d: OUTPUT«===SORRY!===␤Malformed my at line 22, near ":($x, $y) "␤»
16:37 patspam joined #perl6
16:37 pmichaud rakudo: sub a() { return 1..3, 5..7; };  my ($x, $y) := a();  say $x.WHAT;
16:37 p6eval rakudo 27d54d: OUTPUT«Range()␤»
16:37 ajs ah, nice
16:37 pmichaud if you use assignment, then you end up doing a list assignment
16:38 pmichaud the other way is to make sure that the lists you return are items
16:38 pmichaud rakudo: sub abc() { my @a = 1..3;  my @b = 5..7; return @a.item, @b.item };  my ($x, $y) = a();  say $x.WHAT;
16:38 p6eval rakudo 27d54d: OUTPUT«Could not find sub &a␤  in main program body at line 22:/tmp/bSQHkFzdmq␤»
16:38 pmichaud rakudo: sub abc() { my @a = 1..3;  my @b = 5..7; return @a.item, @b.item };  my ($x, $y) = abc();  say $x.WHAT;
16:38 p6eval rakudo 27d54d: OUTPUT«Array()␤»
16:38 pmichaud by having them as items, they won't flatten in list context
16:39 cdarroch joined #perl6
16:39 cdarroch left #perl6
16:39 cdarroch joined #perl6
16:39 pmichaud you can also do
16:39 pmichaud rakudo: sub abc() { my $a = 1..3; my $b = 5..7;  return $a, $b; };  my ($x, $y) = abc();  say $x.WHAT;
16:39 p6eval rakudo 27d54d: OUTPUT«Range()␤»
16:39 pmichaud anyway, the key thing to remember is that @a flattens over list assignment
16:40 ajs that definitely was my problem, thanks
16:40 pmichaud so with
16:40 patspam left #perl6
16:40 pmichaud rakudo: sub abc() { my @a = 1..3;  my @b = 5..7; return @a,@b };  my ($x, $y) = abc();  say $x.WHAT;
16:40 p6eval rakudo 27d54d: OUTPUT«Int()␤»
16:40 pmichaud it ends up being the same as
16:40 pmichaud my ($x, $y) = 1, 2, 3, 5, 6, 7
16:40 pmichaud which means that $x is 1 and $y is 2
16:40 ajs right
16:41 ajs I guess that makes sense... it's going to be  a common question, I expect.
16:41 pmichaud in general, if you don't want eager/flattening, don't use @  :-)
16:42 pyrimidine joined #perl6
16:44 daemon left #perl6
16:44 daemon joined #perl6
16:46 smash pmichaud: (nqp-rx question) is there an direct equivalent to somehing like: rule 'oexpr' is optable { ... } (from PCT) ?
16:47 pmichaud smash: no
16:47 pmichaud smash: we now use the <EXPR> rule inherited from HLL::Grammar
16:48 smash pmichaud: right
16:48 smash let me see
16:48 tylercurtis joined #perl6
16:50 pmichaud could others run a quick test for me?
16:50 pmichaud I'm getting some very bizarre output.
16:50 pmichaud first, sanity check:  from the REPL
16:51 pmichaud for 1..100 { $_ }
16:51 pmichaud anyone get anything other than a list of numbers from 1 to 100 ?
16:51 moritz_ I get the list here
16:51 smash i get the list too
16:51 pmichaud okay
16:51 pmichaud now
16:51 pmichaud for 1..200 { $_ }
16:52 pmichaud I'm getting http://gist.github.com/562541
16:52 smash i get 'name' instead of the first 12 numbers
16:52 smash *named
16:53 * moritz_ gets the same as smash
16:53 moritz_ and on second execution 'scalar' xx 5, 6..20
16:53 pmichaud also
16:53 moritz_ tehn $!llsig on third execution
16:53 pmichaud http://gist.github.com/562544
16:53 pmichaud that looks like a serious problem.
16:54 moritz_ it does
16:54 smash yeap, same behaviour here as moritz_
16:54 pmichaud okay, time to see if it's a recent problem or if it's been around a while
16:56 pmichaud rakudo: say ~(for 1..200 { $_ })
16:56 envi^home left #perl6
16:56 p6eval rakudo 27d54d: OUTPUT«src/string/api.c:3341: failed assertion 'pos <= res->strstart + Buffer_buflen(res) + 1'␤Backtrace - Obtained 24 stack frames (max trace depth is 32).␤/home/p6eval//p1/lib/libparrot.so.2.7.0 [0x2b37798191a3]␤/home/p6eval//p1/lib/l​ibparrot.so.2.7.0(Parrot_confess+0x87)
16:56 p6eval ..[0x2b37798192d…
16:56 pmichaud star: say ~(for 1..200 { $_ })
16:56 p6eval star 2010.07: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
16:56 p6eval ..97 …
16:56 pmichaud looks like a recent parrot change :-(
17:00 SHODAN joined #perl6
17:06 dakkar left #perl6
17:08 smash pmichaud: can i use the --target=parse to test a grammar even if i don't have the actions part ?
17:08 moritz_ if you have missing action methods, they are just ignored
17:08 pmichaud smash: yes, as long as the actions aren't needed to affect the parse
17:09 pmichaud (in rakudo, the actions actually modify the parsing a bit)
17:09 smash ok, thks
17:09 SHODAN just read about all planned features of perl6 :D
17:09 SHODAN sounds like an awesome language
17:09 moritz_ SHODAN: did you also read about the already implemented features? :-)
17:10 SHODAN yes. i've downloaded rakudo and tried it out a bit
17:10 moritz_ they are awesome too (even if not quite as awesome as the full spec)
17:11 SHODAN haven't done perl in ages though, but it still feels perlish
17:11 moritz_ that's what most of us think too
17:18 Chillance joined #perl6
17:18 ajs Well, I desperately need to go take care of other things, but if anyone has a minute and can suggest a workaround for my tee implemention's non-laziness, I'd love to hear it: http://gist.github.com/562575 ... I'll check back later
17:19 florz joined #perl6
17:19 ash_ moritz_: how is that message? for when you don't have javascript enabled
17:20 florz hi
17:20 ash_ greetings
17:20 pmichaud ajs: ummmm, why not   my @iters = for 1..10 { @list.iterator.list }
17:20 pmichaud er, with parens
17:21 moritz_ ash_+++ # good
17:21 pmichaud ajs: ummmm, why not   my @iters = (for 1..10 { @list.iterator.list })
17:21 colomon pmichaud: was just sitting here wondering if that would work.
17:22 moritz_ ajs: if you write a few test cases, I might understand what you want, and maybe help you
17:22 colomon http://docs.python.org/libra​ry/itertools.html#itertools.tee
17:23 ajs Python tee gives you a list of iterators that all appear to be the same as the original, but which, in the background, all feed from the original iterator in unison
17:23 pmichaud ajs: so does what I just wrote, iiuc
17:23 ajs or what colomon said ;)
17:24 ajs pmichaud: really? I would have thought that the returned iterators would be independent... if the original iterator is an input filehandle, will each of the iterators loop over the input file?
17:24 moritz_ I don't understand how that differs from  my @a := gather { ... }
17:24 colomon rakudo: my @list := 1...*; my @iters = (for 1..10 { @list.iterator.list }); say @iters[0].munch(5).perl; say @iters[1].munch(5).perl
17:24 p6eval rakudo 27d54d: OUTPUT«Method 'iterator' not found for invocant of class 'Int'␤  in <anon> at line 22:/tmp/DqWVgNjsDa␤  in main program body at line 1␤»
17:24 moritz_ you get a single array, which you can iterate as often as you want
17:24 pmichaud depends on what you mean by "loop over the input filehandle"
17:24 colomon rakudo: my @list := (1...*); my @iters = (for 1..10 { @list.iterator.list }); say @iters[0].munch(5).perl; say @iters[1].munch(5).perl
17:24 florz I am trying to construct a (generalized) cartesian product from > 2 lists/ranges - as in, a list of n-tuples. I just can't seem to figure it out, probably I'm just lacking in perl6 basics ... and hints that don't require me to internalize half of perl6's grammar for now would be appreciated ;-)
17:25 p6eval rakudo 27d54d: OUTPUT«(timeout)»
17:25 pmichaud florz: @list1 X @list2
17:25 pmichaud rakudo:  my @a = <a b c>;  my @b = <1 2 3>;  say (@a X @b).perl;
17:25 p6eval rakudo 27d54d: OUTPUT«(("a", "1"), ("a", "2"), ("a", "3"), ("b", "1"), ("b", "2"), ("b", "3"), ("c", "1"), ("c", "2"), ("c", "3"))␤»
17:25 florz pmichaud: > 2 lists!?
17:25 pmichaud rakudo:  my @a = <a b c>;  my @b = <1 2 3>;  my @c = <x y z>;  say (@a X @b X @c).perl;
17:25 ajs first element off the first teed iterator should be the same as the first element off the second teed iterator, even if the base iterator from which they were constructed is non-reentrant (e.g. destroys its input)
17:26 p6eval rakudo 27d54d: OUTPUT«No applicable candidates found to dispatch to for 'infix:<X>'. Available candidates are:␤:(Any $lhs, Any $rhs)␤␤  in main program body at line 22:/tmp/tpMYeKyWWj␤»
17:26 colomon pmichaud: @list1 X @list2 X @list3 is NYI in rakudo, right?
17:26 pmichaud grrrr
17:26 pmichaud in ng, it's NYI
17:26 pmichaud it worked in alpha
17:26 pmichaud alpha:  my @a = <a b c>;  my @b = <1 2 3>;  my @c = <x y z>;  say (@a X @b X @c).perl;
17:26 p6eval alpha 30e0ed: OUTPUT«["a", "1", "x", "a", "1", "y", "a", "1", "z", "a", "2", "x", "a", "2", "y", "a", "2", "z", "a", "3", "x", "a", "3", "y", "a", "3", "z", "b", "1", "x", "b", "1", "y", "b", "1", "z", "b", "2", "x", "b", "2", "y", "b", "2", "z", "b", "3", "x", "b", "3", "y", "b", "3", "z", "c",
17:26 p6eval .."1", "…
17:26 ash_ did that flatten?
17:26 pmichaud alpha incorrectly flattened, yes.
17:27 ash_ okay, but it did the @a X @b X @c correctly
17:27 pmichaud florz: anyway, X is defined to work on >2 lists
17:27 pmichaud it's just failing in rakudo at the moment
17:27 patspam joined #perl6
17:28 colomon pmichaud: my @iters = (for 1..10 { @list.iterator.list }); doesn't seem to actually work.
17:28 colomon infinite loop.
17:28 tylercurtis rakudo: my @a = <a b c>; my @b = 1, 2, 3; my @c = <x y z>; say ((@a X @b) X @c).perl
17:28 p6eval rakudo 27d54d: OUTPUT«(("a", "x"), ("a", "y"), ("a", "z"), (1, "x"), (1, "y"), (1, "z"), ("a", "x"), ("a", "y"), ("a", "z"), (2, "x"), (2, "y"), (2, "z"), ("a", "x"), ("a", "y"), ("a", "z"), (3, "x"), (3, "y"), (3, "z"), ("b", "x"), ("b", "y"), ("b", "z"), (1, "x"), (1, "y"), (1, "z"), ("b", "x"),
17:28 p6eval ..("b",…
17:28 pmichaud colomon: it's likely flattening
17:28 tylercurtis Ah, right.
17:28 ash_ tylercurtis: that should have 3 elements in each not two
17:29 ash_ alpha: my @a = <a b>; my @b = <z x>; my @c = <1 2>; say all(@a X @b X @c) cmp all(@c X @a X @b)
17:29 p6eval alpha 30e0ed: OUTPUT«all(all(Order::Decrease, Order::Same, Order::Increase), all(Order::Decrease, Order::Same), all(Order::Same, Order::Increase), all(Order::Decrease, Order::Increase, Order::Same), all(Order::Decrease, Order::Increase, Order::Same), all(Order::Decrease, Order::Increase,
17:29 p6eval ..Order::Same))␤»
17:29 ash_ that... must not be what i meant
17:29 pmichaud ajs:  perhaps
17:29 pmichaud (testing)
17:29 tylercurtis rakudo: my @a = <a b c>; my @b = 1, 2, 3; my @c = <x y z>; say ((@a X @b) <<X>> @c).perl
17:29 p6eval rakudo 27d54d: OUTPUT«===SORRY!===␤Unsupported use of >> to do right shift; in Perl 6 please use +> or ~> at line 22, near "@c).perl"␤»
17:29 pmichaud rakudo:  my $list = $*IN.lines;  say $list[0];  say $list[3];
17:29 p6eval rakudo 27d54d: OUTPUT«Land der Berge, Land am Strome,␤Heimat bist du großer Söhne,␤»
17:30 florz pmichaud: thx - at least a learned a bit while trying to figure out why everything I tried didn't quite work ;-)
17:30 pmichaud rakudo:  my $list = $*IN.lines;  say $list[0];  say $list[3]; say $list[0]
17:30 p6eval rakudo 27d54d: OUTPUT«Land der Berge, Land am Strome,␤Heimat bist du großer Söhne,␤Land der Berge, Land am Strome,␤»
17:30 ash_ alpha: my @a = <a b>; my @b = <z x>; my @c = <1 2>; say all(@a X @b X @c) ~~ all(@c X @a X @b)
17:30 p6eval alpha 30e0ed: OUTPUT«all(Bool::False)␤»
17:30 moritz_ rakudo: multi sub infix:<X>(\$a) { }; 1, 2 X 3, 4 X 5, 6
17:30 p6eval rakudo 27d54d: OUTPUT«No applicable candidates found to dispatch to for 'infix:<X>'. Available candidates are:␤:(Any \|$a)␤:(Any $lhs, Any $rhs)␤␤  in main program body at line 22:/tmp/f8UwpR6v8L␤»
17:30 pmichaud rakudo:  my $list = $*IN.lines;  my $iter1 = $list.iter.list;  my $iter2 = $list.iter.list;  say $iter1[3];  say $iter2[0];
17:30 p6eval rakudo 27d54d: OUTPUT«Method 'iter' not found for invocant of class 'List'␤  in main program body at line 22:/tmp/1qJ1aEVFWH␤»
17:30 moritz_ rakudo: multi sub infix:<X>(|$a) { }; 1, 2 X 3, 4 X 5, 6
17:30 p6eval rakudo 27d54d: OUTPUT«No applicable candidates found to dispatch to for 'infix:<X>'. Available candidates are:␤:(Any |$a)␤:(Any $lhs, Any $rhs)␤␤  in main program body at line 22:/tmp/QK8wvUMpcn␤»
17:31 pmichaud rakudo:  my $list = $*IN.lines;  my $iter1 = $list.iterator.list;  my $iter2 = $list.iterator.list;  say $iter1[3];  say $iter2[0];
17:31 moritz_ why doesn't that dispatch?
17:31 p6eval rakudo 27d54d: OUTPUT«Heimat bist du großer Söhne,␤Land der Berge, Land am Strome,␤»
17:31 ajs Wait... er... does that mean rakudo is memoizing input filehandles? That seems... costly
17:31 moritz_ I thought it took the raw capture
17:31 pmichaud ajs: in this case it's memoizing them
17:31 pmichaud ajs: in the general case it does not
17:32 pmichaud rakudo:  my $list = $*IN.lines;  my @iters = (for 1..10 { $list.iterator.list.item });  say @iters[0][4];  say @iters[5][0];
17:32 p6eval rakudo 27d54d: OUTPUT«Volk, begnadet für das Schöne,␤Land der Berge, Land am Strome,␤»
17:32 pmichaud :-)  works  :-)
17:32 ajs neet
17:33 pmichaud in this case, since I've bound the filehandle input, it will remember the lines read as they're requested
17:33 _jaldhar_ joined #perl6
17:33 pmichaud but the point is that our iterators are immutable, so creating N of them works out okay
17:33 ash_ rakudo: multi sub infix:<X>(*@a) { say @a }; [1, 2] X [3, 4] X [5, 6] # moritz_ is that what you wanted?
17:34 p6eval rakudo 27d54d: OUTPUT«1 23 45 6␤»
17:34 ajs will it save all previous inputs? One of the things python's tee is used for is allowing you to loop over infinitely long input iterators in many child-iterators, saving only the values which have not yet been consumed by any single child iterator. This turns out to be essential for things like Hamming number generation and the like
17:34 moritz_ ash_: no, I want to bind the raw capture
17:34 ash_ ah
17:34 pmichaud ajs: in this case it depends on whether the original list is saving inputs
17:34 ajs ok, well that seems fair.
17:35 pmichaud anyway, we'd probably need to see some use cases
17:35 pmichaud but I think the core pieces exist
17:35 ajs I'll have to do more testing tonight... for now I should go away. thanks all!
17:35 pmichaud in order to write infix:<X> properly we need **@a binding
17:35 pmichaud or we can do it using the raw capture
17:36 pmichaud at the moment infix:<X> in rakudo is written using 2 arguments, which limits it to the binary cases of X
17:36 moritz_ I couldn't get it to work with the raw capture
17:37 jaldhar_ left #perl6
17:37 pmichaud it's a bit trickier there, yes.
17:37 ash_ if you have an infix twice in an expression, does it only dispatch once?
17:38 moritz_ if it's list assoc, yes
17:38 ash_ ah, okay
17:38 ash_ interesting
17:40 pmichaud some operators like infix:<,>   infix:<X>   etc are list associative
17:41 moritz_ S03 knows more :-)
17:42 ash_ i'll look at S03, i just didn't know that about list assoc ops
17:43 pmichaud my $rhs-list = flat($rhs.flat);
17:43 pmichaud that's.... weird
17:43 pmichaud src/core/metaops.pm:20
17:45 rindolf joined #perl6
17:46 proller left #perl6
17:52 snearch left #perl6
17:54 rindolf left #perl6
17:54 ash_ flat($rhs.flat); seems redundant
17:55 moritz_ it's not
17:55 moritz_ (afaict)
17:55 moritz_ flat isn't recursive
17:55 moritz_ hm...
17:56 moritz_ I was thinking of flat($rhs>>.flat)
17:56 alksentrs left #perl6
17:57 tadzik joined #perl6
17:57 ruoso joined #perl6
17:58 ash_ rakudo: my @a = [[1, [2], 3], 4, [[[[5]]]]]; say @a.perl; say flat(@a>>.flat).perl # ah, i see now
17:58 p6eval rakudo 27d54d: OUTPUT«[[[1, [2], 3], 4, [[[[5]]]]]]␤([1, [2], 3], 4, [[[[5]]]])␤»
18:01 ajs left #perl6
18:02 ash_ moritz_: btw, i am using the bug tracker in github for try.rakudo.org, so if you or anyone else see's a bug, feel free to file it there and i'll try to check it
18:02 moritz_ ok
18:03 ash_ also, feature requests can go there if i am not around, or they can go there anyway to keep track of them
18:05 [Coke] SHODAN reminds me I should see if I can get system shock running again.
18:07 mikehh joined #perl6
18:14 colomon pmichaud: presumably given
18:14 colomon my $lhs-list = flat($lhs.list);
18:14 colomon my $rhs-list = flat($rhs.flat);
18:14 colomon there, one of them is a typo?
18:14 pmichaud I think they should both be  .flat
18:14 colomon unless there's some reason I don't understand why they should be different.
18:14 pmichaud and no flat()
18:14 rindolf joined #perl6
18:14 pmichaud oh, wait
18:15 pmichaud both should be .list, and keep flat() I guess.
18:15 pmichaud that's safe for now.
18:15 pmichaud *safer
18:15 pmichaud it won't matter soon anyway, as I'll change the code to generalize for N lists
18:16 colomon btw, just checked, and blame says pmichaud checked in those two lines.  ;)
18:16 colomon you're getting slices up and running soon?  pmichaud++
18:16 pmichaud no, I'm just going to fix the code so that it does the equivalent of slicing
18:17 colomon take a slurpy array of whatever?
18:17 pmichaud no, using a capture
18:17 colomon er, not whatever, that has a precise meaning in p6.  :)
18:18 colomon looking forward to seeing what you come up with for this.
18:19 pmichaud right now I'm trying to track down whatever parrot bug is causing the for loop to fail
18:19 pmichaud that looks pretty serious
18:19 ash_ pmichaud: which for loop?
18:20 pmichaud rakudo:  for 1..200 { $_ }
18:20 p6eval rakudo 27d54d:  ( no output )
18:20 pmichaud rakudo:  say ~(for 1..200 { $_ })
18:20 p6eval rakudo 27d54d: OUTPUT«src/string/api.c:3341: failed assertion 'pos <= res->strstart + Buffer_buflen(res) + 1'␤Backtrace - Obtained 24 stack frames (max trace depth is 32).␤/home/p6eval//p1/lib/libparrot.so.2.7.0 [0x2ad5c9baa1a3]␤/home/p6eval//p1/lib/l​ibparrot.so.2.7.0(Parrot_confess+0x87)
18:20 p6eval ..[0x2ad5c9baa2d…
18:20 pmichaud that one.
18:21 ash_ odd, i get something different when i do that
18:21 pmichaud the only correct answer is the values 1 through 200 separated by spaces (and a newline at the end)
18:21 pmichaud star:  say ~(for 1..200 { $_ })
18:22 p6eval star 2010.07: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
18:22 p6eval ..97 …
18:22 pmichaud ...2010.07 ?
18:22 ash_ http://gist.github.com/562663 is what i get...
18:22 PerlJam pmichaud: I get the correct answer on the rakudo I built yesterday. SHA1 dc9900803a0956dbf634114835fff4c8ad71d7d5
18:22 PerlJam (At least in the REPL)
18:23 ash_ i don't know why $!llsig is in there 51 times though
18:23 pmichaud PerlJam: try
18:23 pmichaud > for 1..200 { $_ }
18:23 pmichaud (in the repl
18:23 pmichaud )
18:23 moritz_ twice
18:24 PerlJam hrm.
18:24 ash_ http://gist.github.com/562663 updated gist, wow, that is a weird bug
18:24 perlygatekeeper left #perl6
18:24 ash_ one time it prints "self" 51-ish times, next it prints "scalar" 51-ish times
18:25 ash_ err, not 51, but a bunch
18:25 pmichaud PerlJam: did it fail for you this time?
18:26 pmichaud (in the repl?)
18:26 PerlJam http://gist.github.com/562672
18:26 * TimToady is back from power outrage
18:26 pmichaud PerlJam: hmmm.
18:26 pmichaud PerlJam: also interesting is   > for 1..1000 { $_ }
18:26 rindolf TimToady: outrage!
18:26 rindolf TimToady: hi.
18:27 moritz_ welcome back TimToady
18:27 * pmichaud sends TimToady on a power trip.  :-)
18:27 PerlJam pmichaud: that one dies horribly
18:27 TimToady I always read "outage" as "outrage" anyway, so I figured I'd just go with it.
18:27 ash_ running it a bunch, i haven't seen any seg faults (built rakudo from master yesterday) but i am getting strange output
18:28 ash_ i am on OS X, if that makes a difference
18:28 colomon TimToady++
18:28 risou_ joined #perl6
18:29 pmichaud my desktop machine feels much slower than I think it ought to be.  anyone have any suggestions for performance analysis tools?
18:29 pmichaud (linux preferred, but I could install that microsoft "os" if I needed to)
18:31 risou left #perl6
18:31 rindolf pmichaud: well,  there's LM-Bench which I haven't tried.
18:31 ash_ top -o cpu -O time to see whats eating processor time
18:32 TimToady we've seen the trash output bug before
18:32 colomon for 1..1000 { $_ } -- very freaky results on my Mac.
18:32 patspam left #perl6
18:32 rindolf pmichaud: and there's some stuff here too - http://catb.org/jargon/html/B/benchmark.html
18:33 pmichaud rindolf: excellent, thanks.
18:33 pmichaud I just got a new SSD drive in this box that helps a bit... but I still want more power :-)
18:33 rindolf pmichaud: ah.
18:33 pmichaud (trash output bug)  it was new to me.  afaict it works fine in the 2010.08 release, which means it's recent
18:33 ash_ more != enough
18:33 rindolf pmichaud: what are this machine's specs?
18:34 pmichaud it's a dell dimension 9150 (yes, a little old), 2gb ram
18:34 TimToady no, it's from before 2010.08
18:34 TimToady it's just rather configuration dependent
18:34 PerlJam It looks like a problem with building strings in parrot to me.
18:35 pmichaud TimToady: hmm.  It seems far more repeatable now, then.
18:35 colomon pmichaud: woah, all my "serious" desktops have 8gb of ram.
18:35 pmichaud I'm trying it with the star release and can't get it to give me trash output
18:35 pmichaud colomon: I have more memory arriving tomorrow :)
18:35 [Coke] 8GB!?
18:36 * [Coke] is clearly in the wrong line of work.
18:36 [Coke] my netbook has 1gb, my imac only has 3gb. (and that was aftermarket)
18:36 [Coke] <- jealous.
18:36 colomon [Coke]: $work requires all as much memory as possible.  I'm hoping to have 8gb on my laptop next time I get a new one...
18:36 colomon s/all//
18:37 pmichaud TimToady: aha, you're correct.
18:37 TimToady I first reported it with the hailstone series: http://irclog.perlgeek.de/​perl6/2010-08-24#i_2739989
18:37 pmichaud for 1..20000 { $_ }   exhibits the bug in latest star release
18:37 pmichaud something is causing it to show up much sooner now, though.
18:37 ash_ for 1...20000 { $_ } dies for me, seg fault
18:38 sorear hello #perl6
18:38 TimToady also discusses more thoroughly at http://irclog.perlgeek.de/​perl6/2010-08-28#i_2757516
18:38 TimToady *ed
18:44 pmichaud (2gb vs 8gb)  even with only 2gb, my system rarely hits swap.
18:44 * sorear still has the .375gb he had a month ago...
18:44 ash_ but with 8, you can load part of your file system into RAM
18:44 lichtkind joined #perl6
18:44 ash_ for even faster access (so it won't have to touch a disk at all)
18:45 TimToady well, the disk cache is supposed to do that anyway
18:45 pmichaud disk cache does that already
18:45 pmichaud and I guarantee the ssd is pretty fast :)
18:45 ash_ as fast as ram?
18:45 ash_ ah, well ssd
18:45 ash_ nm then
18:46 pmichaud sorear: I'll send you the dimms I'm replacing, if they'd fit :-)
18:46 ash_ when they come down in price, i'd love to buy one, just can't afford it on my meager GRA pay
18:47 colomon pmichaud: try loading four 1gb long CAD files into memory at once.  :)
18:48 masak joined #perl6
18:48 masak ahoy, #perl6!
18:48 phenny masak: 14:55Z <smash> tell masak check the new colors on http://gil.di.uminho.pt/use​rs/smash/rakudo-bench.html better to read now i guess
18:48 TimToady yoha!
18:49 sorear ahello masak!
18:49 masak smash: I like it a lot. smash++
18:54 TimToady Util: the http://rosettacode.org/wiki/Anagrams#Perl_6 uses uri(), which doesn't seem to exist.  How're you running it?
19:01 ash_ rakudo: say uri
19:01 p6eval rakudo 27d54d: OUTPUT«Could not find sub &uri␤  in main program body at line 22:/tmp/baSKIE8ya7␤»
19:07 x3nU left #perl6
19:07 justatheory left #perl6
19:08 x3nU joined #perl6
19:13 cbk joined #perl6
19:19 moritz_ http://rosettacode.org/wik​i/Hamming_numbers#Haskell
19:19 [particle] left #perl6
19:19 moritz_ I've implemented the merge part
19:20 moritz_ but the straight-forward haskell translation doesn't work yet :(
19:20 moritz_ returns (1, Any xx *)
19:22 [particle] joined #perl6
19:23 TimToady I already have a hamming entry
19:23 moritz_ that page doesn't show one
19:24 TimToady I didn't install it 'cus it was breaking rakudo
19:24 TimToady it's at http://wall.org/~larry/hamming
19:24 masak there's an RT ticket about it.
19:25 TimToady yes, because *@tail apparently won't bind to a non-reified part of the list
19:25 masak http://rt.perl.org/rt3/Tic​ket/Display.html?id=77474
19:25 rindolf Bug with Rakudo: /usr/bin/perl5.10.1 t/harness --help does not display anything helpful.
19:26 rindolf Neither does t/harness -h
19:28 masak rindolf: feel free to submit.
19:28 moritz_ rindolf: you're supposed to call 'make test' or 'make spectest' or so, which the README documents
19:28 rindolf PackFile_unpack: This Parrot cannot read bytecode files with version 8.2.
19:28 rindolf moritz_: that's what I did, but the tests fail.
19:28 rindolf masak: I will thanks.
19:28 rindolf Let's fork on github.
19:28 moritz_ rindolf: that means you have an old parrot lying arround
19:28 moritz_ which you have to remove first
19:28 masak rindolf: that's... what moritz_++ said.
19:28 rindolf moritz_: ah.
19:28 rindolf moritz_: I've already did perl Configure.pl --gen-parrot
19:28 moritz_ rindolf: try rm -rf parrot parrot_install   first
19:28 [Coke] rindolf: are you working out of a git checkout of rakudo?
19:28 patspam joined #perl6
19:28 moritz_ rindolf: and if you have no previous files in your rakudo dir,  git clean -xdf
19:28 rindolf which: no parrot in (/home/shlomif/apps/test/quadpres/bin/:/home/s​hlomif/apps/vim/bin:/home/shlomif/apps/git/bin
19:28 moritz_ s/previous/precious/
19:28 [Coke] (what moritz said).
19:28 rindolf [Coke]: yes, I am.
19:28 moritz_ rindolf: not just parrot, but also .pbc files built from previous parrot versions
19:29 [Coke] so it's the parrot & parrot_install dirs in your rakudo checkout.
19:29 timbunce left #perl6
19:35 TimToady moritz_: if you want something similar but more challenging, try http://rosettacode.org/wiki/​Formal_power_series#Haskell
19:35 justatheory joined #perl6
19:36 TimToady or http://rosettacode.org/wiki/Pattern_matching, but you might have to fight smash++ for it
19:37 TimToady the formal power series might run into the same problem as hamming, though
19:39 masak probably.
19:39 mantovani left #perl6
19:39 * TimToady hopes it is not intrisically related to the distinction Perl 6 makes between lazy lists and eager scalars.
19:39 TimToady *trin
19:42 TimToady binding to a non-reified element feels a lot like autoviv though
19:46 TimToady hamming is the first place that the non-list-associativity of X* bit me
19:46 nimiezko joined #perl6
19:46 hillu joined #perl6
19:46 Juerd_ joined #perl6
19:46 cls_bsd_ joined #perl6
19:46 Cyrus__ joined #perl6
19:46 TimToady course, the merge isn't written to be 3-way anyway
19:46 jedai_ joined #perl6
19:46 diakopte1 joined #perl6
19:47 Cyrus left #perl6
19:47 Juerd left #perl6
19:47 hillu_ left #perl6
19:47 diakopter left #perl6
19:47 cls_bsd left #perl6
19:47 jedai left #perl6
19:47 Juerd_ is now known as Juerd
19:47 Quadrescence left #perl6
19:47 Sarten-X left #perl6
19:52 molaf left #perl6
19:55 mantovani joined #perl6
19:55 thepler joined #perl6
19:57 ash_ left #perl6
19:57 Italian_Plumber left #perl6
19:58 SHODAN left #perl6
20:00 Quadrescence joined #perl6
20:00 skyheights joined #perl6
20:01 skyheights left #perl6
20:09 pyrimidine left #perl6
20:10 justatheory left #perl6
20:11 TimToady std: sub sideffect (--> Nil) {...}
20:11 p6eval std 32123: OUTPUT«ok 00:01 116m␤»
20:12 tadzik left #perl6
20:12 TimToady that should be sufficient to put the final statement into sink context
20:12 TimToady and eagerize any for loop
20:13 TimToady early enough to be optimized
20:14 TimToady and I don't buy the temp vs lazy list argument
20:15 TimToady temps on lexicals should be implemented more like dynvars anyway, so the correct temporary gets bound into any closure
20:15 rindolf moritz_: OK, pull from http://github.com/shlomif/rakudo
20:15 Italian_Plumber joined #perl6
20:16 masak 'temp vs lazy list argument' -- url?
20:16 TimToady http://irclog.perlgeek.de/​perl6/2010-09-02#i_2775221
20:17 masak thanks
20:19 masak printing Any() in that case feels Wrong on a visceral level, yes.
20:19 masak but that's before any actual arguments from data model kick in -- so I'm glad there is one :)
20:19 nimiezko Is there any way to perform a deep copy of an object ?
20:19 nimiezko rakudo: my %q = (1=>[1..5]) ; my %w = %q ; %w{1}[2]++ ; say %q.perl ;
20:20 p6eval rakudo 27d54d: OUTPUT«{"1" => [1, 2, 4, 4, 5]}␤»
20:21 masak nimiezko: it's a Difficult Problem to provide deep copying in the language itself, due to the very diverse demands on cloning of objects of different types.
20:21 masak nimiezko: in other words, you might be best off writing your own custom recursive-multis solution.
20:22 masak in the above case, you need one multi for arrays and one for hashes.
20:22 * masak tries writing one
20:22 dual joined #perl6
20:23 TimToady there's always eval($x.perl)
20:23 TimToady or any other serializer/deserializer
20:24 justatheory joined #perl6
20:24 TimToady if we had access to the decontainerizer used by eqv, that'd also be helpful, maybe
20:25 TimToady rakudo: my %q = (1=>[1..5]) ; my %w := eval(%q.perl); %w{1}[2]++ ; say %q.perl ;
20:25 p6eval rakudo 27d54d: OUTPUT«{"1" => [1, 2, 3, 4, 5]}␤»
20:26 * TimToady tries not to notice the fact that eval works in a bot
20:27 sorear eh?
20:27 sorear the bot IS eval
20:27 nimiezko recursive REPL
20:27 masak rakudo: run("ls")
20:27 rindolf Can someone pull the t/harness --help display from http://github.com/shlomif/rakudo ?
20:27 p6eval rakudo 27d54d: OUTPUT«Operation not permitted in safe mode␤  in 'Safe::forbidden' at line 2:/tmp/MQzRYSC6XH␤  in main program body at line 22:/tmp/MQzRYSC6XH␤»
20:28 sorear rakudo: eval 'run("ls")'
20:28 masak rakudo: eval q[ run("ls") ]
20:28 p6eval rakudo 27d54d:  ( no output )
20:28 p6eval rakudo 27d54d:  ( no output )
20:28 masak hm.
20:28 pmichaud rindolf: submit a patch or a pull request, perhaps?
20:28 sorear eval hides errors, remember?
20:28 moritz_ rakudo: eval 'run("ls")'; print $!
20:28 sorear because it means try eval
20:28 p6eval rakudo 27d54d: OUTPUT«Operation not permitted in safe mode»
20:28 sorear a disgusting p5ism
20:29 rindolf pmichaud: OK, I'll issue a pull request.
20:29 * moritz_ agrees
20:29 rindolf pmichaud: the changeset is there in the repo.
20:29 pmichaud rindolf: you'll likely get a message saying "we don't take pull requests"... but this is a good chance for me to look at github's new 2.0 pull request system
20:29 moritz_ Pod::Usage is core module since 5.6... no concerns here
20:30 masak I don't think I'd mind getting rid of the disgusting p5ism. I just don't have a strong opinion about it.
20:31 macroron left #perl6
20:31 rindolf pmichaud: http://github.com/rakudo/rakudo/pull/2
20:32 pmichaud oh, drat
20:32 macroron joined #perl6
20:32 sorear rakudo: my $*FORBID_PIR; eval 'say pir::spawnw__is("ls")'
20:32 p6eval rakudo 27d54d: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤dynext␤LI​CENSE␤Makefile␤parrot␤perl6␤perl6.c␤perl6_group.​c␤perl6_group.h␤perl6_group.o␤perl6.o␤perl6.pbc␤​README␤src␤t␤Test.pir␤Test.pm␤tools␤VERSION␤0␤»
20:32 pmichaud it's far too easy to accidentally hit "apply" instead of "ignore" in the web-based interface.  :-(
20:33 * moritz_ curses
20:33 * masak .oO( I accidentally the patch? )
20:33 masak good thing git is good at reverting.
20:33 pmichaud the problem with "for 1..20000 { $_ }"  goes back through at least star-2010.07
20:37 cognominal rakudo:   my $a=[];  say @$a
20:38 p6eval rakudo 27d54d: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "@$a"␤»
20:38 pmichaud rindolf: applied, thanks.
20:38 rindolf pmichaud: thanks and yw.
20:38 kjeldahl left #perl6
20:38 cognominal is there a bug report for this parsing bug?  I hate clipped nails as a workaround
20:39 Mowah left #perl6
20:39 macroron left #perl6
20:40 sorear it looks like for @array { last } is an O(N) operation in Rakudo
20:40 pmichaud ...that's odd, it shouldn't be.
20:40 masak cognominal: dunno if there's a bug report. it's been unimplemented for quite some time now :)
20:41 sorear if @array has a million reified elements, ListIter will return a million values at once, oblivious to how many will actually be consumed
20:41 pmichaud it doesn't really return a million values
20:41 sorear ?
20:42 pmichaud it does end up with a new RPA with a million elements, yes.
20:42 cognominal right now, I am trying to write a patch to add signatures to curried subs.
20:42 pmichaud but that million elements is really just references to the containers in @array
20:43 dalek rakudo: 3b2529b | shlomif++ | t/harness:
20:43 dalek rakudo: Add a --help/-h flag to t/harness.
20:43 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3​b2529b42c66bff63ea0b1671df4702ab651ac70
20:43 dalek rakudo: a0e9d2f | kyleha++ | t/harness:
20:43 dalek rakudo: [t/harness] spelling fix
20:43 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/a​0e9d2f76c5b4f044d0633e8ad1cc08fb00a1852
20:43 pmichaud i.e., it doesn't create new PMCs (at least, it shouldn't)
20:46 patspam left #perl6
20:46 patspam joined #perl6
20:48 bacek joined #perl6
20:49 aloha joined #perl6
20:51 aloha left #perl6
20:51 masak rakudo: my $s = Set.new(1..5); say $s{5}; say $s<5> # one has to be careful with Set indexing, since they (currently) do not coerce keys to Str by default
20:51 p6eval rakudo 27d54d: OUTPUT«1␤0␤»
20:52 pmichaud masak: ooc, why did you implement postcircumfix:<{ }>  instead of overloading at_key() ?
20:52 pmichaud or is it that slicing operations are different for sets than hashes?
20:52 masak because I'm slightly unfamiliar with the state of the art.
20:53 masak no.
20:53 masak I can change the patch to use at_key()
20:53 pmichaud that might be better-ish.
20:53 masak is there a similar underlying method for postcircumfix:<[ ]> ?
20:53 pmichaud at_pos()
20:53 masak ok.
20:53 * masak fixes
20:57 sorear pmichaud: so the cost of a sizeof(PMC*) * 1000000 block copy is ignorable for Rakudo's current purposes, you say?
20:58 pmichaud sorear: I'm not saying that necessarily, no.  :)
20:59 pmichaud I haven't looked at it from that perspective.  But it should be the case that it's not like it's creating 1000000 new PMCs, either.  :-)
20:59 pmichaud I can re-evaluate ListIter sometime.  At the time, I was just trying to get something/anything that could possibly work.
21:02 javs left #perl6
21:02 florz pmichaud: BTW, regularly the announcements on http://www.rakudo.org/ contain hard linebreaks which makes reading them in my browser somewhat unpleasent ...
21:03 pmichaud florz: yes, I'm growing to dislike drupal a lot.
21:03 Ross left #perl6
21:03 florz IC =:-)
21:04 lue hello o/
21:05 colomon \o
21:05 pmichaud I'm open to suggestions for an alternate cms.
21:06 mikehh left #perl6
21:06 dalek rakudo: 870efdb | masak++ | src/core/Set.pm:
21:06 dalek rakudo: [Set] replaced postcircumfix:<{ }> with at_key
21:06 dalek rakudo:
21:06 dalek rakudo: Suggested by pmichaud++.
21:06 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8​70efdbb4185344de3637e3456a641a09f649cd4
21:06 Mowah joined #perl6
21:08 pmichaud well, the for() problem exists as far back as 2010.06 -- 2010.05 doesn't seem to have the problem.
21:09 pmichaud So, it's either something related to lists/iterators, or a parrot change, or a dispatcher change, or something that changed in May/June
21:09 pmichaud this does not feel like a fun one to track down.  :|
21:10 PerlJam pmichaud: you built 2010.06 with a modern parrot or a contemporary parrot?
21:10 pmichaud 2010.06 with contemporary parrot
21:10 pmichaud part of the problem is that one cannot always move far away from contemporary parrots
21:10 ruoso left #perl6
21:10 pmichaud I'd be surprised if 2010.06 built with current parrot.
21:10 florz pmichaud: vi, wml and git? ;-) I don't have a clue of CMSes either ...
21:12 whiteknight joined #perl6
21:13 * sorear wonders how mowyw fares
21:13 sorear crazy idea: persistant lists in Perl 6
21:14 sorear with O(1) "copying" and O(log n) shift() I can make for some nice iterators
21:15 pmichaud ...O(log n) shift?  do tell :)
21:15 Guest22756 left #perl6
21:17 sorear pmichaud: elements stored in a trie, so all read/writes are log time; probably using the old two-pointer-deque trick to do shift
21:17 masak sorear++ # rocks
21:17 pmichaud sounds interesting
21:17 sorear if I wanted to get really fancy I could use finger trees for O(log n) splice() and catenation
21:17 sorear but that would probably hurt the other constant factors too much
21:18 TimToady see red/black trees in http://rosettacode.org/wiki/Pattern_matching
21:23 rindolf left #perl6
21:29 risou joined #perl6
21:29 Mowah left #perl6
21:30 sahadev left #perl6
21:31 sorear I wonder how list assignment would work in a persistant environment
21:32 masak by 'persistant', do you mean 'persistent'?
21:32 sorear currently list assignment is thought of as turning the RHS into iterators then using it to fill the list
21:32 sorear sure
21:32 masak ok.
21:32 sorear an O(n) operation that makes fine sense currently
21:33 risou_ left #perl6
21:33 sorear but it doesn't make so much sense in an environemtn where O(log n) catenation is possible
21:33 cbk left #perl6
21:33 sorear how can I define = and , to make @a = @b , @c exploit the full asymptotic performance of the primitives?
21:33 wamba left #perl6
21:34 masak unproportianally many solutions on Rosetta Code seem to be translations of Haskell solutions :) wonder why.
21:35 masak sorear: I only have a very-very thin grasp of your question, but it would seem to me that infix:<,> could be made lazy in this case.
21:35 masak sorear: that is, there's some structure representing the concatenation of @b and @c that gets triggered when @b runs out.
21:36 dalek rakudo: 33e94e7 | masak++ | src/core/Set.pm:
21:36 dalek rakudo: [Set] implemented .hash
21:36 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3​3e94e7f86ed5101f97bd4056b141eb2180fb6fd
21:41 patspam left #perl6
21:44 sorear nah, eager
21:44 masak or that. should work anyway.
21:45 sorear I want to define , and = such that @a = @b , @c works in O(log n) time
21:45 masak the idea is that for all purposes, the structure represnting the concat is invisible. I guess that leads to a tree structure of some sort.
21:45 sorear I already have the technology to make @a := concat(@b, @c) that fast
21:46 sorear masak: you're going the wrong way.  I have technology far better than invisible concats
21:46 sorear I just need to *expose it to Perl*
21:46 masak ok :)
21:47 Holy_Cow left #perl6
21:50 masak sorear: have you seen http://portal.acm.org/citati​on.cfm?doid=1596550.1596551 ?
21:50 EvanCarroll joined #perl6
21:50 diakopte1 masak: would you like a copy of that? I can get it if you'd like.
21:51 masak a copy of what? the pdf?
21:51 diakopte1 yes
21:51 masak I've read it twice, I think. :)
21:51 masak so no pressing need. but thanks.
21:51 diakopte1 the abstract?
21:51 masak no, the slides.
21:51 masak I just found the video, so I will probably watch that over lunch.
21:52 diakopte1 oh
21:52 diakopte1 ok
21:52 Tene There was a paper a while back about how lisp was doing it all wrong for concurrency, and that lists should be trees isntead of chained cons cells.  I don't quite remember who wrote it, but one of the other big names in PL design, I think.
21:52 masak Tene: might be the one we're just talking about.
21:52 masak sounds very similar.
21:53 masak the author is GLS, indeed a very big name.
21:53 Tene Um.  Yes.  Yes it is exactly the same paper I was thinking of.
21:53 Tene masak++
21:53 sorear masak: no, but the concepts in the abstract are not unfamiliar to me
21:53 diakopte1 well in general if you need any fulltext academic publications (this appears to be one of the ones [minority, seems to me] that's publicly available) I can get them for you.
21:53 aloha joined #perl6
21:53 masak Tene: by the way -- hi -- ihrd wrote an interesting email to us. I'll think some more and then try to write a good reply.
21:53 sorear masak: O(log N) list techology - http://www.soi.city.ac.uk/~​ross/papers/FingerTree.pdf
21:54 Tene masak: It sounds similar to my concerns about claiming we're done when it runs on alpha and not recent releases.
21:54 masak diakopte1: thanks. I'll remember that.
21:54 masak diakopte1: I already have relatively good access, being at the university and all.
21:55 aloha left #perl6
21:55 aloha joined #perl6
21:55 masak Tene: I respect the objection about alpha. and I agree that we'll want to upgrade to Rakudo master as soon as possible. my decision about that is based on not wasting extra time shaving yaks within the scope of the grant.
21:56 bacek ~~
21:56 masak and believe me, upgrading code to master is time-consuming. :/
21:56 Tene masak: It's only a question, as far as I'm concerned.  It doesn't get to be an objection unless I'm willing to actually fix it.
21:56 masak though a test suite and a clear head help a lot.
21:56 bacek aloha, seen masak
21:56 aloha bacek: masak was last seen in #perl6 0 seconds ago saying "though a test suite and a clear head help a lot.".
21:57 bacek sorear, aloha is here now
21:57 masak Tene: I'm willing to actually fix it, soon as we finish the grant.
21:57 sorear seen Tene
21:57 aloha Tene was last seen in #perl6 56 seconds ago saying "masak: It's only a question, as far as I'm concerned.  It doesn't get to be an objection unless I'm willing to actually fix it.".
21:57 sorear bacek++ awesome
21:57 masak bacek++
21:57 Tene aloha: seen aloha
21:57 aloha Tene: aloha was last seen in #perl6 2 mins 3 seconds ago joining the channel.
21:58 Tene aloha: lies!
21:58 masak :)
21:58 sorear seen dukeleto
21:58 aloha Sorry, I haven't seen dukeleto.
21:58 masak bacek: what does aloha trigger on, besides 'seen'?
21:58 Tene aloha: owner?
21:58 aloha Tene: Sorry, I don't know.
21:58 tylercurtis karma masak
21:58 aloha masak has karma of 0.
21:58 Tene aloha: aloha?
21:58 aloha Tene: I give up.
21:58 tylercurtis karma bacek
21:58 aloha bacek has karma of 2.
21:59 masak masak++ # gotta test
21:59 masak aloha: karma masak
21:59 aloha masak: masak has karma of 0.
21:59 masak :)
22:01 pmichaud okay, the problem with the for() loop giving wrong output is undoubtedly related to the join.
22:02 TiMBuS left #perl6
22:05 TiMBuS joined #perl6
22:05 sorear Can @array = @array[0..499_999, 500_000..999_999] be made as efficient as @array := @array.subrange(0, 500_000).append(@array.subrange(500_000, 500_000))?
22:07 mfollett left #perl6
22:08 bacek masak, it's just Bot::BasicBot::Pluggable.
22:09 masak ok.
22:09 sorear bacek: why do you get karma and masak doesn't?
22:10 sorear or is it because he karmaed himself
22:10 masak it is.
22:10 lue new karmabot ?
22:10 sorear lue: incidentally
22:10 masak I think its chief claim to fame is as the new seenbot.
22:11 sorear lue: bacek++ is working on a less spammy purl replacement for #parrot; I saw the seen function and invited it here
22:13 pmichaud less spammy purl replacement +1 sorear++ bacek++
22:13 tylercurtis left #perl6
22:17 pmichaud *sigh*  pir::trace causes segfaults
22:17 * pmichaud cries
22:18 masak hugme: hug pmichaud
22:18 * hugme hugs pmichaud
22:18 au|irc left #perl6
22:20 pmichaud http://gist.github.com/563074   # trace produces segfault -- code runs fine if "trace 1" is commented out.  :-(
22:22 masak confirmed.
22:23 aloha left #perl6
22:23 pmichaud yay, I golfed it!
22:24 aloha joined #perl6
22:24 sorear aloha: karma sorear
22:24 aloha sorear: sorear has karma of 0.
22:24 sorear aloha: karma bacek
22:24 aloha sorear: bacek has karma of 0.
22:25 pmichaud http://gist.github.com/563082  # segfault in pir's join
22:25 sorear bacek: no persistent database?
22:25 bacek sorear, I just recreated it few minutes ago
22:25 bacek aloha, now share DB between #parrot and #perl
22:27 meppel joined #perl6
22:27 bacek explain sorear
22:27 aloha positive: just for fun (bacek); negative: nothing; overall: 1.
22:27 bacek done and dusted
22:27 sorear buubot: karma sorear
22:27 buubot sorear: sorear has karma of 880
22:28 sorear bacek: won't that get a bit... long?
22:28 meppl left #perl6
22:29 bacek sorear, ?
22:30 risou_ joined #perl6
22:30 rgrau` joined #perl6
22:31 Tene sorear++ # foo
22:31 Tene explain sorear
22:31 aloha positive: for another reason (nwellnhof), foo (Tene), just for fun (bacek); negative: nothing; overall: 3.
22:31 Tene bacek: won't the output of 'explain' get absurdly long after a while?
22:31 masak sorear++ # so basically, I can write anything I want here, and it'll show up in 'explain'?
22:32 masak explain sorear
22:32 aloha positive: so basically, I can write anything I want here, and it'll show up in 'explain'? (masak), for another reason (nwellnhof), foo (Tene); negative: nothing; overall: 4.
22:32 lue would making /<A::B>/ work be considered LHF?
22:32 risou left #perl6
22:32 bacek Tene, it's limited to 3 comments
22:32 bacek last 3 :)
22:32 Tene Ahh.
22:32 masak bacek++
22:33 Tene sorear++ # http://www.youtube.com/watch?v=_RyodnisVvU
22:33 Tene Actually unrelated to sorear, just being silly.
22:33 masak :)
22:33 masak Tene++ # silly
22:35 Tene Oh, one other comment to the radix discussion on the ML... "base" likely is a poor choice for that.
22:35 alester left #perl6
22:35 Tene as it would cause confusion with p5 "use base"
22:35 Tene At least do something more like "use radix" :P
22:35 lue what is 'use base' in P5?
22:36 masak Tene: that is a cute robot!
22:36 Tene { use base qw/Foo Bar/; } roughly equals: { BEGIN { require Foo; require Bar; push @ISA, qw/Foo Bar/; }
22:37 Tene masak: my favorite is still: http://www.youtube.com/watch?v=ejROvUC-gWU
22:38 lue .oO([in response to P5 use base] that seems a bit useless)
22:38 Tene I was very entertained by "difficult to film, as it likes drumming on the camera"
22:39 Tene lue: because it only saves a few lines?
22:39 Tene Declarative syntax still has value, even if the alternative isn't very long, IMO.
22:41 masak wow. robots. they'll be mainstream soon.
22:43 lue making the regex /<A::B>/ work in rakudo wouldn't be too terribly difficult, would it?
22:45 masak lue: it'd be a patch to nqp-rx. that in itself doesn't mean it'd be difficult, though.
22:47 lue does parrot pull the latest copy of nqp-rx when it compiles [like rakudo does with parrot] ?
22:48 Tene lue: no
22:49 Tene lue: parrot gets occasional manual imports of nqp-rx
22:51 lue Hm. Which would mean (if I have this right) that it would take longer for me to get the fix. I'm not even sure how I would test it to make sure it works in the first place.
22:51 meppel is now known as meppl
22:52 Tene lue: you can compile nqp from the nqp-rx repo just fine.  It makes an nqp binary.
22:52 Tene then just run ./nqp foo.pl
22:53 lichtkind it is important to stop with the top rule in a grammar definition?
22:54 Tene lichtkind: I'm sorry, but I don't follow.  What do you mean by stop?
22:55 lichtkind i mean last line in a grammar is in example i see the top rule
22:55 lichtkind has it be that way?
22:55 sorear How badly would I break Perl 6 if I made "array" and "hash" indexing O(log n) ?
22:57 sorear lichtkind: order of rules in a grammar is irrelevant except for protoregex tiebreaking
22:58 * sorear is running a big thought experiment on immutable arrays to go with immutable iterators...
22:58 sorear (except, they'd actually be trees)
22:58 masak nom &
22:58 masak left #perl6
22:59 lichtkind sorear: thnk you
22:59 _jaldhar_ left #perl6
23:00 skangas left #perl6
23:00 _jaldhar_ joined #perl6
23:02 nimiezko left #perl6
23:03 envi^home joined #perl6
23:04 _jaldhar_ left #perl6
23:04 _jaldhar_ joined #perl6
23:05 dalek book: 2767aa1 | chromatic++ | src/grammars.pod:
23:05 dalek book: Edited grammars chapter; needs a lot of work.
23:05 dalek book: review: http://github.com/perl6/book/commit/27​67aa116a7d61261b96e4213e29c2f9d2ce391a
23:12 rgrau` left #perl6
23:14 envi^home left #perl6
23:18 cdarroch left #perl6
23:18 masonkramer joined #perl6
23:19 lue does anyone know where character classes (the <> kind) are handled in nqp-rx?
23:19 pmichaud src/Regex/Cursor-builtins.pir
23:20 lue domo arigato, pmichaud
23:23 pmichaud afk, meeting
23:26 sftp left #perl6
23:26 lichtkind sorear: do you also know why rakudo test numbers recently went doen?
23:26 lichtkind down
23:35 lue it seems like <A::B> doesn't even parse in nqp-rx. Is this the case?
23:37 Tene lue: I think so.
23:38 jferrero left #perl6
23:41 smash left #perl6
23:43 masonkramer left #perl6
23:44 jimi_hendrix joined #perl6
23:44 jimi_hendrix what is the current status of perl6?
23:49 PerlJam jimi_hendrix: um ... 42
23:49 PerlJam jimi_hendrix: what do you mean by "status"?
23:49 Tene jimi_hendrix: Perl 6 is useful for many tasks, but insufficient for some tasks.
23:50 Tene I use Perl 6 all the time.  There are some features that are unimplemented, or have bugs.  Performance isn't good enough for some tasks.
23:50 Patterner left #perl6
23:52 Tene http://rakudo.org/announce/rakudo-star/2010.08 includes a list of most of the major missing features in Rakudo.
23:52 Tene Rakudo is currently the most-complete implementation of Perl 6
23:54 jferrero joined #perl6

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

Perl 6 | Reference Documentation | Rakudo