Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-05-21

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:06 ruoso joined #perl6
00:07 quietfanatic rakudo: state $x = 0; say $x
00:07 p6eval rakudo e6863e: OUTPUT«Symbol '$x' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
00:07 quietfanatic state variables not working?
00:11 [particle] do state variables need scope?
00:11 [particle] rakudo: my state $x = 0; say $x
00:11 p6eval rakudo e6863e: OUTPUT«Malformed my at line 11, near "state $x ="␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
00:11 [particle] well, either they're not implemented, or they don't need scoping and they're not implemented :)
00:16 yinyin joined #perl6
00:19 sjohnson rakudo: sub cool { state $n = 0; $n++; say $n; }; cool() for ^5;
00:19 p6eval rakudo e6863e: OUTPUT«Symbol '$n' not predeclared in cool␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
00:20 sjohnson rakudo: sub cool { my state $n = 0; $n++; say $n; }; cool() for ^5;
00:20 p6eval rakudo e6863e: OUTPUT«Malformed my at line 11, near "state $n ="␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
00:20 sjohnson yeah, i have no idea :/
00:23 TimToady state is a scope declarator already
00:27 pugssvn r30733 | lwall++ | [STD] not all expression terminators are valid statement terminators
00:29 sjohnson it is possible... that the online rakudo here, isn't up to snuff with the latest perl6 technologies.
00:29 lue ohai
00:29 sjohnson and by that, i mean... latest rakudo build
00:29 sjohnson i wonder if you can get rakudo to spill the beans as to what build it is
00:31 quietfanatic alpha: state $x = 0; say $x
00:31 p6eval alpha 30e0ed: OUTPUT«0␤»
00:33 lue rakudo: exec('ls ./')
00:33 p6eval rakudo e6863e: OUTPUT«Could not find sub &exec␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
00:33 lue What was it again...
00:37 lue rakudo: run('ls ./')
00:37 p6eval rakudo e6863e: OUTPUT«build␤Configure.pl␤CREDITS␤docs␤dynext␤lib␤LICENSE␤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␤»
00:37 lue rakudo: run ('./perl6 -v')
00:37 p6eval rakudo e6863e: OUTPUT«This compiler is built with the Parrot Compiler Toolkit, parrot revision 46819.␤»
00:37 diakopter grr
00:38 lue sorry.
00:38 bkeeler rakudo: class C does Positional does Associative { }
00:38 p6eval rakudo e6863e: OUTPUT«get_attr_str() not implemented in class 'Sub'␤current instr.: 'perl6;Code;multi' pc 13975 (src/builtins/Num.pir:234)␤»
00:38 bkeeler rakudo: class C does Positional { }
00:38 p6eval rakudo e6863e:  ( no output )
00:39 bkeeler rakudo: class C does Associative { }
00:39 p6eval rakudo e6863e:  ( no output )
00:39 bkeeler rakudo: class C does Associative { }; use MONKEY_TYPING; augment class C does Positional { }
00:39 p6eval rakudo e6863e: OUTPUT«get_attr_str() not implemented in class 'Sub'␤current instr.: 'perl6;Code;multi' pc 13975 (src/builtins/Num.pir:234)␤»
00:40 bkeeler Hmmmmmmm.  Seems impossible for a class to do both Associative and Positional
00:40 lue std: class C does Positional does Associative { }
00:40 p6eval std 30732: OUTPUT«ok 00:01 110m␤»
00:40 TimToady yeah well
00:41 TimToady std: class C does Foo does Bar { }
00:41 p6eval std 30732: OUTPUT«ok 00:01 110m␤»
00:41 lue syntactically correct though. [can't wait for the std interpreter! :)]
00:41 TimToady std: say 1 if 2 if 3 { say 3 }
00:41 p6eval std 30732: OUTPUT«ok 00:01 111m␤»
00:41 TimToady ENOTYET
00:41 quietfanatic Okay, what on earth did I do to get 'Can only transform an Object to p6opaque'?
00:42 TimToady bbl &
00:42 quietfanatic EGOTTAGO
00:46 snarkyboojum std: use MONKEY_TYPING;  my class C does Associative { }; augment class C { }
00:46 p6eval std 30732: OUTPUT«ok 00:01 122m ./lib/MONKEY_TYPING.pm6␤ok 00:01 111m␤»
00:46 snarkyboojum rakudo: use MONKEY_TYPING;  my class C does Associative { }; augment class C { }
00:46 p6eval rakudo e6863e: OUTPUT«Method 'HOW' not found for non-object␤current instr.: 'perl6;C;!class_init_11' pc 490 (EVAL_1:214)␤»
00:46 snarkyboojum rakudo: use MONKEY_TYPING; class C does Associative { }; augment class C { }
00:46 p6eval rakudo e6863e:  ( no output )
00:55 diakopter "Since the four-based genetic code is read in three-letter triplet combinations, the scientists devised a new code in which the 64 possible triplets symbolize the letters of the alphabet and punctuation.
00:55 diakopter Read more: http://www.time.com/time/health/article/0,8599,1990836-2,00.html#ixzz0oWN1y2DO
00:55 diakopter wheh
00:56 diakopter ooo a "new code"
00:56 jaldhar joined #perl6
00:57 rdesfo joined #perl6
00:59 rdesfo hello Diaspora is an open source facebook alternative project written in ruby.  Does any one know it there is a similar perl project?
01:01 diakopter probably not in Perl 6, yet
01:05 lue diakopter: I thought of DNA being a secret code first! :)
01:06 lue The ironic thing this is the D* team love Ruby because, to put it in P6 terms, of its TIMTOWTDI-ness. :)
01:06 diakopter std: say 1 if 2 if 3 { say 3 }
01:06 p6eval std 30733: OUTPUT«[31m===[0mSORRY![31m===[0m␤Missing semicolon at /tmp/9kQNhL52Zn line 1:␤------> [32msay 1 if 2[33m⏏[31m if 3 { say 3 }[0m␤Parse failed␤FAILED 00:01 111m␤»
01:08 diakopter std: say 1 if 2 = 3
01:08 p6eval std 30733: OUTPUT«ok 00:01 111m␤»
01:08 diakopter rakudo: say 1 if 2 = 3
01:08 p6eval rakudo e6863e: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 18058 (src/builtins/Junction.pir:381)␤»
01:08 lue .oO(diakopter: This Time article is talking about _everything_ I've been thinking of, but done by the dark side)
01:10 lue The only difference between me and *Venter* is that I'm trying to make DNA fit Unicode [I know it's crazy, but hey] to find messages in the human genome.
01:11 lue ( That, and I want to throw DNA into the proverbial blender and make a TARDIS :D )
01:11 diakopter lue: I thought you were writing an NES emulator
01:13 lue That, and a sidequest to decode DNA.
01:13 lue I can actually upload a zip file that contains a rudimentary DNA "decoder" (P6 of course), and several "decoded" noncoding DNA sequences.
01:13 lue s/zip/tar.bz2/
01:14 * lue goes and preps the archive, JIC
01:20 lue .oO(I actually could upload this dna-to-binary script as a perl6 example, but it's horribly rudimentary)
01:21 masonkramer joined #perl6
01:26 s1n joined #perl6
01:37 rdesfo left #perl6
01:37 masonkramer joined #perl6
01:38 Exodist_ joined #perl6
01:40 lue I curious as to what the "standard perl library" should be. [one of the TBD specs]
01:40 gbacon joined #perl6
01:45 tylerni7 joined #perl6
01:54 [Coke] joined #perl6
02:09 quester_ joined #perl6
02:11 snarkyboojum let's have a social network of social network sites :P
02:13 lue I think that's actually an eventual goal of D*
02:14 lue although not quite phrased that way by them :)
02:14 snarkyboojum lue: put your decoder on github :)
02:14 lue The fight to stop Venter (again)!
02:15 lue ...from patenting the creation of Life, specifically.
02:15 lue [right now I'm working on euler problems for fun]
02:18 [Coke] joined #perl6
02:19 diakopter I guess I need to set my blog's timezone to new zealand to ensure its place in the planetsix roll is better
02:21 diakopter Fiji will work.
02:22 diakopter weird.
02:22 diakopter it shows the last-edited time of the post
02:22 diakopter oh well.
02:23 lue That's flawed :D
02:23 lue (great advertising for Fiji though :) )
02:26 JimmyZ joined #perl6
02:30 JimmyZ joined #perl6
02:31 agentzh joined #perl6
02:40 quietfanatic joined #perl6
02:44 * sorear ponders making viv output use MooseX::Role::Parameterized
02:46 quietfanatic So, 'Can only transform an Object to p6opaque'...
02:46 quietfanatic does that mean 'only Objects can be transformed to p6opaque'
02:46 quietfanatic or 'Objects can only be transformed to p6opaque'?
02:48 diakopter 'Objects can be transformed only to p6opaque' is slightly more clear, imho
02:49 quietfanatic Actually it seems to mean the latter, examining the source
02:49 quietfanatic *former
02:49 quietfanatic not latter
02:49 diakopter oh
02:49 diakopter 'Can transform only Objects to p6opaque' then
02:49 quietfanatic That only leaves the mystery of why I'm getting this error.
02:50 quietfanatic Somebody's /* Sanity check. */ is doing its job :)
02:53 dalek csmeta: r283 | diakopter++ | trunk/Sprixel/ (4 files):
02:53 dalek csmeta: [perlesque] first try to fix bug(s) exposed by self.t
02:53 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=283
02:54 pugssvn r30734 | coke++ | ignore more *.rakudo files.
02:55 diakopter hrm. didn't work.
03:00 [Coke] perl6: say <a b c d e>.map: * ~ 'A'
03:00 p6eval pugs: OUTPUT«*** Cannot cast from VList [VStr "InfA"] to Pugs.AST.Types.VCode (VCode)␤    at /tmp/H341JnEJpl line 1, column 5 - line 2, column 1␤»
03:00 p6eval ..rakudo e6863e: OUTPUT«No candidates found to invoke␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
03:00 p6eval ..elf 30734: OUTPUT«Use of uninitialized value in subroutine entry at ./elf_h line 197.␤Can't use string ("") as a subroutine ref while "strict refs" in use at ./elf_h line 197.␤ at ./elf_h line 5881␤»
03:04 pugssvn r30735 | svatsan++ | [u4x] use HTML::Template
03:06 [Coke] code in day 22 complains about needing MONKEY_TYPING.
03:11 lue rakudo: say fac(5)
03:11 p6eval rakudo e6863e: OUTPUT«Could not find sub &fac␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
03:11 lue rakudo: say factorial(5)
03:11 p6eval rakudo e6863e: OUTPUT«Could not find sub &factorial␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
03:12 lue grr... Is there a factorial function?
03:12 lue rakudo: say 5!
03:12 p6eval rakudo e6863e: OUTPUT«Confused at line 11, near "say 5!"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
03:12 [Coke] class PieceOfString { has Int $.length; } ; multi sub infix:<+>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length, $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a + $b; say $c.length;
03:12 [Coke] lue: no, but it's easy to write one, here:
03:12 [Coke] multi sub postfix:<!>(Int $n) { [*] 1..$n;
03:12 [Coke] }
03:12 lue Ok.
03:13 lue dankon
03:13 [Coke] see: http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/
03:13 [Coke] rakudo: class PieceOfString { has Int $.length; } ; multi sub infix:<+>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length, $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a + $b; say $c.length;
03:13 p6eval rakudo e6863e: OUTPUT«46␤»
03:14 [Coke] that sample code from day 22 looks wrong. what is the + supposed to be doing there?
03:15 [Coke] it's creating a new POS but is passing a list to :length?
03:15 [Coke] (you end up with a POS of length (4,6)
03:16 quietfanatic It ought to conflict with the type constraint of Int.
03:16 quietfanatic rakudo: class PieceOfString { has Int $.length; } ; multi sub infix:<+>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length, $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a + $b; say $c.length.WHAT;
03:17 p6eval rakudo e6863e: OUTPUT«Seq()␤»
03:17 lue .oO(now to create a combinatronics thingy :) )
03:17 lue .oO(that's what the factorial is for)
03:21 snarkyboojum rakudo: say pir::fact__ii(5)
03:21 snarkyboojum heh
03:21 p6eval rakudo e6863e: OUTPUT«120␤»
03:22 pugssvn r30736 | coke++ | add day 22 spec tests (one fudged, one dodgy, and one spec change?)
03:23 [Coke] that's probably faster (but less portable.)
03:23 snarkyboojum aye :)
03:23 snarkyboojum rakudo: say pir::fact__ii(20)
03:23 p6eval rakudo e6863e: OUTPUT«2432902008176640000␤»
03:28 lue rakudo: multi sub postfix:<!>(Int $n) { [*] 1..$n; }; say 0!
03:28 p6eval rakudo e6863e: OUTPUT«1␤»
03:28 JimmyZ rakudo: Q:PIR{ .loadlib  'obscure_ops' }; say pir::gcd_iii(6,20);
03:28 p6eval rakudo e6863e: OUTPUT«error:imcc:syntax error, unexpected LOADLIB ('.loadlib')␤  in file 'EVAL_1' line 63␤error:imcc:syntax error, unexpected PREG, expecting '(' ('$P45')␤  in file 'EVAL_1' line 68␤syntax error ... somewhere␤current instr.: 'perl6;PCT;HLLCompiler;evalpmc' pc 987
03:28 p6eval ..(compilers/pct/src/PCT/HLL…
03:33 snarkyboojum rakudo: say pir::fact__ii(60)
03:33 p6eval rakudo e6863e: OUTPUT«-8718968878589280256␤»
03:33 snarkyboojum rakudo: multi sub postfix:<!>(Int $n) { [*] 1..$n; }; say 60!
03:33 p6eval rakudo e6863e: OUTPUT«8.32098711274139e+81␤»
03:33 snarkyboojum yay rakudo!
03:33 snarkyboojum boo parrot
03:33 lue .oO(here here!)
03:34 JimmyZ rakudo: say pir::gcd_iii(6,20);
03:34 p6eval rakudo e6863e: OUTPUT«error:imcc:syntax error, unexpected PREG, expecting '(' ('$P45')␤  in file 'EVAL_1' line 22837763␤syntax error ... somewhere␤current instr.: 'perl6;PCT;HLLCompiler;evalpmc' pc 987 (compilers/pct/src/PCT/HLLCompiler.pir:542)␤»
03:34 JimmyZ :(
03:35 snarkyboojum rakudo: say pir::gcd__iii(6, 20)
03:35 p6eval rakudo e6863e: OUTPUT«2␤»
03:36 snarkyboojum rakudo: say pir::gcd__iii(612, 64)
03:36 [mark] joined #perl6
03:36 p6eval rakudo e6863e: OUTPUT«4␤»
03:37 JimmyZ rakudo: say pir::lcm_iii(6, 20);
03:37 p6eval rakudo e6863e: OUTPUT«error:imcc:syntax error, unexpected PREG, expecting '(' ('$P45')␤  in file 'EVAL_1' line 22837763␤syntax error ... somewhere␤current instr.: 'perl6;PCT;HLLCompiler;evalpmc' pc 987 (compilers/pct/src/PCT/HLLCompiler.pir:542)␤»
03:37 snarkyboojum rakudo: say pir::lcm__iii(12, 64)
03:37 p6eval rakudo e6863e: OUTPUT«192␤»
03:37 snarkyboojum JimmyZ: double _
03:37 JimmyZ rakudo: say pir::lcm__iii(6,20);
03:37 p6eval rakudo e6863e: OUTPUT«60␤»
03:38 JimmyZ oh
03:38 TimToady pugs: multi sub postfix:<!>(Int $n) { [*] 1..$n; }; say 60!
03:38 p6eval pugs: OUTPUT«8320987112741390144276341183223364380754172606361245952449277696409600000000000000␤»
03:38 JimmyZ rakudo: multi sub postfix:<!>(Int $n) { [*] 1..$n; }; say ~60!
03:38 p6eval rakudo e6863e: OUTPUT«8.32098711274139e+81␤»
03:39 spinclad rakudo: class PieceOfString { has Int $.length; } ; multi sub infix:<+>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length + $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a + $b; say $c.length
03:39 p6eval rakudo e6863e: OUTPUT«No applicable candidates found to dispatch to for 'infix:<+>'. Available candidates are:␤:(PieceOfString $lhs, PieceOfString $rhs)␤␤current instr.: 'infix:<+>' pc 415 (EVAL_1:0)␤»
03:40 spinclad [Coke]: i suspect the lengths should be added.
03:41 spinclad rakudo: class PieceOfString { has Int $.length; } ; multi sub infix:<`>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length + $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a ` $b; say $c.length
03:41 p6eval rakudo e6863e: OUTPUT«10␤»
03:42 snarkyboojum or use our?
03:42 snarkyboojum rakudo: class PieceOfString { has Int $.length; } ; our multi sub infix:<+>(PieceOfString $lhs, PieceOfString $rhs) { PieceOfString.new(:length($lhs.length + $rhs.length)); };  my $a = PieceOfString.new(:length(4)); my $b = PieceOfString.new(:length(6)); my $c = $a + $b; say $c.length
03:42 spinclad [Coke]: (and one infix:<+> hides the other)
03:42 p6eval rakudo e6863e: OUTPUT«10␤»
03:42 spinclad ooh, yes, that's better.  our++
03:45 spinclad (though it's still debatable whether 'adding' two bits of string is 'more like' addition or catenation-of-strings-of-characters)
03:46 spinclad (it builds a nice bridge between operators)
03:46 snarkyboojum or tying :)
03:47 sorear quietfanatic: sounds like you're running into the metamodel fault line between perl6 and parrot
03:47 spinclad snarkyboojum: alas, knot theory lies outside both arithmetic and lexicology
03:48 snarkyboojum :)
03:48 quietfanatic sorear: I figured that was the issue, but I can't reproduce it i nsimpler code.
03:48 snarkyboojum the ⌘ infix operator :)
03:49 sorear "box"
03:49 * snarkyboojum isn't fluent in unicode (yet)
03:49 sorear try .u
03:50 * sorear has finally figured out what mangle.pl is for
03:50 spinclad .u ⌘
03:50 phenny U+2318 PLACE OF INTEREST SIGN (⌘)
03:50 snarkyboojum that won't do then :)
03:51 spinclad how about apple's command sign? except that only works on macs
03:53 spinclad .u knot
03:53 phenny spinclad: Sorry, no results for 'knot'.
03:54 spinclad unicode, what good are you?
03:54 spinclad .u trefoil
03:54 phenny spinclad: Sorry, no results for 'trefoil'.
03:54 spinclad .u square
03:54 phenny U+32CC SQUARE HG (㋌)
03:54 sorear spinclad: apple's command sign IS place of interest sign
03:54 spinclad .u granny
03:54 phenny spinclad: Sorry, no results for 'granny'.
03:55 spinclad sorear: thanks, i wondered
03:58 [mark] joined #perl6
03:58 envi^home joined #perl6
04:00 TimToady .oO(Sweets for the sweet, and knots for the naughty...)
04:03 shade_ joined #perl6
04:06 shade_ joined #perl6
04:09 sorear TimToady: Do you know what's up with STD parsing of sigspace?
04:09 dju joined #perl6
04:18 pugssvn r30737 | sorear++ | [viv] Implement role translation
04:18 sorear I love how prompt pugssvn is
04:20 TimToady I haven't looked at the sigspace problem yet, but might be related to using EXPR to parse regexes, since EXPR tosses whitespace between terms and infixes
04:20 sorear in theory, STD::Regex::ws only matches the null string if %*RX<s>
04:21 sorear I've done a cursory look
04:21 pugssvn r30738 | lwall++ | [STD] don't accidentally use the same lexpad for different multis
04:21 sorear in VAST::package_def::emit_p5, what is the call to _AUTOLEXpeek for?
04:24 TimToady there was some hanky panky in gimme5 to load in termish before EXPR gets called, since EXPR doesn't have a peek routine, iirc
04:24 * sorear is having this urge to refactor VAST::package_def::emit_p5
04:24 TimToady it might be forced a different way now though, so possibly a fossil
04:25 sorear ok I'll throw it out
04:25 sorear viv-STD.pmc won't work the first time anyway
04:25 TimToady not without something to feed the LTM generator
04:25 sorear oh sure
04:25 TimToady and VAST isn't quite the same as the ast that gimme5 uses anyway
04:26 sorear I'm going to implement /that/ real soon now
04:26 sorear I mean more like... small bugs
04:26 sorear since I don't really have a way to test viv
04:26 TimToady I actually have code sitting around to try to switch gimme5 to using Data::Dumper instead of YAML::XS, but it turned out to be buggier than YAML
04:26 sorear ultimately I'd like to just use Storable
04:27 TimToady I just tested by translating little bits and seeing if they came out identical to gimme5's
04:27 sorear perl5 has no trouble with 8-bit data in heredocs
04:27 TimToady well, ultimately I'd like to just ask the function object itself what it things :)
04:27 TimToady but that sort of thing was too hair for p5
04:28 TimToady *hairy
04:30 sorear from a performance standpoint, how do slangs and LTM interact?
04:30 TimToady at the moment it has to rederive any affected LTM tables every time you derive a new slang
04:30 * sorear has been running thought experiments on a regex -> C compiler
04:30 TimToady it does shortcut those categories that are not affected, however
04:31 sorear right; I wonder if things can be done better
04:31 TimToady and just reuses the parent's LTM table on those
04:31 TimToady I'm sure they can, I was just going for clean first
04:31 TimToady FSDO clean
04:31 TimToady in particular, the operator defs in CORE.setting actually produce deep recursion warnings currently
04:32 TimToady because each def derives a new language
04:32 sorear what is the function of $lvl?
04:32 TimToady in viv?
04:33 TimToady generally those will just be for indent levels on diagnostics
04:34 TimToady but they could also be used to manage a stack of contexts such as a highlighter would run off of.
04:35 TimToady and, in fact, we do use it currently to examine contexts
04:35 TimToady $context[$lvl] = $self in Base's emit_p5
04:36 sorear oops.
04:36 sorear I've been rewriting that stuff into contextuals
04:37 sorear or maybe that's a good thing?
04:37 TimToady hard to look at your grandparent contextual without CALLER::CALLER though
04:37 TimToady or even your parent, unless you store it before clobbering it
04:38 * sorear hasn't used SUPER::emit_p5
04:38 TimToady it's more useful in the un6 bits, where mostly you're just copying stuff over with tweaks
04:39 sorear yeah
04:43 alester joined #perl6
04:50 dalek csmeta: r284 | diakopter++ | trunk/Sprixel/ (12 files):
04:50 dalek csmeta: [perlesque] made all the tests pass again. I think.  Also added new Assertion
04:50 dalek csmeta: grammar node
04:50 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=284
04:53 sorear my greatest annoyance with viv right now is that I can never remember if $self->{foo} is going to be VAST::foo or an array of VAST::foo
04:54 \shade\ joined #perl6
04:55 dalek csmeta: r285 | diakopter++ | trunk/Sprixel/ (2 files):
04:55 dalek csmeta: [perlesque] sigh. remove debugging again.
04:55 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=285
04:59 diakopter hm, now that parrot svn is off perl.org, dalek's polling interval could be safely reduced significantly
05:00 dalek csmeta: r286 | diakopter++ | trunk/Sprixel/ (2 files):
05:00 dalek csmeta: [perlesque] still more fix(es)
05:00 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=286
05:02 diakopter [OT, slightly] are you *kidding* me?!?  http://www.physorg.com/news193551675.html
05:02 diakopter phenny: tell pmurias after much travail, all tests successful again.
05:02 phenny diakopter: I'll pass that on when pmurias is around.
05:04 xinming_ joined #perl6
05:07 plobsing joined #perl6
05:14 hercynium joined #perl6
05:15 dalek csmeta: r287 | diakopter++ | trunk/Sprixel/ (2 files):
05:15 dalek csmeta: [perlesque] spello
05:15 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=287
05:17 pugssvn r30739 | sorear++ | [viv] Implement parametric role translation
05:17 diakopter goodness gracious
05:18 sorear ?
05:18 diakopter at this rate emit_p5 will be done by July
05:18 diakopter a few hundred months sooner than I could've done it
05:26 diakopter thinking about what to do next...(and dreading Cursor translation, manual or automatic), my heart tells me to jump right into making all the runtime system objects (non-user-visible, or at least non-user-extensible) for Perl 6.. in a naive, totally-unoptimized fashion, a la yapsi
05:27 diakopter urk
05:28 kel_ joined #perl6
05:33 diakopter 'cept.. that wouldn't help the bootstrapping effort.
05:33 diakopter :'(
05:34 diakopter :`(
05:34 diakopter :,(
05:47 sorear in a few hours, I'll be out of town for 4-5 days (and away from 'net)
05:47 sorear so... don't wait for me
05:47 sorear I'll make do with whatever's there when I get back
05:50 kaare joined #perl6
05:53 sorear TimToady: Can you explain the fields in a RE_ast tree?
05:53 sorear method: a,i,r,s,dba,min,rest
05:53 sorear (name makes sense)
05:54 sorear sequence: a,i,r,s,dba,min,zyg
05:54 sorear ast: decl,min,pkg
05:55 sorear min seems to be 12345 a lot
05:58 sorear a,i,r,s seem to be the eponymous regex flags
05:58 diakopter dba is doing-business-as
05:59 diakopter (as in, alias)
06:13 uniejo joined #perl6
06:22 Su-Shee joined #perl6
06:31 snarkyboojum this is an utterly ridiculous way of testing colomon++s beautiful advent day17 mandlebrot post isn't it http://gist.github.com/408538 :)
06:33 iblechbot joined #perl6
06:33 snarkyboojum esp. considering that it takes over 50 seconds on my laptop to run that one test :P
06:36 m6locks :<
06:43 pugssvn r30740 | sorear++ | [viv] Add a framework for generating LTM ASTs
06:44 snarkyboojum or there's this one which runs $height tests, e.g. 32, (instead of just one) http://gist.github.com/408545
06:44 snarkyboojum :)
06:48 JimmyZ_ joined #perl6
06:49 sorear diakopter: finishing the regex compiler should be pretty smoppy at this point
06:49 TimToady zyg is zygotes == kids, but sorts last :)
06:50 TimToady a,i,r,s are :i, :r, :s flags, yes
06:51 sorear STD parsing does not make :dba easy to access
06:54 TimToady could just ->Str a higher node and parse
06:55 pugssvn r30741 | snarkyboojum++ | [t/spec] Initial tests for Perl 6 Advent Calendar Day 17: Making Snowmen
06:55 TimToady iirc, decl are like :my nodes
06:56 TimToady and rest is usually random stuff to add on, like method args
06:59 sorear "is usually"?
06:59 moritz_ good morning
06:59 sorear where is the code that interprets re_ast?
06:59 sorear hello moritz_
07:00 jaldhar joined #perl6
07:01 snarkyboojum moritz_ o/
07:01 diakopter sorear: finishing the regex compiler in csmeta you mean?  or your work in viv?
07:02 diakopter fell asleep during Mentalist. now for Fringe.
07:04 sorear diakopter: the one in viv
07:09 quester_ left #perl6
07:10 lue I bid you adieu
07:11 snarkyboojum lue: adieu
07:15 pugssvn r30742 | lwall++ | [Spec] :() is now always signature.  Use foofix:[...] as the general op form
07:16 moritz_ now that's some to and fro
07:16 moritz_ didn't we have :{} first? :-)
07:17 pugssvn r30743 | lwall++ | [sub.t] switch to foofix:['op'] form from :() which is reserved for sigs now
07:18 am0c joined #perl6
07:21 pugssvn r30744 | lwall++ | [Cursor] now treat :() on name extension as a sig always
07:21 pugssvn r30744 | [Cursor] don't introduce a stopper for circumfix until we're *in* the circumfix
07:21 pugssvn r30744 |     (actually, don't set stopper there either, just use a $*GOAL)
07:21 pugssvn r30744 | [STD] stop correctly on goal that is set by a circumfix
07:21 pugssvn r30745 | snarkyboojum++ | [t/spec] Updated tests for Advent Calendar Day 17 to include the snowman operator and feedback from moritz_++
07:41 gfx joined #perl6
07:42 szabgab joined #perl6
07:44 sorear TimToady: what's min in RE_ast?
07:50 diakopter maybe the minimum number of chars the pattern must match?
07:50 diakopter (I don't know)
08:03 sorear diakopter: it shouldn't have 5 digits that way ...
08:08 JimmyZ_ joined #perl6
08:22 XaeroOne joined #perl6
08:30 ejs joined #perl6
08:30 dakkar joined #perl6
08:41 proller joined #perl6
08:49 jaldhar joined #perl6
08:53 TiMBuS joined #perl6
08:56 BrowserUk joined #perl6
09:06 ejs joined #perl6
09:14 _abs joined #perl6
09:14 agentzh joined #perl6
09:21 Sarten-X joined #perl6
09:24 BrowserUk ?
09:26 moritz_ good morning BrowserUk
09:36 ejs joined #perl6
09:43 BrowserUk Morning moritz.
09:53 * moritz_ seeks spec clarification for the MAIN sub table in S06
09:54 moritz_ the S06 table talks about spacey values
09:54 moritz_ but the system shell decomposes the argument string into array items (unless quoted)
09:55 moritz_ should the runtime support try to re-assemble them to support "spacey" values?
09:55 moritz_ or do we exepct the user to properly quote them? (I'd prefer that)
09:56 BrowserUk On Win, there's a system call to retrieve the raw command line if it helps?
09:56 moritz_ BrowserUk: that's interesting to note
09:57 BrowserUk But it doesn't do wildcard expansions.
09:59 moritz_ aye, I've put things like BEGIN { @ARGV = map glob, @ARGV if $^O eq 'Win32' } or so into some of my scripts
10:00 proller joined #perl6
10:01 BrowserUk There is a file (library of source I don;t remember) kicking around the P5 sources that if enabled at build time, gives perl wild-card expansion. I think Tye wrote it, but I don;t think it gets used much.
10:01 moritz_ well, if it's a build option it's nothing I can rely on as a module author
10:02 moritz_ anyway, I'm pretty happy with the eval/die/warn/$@ changes in perl 5.13.1
10:03 BrowserUk Agreed. (on both matters.)
10:04 BrowserUk That one change is (IMO) more significant than all of those in 5.12. (The yadda yadda thing doesn't really float my boat :)
10:05 mathw I think I need to see the changelog for 5.13.1
10:06 moritz_ well, the Unicode improvements in 5.12 were pretty neat
10:06 BrowserUk Jenda has (or had) a module called G.pm that did tranparent wild card expansion on @ARGV also  but it conflicted with -s, so I stopped using it (I like the simplicity of -s for quick scripts).
10:06 moritz_ but only relevant for you if you actually do Unicode text processing
10:08 BrowserUk I'm sure tehy were, but I have had to use Unicode on exactly 2 occasions in the last 8 years. And they were only for pulling stuff off the web. But I can t would be important to those that use it.
10:08 BrowserUk Eek. s/can t/can see/ (freudian!)
10:11 BrowserUk Getting back to the SO6 thing, ... it's very hard to see how you would reconstruct spacey things without the user quoting them?
10:14 jaldhar joined #perl6
10:17 moritz_ it would be mostly guessing
10:17 moritz_ looking for unbalanced quote characters or so
10:22 mathw Oh that is nice.
10:22 * mathw looks forward to Perl 5.14 now
10:25 krakan_ joined #perl6
10:33 clintongormley joined #perl6
10:35 meppl joined #perl6
10:37 BrowserUk ruoso: I've been exploring the Erlang experience of adding SMP support on top of their green threads. They do run green threads inside each kernel thread. it also seems that they started out running socket IO in a separate IO scheduler (green threads inside a dedicated kernel thread), but then reverted to doing it inline (cooperatively). **Upshot** It looks like you are right to want to not use a dedicated IO kernel thread. (At least for sockets. I
10:37 BrowserUk haven't seen anything about file IO yet)
10:48 renormalist joined #perl6
11:01 pnate joined #perl6
11:17 ejs joined #perl6
11:20 viklund joined #perl6
11:40 merlin1978 joined #perl6
11:42 islandmyth joined #perl6
11:42 islandmyth hello
11:43 moritz_ hi
11:44 islandmyth <tag>some text here</tag> - i wanted to search and replace this tag with XXX . is it possible?
11:45 moritz_ with Perl 6?
11:45 moritz_ rakudo: say 'some text with <tag>some text here</tag>, really'.subst(/ '<tag>' .*? '</tag>'/, 'XXX', :g)
11:46 p6eval rakudo e6863e: OUTPUT«some text with XXX, really␤»
11:47 islandmyth thank you
11:48 islandmyth by the way can i use regular expression?
11:49 moritz_ the things inside /.../ is a regular expression
11:49 moritz_ *thing
11:53 islandmyth @moritz_ gracias
11:54 moritz_ de rien
11:54 * moritz_ has to learn Spanish at some point
11:59 pmichaud good morning, #perl6
11:59 moritz_ good morning, pmichaud
12:00 moritz_ hugme: reload
12:00 hugme moritz_: reloaded successfully
12:01 moritz_ hugme: add patrickas to process-cmd-args
12:01 * hugme hugs patrickas. Welcome to process-cmd-args!
12:02 pmichaud exit
12:02 pmichaud ww
12:05 moritz_ I'm pleased to announce that patrickas++ took up this week's challenge, and wrote some code to support the MAIN sub in Rakudo
12:05 moritz_ it's in this repo for now: http://github.com/moritz/process-cmd-args (I forked so that I can use hugme to add contributors, in accordance to patrickas' wishes)
12:06 masak joined #perl6
12:06 pmichaud excellent.  patrickas++ moritz_++
12:06 masak oh hai, #perl6
12:07 moritz_ pmichaud: if you have any ideas for LHF to attract new contributors, dump them here or in misc/helpnow/README in the pugs repo
12:08 pmichaud moritz_: will do
12:08 masak moritz_: what are your observations about contributors so far? I've not been paying enough attention -- do different types of tasks attract different amounts of people?
12:09 moritz_ masak: yes. Web stuff (which doesn't require Perl 6) attracts more people :-)
12:09 masak thought so. :)
12:09 moritz_ masak: we've had two takers for writing Perl 6 code/tests so far, patrickas++ and bubaflub++
12:09 masak \o/
12:10 moritz_ even if we don't gain any more contributors, having two is already great
12:10 masak Web stuff doesn't have the Perl 6 learning curve attached to it. also, it's very visible and has a tight development loop.
12:10 moritz_ right
12:11 moritz_ we *really* should do that tryrakudo website
12:12 ejs joined #perl6
12:12 moritz_ but I'd like for persistent REPL before starting with it
12:12 moritz_ s/<before 'for'>/to wait /
12:13 fridim joined #perl6
12:14 patrickas joined #perl6
12:14 patrickas speaking of the devil :-) ola!
12:15 moritz_ \o/
12:15 pmichaud unless my day gets more unpleasant surprises, I think I'll be able to have sorear++'s patches in today (for REPL)
12:16 * masak shivers in anticipation
12:16 * moritz_ has high hopes
12:16 masak it's be like Christmas in May.
12:16 masak s/s/ll/
12:18 moritz_ speaking of christmas in may, I'm please to read that Debian has enabled parallel execution of startup scripts by default
12:19 patrickas what does the patch add?
12:19 moritz_ you'll be able to say
12:19 moritz_ my $x = 3;
12:19 moritz_ say $x;
12:19 moritz_ on the interactive rakudo prompt
12:19 moritz_ previously all lexical variables were forgotten
12:20 patrickas so it remembers vars between lines whcih I guess it didn't ?
12:20 patrickas cool!
12:20 moritz_ (or rather went out of scope, not forgotten)
12:20 moritz_ right
12:21 jaldhar joined #perl6
12:28 araujo joined #perl6
12:29 [Coke] joined #perl6
12:33 JimmyZ joined #perl6
12:34 rv2733 joined #perl6
12:48 bbkr rakudo: my $x = Inf; say ($x.Int / 1).WHAT;
12:48 p6eval rakudo e6863e: OUTPUT«Rat()␤»
12:49 ejs joined #perl6
12:56 bbkr what does "use MONKEY_TYPING;" do ?
12:57 JimmyZ rakudo: augment
12:57 p6eval rakudo e6863e: OUTPUT«Malformed augment at line 11, near ""␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
12:57 JimmyZ bbkr: augment
12:57 masak bbkr: it allows you to modify the definition of classes after they've already been defined.
12:57 _jaldhar joined #perl6
12:57 masak bbkr: http://en.wikipedia.org/wiki/Monkey_patch
12:57 bbkr thanks :)
12:58 masak it's both very useful and quite frowned-upon, so it's been hidden behind a capital-letters pragma.
13:00 bbkr rakudo: class Quill {}; my $a = Quill.new();
13:00 p6eval rakudo e6863e: OUTPUT«Confused at line 11, near "my $a = Qu"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
13:00 ejs joined #perl6
13:00 masak any leads on that one yet?
13:02 bbkr rakudo: say '16'{'%x'} # checking if http://rt.perl.org/rt3/Ticket/Display.html?id=74112 is fixed
13:02 p6eval rakudo e6863e: OUTPUT«Method 'postcircumfix:<{ }>' not found for invocant of class 'Str'␤current instr.: '!postcircumfix:<{ }>' pc 14645 (src/builtins/Code.pir:20)␤»
13:02 ruoso joined #perl6
13:05 bbkr looks like fixed, where tests for such case should go str or blocks-and-statements ?
13:08 bbkr rakudo: grammar G { regex foo { (\d+) <?{ $0.chars > 4 }> '!'
13:08 bbkr } }; say $_ ~~ /<G::foo>/ for '1234!', '123456!'
13:08 p6eval rakudo e6863e: OUTPUT«Malformed regex at line 11, near "foo { (\\d+"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
13:08 bbkr rakudo: grammar G { regex foo { (\d+) <?{ $0.chars > 4 }> '!' } }; say $_ ~~ /<G::foo>/ for '1234!', '123456!'
13:08 p6eval rakudo e6863e: OUTPUT«regex assertion not terminated by angle bracket at line 11, near "::foo>/ fo"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
13:11 fridim joined #perl6
13:11 JimmyZ joined #perl6
13:13 dalek rakudo: c950dec | pmichaud++ | docs/spectest-progress.csv:
13:13 dalek rakudo: spectest-progress.csv update: 448 files, 32347 (82.2% of 39356) pass, 0 fail
13:13 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c950decb88e0f8a0a82a136d90697dcf6a7291a7
13:14 pmurias joined #perl6
13:19 ruoso BrowserUk, So I think we're settling with the cooperative-coroutine-scheduler running in each kernel thread. I think the next step is thinking about the "shared values" infraestructure. I'm getting convinced the actor model can be implemented by an independent module.
13:26 am0c joined #perl6
13:49 plobsing joined #perl6
13:52 sahadev joined #perl6
14:03 am0c joined #perl6
14:08 tlb joined #perl6
14:09 gbacon joined #perl6
14:11 ruoso Proposed Perl 6 threading model http://twitpic.com/1poh13
14:13 ruoso phenny, tell BrowserUk http://irclog.perlgeek.de/perl6/2010-05-21#i_2353688
14:13 phenny ruoso: I'll pass that on when BrowserUk is around.
14:14 JimmyZ sign...I can't open it
14:14 masak twitpic is petty-borgeoise and must be resisted!
14:14 masak ruoso++
14:14 * ruoso accepts suggestions on where to post the image
14:15 ruoso will the list accept a 300K attachment/
14:15 ruoso ?
14:15 ruoso (or maybe the 34k svg file instead)
14:24 * ruoso re-started the threading thread in another thread
14:24 justatheory joined #perl6
14:25 * masak has blogged: http://use.perl.org/~masak/journal/40361
14:25 Su-Shee ruoso: do you use thread-view for the thread about threads?
14:25 ruoso :)
14:32 alester joined #perl6
14:37 ruoso JimmyZ, the image is now on the p6-l list also
14:44 JimmyZ ruoso: thanks. I got it
14:54 diakopter "'Pro tip': when booking, check an extra time that chosen dates are actually correct." (masak)  --  I gave away $400 to this last week. :[
14:55 masak something like that sum for me as well.
14:55 smash_ joined #perl6
14:55 smash_ hello everyone
14:55 masak still, I greatly preferred that to remaining in Russia and facing the Visa Control Squad.
14:57 diakopter ruoso: did you see buk's msgs here 4.3 hours ago?
14:59 diakopter sorear: oh :)
15:02 pmichaud sorear: ping
15:06 diakopter ruoso: how closely does your latest match the scheme outlined in that paper I linked [the one about scala]
15:07 ruoso diakopter, yes... I saw...
15:07 orafu joined #perl6
15:07 ejs joined #perl6
15:07 ruoso diakopter, about the paper, it's quite close, actually...
15:07 diakopter <whew> that was my feeling
15:07 diakopter I was hoping I wasn't having a wrong feeling
15:08 diakopter oh goody; that'll be quite easy to implement on the CLR
15:09 dalek rakudo: f9c987e | moritz++ | t/spectest.data:
15:09 dalek rakudo: run three more integration test files
15:09 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f9c987ec173ee1d135211ef7626aa72dff0bc180
15:10 justatheory joined #perl6
15:13 alanhaggai joined #perl6
15:14 alanhaggai joined #perl6
15:14 bbkr rakudo: grammar G { token TOP { [ <single> | <pair> ]+ }; token single { . }; token pair { .. }; }; class A { method single ($/) { say "single" }; method pair ($/) { say "pair" };}; G.parse("kot", actions => A.new); # alternation '|' should get longest token matched. so why do i get single,single,single instead of pair,single ?
15:14 p6eval rakudo c950de: OUTPUT«single␤single␤single␤»
15:15 moritz_ bbkr: because longest token matching is NYI
15:15 bbkr thanks
15:15 moritz_ bbkr: putting <pair> before <single> "helps"
15:17 polettix joined #perl6
15:20 am0c joined #perl6
15:27 moritz_ quick question about S03:4057
15:27 moritz_ it says "per operators are defined recursively on shaped arrays"
15:28 moritz_ S09 uses "shaped arrays" as "predeclared with a certain structure/dimensionality"
15:28 moritz_ but the example that follows seems to indicate otherwise
15:28 moritz_ -« [[1, 2], 3]               #    [-«[1, 2], -«3]
15:28 moritz_ # == [[-1, -2], -3]
15:28 moritz_ rakudo: say [1, 2] ~~ Iterable
15:28 p6eval rakudo c950de: OUTPUT«1␤»
15:29 masak moritz_: maybe S03 doesn't mean 'shaped arrays' there, but something more like 'nested arrays'.
15:29 bbkr std: / . || . | . /;
15:29 p6eval std 30745: OUTPUT«ok 00:01 114m␤»
15:30 moritz_ masak: probably
15:36 BrowserUk Ruoso: You pic looks good, but limited. How do you handle for example: Matrix multiplication? Socket server? Genome matching (find all possible offsets;  for each of thousands of short (25) sequences; fuzzy matching at least 15 positions; within 1 GB sequence)?  I've more scenarios. I'd like to gather many more.
15:36 phenny BrowserUk: 14:13Z <ruoso> tell BrowserUk http://irclog.perlgeek.de/perl6/2010-05-21#i_2353688
15:37 constant joined #perl6
15:37 constant joined #perl6
15:37 masak I'm not sure I understand the question "How do you handle matrix multiplication?" I can only assume that there is some threading challenge in that problem, or otherwise you wouldn't bring it up. but what, in more detail, is it?
15:39 sahadev rakudo: my @a = 1, 2, 3; @a>>++; say @a.perl
15:39 p6eval rakudo c950de: OUTPUT«[2, 3, 4]␤»
15:40 ruoso BrowserUk, mostly, it's much more explicit than I first thought... hyper operators, feeds, gather/take should be able to make it
15:40 diakopter I blogd http://diakopter.blogspot.com/2010/05/perlesque-class-predeclarations-enable.html
15:40 moritz_ are there any 2-arg operators that modify in-place?
15:41 arnsholt_ moritz_: += et al I suppose
15:41 moritz_ arnsholt_: right, thanks
15:41 ruoso rakudo: my @a = 1,2,3; my @b = 4,5,6; say join ', ', (@a >>*<< @b)
15:42 p6eval rakudo c950de: OUTPUT«4, 10, 18␤»
15:42 ruoso BrowserUk, the above could, theoretically, be run in parallel
15:42 BrowserUk ruoso: mat mult (and scaling) on large mats is very parallisable...but it requires partitoning & SMP (or GPUizing) for scalability.
15:42 ruoso since the hyper operator is a "threading hint"
15:42 [Coke] joined #perl6
15:43 moritz_ and it requires proper aligning so that SSE can be used
15:43 ruoso my bet is on the high-level of the operators
15:43 masak diakopter++ # nice post
15:43 ruoso >>*<< can be turned into anything, low-level speaking
15:44 moritz_ rakudo: my @a = 1, 2, 3; sub f(@b) { $_++ for @b }; say @b.perl
15:44 p6eval rakudo c950de: OUTPUT«Symbol '@b' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
15:44 BrowserUk It really just a "thread hinting" problem....
15:44 moritz_ rakudo: my @a = 1, 2, 3; sub f(@b) { $_++ for @b }; f(@a); say @a.perl
15:44 p6eval rakudo c950de: OUTPUT«[2, 3, 4]␤»
15:44 moritz_ sahadev: this is how in-place unary hyper ops work right now
15:47 polettix moritz_: I'm curious about two changes in the perl6-examples, namely http://github.com/perl6/perl6-examples/blame/master/euler/prob025-polettix.pl and http://github.com/perl6/perl6-examples/blame/master/euler/prob063-polettix.pl
15:47 polettix moritz_: the latter seems better imho
15:47 polettix moritz_: anyway thanks for both :)
15:49 BrowserUk Ruoso: See http://www.slideshare.net/pkpramit/matrix-multiplicationan-example-of-concurrent-programming
15:49 moritz_ polettix: int() got removed from the language
15:49 moritz_ polettix: so I removed it from the scripts to get it running again
15:49 polettix moritz_: yep, the thing is that the int() removal was done in two different ways but modifying basically the same thing
15:50 * ruoso looking
15:50 BrowserUk Ruoso: Efficient (direct) shared memory + fast (user space) locking is required.
15:50 moritz_ rakudo: say 6 div 2.5
15:50 p6eval rakudo c950de: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
15:50 moritz_ polettix: div works only with integers on both sides
15:51 moritz_ polettix: so I only took 'div' when I was sure that both sides actually are integers
15:51 Trashlord joined #perl6
15:52 polettix moritz_: yep, we only have integers in both cases. Just curious anyway, both are valid solutions and... TIMTOWTDI :)
15:52 moritz_ polettix: if it's only integers, I agree that 'div' looks better
15:53 ruoso BrowserUk, yes... as I said earlier, I don't think we should target remote processes (or even forks) in the core threading model... such extra functionality can be provided by modules
15:53 ruoso BrowserUk, so in the basic threading model, I think we just use process memory amongst threads....
15:53 sorear pmichaud: pong, but make it quick - I'm leaving townin a few minutes
15:54 pmichaud sorear: I was just reviewing the lexical persistence branch.  Many parts look good, but HLL::Compiler should not be manipulating PAST structures either
15:54 pmichaud I'm cherry picking a few items into master and then will work on it a bit from there.
15:54 BrowserUk ruoso: I  completely agree about remote processes and fork. (Did anything I've suggested indicate otherwise?)
15:54 ruoso nope... I was just making my agreement explicit ;)
15:55 sorear pmichaud: if the PAST isn't manipulated, PAST::Compiler throws a "lexical $whatever not found" error
15:55 pmichaud I didn't say the PAST shouldn't be manipulated, just that HLL::Compiler shouldn't be doing it.
15:55 BrowserUk Ruoso: WHat I mean by "directly shared" is non-copying sharing. That is
15:55 pmichaud that should be handled by the individual compiler.
15:56 sorear Perl6::Compiler?
15:56 pmichaud in the case of Perl6, yes.
15:56 pmichaud but it does that anyway, as part of eval()
15:56 pmichaud Perl6::Compiler already knows to look at the outer_ctx option and update its symbol table
15:56 BrowserUk ... if you tried to scale a large matrix using a purely message passing model, copying and sharing reduces you to a snail-pace.
15:57 ruoso BrowserUk, yes... yes... the idea is that most data won't be seen between threads (i.e. the map closure doesn't use most of the variables in the current lexical scope), but the data that is seen, must be made thread-safe through locking
15:57 sorear pmichaud: lexical-persistence-2 already goes somewhat in that direction
15:58 sorear pmichaud: the reason past is so heavily factored is so that compilers can write their own overrides
15:58 pmichaud sorear: sure, but there are simpler mechanisms to do this
15:58 sorear ?
15:58 pmichaud in general, I don't want HLL::Compiler doing past manipulations that a compiler writer has to know about
15:58 BrowserUk Therefore, for efficiency, you need to be able to have multiple kthreads operate concurrently upon difference slices of a single perl object (array of ints or array of reals) concurrently, without locking--because they are operating on different parts of the memory, so locking is redundant.
15:58 pmichaud it breaks encapsulation
15:59 sorear how about just removing method post from HLL::Compiler?
15:59 ruoso BrowserUk, if the array is immutable, it doesn't require locking
15:59 pmichaud that's one step, yes.
15:59 sorear all the tools are there for a compiler writer to easily put together one of their own
15:59 masak has anyone ever gotten the error 'No result object' before during compilation to .pir?
15:59 pmichaud sure, but the thing is that past manipulations belong in HLL::Actions or HLL::Grammar, not HLL::Compiler
16:00 pmichaud if we're going to provide them for others to use
16:00 dual joined #perl6
16:00 pmichaud in general, ::Compiler doesn't manipulate PAST -- that's what grammars and actions do.
16:00 BrowserUk You cannot scale (multiple all elements by a value), if the array is immutable.
16:00 sorear ...didn't you reject the first version simply because it did past manipulations in Actions
16:00 ruoso BrowserUk, the source array, I mean
16:01 pmichaud no, because the past manipulations were specific to the interactive mode
16:01 pmichaud not because they were in actions
16:01 BrowserUk Unless you're going to allocate and populate an new equal-sized matrix to hold the results and discard the original...
16:01 TimToady by default, arrays are mutable in Perl 6
16:02 TimToady that doesn't mean you couldn't have shaped immutable values though
16:02 REPLeffect joined #perl6
16:02 BrowserUk and that is so costly as to be pointless using concurrency. Quicker to mutate a lexical array in place on one thread. (But then you loose th potential of 2/12/48/next year cores).
16:02 TimToady but certainly @array »+=» 1 would be illiegal if @array were immutable
16:03 TimToady *leg
16:03 * [Coke] now hears * in a valley girl accent all the time, btw. curse you all.
16:04 masak rakudo: "\e"
16:04 p6eval rakudo c950de: OUTPUT«Unrecognized backslash sequence: '\e' at line 11, near "\""␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
16:04 masak perl6: say "\e"
16:04 p6eval rakudo c950de: OUTPUT«Unrecognized backslash sequence: '\e' at line 11, near "\""␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
16:04 p6eval ..elf 30745, pugs: OUTPUT«e␤»
16:04 masak std: "\e"
16:04 p6eval std 30745: OUTPUT«ok 00:01 114m␤»
16:04 sorear pmichaud: so, what if wrap_past and friends were moved to HLL::Actions, and post was removed?
16:04 * masak submits rakudobug
16:04 TimToady [Coke]: well, I married a valley girl, so it, like, stands to reason, and stuff.
16:04 pmichaud sorear:  that might be better, yes.
16:05 sorear pmichaud: what would be better than that?
16:05 pmichaud sorear: I need to play with it a bit.
16:05 pmichaud s/I/we/
16:05 pmichaud anyway, I'll work on it a bit in master and cherry pick things from the branch, and we can go from there.
16:06 TimToady and all my kids are valley girls, except for the ones who are boys
16:06 pmichaud I was a little surprised that NQP itself wasn't using lexical persistence in the branch yet
16:06 ruoso BrowserUk, TimToady, but the compiler could optimize "@array »+=» 1" very easily if @a is a compact array...
16:06 pmichaud oh, I guess it was
16:06 moritz_ masak: that one is already re-opened in RT
16:06 moritz_ masak: IIRC
16:06 sorear pmichaud: you're welcome to experiment; I won't be able to give feedback for a few days though
16:06 masak oh, ok.
16:06 pmichaud but it was all buried in HLL::Compiler
16:06 BrowserUk Of course, it may be that GPGPU (or even SIMD instructions are quicker for MAT MULT than can be done with SMP ktrheading, but there are other tasks that have similar parallelisation requirements. (Partitoning of large datasets to run non-GPGPU-able, dientical algorithm in separate kthreads, directly on shread memory)
16:07 pmichaud sorear: I'll move it along a bit more and then I'll be happy to have you pick it up again when you have time
16:07 sorear pmichaud: yes, I had this silly idea that "normal" compilers should get it for free
16:07 pmichaud sorear: it's a bit too free
16:07 pmichaud they should get it for free, but not at the cost of manipulating their PAST structures unexpectedly
16:08 ruoso BrowserUk, the compiler could even create subsets of the array with proxy variables that would access the data without locking...
16:08 pmichaud it's too actiony-at-a-distance
16:08 pmichaud they should get it by following a relatively clean-ish api
16:09 BrowserUk Ruoso: The compiler probably "could", if it was GHC-like...but on-the-fly?
16:09 [Coke] TimToady: aha!
16:09 masak moritz_: do you know which RT ticket mentions \e? I don't seem to be able to find it.
16:10 ruoso BrowserUk, I think so...
16:11 arnsholt [Coke]: And now I want to listen to Frank Zappa, but he's not on Spotify, and all my vinyl is elsewhere. So curse you =p
16:11 sahadev rakudo: my @a = 1, 2, 3, [4, 5]; for @a { $_++ unless $_ ~~ Iterable }; say @a.perl
16:11 p6eval rakudo c950de: OUTPUT«[2, 3, 4, [4, 5]]␤»
16:11 sahadev rakudo: my @a = 1, 2, 3, [4, 5]; for @a { unless $_ ~~ Iterable {$_++} }; say @a.perl
16:11 p6eval rakudo c950de: OUTPUT«[1, 2, 3, [4, 5]]␤»
16:11 BrowserUk Go has a 'mutable slice' type--which doesn't have real memory, but overlays with bounds, slices of an array type. I effect they are very similar to substr refs in Perl 5. It's a very powerful concept (ripe for stealing). I think D has them also. But the main point is that they are programmer constructions, not compiler magic.
16:12 ruoso Perl has too much polymorphism for that to be a programming construct...
16:12 ruoso it needs to be done as optimization
16:12 BrowserUk Nope. It cannot be done that way.
16:13 TimToady @array[1; *; 0..10] »+=« 1 will do such a slice
16:13 sorear pmichaud: excellent
16:13 masak EALREADYWORKS
16:13 sahadev using unless (or if) as a non-modifier seems to make $_ lose its binding to the array element?
16:13 BrowserUk TimToady: That a programmer explicit slice? It knows its bounds?
16:13 TimToady building slices into the language such that they can do PDLish things is most of what S09 is about
16:14 TimToady if you declared it with bounds, yes
16:14 BrowserUk Nice++
16:14 TimToady see S09:178
16:14 * BrowserUk off to read S09
16:17 TimToady BrowserUk: but note that there are passages in S09 that are still somewhat speculative, and may not get into 6.0.0, or into Perl 6 ever
16:18 TimToady S09 has had several different authors...
16:18 PerlJam TimToady: you have to leave a little something for future generations to work out ..  :)
16:18 TimToady and very little implementation to back up the notions
16:21 rgrau_ joined #perl6
16:21 * masak times out and submits the e bug anyway
16:21 masak better having dups than holes in RT.
16:22 [Coke] masak: agreed.
16:22 masak this one was brought to my attention by GGE, by the way. I'm trying to port it to Rakudo master.
16:23 colomon masak++
16:24 masak std: "\q"
16:24 p6eval std 30745: OUTPUT«[31m===[0mSORRY![31m===[0m␤Couldn't find terminator " at /tmp/ZM7AoEHnsf line 1 (EOF):␤------> [32m"\q"[33m⏏[31m<EOL>[0m␤Parse failed␤FAILED 00:01 111m␤»
16:24 TimToady \e is supposed to produce an esc char
16:25 masak TimToady: yes, and I used it as such in GGE. now it has regressed in Rakudo master, so I have to do \c[27] or chr(27) instead.
16:25 TimToady std: "\q"hi" there"
16:25 p6eval std 30745: OUTPUT«[31m===[0mSORRY![31m===[0m␤Confused at /tmp/dYCMxdbuLx line 1:␤------> [32m"\q"h[33m⏏[31mi" there"[0m␤    expecting escape␤Parse failed␤FAILED 00:01 111m␤»
16:25 TimToady std: "\qq"hi" there"
16:25 p6eval std 30745: OUTPUT«[31m===[0mSORRY![31m===[0m␤Confused at /tmp/4tSX5xnKgt line 1:␤------> [32m"\qq"h[33m⏏[31mi" there"[0m␤    expecting escape␤Parse failed␤FAILED 00:01 111m␤»
16:25 masak std: "\g"
16:25 p6eval std 30745: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized backslash sequence: '\g' at /tmp/9s5c0WERiO line 1:␤------> [32m"\g[33m⏏[31m"[0m␤Check failed␤FAILED 00:01 111m␤»
16:25 BrowserUk joined #perl6
16:25 TimToady std: '\qq"hi" there'
16:25 p6eval std 30745: OUTPUT«ok 00:01 111m␤»
16:26 BrowserUk Grr. Bloody ISP  :@
16:26 TimToady std: say "\c["
16:26 p6eval std 30745: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized character name at /tmp/qYzciEJTyL line 1:␤------> [32msay "\c[[33m⏏[31m"[0m␤Unrecognized \c character at /tmp/qYzciEJTyL line 1:␤------> [32msay "\c[33m⏏[31m["[0m␤Check failed␤FAILED 00:01 111m␤»
16:26 TimToady right
16:27 clintongormley joined #perl6
16:28 masak "Unable to find module 'GGE' in the @*INC directories." -- would it be a bad idea to list those directories?
16:28 masak (liek Perl 5 does)
16:28 masak s/iek/ike/
16:30 moritz_ not bad at all
16:30 moritz_ and easy to implement, I think
16:30 masak it would be SMA, IMO.
16:31 pmichaud might be a good challenge task
16:31 BrowserUk TimToady: Can you take (and pass) a reference to a slice? (Or would you have to pass a ref to the array and the "bounds"?)
16:31 * moritz_ was just about to do it himself
16:31 pmichaud either ways works :)
16:31 pmichaud *way
16:31 moritz_ it's a good idea
16:32 moritz_ anyway, I disagree with calling exit() after the error message
16:32 moritz_ mberends++ did that to avoide the backtrace
16:32 moritz_ but it means that it's not easily catchable, for example if it happens in an eval()
16:32 masak *nod*
16:32 moritz_ or try { require ... }
16:33 masak the intent was noble, but the method isn't correct.
16:33 moritz_ agreed
16:33 masak but for once, it was nice not to get one of those horrible stacktraces. mberends++
16:34 masak that shows how nice it could be, at some point in the future.
16:37 PerlJam for some reason I read "the internet was noble ..."
16:37 masak if only :)
16:38 moritz_ rakudo: say pir::join('a', <b c d>)
16:38 p6eval rakudo c950de: OUTPUT«bacad␤»
16:38 PerlJam wishful thinking perhaps
16:40 cdarroch joined #perl6
16:40 cdarroch joined #perl6
16:44 TimToady BrowserUk: the intent is to allow the possibility of slice refs, but perhaps not as the default semantics, but it's easy to apply an adverb to a subscript, just as you can to any other operator
16:44 TimToady afk &
16:44 moritz_ masak: do you prefer each @*INC entry on a new line? or rather delimited by quotes and joined by ', '?
16:44 ruoso @a := @b[0;*;1..10];
16:45 ruoso ?
16:45 moritz_ or space delimited_
16:46 BrowserUk ruoso: I assume that's meant to bind @a to the slice of the 3-dim array @b?
16:47 BrowserUk And yu can pass arrays to subs by reference in P6?
16:48 masak moritz_: I prefer space separated, like in Perl 5.
16:48 masak moritz_: '(@*INC contains: X Y Z)'
16:49 BrowserUk masak: what if the paths contain spaces?
16:49 * masak checks what Perl 5 does about that
16:49 ruoso BrowserUk, it always goes as references... it's the signature that decides to take it as value
16:50 moritz_ Unable to find module 'Foo' in the @*INC directories.
16:50 moritz_ @*INC contains: '.', '/home/moritz/.perl6/lib', '/home/moritz/rakudo/parrot_install/lib/2.4.0-devel/languages/perl6/lib'.
16:50 masak Perl 5 doesn't distinguish between a space in a path and one between paths.
16:50 moritz_ that's my current patch, but easy enough to change to spaces
16:50 masak either works.
16:50 masak but I kinda liked the parentheses of Perl 5.
16:51 moritz_ I thought maybe newlines (and indented two spaces or so) because newlines in pathes are rather rare
16:51 ruoso rakudo: sub foo($a,$b;$c,$d) { say $a,$b,$c,$d }; foo((1,2),(3,4))
16:51 p6eval rakudo f9c987: OUTPUT«Not enough positional parameters passed; got 2 but expected 4␤current instr.: 'foo' pc 204 (EVAL_1:-805598962)␤»
16:52 masak it's an idea, though pehaps that would make the error message rather long.
16:52 masak vertically, that is.
16:52 ruoso rakudo: sub foo($a,$b;$c,$d) { say $a,$b,$c,$d }; foo(1,2;3,4)
16:52 p6eval rakudo f9c987: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
16:52 * masak stops bikeshedding
16:52 masak moritz_++
16:52 * BrowserUk trying to think through the implications of passing a bound reference to a slice of an array to another kthread?
16:55 * ruoso .oO( if you send different views of a bigger array to different threads, it means you don't need locking ? )
16:57 BrowserUk So long as those views don't overlap, then there is no conflict.
16:58 masak nom &
16:59 BrowserUk It's more complex if you have fat datastructures (as in perl). It means that you cannot safely change the nature (dimensions etc.) of the structure without locking.
17:02 [Coke] any reason why autounfudge needs threads?
17:03 moritz_ [Coke]: to run parallel
17:04 [Coke] yes, but that's more of a nice to have, yes?
17:04 [Coke] (presuming you have lots of free time.)
17:04 moritz_ well, I'm impatient, and my computer has two cores
17:04 [Coke] I will float a patch that allows 'no threads' and implies -j=1.
17:05 moritz_ wfm if parallel execution still works
17:06 iblechbot joined #perl6
17:09 BrowserUk The mat mult is a good (hard) test example, especially if you multiply in-place(eg: @a *= @b with appropriate >><< bits) of parallelisation because of the trade off between a threaded version of the naive algorithm versus the complexity of trying to paralellise the Strassens algorithm. (Even if in reality, it much quicker to just pass Mat Mult off to GPGPU or SIMD)
17:11 [Coke] moritz_: ugh. PITA to remove. Ah well. I'll just let you run it. =-)
17:12 moritz_ [Coke]: I do it regularly anyway
17:13 moritz_ and it's a PITA to run if your ulimit doesn't work :-)
17:15 dalek rakudo: 6a7ded6 | moritz++ | src/Perl6/Module/Loader.pm:
17:15 dalek rakudo: Not finding a module throws an exception again.
17:15 dalek rakudo: The intention of not having an unnecessary stack trace was noble, but it made
17:15 dalek rakudo: it very hard (if not impossible) to catch the error with a try { } block, or
17:15 dalek rakudo: form within an eval.
17:15 dalek rakudo: Also awesomeified the error message to include report contents of @*INC.
17:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6a7ded6234296b8588761429664bcfb765ec52eb
17:15 isBEKaml joined #perl6
17:26 justatheory joined #perl6
17:31 araujo joined #perl6
17:33 moritz_ rakudo: my @a = 1, 2; say 1 xx @a
17:33 p6eval rakudo f9c987: OUTPUT«1␤»
17:33 moritz_ weird, I've found a case where that loops infinitely
17:35 pmurias joined #perl6
17:36 graffiti joined #perl6
17:36 graffiti hello
17:36 moritz_ hi
17:39 moritz_ \o/ I have working code for MAIN
17:39 moritz_ it's just not in Rakudo yet :-)
17:40 colomon moritz_++
17:40 colomon I'm assuming you mostly didn't write said code?  :)
17:40 pmichaud back from lunch
17:46 graffiti ...
17:51 graffiti i want to write something in perl
17:53 [Coke] perl 5? perl 6?
17:53 graffiti Perl5
17:55 PerlJam graffiti: you want ot write something in Perl 5 that will help Perl 6?
17:55 PerlJam s/ot/to/
17:56 PerlJam graffiti: if you just want to write some Perl 5 and need help or resources, try #perl instead.
18:04 pmurias joined #perl6
18:09 pmurias diakopter: is it possible to call a method with a dynamically determined name at runtime in the CLR?
18:09 phenny pmurias: 05:02Z <diakopter> tell pmurias after much travail, all tests successful again.
18:10 pmurias like my $method_name='foo';$obj.$method_name(1,2,3); ?
18:11 pmurias diakopter: hi
18:11 pmurias diakopter: see the new failing test
18:14 dalek csmeta: r288 | pawelmurias++ | trunk/Sprixel/Main.cs:
18:14 dalek csmeta: toggle a flag so the perlesque accepts user defined input
18:14 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=288
18:14 dalek csmeta: r289 | pawelmurias++ | trunk/Sprixel/t/virtual.t:
18:14 dalek csmeta: add a failing test for virtual methods
18:14 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=289
18:19 XaeroOne joined #perl6
18:20 circuitbreaker joined #perl6
18:22 uniejo joined #perl6
18:32 moritz_ http://github.com/moritz/process-cmd-args now contains an example that actually calls a sub MAIN
18:32 moritz_ next step: plug it into Rakudo
18:32 * moritz_ looks at alpha branch to find out how it was done there
18:36 moritz_ differently :(
18:36 moritz_ since it's now lexically scoped...
18:36 moritz_ we can't do the namespace-lookup anymore
18:38 pmichaud it can be done in the mainline code that rakudo generates, though.
18:38 moritz_ aye, thought so
18:38 moritz_ I'll write a sub RUN_MAIN or so
18:38 diakopter pmurias: ok
18:38 pmichaud I think it could go directly in the PAST generation
18:39 pmichaud and we can easily look up lexically to see if &MAIN exists
18:39 dalek nqp-rx: def10fd | sorear++ | src/HLL/Compiler.pm:
18:39 dalek nqp-rx: Write NQP replacements for eval and interactive
18:39 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/def10fd60c43741c13d6de45b7386568922c412f
18:39 dalek nqp-rx: 528fb67 | sorear++ | src/HLL/Compiler.pm:
18:39 dalek nqp-rx: Add the autoprint hook
18:39 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/528fb676886eaa380469cc11ae87ac3f9e0f7ddd
18:39 dalek nqp-rx: c4649e1 | pmichaud++ | src/HLL/Compiler.pm:
18:39 dalek nqp-rx: Refactor outer_ctx handling a bit in HLL::Compiler.
18:39 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/c4649e11887874182d9bd2a56be6a02c00499834
18:39 dalek nqp-rx: fca4ee1 | pmichaud++ | src/HLL/Compiler.pm:
18:39 dalek nqp-rx: HLL::Compiler.eval() needs to pass its slurpy args to the code it evals.
18:39 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/fca4ee177643413f80ac426e9b565f0a62c578c1
18:39 diakopter pmurias: to answer your question, sorta...
18:40 pmichaud actually, UNIT_START can do it.
18:40 diakopter pmurias: if the dispatch method takes a params object[]
18:40 diakopter pmurias: and each of the invocant's possible methods are string-compared
18:40 diakopter pmurias: and if a match is found, casts are done to the params, and the method is invoked
18:41 diakopter that way it's all "type safe"
18:42 ash_ joined #perl6
18:42 moritz_ pmichaud: mind if I remove src/old from rakudo?
18:42 pmichaud moritz_: +1
18:42 moritz_ backporting stuff from alpha doesn't happen all that often anymore
18:42 pmichaud I agree.
18:43 diakopter pmurias: why do you ask
18:44 moritz_ if nobody objects in the next few minutes I'll delete it
18:44 diakopter pmurias: hopefully you'll want to write p6 methods as perlesque closures and not as clr methods
18:47 diakopter pmurias: perlesque methods/classes are intended to be runtime classes/routines, not user-code (or setting-code) routines.
18:50 diakopter pmurias: where by "runtime" I mean all the supporting/scaffolding code
18:57 diakopter pmurias: another somewhat equivalent way to do the method lookup (but which doesn't avoid the casts) is to store the methods in an optimized-for-retrieval hash/dictionary, but for invocants with only a few methods, it may not be worth it.
19:02 diakopter pmurias: re virtual.t - it's actually not a virtual call there.  I assume you discovered it "works" if you mark $foo as a Bar (or leave off the type annotation entirely).
19:02 rokoteko joined #perl6
19:02 diakopter pmurias: a cleaner way to do that is just to do this:
19:04 diakopter my $foo_as_bar = Bar.new(); $foo_as_bar.foo(); my Foo $bar = $foo; $bar.foo();  # DTRT
19:05 diakopter er
19:05 moritz_ opinion question: most GNU tools allow switches/options after arguments
19:05 diakopter my $foo_as_bar = Bar.new(); $foo_as_bar.foo(); my Foo $bar = $foo_as_bar; $bar.foo();  # DTRT
19:05 ShaneC joined #perl6
19:05 moritz_ S06 says that for the MAIN sub that's disallowed
19:05 ShaneC left #perl6
19:05 moritz_ ie more strict argument parsing
19:06 moritz_ what would you prefer?
19:06 diakopter pmurias: do you see how that's a virtual call there in my example, but not how you wrote it in virtual.t ?
19:07 stephenlb joined #perl6
19:11 BrowserUk moritz: maybe the restriction is to allow switches to the interpreter and switches to the script being run to coexist.
19:12 dalek csmeta: r290 | diakopter++ | trunk/Sprixel/ (3 files):
19:12 dalek csmeta: [perlesque] clarify semantics of casting and variable declaration, for virtual
19:12 dalek csmeta: calls. ++pmurias
19:12 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=290
19:17 rokoteko so how did perl6 get rid of globs in a nutshell?
19:19 moritz_ rokoteko: with clever ideas
19:19 moritz_ was that sufficiently "in a nutshell"
19:19 rokoteko moritz_: you've got a briliantly tiny nut.
19:20 moritz_ there are actually multiple ways
19:20 moritz_ one is the idea of having a "setting"
19:20 moritz_ which is an outer lexical scope to the program
19:20 moritz_ and contains all the built-ins
19:20 moritz_ another tools is "contextual" variables
19:20 rokoteko to the program as in the perl interpreter?
19:20 moritz_ which are passed along the call chain, and can be overridden in lexical scopes
19:21 colomon joined #perl6
19:21 moritz_ builtins; { user code }
19:21 rokoteko so is it really just a work-around that hides them?
19:21 snarkyboojum .'\]
19:23 rokoteko in builtins they still exist? lately, (sorry to distract from the perl6 topic), I learnt about Internals:: namespace in perl5
19:24 BrowserUk left #perl6
19:25 moritz_ rokoteko: they are not globals
19:26 moritz_ rokoteko: you can also run code outside the setting if you wish
19:26 moritz_ or in a different, self-written setting
19:26 moritz_ and you can lexically override them
19:26 rokoteko got a link that explains this? I could study it instead of bothering you. :)
19:27 moritz_ rokoteko: I think it's specified in either http://perlcabal.org/syn/S02.html or http://perlcabal.org/syn/S06.html
19:28 moritz_ S02, search for SETTING
19:28 rokoteko hm. ok. I comment no more, before studying this. thanks a bunch!
19:28 moritz_ S06 discusses how you can run stuff in a different setting, search for MAIN
19:29 diakopter pmurias: o wait, I erred; ... fixing
19:32 moritz_ rakudo: YOU_ARE_HERE(sub { say "hi"})
19:32 p6eval rakudo 6a7ded: OUTPUT«Could not find sub &YOU_ARE_HERE␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
19:33 rokoteko left #perl6
19:34 patrickas joined #perl6
19:37 patrickas hello
19:38 moritz_ hi patrickas
19:38 moritz_ patrickas: I've pushed a bit of stuff into the repo, including a new failing test
19:38 patrickas moritz_: I have a question about short options... how do I map -n to --long-name ? should that be another parameter added to process-cmd-args ?
19:38 moritz_ patrickas: I guess that iin the long run, process-cmd-args needs to know the names of all named parameters
19:39 moritz_ patrickas: and it can then decide if 'n' as a prefix is ambiguous or not
19:40 dalek nqp-rx: 3ad3114 | pmichaud++ | src/HLL/Compiler.pm:
19:40 dalek nqp-rx: Improve autoprint so that it only outputs the result value if the
19:40 dalek nqp-rx: executed code didn't itself send anything to stdout.  Coke++
19:40 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/3ad311437df65191e7a63f4434409d47b2f3a8dd
19:40 moritz_ I also re-read the spec and found that named parameters which are declared as arrays need special treatment (ie slurp up all following arguments unless they are switches again)
19:41 moritz_ so we need more than just Bool anyway
19:41 pmichaud I'
19:41 pmichaud I've remarked in the past that S19 is self-inconsistent in these respects
19:41 pmichaud not sure where my comments are/went ... looking
19:41 moritz_ I'm talking about S06, not S19
19:42 pmichaud oh, S06 also, since it's related
19:42 patrickas I guess I'll start with the easy cases then.
19:42 patrickas the skeleton should be able to handle arrays as is ...
19:42 moritz_ -- as separator should be easy to do
19:43 moritz_ I'm trying to figure out how to call MAIN automatically in Rakudo
19:43 moritz_ it's non-trivial
19:43 pmichaud I think it should be done from !UNIT_START
19:44 patrickas yes I noticed you added the tests ... I'll add a few tests too .. and if no one picks them up I suppose I can fix them myself on Sunday
19:44 moritz_ pmichaud: how can !UNIT_START inspect the lexpad of mainline?
19:44 diakopter pmurias: fixed :)
19:44 pmichaud moritz_: it can call mainline, then grab its context and look to see if there's a &MAIN in it
19:45 pmichaud for that matter, it could look at the lexinfo of the sub prior to ever calling the mainline
19:45 moritz_ that only works for determining if there's a MAIN
19:45 pmichaud true
19:45 moritz_ calling it is the hard part
19:46 pmichaud but the first version (grab the context) would also give you the &MAIN sub to be invoked
19:46 pmichaud since it'll be stored in the lexpad
19:46 moritz_ ok, how do I grab the context of a function that already exited?
19:46 pmichaud it's an attribute of the Sub PMC
19:46 moritz_ ok
19:47 pmichaud (unless it got cloned somewhere, which is entirely possible.)
19:47 pmichaud ....but not in this case, I don't think.
19:47 moritz_ I'll try
19:47 pmichaud it's also possible that we'll have the mainline code store its context in a dynamic var somewhere
19:47 pmichaud that seems a bit more likely.
19:48 pmichaud then UNIT_START could just run the mainline and get the context from the dynamic var
19:49 moritz_ dynamic? I thought that's reset when mainline exits?
19:49 pmichaud not if the dynamic var is outside of the mainline's context
19:49 moritz_ ah
19:49 pmichaud dynamic, not temp
19:49 pmichaud e.g.,  $*MAINLINE_CTX
19:49 moritz_ I'll try  getting the context first
19:50 pmichaud or perhaps $*COMPUNIT_CTX
19:51 pmichaud right now I'm trying to figure out a good way to flag a block/sub as being the one that represents the compunit
19:51 dalek csmeta: r291 | diakopter++ | trunk/Sprixel/ (3 files):
19:51 dalek csmeta: [perlesque] make every perlesque method "override" and make every invocation
19:51 dalek csmeta: also potentially (but not necessarily) virtual; ++pmurias
19:51 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=291
19:52 pmichaud I guess a special :subid() seems most likely.
19:53 k23z__ joined #perl6
19:53 k23z__ any way to see where sorear is and when he was last time here ?
19:53 k23z__ !seen sorear
19:53 k23z__ ah yes
19:53 pmichaud he was here about 3 hours ago
19:53 moritz_ k23z__: check the IRC logs
19:54 k23z__ ok
19:59 moritz_ get_attr_str() not implemented in class 'Sub'
19:59 moritz_ so a simple getattribute isn't enough to obtain the context
20:00 * moritz_ continues his research into parrot land
20:00 pmichaud hmmmm
20:01 pmichaud Parrot might not be exposing the ctx at the moment
20:01 pmichaud do we have a way yet for a comp unit to know if it's the mainline?
20:01 pmichaud I think we do.
20:01 pmichaud perhaps related to YOU_ARE_HERE
20:03 pmichaud no, that doesn't appear to be it
20:03 pmichaud hrm.
20:05 moritz_ YOU_ARE_HERE is for everything that's executed in the context of the setting
20:06 pmichaud that doesn't quite make sense to me yet, but I need to review what's happened there
20:08 pmichaud I need to focus on REPL a bit...will come back to MAIN a bit later
20:08 moritz_ sure
20:08 pmichaud the two have very similar issues involved, however.
20:12 patrickas moritz_: --name "spacey value"      :name�'spacey value'� even if not declared bool ?
20:13 patrickas I would have guessed it would be the same as : --name non-spacey-value
20:14 moritz_ patrickas: me too. I don't understand that part of the spec...
20:14 patrickas I'll skip testing this part then
20:14 moritz_ patrickas: except that there are some OS (win32) where you can actually get the command line string before it's broken up into an array
20:17 pmichaud my comments about S19 are at http://irclog.perlgeek.de/perl6/2009-11-02#i_1675622
20:17 patrickas I also don't understand some notations ....
20:17 patrickas what is the difference between this  :name�'spacey value'�
20:17 patrickas and this :name�val1 'val 2' etc�
20:18 patrickas the first means a hash with a key name and a value the string 'spacey value'
20:18 patrickas but what about the second ?
20:18 moritz_ it's a three-item list
20:19 patrickas ok
20:19 moritz_ ie  name => ("val1", "'val2'", "val3")
20:19 patrickas obvious now that you explain it :-)
20:20 moritz_ oh wait
20:21 moritz_ probably without quotes around val2
20:21 moritz_ rakudo: say «val1 'val2' val3».perl # probably wrong, because «...» is mostly NYI
20:21 p6eval rakudo 6a7ded: OUTPUT«("val1", "'val2'", "val3")␤»
20:22 pmichaud alpha:  say «val1 'val2' val3».perl
20:22 p6eval alpha 30e0ed: OUTPUT«["val1", "val2", "val3"]␤»
20:24 * moritz_ is in favour of disallowing multi MAIN
20:24 moritz_ you can't generate reliable, comprehensible usage messages if you allow it
20:25 thepler joined #perl6
20:27 patrickas The syntax for specifying array arguments would be: process-cmd-args(@args, {name=>'Array'})
20:27 TimToady me, I'd just poke a conditional call to MAIN at the end of the mainline when I compile it...
20:28 pmichaud "conditional call"?
20:28 moritz_ patrickas: I'd pass the type object as value
20:28 moritz_ patrickas: ie name => Array, name2 => Bool etc.
20:29 pmichaud I'd probably introspect the signature and use it
20:29 moritz_ that's what I do right now
20:29 TimToady S06:3055 lists the conditions
20:30 moritz_ http://github.com/moritz/process-cmd-args/blob/master/process-cmd-args.p6
20:31 moritz_ I don't know if we have knowledge of a) in rakudo at compile time
20:31 pmichaud it has to be a runtime selection, I think
20:31 pmichaud but no, in the general case we don't yet know (a) at compile time in Rakudo
20:32 TimToady you don't need the info at compile time
20:33 TimToady that's why you wrap the call in a conditional!
20:33 pmichaud more to the point, we don't have a reliable condition to test at the moment
20:34 TimToady a contextual set up by the start code would be appropriate, methinks
20:34 pmichaud *which* start code is the problem.
20:34 pmichaud especially if we're doing pre-compiled modules
20:34 TimToady the one that knows it's starting the mainline
20:35 pmichaud for a precompiled module, there's not something that "starts the mainline"
20:35 pmichaud at least, not in Parrot
20:35 * TimToady stares at pmichaud :)
20:36 * moritz_ knows that kind of stares
20:36 * patrickas shivers
20:37 * TimToady also thinks people who can't introspect multis and come up with a decent usage message are somehow defective :)
20:37 moritz_ thanks :-)
20:37 * TimToady stares at moritz_
20:38 moritz_ for certain values of "decent" I could manage that
20:38 pmichaud I mean, sure, we can do something like   "if $*YOU_ARE_MAINLINE { MAIN(...); }
20:38 moritz_ but probably not for decent eq awesome
20:38 pmichaud but the hard part in Rakudo is being able to reliably set $*YOU_ARE_MAINLINE
20:38 TimToady It's a lofty goal to strive for, I'm sure :)
20:38 pmichaud because for precompilation, every module thinks it's potentially the mainline
20:39 moritz_ "your command line arguments are wrong" # decent?
20:39 TimToady I suspect we can do a bit better
20:39 TimToady you can at least list the candidates like jnthn++ does
20:40 moritz_ and show the user Perl 6 code when there's a constraint on an argument?
20:42 TimToady eventually someone will write the p6 shell, and then everyone will be happy.  :)
20:42 _buno_ joined #perl6
20:44 TimToady if CALLER eqv SETTING { MAIN(...) }
20:44 TimToady hmm, maybe === instead
20:44 pmichaud does the caller have to be the setting?
20:44 TimToady or some such
20:44 pmichaud or is it just that the setting is the outer context?
20:44 TimToady for the outer scope of the mainline code?
20:44 pmichaud yeah
20:45 TimToady hmm
20:45 pmichaud in our case, the setting isn't always the caller
20:45 pmichaud (it's an outer context, yes, but not necessarily the direct caller)
20:45 TimToady well, caller === some kind of you-are-here thing
20:46 polettix joined #perl6
20:46 TimToady I can't believe that this is impossible to know somehow... :)
20:46 pmichaud oh, I don't think it's impossible
20:46 pmichaud I just haven't stumbled on the appropriate magic yet
20:48 wasy_ joined #perl6
20:49 wasy_ left #perl6
20:49 TimToady my point was that you don't necessarily have to turn the lexical scope inside out, is all.
20:49 pmichaud right, I'm not thinking of anything like that
20:49 TimToady well, that's what the UNIT_START stuff was sounding like to me
20:50 pmichaud UNIT_START is essentially some glue that says "okay, some module got here, I have to figure out how to execute its mainline"
20:51 pmichaud if we do "use Test"  (which in turn loads Test.pbc) .... something has to cause the mainline code of Test.pbc to be invoked properly
20:51 TimToady sure, just stirring the pot...
20:51 TimToady didn't want it to burn :)
20:51 pmichaud we can't just mark the mainline code with a :load flag, because then the mainline executes before any of its nested init/check/etc blocks
20:52 pmichaud we can't put the mainline code at the end, because Parrot requires lexically nested blocks to come after the block they're nested in
20:52 patrickas rakudo: my %h={'t'=>Bool}; say 'truthy' if %h{'t'};
20:52 p6eval rakudo 6a7ded:  ( no output )
20:52 pmichaud so, we put it at the beginning, and have a :load sub at the end that calls UNIT_START and passes the mainline as an argument
20:53 pmichaud UNIT_START takes care of setting an appropriate outer context, invoking the mainline, and returning the result
20:54 pmichaud (passing command line arguments if there are any, etc.)
20:54 patrickas pugs: my %h={'t'=>Bool}; say 'truthy' if %h{'t'};
20:54 p6eval pugs:  ( no output )
20:54 patrickas bug ?
20:55 pmichaud type objects are undefined (and hence "false")
20:55 pmichaud %h{'t'} is a type object
20:55 pmichaud so no, not a bug
20:57 patrickas I guess that makes sense ... but I did not expect it to be that way.
20:57 quietfanatic joined #perl6
20:57 moritz_ %h.exists{'t'}
20:57 ash_ pugs: say Bool.defined
20:57 p6eval pugs: OUTPUT«␤»
20:57 moritz_ or $h<t> ~~ Bool
20:58 ash_ i think the smart match is probably the functionality you wanted
20:58 ash_ pugs: my %h={'t'=>Bool::False}; say 'truthy' if %h<t> ~~ Bool;
20:58 p6eval pugs: OUTPUT«truthy␤»
20:59 pmichaud moritz_: I'm guessing we'll likely have a dynamic var that indicates a given block is to act as mainline code
20:59 pmurias diakopter: re perlesque closures vs runtime closures what do you mean?
20:59 pmichaud so we'll have something like    if $*YOU_ARE_MAIN { Main() }    added to the code generation whenever Main is defined in the compilation unit
20:59 pmichaud er, &MAIN
21:00 patrickas moritz_: I added a bunch of tests, most of which are failing, even ones that were passing are now failing (because I used {'t'=>Bool} instead of {'t'=>'Bool'} )
21:00 patrickas I guess that's good since it gives people and easy way to start fixing :-)
21:01 pmichaud afk, walk to think about repl and main
21:04 BrowserUk joined #perl6
21:05 diakopter pmurias: I mean that you shouldn't plan to make a 1:1 between p6 classes/objects and clr classes/objects
21:05 diakopter pmurias: make another layer of object system
21:05 moritz_ patrickas: I disagree - fixing code requires deeper understanding than extending
21:05 diakopter with its entirely own dispatch/resolution
21:06 pmurias why?
21:06 diakopter pmurias: b/c it needs its own dispatch/resolution
21:07 pmurias diakopter: will the continuations work with the perlesque methods
21:08 diakopter pmurias: explain?
21:09 patrickas moritz_ you're probably right ... my impression is tainted by the fact that I know the commit that messed it up contains a single change ... I guess I'll fix that one myself then.
21:09 pmurias class Foo {method foo() {# can i save the continuation here?}};my $foo = Foo.new;$foo.foo();
21:09 diakopter you can save the continuation, but what will you do with it? you have to have something to "catch" it
21:10 pmurias "catch"?
21:10 patrickas I'll also add the first negation case cause it seems easy as it does not require a "looks Truethy but false" situation.
21:11 diakopter pmurias: yes, a continuation is a typed object just like everything else. you'll need to store it someplace. a closure is a good spot.
21:11 diakopter and you need something that knows how to execute it
21:12 moritz_ patrickas: we should also re-name the hash passed to process-cmd-args, since it's now not only the boolean named
21:12 patrickas %special-names ?
21:12 pmurias diakopter: i can store a continuation in a variable
21:12 moritz_ %named-params or %typed-named or so
21:12 moritz_ or just %named
21:13 diakopter pmurias: yes.
21:13 diakopter but it's difficult to know its type beforehand, so you'd have to do something like this:
21:14 pmurias diakopter: show an example of what do you mean by a continuation type
21:15 moritz_ patrickas: I've updated the support code at the end of the file to actually pass the types along
21:15 pmurias as i can imagine it being something other than Continuation
21:15 pmurias s/can/can't
21:16 diakopter yes, it's parametric on the signature of the routine it would return to
21:16 diakopter <still writing an example>
21:17 * pmurias waits patiently
21:23 quietfanatic rakudo: say (multi say (Int $x) {...}).candidates
21:23 p6eval rakudo 6a7ded: OUTPUT«saysay␤»
21:23 quietfanatic I'd go in and make a patch to fix this bug but Rakudo's internals are too scary.
21:24 diakopter perlesquel: sub a(-->int) { say(frame); return 1}; a();
21:24 p6eval perlesquel: OUTPUT«Sprixel.Frame␤real 0.04␤user 0.02␤sys 0.00␤»
21:24 moritz_ quietfanatic: I've recently patched something which I thought was quite scary, and it turned ot not to be scary at all
21:24 diakopter pmurias: hunh. I guess it is the base type (Sprixel.Frame)
21:24 diakopter oh, I see
21:24 moritz_ quietfanatic: and then I've worked on something which looked quite straight forward, and turns out to be scary :/
21:25 diakopter pmurias: the type of the continuation frame will be enforced when the frame "returns"
21:25 diakopter pmurias: (when it is casted to the interface that represents its return value)
21:25 diakopter pmurias: (sorry for the diversion into sprixel internals)
21:25 diakopter pmurias: it should "just work".  You can write your own "call/cc" now
21:26 quietfanatic I'm guessing it's the ".sub 'new'" section of src/builtins/Code.pir
21:26 quietfanatic no maybe not
21:28 * moritz_ guesses method routine_def($/) in src/Perl6/Actions.pm
21:28 moritz_ that new method seems to return the candidate, not the multi
21:30 moritz_ specifically lines 1041 and onwards (of Actions.pm)
21:31 quietfanatic Yeah I found that...but I have no clue how Actions.pm works
21:31 jnthn I'm not sure how best to fix that issue.
21:32 moritz_ shouldn't it be as simple as having one variable containing the PAST for the current candidate
21:32 jnthn Probably does need a change in routine_def though.
21:33 moritz_ and then emit PAST node that first does whatever it does now, and then returns that candidate?
21:33 jnthn moritz_: Don't think it wants an extra variable really...the other problem is that the thingy that installs all the candidates isn't necesarily in the same block as the candidate itself.
21:33 justatheory joined #perl6
21:33 jnthn But yes, changing what routine_def will "make" is the right answer.
21:34 moritz_ and luckily it's "just" 102 lines long :-)
21:34 jnthn EMORETHANDALMATIANS
21:35 moritz_ lol
21:35 pmichaud won't routine_def continue to make PAST for a wrapper object?
21:35 pmichaud (and calls to code to install the wrapper into the appropriate multi?)
21:35 jnthn pmichaud: Well, at the moemnt it makes a node that looks it up.
21:35 jnthn oh heh
21:36 dalek csmeta: r292 | diakopter++ | trunk/Sprixel/src/Perlesque/Terminals.cs:
21:36 dalek csmeta: [perlesque] change frame keyword to _cc so it doesn't conflict with
21:36 dalek csmeta: Sprixel.Frame as a typename (I need also to make the type resolution case
21:36 dalek csmeta: sensitive)
21:36 dalek csmeta: review: http://code.google.com/p/csmeta/source/detail?r=292
21:36 patrickas moritz_: starting seeing some strange is() and is_deeply() nehaviour!
21:36 jnthn I wonder what happens if we toss that code and let the code that handles anonymous subs always return whatever it would.
21:36 patrickas rakudo: use Test; sub p() {my (@a ,%h);@a = ();%h = {}; return @a, %h; }; plan *; is( p() , ( [] , {} ) ); done_testing;
21:36 p6eval rakudo 6a7ded: OUTPUT«not ok 1 - ␤#      got: ([], {})␤# expected: ([], {})␤1..1␤# Looks like you failed 1 tests of 1␤»
21:36 jnthn (Which would be the specific candidate.)
21:36 pmichaud right
21:36 moritz_ patrickas: yeah, it's fragile :(
21:36 patrickas the got and expected seem the same to me ... but the tests are failing anyway .. same thing is happening for is_deeply
21:36 jnthn (fixing bugs by deleting code)++ ;-)
21:38 jnthn I'm tired to the point that I don't trust myself to do any code tonight. But I have a pretty free weekend. Or someone else feel free to beat me to it. :-)
21:38 diakopter pmurias: I'll work on that... and get back to you.
21:38 quietfanatic does the make $past statement determine what it returns?
21:39 moritz_ yes
21:39 quietfanatic oh (just read above) never mind, I see.
21:39 patrickas moritz_: Could that be the Weekly challenge number 4 ?
21:39 patrickas fix is_deeply :-)
21:40 patrickas or at least make it less broken
21:40 quietfanatic I'm guessing it's this "$past := PAST::Var.new( :name($name) );"
21:40 jnthn quietfanatic: Yup, that's the thingy.
21:40 jnthn (the wrong thingy)
21:40 moritz_ patrickas: I guess it's more involved... probably is_deeply is right, and everything else is wrong
21:40 quietfanatic that's making it the wrong return value
21:40 moritz_ jnthn: I'm compling now without that line... built Test.pir
21:41 jnthn moritz_: It's probably not quite that simple.
21:41 jnthn Well
21:41 jnthn Maybe it is
21:41 jnthn :-)
21:41 patrickas oh ok :-( too bad
21:41 moritz_ patrickas: [] and () don't return objects of the same kind, but .perl sometimes produces identical output
21:41 moritz_ jnthn: it's not
21:41 * jnthn didn't check out the code, it just feels too simple
21:42 moritz_ patrickas: we have what feels like a dozen listy types, and .perl only produces two different kinds
21:42 moritz_ () and []
21:42 patrickas moritz_ I figured about [] and () being different ... but [] was even worse :-)
21:42 pmurias diakopter: when i invoke a continuation why should it's return type matter?
21:42 patrickas rakudo: use Test; sub p() {my (@a ,%h);@a = [];%h = {}; return @a, %h; }; plan *; is( p() , ( [] , {} ) ); done_testing;
21:42 sahadev left #perl6
21:42 p6eval rakudo 6a7ded: OUTPUT«ok 1 - ␤1..1␤»
21:43 moritz_ rakudo: say <a b c>.WHAT; say (1, 2).WHAT; sub f { return 1, 2 }; say f().WHAT
21:43 p6eval rakudo 6a7ded: OUTPUT«Parcel()␤Parcel()␤Parcel()␤»
21:43 patrickas Who! I am getting a different output here ! time to pull again :-)
21:43 jnthn moritz_:
21:43 jnthn $past := create_code_object($past, 'Sub', $multi_flag, $sig_setup_block);
21:43 jnthn On that line try
21:43 jnthn my $final_result := $past := create_code_object($past, 'Sub', $multi_flag, $sig_setup_block);
21:43 diakopter pmurias: you're right; it doesn't.
21:44 jnthn And change $past := PAST::Var.new( :name($name) ); to make $final_result;
21:44 jnthn (or another equivalent neater change)
21:44 jnthn That may do it.
21:44 diakopter pmurias: but it does throw away the entire intermediary stack(s) branched from when the continuation was saved.
21:45 moritz_ jnthn: I'm not quite following you, and I'm quite tired too... so maybe it's better to leave it for tomorrow :-)
21:45 jnthn moritz_: :-)
21:45 pmurias diakopter: continuations shouldn't do that
21:45 quietfanatic I could try that I suppose.
21:45 diakopter pmurias: what do you mean; explain?
21:46 moritz_ bed&
21:46 jnthn night o/
21:46 moritz_ \o
21:46 patrickas good ight
21:46 pmurias what do you mean by throwing away the intermediary stack?
21:47 diakopter the stack created/initiated by the call/cc
21:47 diakopter invocation
21:48 pmurias invoking a continuation sets the stack to the state when the continuation was saved
21:49 diakopter I know; I thought that's what I said; sorry if I was confusing.
21:49 pmurias look at http://en.wikipedia.org/wiki/Delimited_continuation for continuations which only save part of the stack
21:50 pmurias re layering the object system it's very important to avoid adding an extra layer over object system if we want decent performance
21:50 diakopter that's absolutely not possible
21:51 pmurias what are the problems?
21:51 diakopter it's possible for an optimizing compiler, yes
21:51 pmurias that's what i'm interested in
21:52 diakopter well then of course it's possible.  I'm not writing an optimizing compiler anytime soon.
21:52 diakopter but for Perl 6 code as input, the only way I see any kind of success path for the foreseeable few years is to follow the similar path of Rakudo
21:53 pmurias the path being?
21:53 diakopter afaict, lots of dispatches, lots of overload resolutions
21:53 diakopter for every operation
21:54 pmurias writing an optimizing compiler is more fun
21:54 diakopter I still foresee very large performance advantages over parrot, simply because the primitives in those resolution/dispatch methods can be much lower-level
21:55 Targhan joined #perl6
21:55 pmurias than emitting naive code  and jumping through hops to make it run acceptably
21:56 diakopter I'm sure it will be, several years down the road...
21:56 diakopter :P
21:56 diakopter (for me)
21:57 quietfanatic jnthn: I made the changes you mentioned but it doesn't seem to act any different.
21:58 jnthn Hmm. :-/
22:06 pmurias diakopter: re the question i asked you about methods with unknown name is there a fast way to do it if i know the method signature in advance?
22:06 quietfanatic Is there a way to insert a debugging message into Actions.pm?
22:07 diakopter pmurias: when is "in advance"?
22:07 pmichaud quietfanatic:   { pir::say('debug'); }
22:07 jnthn quietfanatic: pir::say("# some message ")
22:07 pmichaud oh, curlies aren't needed in Actions.pm
22:08 pmichaud I was thinking in Grammar.pm :-)
22:08 pmichaud one can also do:   pir::printerr("# some message \n");
22:08 quietfanatic ah I see.  It didn't like plain say()
22:08 pmichaud right, because then it tries to use the say() in your runtime
22:08 pmichaud and your runtime might not be fully available yet
22:09 diakopter pmurias: I've gtg
22:09 pmurias all methods will be P6object method_name(P6object capture) {...}
22:09 pmurias diakopter: ok, see you tommorow
22:10 diakopter pmurias: in that case, it's simpler, yes, because no casting is needed
22:10 diakopter but string comparisons still need done
22:10 pmichaud anyway, pir::printerr("message\n");  is nice because if you're doing --target=pir or later the debug messages aren't in the midst of the thing trying to be compiled :)
22:10 diakopter if you can convert the method stringnames at compiletime to an array, those indexes can be emitted as a jumptable, and the switch/case will be much more efficient
22:11 diakopter pmurias: afk&
22:12 quietfanatic Does NQP support return?
22:13 pmichaud of a single value, yes
22:13 quietfanatic how about of no values?
22:13 pmichaud no
22:13 quietfanatic jus tto exit the sub?
22:13 pmichaud need to do at least return 0 or something like that
22:13 quietfanatic Ah huh.  That may explain it.
22:13 pmichaud return is implemented as a prefix listop
22:13 pmichaud (because nqp doesn't have listops)
22:13 quietfanatic I seems to ignore a bare return;
22:14 pmichaud hmmmm, should at least get some sort of error
22:14 sjohnson diakopter: make you can help me with this question.  does p6 have any javascript-like syntax for doing simple sed/perl5 stuff?  ie,  if ($string.match(/something/)) { do something } ?
22:14 bkeeler Good afternoon, folks!
22:14 pmichaud oh, it might be treating bare return as a name lookup
22:14 quietfanatic so after getting make $final_result it continues and gets make $past anyway.
22:15 pmichaud I wonder if it would be hard to create  term:sym<return> in NQP, and if that would even work.
22:15 ash_ sjohnson: you mean ~~ ?
22:15 ash_ rakudo: if 'abc' ~~ /a.c/ { say $_ }
22:15 p6eval rakudo 6a7ded: OUTPUT«Any()␤»
22:15 pmichaud sjohnson: if $string ~~ /something/ { do something }
22:16 Chillance joined #perl6
22:16 ash_ rakudo: if 'abc' ~~ /(a.c)/ { say $_ }
22:16 p6eval rakudo 6a7ded: OUTPUT«Any()␤»
22:16 ash_ i guess i should of used $/
22:16 pmichaud rakudo:  if 'abc' ~~ /a(.)c/ { say $0 }
22:16 p6eval rakudo 6a7ded: OUTPUT«b␤»
22:16 ash_ rakudo: given 'abc' ~~ /a.c/ { say $_ }
22:16 p6eval rakudo 6a7ded: OUTPUT«abc␤»
22:17 ash_ i rather like given
22:17 pmichaud rakudo:  given 'abc' { when /a.c/ { say $_; } }
22:17 p6eval rakudo 6a7ded: OUTPUT«abc␤»
22:17 sjohnson pmichaud / ash_ : i realize the ~~ or given/when structure is there... but i was wondering if there was a javascript like way to do it... ie, a String method.
22:17 pmichaud sjohnson: oh.  .match
22:17 sjohnson not saying that i would prefer this... just very curious about it
22:18 sjohnson ahh, cool
22:18 pmichaud rakudo:  say 'abc'.match(/a.c/);
22:18 p6eval rakudo 6a7ded: OUTPUT«abc␤»
22:18 pmichaud rakudo:  if 'abc'.match(/a.c/) { say 'yes'; }
22:18 p6eval rakudo 6a7ded: OUTPUT«yes␤»
22:18 sjohnson pmichaud: indeed, this is what i was curious about.  im kinda cool it is in there, as another timtowtdi way to do it
22:18 quietfanatic Aha!  It works! jnthn++
22:19 quietfanatic sort of.  May have caused a different error.
22:21 masak joined #perl6
22:21 masak ahoy, #perl6!
22:21 bkeeler o/ masak!
22:22 masak say, has anyone else noticed that a lot of people report that they've been stumbling on the fact that nowadays you need to scope-declare free regexes with 'my'?
22:22 masak is it possible that that indicates a design smell?
22:23 bkeeler Could default them to 'my' if they're not in a class/grammar perhaps
22:23 masak perhaps.
22:23 PerlJam masak: where do they "need" to be scoped?
22:24 masak PerlJam: outside of a grammar.
22:24 masak at least if they're named.
22:24 masak PerlJam: because they're basically methods, and methods need a metaclass to has-scope themselves to.
22:24 masak or sump'n.
22:24 PerlJam oh, I see what you're saying
22:25 masak it wasn't always like that.
22:25 bkeeler Of course you can't really do much with them outside a grammar for now
22:25 masak in alpha, where we cheated more, it worked fine without 'my' :)
22:26 bkeeler / <foo> /   won't find a lexical 'foo'
22:26 bkeeler Perhaps I should work on that next
22:27 masak ++bkeeler
22:27 bkeeler pmichaud: had a chance to inspect my 'regex-interpolation' branch?
22:29 wknight8111 joined #perl6
22:31 kel__ joined #perl6
22:34 patrickas rakudo: use Test; sub p() {my (@a ,%h);@a = [];%h = {}; return @a, %h; }; plan *; is_deeply( p() , ( [] , {} ) ); done_testing;
22:34 p6eval rakudo 6a7ded: OUTPUT«not ok 1 - ␤#      got: ([[]], {})␤# expected: ([], {})␤1..1␤# Looks like you failed 1 tests of 1␤»
22:45 lue ohai!
22:45 lue (I'd like to see the removal of the src/cheats folder. It just seems out of place)
22:48 masak lue: \o
22:49 masak lue: I'm afraid that folder is very much in use.
22:49 masak see the Makefile for just how much.
22:49 lue Not that I don't want it there, it just looks odd in a language interpreter. (It wouldn't be odd in a game :) )
22:50 masak your complaint seems to be purely on the level of naming.
22:50 masak what if the contents of that folder actually are a lot of cheats?
22:50 jnthn They *are* cheats. :-)
22:50 masak see? :)
22:50 jnthn It's a quite apt name.
22:51 masak and 'apt' is the opposite of 'out of place'.
22:53 quietfanatic Indeed, changing what routine_def makes breaks something else.
22:53 jnthn They're things that get us to a workingish Perl 6 without having to beat all the hard guys.
22:53 lue I know. You just wouldn't expect to find it in a language interpreter! :)
22:53 lue [then again, it is Perl 6...]
22:53 arnsholt Compiler writing is, to a certain extent, cheating I think =)
22:54 masak lue: Perl 6 is my MMORPG.
22:55 lue :)
22:55 * lue finds +5 Beard of Unix
22:56 bkeeler If only we could charge millions of people $15 a month to hack on rakudo
22:56 masak lue: want to help me track down a GGE bug?
22:57 lue Ooh! Deep Magic™! What is it?
22:57 masak lue: I'm trying to port GGE from alpha to master, and I find one regex that simply hangs on parsing, and some others that parse wrong.
22:58 masak lue: I just pushed to the ng-compat branch at http://github.com/masak/gge, so if you want to play, please pull a copy and I'll guide you through it.
22:58 * lue realizes how long it's been since he last logged into the RT
22:58 masak I cannot guarantee that this will result in an RT submit.
22:59 masak might be something wrong with GGE rather than Rakudo.
22:59 Psyche^ joined #perl6
23:00 quietfanatic It makes Test.pm not work.  "Ambiguous dispatch to multi 'plan'"
23:00 lue I know. You said bug I and thought .oO(Oh! RT! How long has _that_ been?)
23:00 quietfanatic where multi plan is only defined once
23:01 lue I didn't get any source code. Is that right? (no src/ folder)
23:01 masak lue: there's a lib/ folder.
23:02 masak lue: you'll need to switch branches. 'git pull; git co -b ng-compat origin/ng-compat'
23:03 lue ah. (dur)
23:03 lue I actually cloned it as a new repository *.*
23:04 masak that's good, if you didn't have it before.
23:05 lue git co doesn't work :)
23:05 masak hm.
23:05 masak any informative error message?
23:06 lue git: 'co' is not a git-command. See 'git --help'.
23:06 masak oh, sorry :)
23:06 masak it's 'git checkout'
23:07 * masak falls victim to his convenient aliases :P
23:07 masak they're excellent until you try to tutor others...
23:07 lue > git checkout -b ng-compat origin/ng-compat
23:07 masak aye
23:07 masak should work.
23:07 lue fatal: git checkout: updating paths is incompatible with switching branches/forcing
23:07 lue Did you intend to checkout 'origin/ng-compat' which can not be resolved as commit?
23:07 lue [trying again]
23:07 PerlJam masak: git should come with those aliases by default.  Everyone uses them.
23:07 masak lue: did you do a 'git pull' before?
23:08 quietfanatic I have rak aliased to rakudo perl 6 on my system, so I often find myself typing "rak: ..." into IRC
23:08 lue does git pull always have to come first
23:08 ash_ lue: git checkout -t origin/ng-compat
23:08 masak lue: or what ash_ said.
23:08 ash_ not only does it make a local branch, it makes it a tracking branch too, and checks it out
23:09 ash_ so that kills 3 birds with 1 stone
23:09 masak lue: well, the 'git pull' was so that it should pull the origin/ng-compat thing, so that it would know what it was. :)
23:09 masak ash_++
23:10 lue running what ash_ gave: fatal: git checkout: --track and --no-track require -b
23:10 lue What has happened to my copy of rakudo/git ? :)
23:10 lue then putting in -b causes the same fatal err as before!
23:11 masak :/
23:11 ash_ git branch -l ?
23:11 lue still on master
23:11 * lue will attempt to reclone rakudo to try and resolve this issue; please wait
23:12 masak er.
23:12 ash_ oh
23:12 ash_ there is no origin/ng-compat
23:12 lue I just went to the github page for GGE and realized.
23:12 masak GGE != Rakudo.
23:13 lue I am !SMART /o
23:13 lue \
23:13 masak so. if you try it with GGE, you're likely to have a higher success rate.
23:15 lue Unless I *need* rakudo to start, I'm ready. [probably do need it]
23:16 masak you need it.
23:16 masak as freshly a build as possible.
23:17 masak s/ly//
23:17 lue I acciendatly rm -rf 'd it [see above for attempt at resolution]. It's going to be fresher than 5 seconds ago.
23:18 masak actually, all you need is a 'perl6' executable in your path.
23:18 mathw hey
23:19 masak mathw!
23:19 masak mathw: congrats on the successful performance!
23:19 mathw Thanks
23:19 mathw I can get to work on Form.pm after I've slept :)
23:19 masak YaY
23:20 * masak ushers mathw towards the sleeping pod
23:20 * lue forgot what floor those are on
23:20 mathw No I need to wind down first
23:20 mathw I'm watching a bit of TV
23:20 masak they're on Nivelo 38. :)
23:20 mathw bit of chatting
23:21 * masak .oO( src/chats )
23:22 jnthn o/ mathw
23:22 mathw o/ jnthn
23:22 jnthn Form.pm! \o/
23:22 lue .oO(src/chats/cheats/[OFF].pm)
23:22 mathw heh
23:22 mathw tomorrow, jnthn
23:22 lue More of my !SMART coming, but what is Form.pm
23:23 mathw I should have time for that, maybe an aikido class (if I wake up soon enough), and some music to transcribe
23:23 masak lue: it's the R in Perl.
23:23 masak Reporting.
23:23 mathw lue: Data formatting, the Perl 6 approach to Perl 5's 'format' function
23:23 jnthn .oO( look at that n00b, insinuating it's called PERL ;-) ;-) )
23:23 masak O.O
23:24 masak everybody knows it's really P.E.R.L.
23:24 lue PE L (<-- Wheel of Fortune)
23:25 * masak recalls some Perl person naming a tool 'pler', and subsequently being nibbled to death by the Japanese
23:25 lue I thought were the Extraction of Practial Reports Language(EPRL)!
23:25 mathw Peppered Egg & Radish Langoustines
23:25 lue Or maybe the Reports of Practical Extraction Language (RPEL)!
23:25 mathw well it does have a REPL
23:26 lue .oO(src/eastereggs/LifeOfBrian.pm)
23:26 masak lue: how's that Rakudo build coming?
23:26 lue core.pm > core.pir . Almost....
23:27 masak I've isolated the bug a bit more.
23:28 mathw oh yes
23:28 mathw I could set a build going
23:28 mathw I've not updated Rakudo for ages
23:29 lue I have set my rakudo folder to part of my $PATH [lazy], but that stupid "parrot must be with you!" err :(
23:29 lue EGETOFFMYSHOULDER
23:30 * masak has updated Rakudo for ages :)
23:31 lue How do I fix that?
23:31 lue (stupid segmentation fault)
23:31 masak lue: 'make install'
23:32 lue That would never occur to me (considering I _never_ install it) dankon.
23:33 masak you should. that way, you can type 'perl6' from anywhere.
23:36 lue I would on my own computer, but never on a server I can't install to /usr/* . I don't know why, I just like having all my programs in /usr
23:36 masak all set?
23:37 masak ready to proceed to the next level?
23:37 ruoso joined #perl6
23:38 lue I found the exit! World 6-0, here I come!
23:38 * mathw has a rakudo
23:38 masak lue: ok, Mario. do you have GGE, and is it set to the ng-compat branch?
23:38 mathw hah
23:39 mathw compilation error :)
23:39 lue yes i do. Haven't done anything else with GGE though.
23:39 masak right. so let's do something with it. :)
23:39 masak hm, let's make a Makefile.
23:39 saaki rakudo: $str = 'a' _ 'b'
23:39 p6eval rakudo 6a7ded: OUTPUT«Confused at line 11, near "$str = 'a'"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
23:39 saaki ?
23:39 lue just run Configure, right?
23:40 masak lue: 'perl6 Configure' doesn't work too well. so maybe 'cp Makefile.in Makefile' instead.
23:40 masak saaki: the '_' is spelled '~' nowadays.
23:40 saaki thx
23:40 masak rakudo: my $str = 'a' ~ 'b'; say $str
23:40 p6eval rakudo 6a7ded: OUTPUT«ab␤»
23:41 masak lue: and then change the first three lines to say meaningful things rather than <PERL6> etc.
23:41 masak (in Makefile)
23:41 masak I have 'PERL6=perl6'
23:41 masak and RAKUDO_DIR pointing to my Rakudo dir.
23:42 masak and PERL6LIB pointing to the directory with GGE in it, colon, $(RAKUDO_DIR)
23:42 masak lue: after you've done something similar. try running 'make'.
23:43 lue Unable to find module 'GGE::Match' in the @*INC directories.
23:44 lue PERL6LIB='~/gge:$(RAKUDO_DIR)', RAKUDO_DIR=~/rakudo
23:44 masak try expanding the ~ into what it really means.
23:44 masak not sure the 'make' tool respects ~
23:45 lue Still no. That's weird.
23:45 masak oh, wait.
23:45 masak should be ~/gge/lib
23:45 masak or equiv.
23:46 lue Just realized that :)
23:46 masak because that's where the modules are.
23:46 masak sorry :)
23:46 lue winning...winning... (*cough* s/winning/compiling/)
23:47 masak I think you're home free now.
23:47 masak lue++
23:48 mathw hmm
23:48 mathw some interesting problems with Form.pm in new rakudo
23:48 mathw but much more of it works than it used to
23:48 lue aaand... done!
23:48 mathw I shall examine them properly tomorrow
23:49 mathw but now... bed
23:49 masak lue: 'export PERL6LIB=`pwd`/lib; perl6 t/perl6regex/01-regex.t'
23:50 masak lue: over here, that runs the first 414 tests fine, and then hangs. see if it does the same for you.
23:50 masak mathw: \o
23:51 lue Why is the goal of GGE to be slow? (Besides heritage & name)
23:52 masak lue: being slow is just a side effect of the rest of the things it is: a grammar engine implemented on too high a level.
23:53 masak actually, it isn't as slow as I envisioned. :)
23:53 lue Ah. So hardware is your excuse :P
23:53 masak compilation is a bit of a drag, but it runs pretty OK.
23:53 masak rule compilation, that is. that's basically Rakudo being slow, though.
23:54 * lue is looking for CAD tools to design the RD* while waiting, IIUC (or has a suggestion :) )
23:55 masak well, if you're impatient to see the regex expression which hangs, you can do `./test-regex 'a**bc' ''` :)
23:55 justatheory joined #perl6
23:55 masak that's the golfed version of test 415.
23:56 lue I can wait. There's a sleepover tonight and I'm confined to this computer :/
23:59 cxreg i'm guessing "1..Inf" isn't meant to be lazy just yet in rakudo
23:59 masak I'm currently using that regex to try to figure out what's going on inside the optable parser that makes it hang.
23:59 * lue takes the way of impatience

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

Perl 6 | Reference Documentation | Rakudo