Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-10-08

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:00 quietfanatic Yeah.  It ought to find the right file if nobody's chdir'd
00:01 Tene unless it's in their $PATH ;)
00:02 quietfanatic Oh.
00:03 quietfanatic Of course, I could examine %ENV{PATH}...
00:03 Limbic_Region joined #perl6
00:03 quietfanatic ...but that may just be the beginning of a wild goose chase.
00:04 Tene look at Perl's FindBin library for ideas.
00:07 tylerni7 joined #perl6
00:12 quietfanatic Another thing: Is there a way to get a file's modification time?
00:12 quietfanatic $file ~~ :M does not work.
00:12 quietfanatic I conclude I shall use `stat`
00:16 r0bby joined #perl6
00:26 charsbar joined #perl6
00:28 envi^office joined #perl6
00:38 ShaneC does rakudo implement exceptions at all yet?
00:38 Tene ShaneC: Yes, but not extensively.
00:39 Tene ShaneC: what do you want to do with them?
00:39 ShaneC just basic try/catch
00:41 Tene Sure.  Just put a CATCH {...} block in another block.
00:43 crythias joined #perl6
01:16 ihrd joined #perl6
01:17 orafu joined #perl6
01:18 SmokeMachine joined #perl6
01:19 KyleHa joined #perl6
01:25 xenoterracide joined #perl6
01:35 hello joined #perl6
01:39 msmatsko joined #perl6
01:46 ihrd joined #perl6
01:55 ihrd left #perl6
02:06 diakopter first post!
02:06 diakopter snap out of it
02:07 diakopter o wait.
02:07 * diakopter hides
02:08 PerlJam hiding doesn't do much good if you keep making noise
02:08 diakopter heh
02:14 sjohnson howdy
02:15 pugs_svn r28658 | lwall++ | [STD] properly check dups inside individual sigs of a multisig
02:15 pugs_svn r28658 | without interering across different sigs, or with only-ness in the body.
02:17 PerlJam "interering"?
02:17 PerlJam :)
02:18 * diakopter am writing up notes for redoing sprixel's object/type/calling-conventions (the *right* way this time), now that the interpreter engine proves stable for any sort of control flow
02:19 PerlJam btw, diakopter++ for sprixel
02:23 diakopter thanks :)
02:39 * PerlJam wonders if the book should mention the other perl6 implementations and give URLs for them
02:40 ihrd joined #perl6
02:45 Confield joined #perl6
02:45 Confield left #perl6
02:45 Confield joined #perl6
02:48 xinming_ joined #perl6
03:03 SmokeMachine joined #perl6
03:19 ihrd joined #perl6
03:23 Ryan52 left #perl6
03:25 [bjoern] left #perl6
03:36 Patterner "illegal hardware instruction  perl6"
03:50 am0c joined #perl6
04:00 ihrd left #perl6
04:10 Confield left #perl6
04:27 muri joined #perl6
04:35 ihrd joined #perl6
04:50 pugs_svn r28659 | lwall++ | [Cursor] don't delete important bits of the cached settings, duh
05:12 nbrown_ joined #perl6
05:12 justatheory joined #perl6
05:33 szabgab joined #perl6
05:46 snearch joined #perl6
06:10 moritz_ good morning
06:13 TimToady guten abend
06:15 ihrd left #perl6
06:19 sjohnson (´ー` )
07:07 mberends joined #perl6
07:08 rfordinal joined #perl6
07:10 iblechbot joined #perl6
07:17 bAUt ( `ー´)
07:30 mariuz joined #perl6
07:58 Grrrr joined #perl6
08:15 |Jedai| joined #perl6
08:18 pugs_svn r28660 | lwall++ | [STD] parse quasiunquotes correctly
08:18 pugs_svn r28660 | [STD_P5] prefix regex categories with p5 more consistently
08:20 pugs_svn r28661 | lwall++ | [rx.t] :Perl5 goes outside of // for now
08:28 jnthn oh morning
08:31 zloyrusskiy joined #perl6
08:33 maja joined #perl6
08:35 moritz_ \p/
08:37 Matt-W \o/
08:42 sjohnson \ö/
08:46 Matt-W :D
08:46 Matt-W sjohnson++
08:47 rfordinal left #perl6
08:47 sjohnson (´ー` )
08:50 carlin Unicode art; who needs real conversation anyway?
08:51 jnthn Conversation is srsly overrated.
08:59 mzedeler joined #perl6
09:30 NorwayGeek joined #perl6
09:39 jnthn (doing stuff at compile time)++
09:39 jnthn (doing said stuff we used to do at runtime in PIR at compile time instead but in NQP)++
09:40 riffraff joined #perl6
09:43 Matt-W jnthn++
09:44 rgrau` joined #perl6
09:49 masak joined #perl6
09:49 masak good day, #perl6.
09:49 moritz_ \o/
09:50 Matt-W oh hai masak
09:50 Matt-W jnthn's been muttering about doing things at compile time in NQP that we used to do in runtime in PIR. I'm encouraged.
09:51 jnthn yayitsmasak
09:51 jnthn masak: timezone sync status? ;-)
09:51 * jnthn is slipping back into late nights and late mornings now his jetlag is wearing off.
09:53 drbean_ joined #perl6
09:53 jnthn Matt-W: If you're interested, compare what was removed in http://github.com/rakudo/rakudo/commit/2​634678620cceabc9d1ddccc52abbb1407ff2f5c with what was added in http://github.com/rakudo/rakudo/commit/c​83268b38b4e2a42310870f374c653cb063b014c
09:53 masak jnthn: today marks the first honest attempt to re-sync in a long time. result: FAIL. but still.
09:54 am0c joined #perl6
09:55 jnthn o/ am0c :-)
09:55 Matt-W jnthn: does all that stuff you removed only do what the added stuff does?
09:55 Matt-W because that's immensely cool
09:55 am0c \o/ jnthn OH HAI
09:57 jnthn Matt-W: Yes
09:57 jnthn Matt-W: Well
09:57 jnthn Matt-W: It did one thing.
09:57 jnthn That what went in does not do.
09:57 jnthn Which I'm not sure how to handle yet.
09:58 jnthn But it pretty much decides all of the stuff at compile time and emits code to build a correct signature.
09:58 jnthn Rather than figuring it out at runtime as the PIR did.
09:58 jnthn I mean, if we've got all the information... :-)
09:59 jnthn I now make it about half way through the setting, them something explodes when compiling Rat. :-/
10:02 Matt-W cool
10:02 Matt-W What's the thing it doesn't do?
10:02 simcop2387 joined #perl6
10:02 jnthn Consider:
10:03 jnthn subset Odd of Int where { $^n % 2 };
10:03 jnthn multi foo(Odd $x) { }
10:03 jnthn multi foo(Int $x) { }
10:03 jnthn So we expect foo(3) to call the first of those, not the second.
10:03 Matt-W We do
10:04 jnthn But for that to happen, we have to take Odd, identify that it's a refinement type, pull out the thingy it's refining (Int) and stick that as the nominal type, and boot the Odd over to the constraints.
10:04 jnthn Probably.
10:04 jnthn Or at least, that's what we were doing before now.
10:04 jnthn Though out of curiosity...
10:04 Matt-W So what you were doing is transforming it into
10:05 jnthn rakudo: subset Odd of Int where { $^n % 2 };; say Odd ~~ Int
10:05 p6eval rakudo 30e2cf: OUTPUT«1␤»
10:05 jnthn Oh hmm.
10:05 Matt-W multi foo(Int $x where { $^n % 2 } )
10:05 jnthn Matt-W: Yeah.
10:05 moritz_ I think TimToady once mentioned that subset types are notionally inlined
10:05 jnthn We may *just* get away with it.
10:05 Matt-W Provided your candidate sorting on wheres is okay, it's probably fine
10:05 jnthn But I think we need to really split it up.
10:06 jnthn My problem is that at the moment, I don't have a way to know - at compile time - if what I have is a refinement type or not.
10:06 Matt-W Although it might lead to LTA error reporting
10:06 Matt-W Ah
10:06 Matt-W Hmm
10:06 Matt-W that's a bit of a problem
10:07 moritz_ jnthn: but you can know at CHECK time, no?
10:07 jnthn The role stuff we can figure out easy enough, the fact that the user didn't write a type on something and that we need the default we can also figure out.
10:07 jnthn moritz_: Actually I think we *can* know at compile time.
10:07 moritz_ can subset types be stubbed?
10:08 jnthn Hmm. Not sure.
10:08 jnthn moritz_: The issue is more than we don't have the infrastructure at the moment to know.
10:08 Matt-W And at compile time, is there a problem if the subset type hasn't been declared yet, or is predeclaration enforced in Perl 6 for that sort of thing?
10:08 moritz_ well
10:08 moritz_ you can say ::Odd
10:09 jnthn Well, there's that too, yeah...what if it's a late-bound lookup.
10:09 moritz_ which means "that's a type, I'll declare that later"
10:09 jnthn Careful.
10:09 jnthn ::Odd inside a signature is a type capture.
10:09 moritz_ oh
10:09 moritz_ right
10:09 jnthn Which is the case that I'm considering here.
10:09 jnthn I don't think there is a way to build a signature from a not yet declared type.
10:10 jnthn (I think I consider that a good thing...)
10:10 Matt-W WEll
10:10 Matt-W it would be quite tricky, since you don't knwo what the type is
10:10 moritz_ and you can't do any sorting at compile time
10:10 Matt-W And I suppose you can't really build it incomplete, and come back later
10:10 jnthn Yeah
10:10 Matt-W Does that mean you need to be able to build them at runtime as well
10:10 jnthn So anyway, I expect by the time we hit the Odd in the signature we know what kind of type it is.
10:11 jnthn Even if it's stubbed, I highly doubt you can stub something as a class and then define it as a subset type.
10:11 jnthn I'd think std says no to those kinda tricks.
10:11 Matt-W Well that'd be a name collision wouldn't it
10:11 moritz_ std: class A { ... }; class A { } # sanity check
10:11 jnthn std: class Foo { ... }; subset Foo of Int;
10:11 p6eval std 28658: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol GLOBAL::<A> (from line 1) at /tmp/GsE9hZKcli line 1:␤------> [32mclass A { ... }; class A[33m⏏[31m { } # sanity check[0m␤FAILED 00:01 96m␤»
10:11 p6eval std 28658: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol Foo (from line 1) at /tmp/EcYNnXY1jv line 1:␤------> [32mclass Foo { ... }; subset Foo [33m⏏[31mof Int;[0m␤FAILED 00:02 96m␤»
10:11 Matt-W 'This name already exists as a class, go away'
10:12 moritz_ it doesn't do any sstubbing at all, it seems
10:12 jnthn Oh, I thought that had been put into std.
10:12 jnthn I musta been mistaken.
10:12 moritz_ I thought so too
10:13 moritz_ maybe it got b0rked by some other change
10:13 jnthn Anyway, I rather hope the kind of a type can't change, so I think with the right infrastructure we'll be able to know that at compile time.
10:13 Matt-W I don't think the kind of a type *should* be able to change
10:13 jnthn For now, I suspect I'll have to check it at the time we build the signature (check).
10:14 jnthn oh hmm
10:14 jnthn We go explodey on our Int multi(...) { ... }
10:14 Matt-W is that... a sub called multi
10:14 jnthn oh no
10:14 jnthn I shoulda really copied it
10:15 jnthn I was getting at, compiling a multi method with the "our Int" bit out front.
10:15 Matt-W ah
10:15 jnthn I suspect it may be the call to the trait handler though.
10:15 Matt-W so is it the our or the return type
10:15 Matt-W ah
10:15 moritz_ I think much of that 'our Int' is bogus, especially on methods
10:15 jnthn Yeah
10:16 jnthn It's probably on the call to trait_mod:<of>
10:16 * Matt-W isn't sure yet why you need 'our' methods
10:16 jnthn That probably just means I've a bug when building the sig for one of the trait_mod:<of> multi variants.
10:17 Matt-W Given what you're doing, that seems plausible
10:17 jnthn It's kinda challening to hack on some of this stuff.
10:17 Matt-W I bet
10:17 Matt-W That's why I'm not doing it
10:18 jnthn Mostly because you have to compile the setting before you can run the tests.
10:18 jnthn And compiling the setting and surviving its init sequence is actually quite hard.
10:18 Matt-W Well
10:18 Matt-W it's a test :)
10:18 jnthn The trait mods are probably some of the deepest use of multiple dispatch in the entire setting.
10:18 moritz_ well, compiling the setting worked, no?
10:18 Matt-W A very big, very mean test
10:19 jnthn moritz_: Yeah, it does not, it blows up at init time.
10:19 jnthn aha
10:19 moritz_ you can also try to run some basic tests with the s1 compiler
10:19 jnthn figured it.
10:19 moritz_ or did we move say/print to the setting?
10:19 jnthn moritz_: Yes, I've been playing with the s1 a lot.
10:19 jnthn moritz_: We moved say/print to the setting
10:19 moritz_ oh
10:20 jnthn moritz_: However, die ... will throw an exception with the output you desire. ;-)
10:20 moritz_ so no .t file runs without compiling the setting. Ha.
10:20 jnthn moritz_: I think we may end up though, having a PIR-based minimal "setting".
10:20 jnthn That we don't compile in at all other than to the stage 1 compiler.
10:21 jnthn Yes, correct. That's why this is a pain. :-)
10:49 colomon jnthn: does something in Rat really generate an "our
10:49 colomon Int multi"?
10:51 jnthn colomon: Num not Int actually
10:51 jnthn line 36
10:51 colomon ah, sure
10:51 colomon I did that.
10:52 colomon must have copied and pasted from somewhere, as I do not usually use "our" or return types.
10:52 jnthn colomon: It's valid Perl 6, just hits a bug.
10:52 jnthn In the refactor I'm doing.
10:52 jnthn (So I need to isolate and fix the bug...)
10:53 jnthn If I didn't hit it here, I'd do so in the spectets anyway.
10:54 colomon understood, and good hunting
11:13 ihrd joined #perl6
11:29 ihrd left #perl6
11:30 jnthn Initial signs are that changing the way we construct signatures at startup has won us another 10% saving.
11:31 Matt-W yay!
11:31 Matt-W jnthn++
11:32 jnthn Provided fixing up spectests doesn't cause any slow-down, it seems the last few days changes since I started on re-working signatures have taken away 20% of our startup time.
11:33 spinclad sweet!
11:34 jnthn Since we spend plenty of startup doing dispatches to set various things up, I'm hoping that as dispatch gets faster (next steps in what I'm working on over the next week or so) we'll shave yet more off.
11:35 Matt-W :)
11:35 spinclad (burning fat out of the layers of interpretation)++
11:37 ihrd joined #perl6
11:37 masak all speedups are very welcome indeed.
11:37 ihrd hi there
11:37 masak hi ihrd!
11:38 ihrd masak: hello
11:38 colomon does someone remember where pmichaud's awesome short card script lives online?  I know I found it for someone else a few month's back, but I don't remember where I found it now...
11:41 rgrau` colomon: They are in one of his slides IIRC
11:41 colomon yes...
11:41 masak colomon: it can also be found in the "Perl Myths" talk on SlideShare.
11:41 masak probably not copyable, though. :/
11:42 colomon Ha!
11:42 carlin http://gist.github.com/153993
11:42 colomon that reminded me, I actually have a copy.
11:42 colomon locally, I mean.
11:42 colomon carlin++
11:43 ihrd roles-related question
11:43 ihrd rakudo: role R { method foo { ... } }; class C {}; (C.new does R).^methods(:local)>>.name>>.say;
11:43 p6eval rakudo 30e2cf:  ( no output )
11:43 ihrd why I do not got 'foo' here?
11:43 colomon X~, that's what I was looking for.  \o/
11:43 jnthn ihrd: Ah, I've run into that one before.
11:43 masak ihrd: I agree that you should. I don't know why you don't.
11:43 jnthn ihrd: I think it's a bug.
11:44 jnthn ihrd: Suspect "does" is somehow not generating creating an updated meta-class or something.
11:44 ihrd jnthn, masak: thank you very mach :)
11:44 masak ihrd: will you submit it to RT, or shall I?
11:44 ihrd masak: yes!
11:44 masak great.
11:45 masak any(ihrd, masak) will submit it. :)
11:45 ihrd masak: :) I mean I like to submit this one
11:46 ihrd masak: I can`t do much for perl6 now, so I happy to do this bit
11:46 masak ihrd++
11:47 colomon rakudo: say ((1, 2, 3) X+ (5, 4, 3)).perl
11:47 p6eval rakudo 30e2cf: OUTPUT«[6, 5, 4, 7, 6, 5, 8, 7, 6]␤»
11:48 ihrd jnthn: can I use you suggestions here in the bug report?
11:48 jnthn Sure
12:06 envi^home joined #perl6
12:08 abra joined #perl6
12:09 takadonet joined #perl6
12:09 takadonet morning all
12:10 ihrd syntax 'of' NYI in Rakudo?
12:10 ihrd I mean something like '$o does R of Some'?
12:11 masak ihrd: there's R[Some]
12:12 masak takadonet: \o
12:13 jnthn std: $x does Positional of Int
12:13 p6eval std 28658: OUTPUT«[31m===[0mSORRY![31m===[0m␤Two terms in a row at /tmp/2CW3O8VXuf line 1:␤------> [32m$x does Positional [33m⏏[31mof Int[0m␤    expecting any of:␤      bracketed infix␤  infix stopper␤    standard stopper␤ statement modifier loop␤  terminator␤Other potential difficulties:␤
12:13 p6eval ..Variable $…
12:13 jnthn aye
12:13 jnthn std: $x does Positional[Int]
12:13 p6eval std 28658: OUTPUT«Potential difficulties:␤  Variable $x is not predeclared at /tmp/yHcZ4m20r0 line 1:␤------> [32m$x[33m⏏[31m does Positional[Int][0m␤ok 00:01 99m␤»
12:15 ihrd jnthn: I just read last part of you talk
12:15 ihrd where you say about Can of Beer
12:16 ihrd masak: yes, R[Some] works
12:16 jnthn rakudo: class Beer { }; role Can[::Contents] { }; my Can of Beer $starobrno;
12:16 p6eval rakudo 30e2cf:  ( no output )
12:16 jnthn ihrd: You probably saw that.
12:16 jnthn ihrd: That syntax is valid in declarations.
12:16 jnthn But I think not just as a noun anywhere.
12:17 ihrd jhnth: but not with `does`... *confused*
12:17 jnthn ihrd: does is just an operator
12:17 jnthn ihrd: It's RHS is parsed no differently to any other operator.
12:18 jnthn erm, Its
12:18 jnthn .oO( must make less grammar mistakes )
12:22 lmc joined #perl6
12:22 jnthn rakudo: say 2 * 69.72
12:22 p6eval rakudo 30e2cf: OUTPUT«139.44␤»
12:27 ihrd jnthn: when you say 'my Pack of Can of Beer ...' you mean Pack is parametrize role with argument Can wich is parametrized role too?
12:28 masak ihrd: pravda.
12:29 * masak cheats again with Cyrillic. bad masak!
12:29 ihrd masak: it is nice ;)
12:30 masak typing with Cyrillic layout is slow, because I don't know where the keys are at. :/
12:31 masak правда
12:31 ihrd OMG multiple variants of Roles! roles multi dispatch, I missed this one in spec.
12:32 ihrd ha! a lot of people who use single layout think we use to keyboards
12:32 ihrd s/to/two/;
12:33 ihrd and wondering how fast we swap it
12:34 zloyrusskiy ihrd, привет
12:34 masak are roles multi by default?
12:34 masak ihrd: are those the same people who think that the Chinese must have HUGE keyboards?
12:34 masak rakudo: role Foo[Int] { method bar() { "I only do Ints" } }; role Foo[Str] { method bar() { "I only do Strs" } }; say .bar for Foo[Int].new, Foo[Str].new
12:34 p6eval rakudo 30e2cf: OUTPUT«I only do Ints␤I only do Strs␤»
12:37 jnthn masak: yes
12:37 jnthn oh noes! I haz Slovak class...I wonder if I can still even speak this language...
12:38 jnthn masak: Chinese keyboards are crazy, so many thousands of keys...
12:38 jnthn ...and the fact that to fit them in such a small space, they have to be really small, and then you have a thing like a pointy chop-stick to press them, and you gotta be really accurate...
12:39 jnthn ...it's amazing!
12:39 masak jnthn: and you have to push the key from the right direction to get the right tone... it's a wonder they manage it.
12:39 jnthn Yeah, I know.
12:40 * jnthn bbl, slovak
12:56 [particle] joined #perl6
13:02 NorwayGeek joined #perl6
13:05 [particle] joined #perl6
13:12 PerlJam good $localtime all
13:12 ihrd Perljam: hi
13:12 moritz_ oh hai
13:12 moritz_ PerlJam++ # nice preface
13:12 PerlJam It's a start.
13:13 * moritz_ just learned a new word from reading a scientific paper: to epitomize. I like it.
13:16 PerlJam moritz_: btw, I have told you that I see your name every where I go?   There's a car place here called Moritz that puts its name on all of the vehicles it sells, so as I'm driving around town and glance at the cars around me, I'll invariably see your name :)
13:16 ihrd jhnthn: does traits example in your talk works?
13:18 moritz_ PerlJam: I deny the existence of any conspiracy related to that.
13:18 ihrd I have problem with multi trait_mod:<is>...
13:18 ihrd rakudo: multi tarit_mod<is>() { ... }
13:18 p6eval rakudo 30e2cf: OUTPUT«Malformed routine definition at line 2, near "tarit_mod<"␤in Main (src/gen_setting.pm:146)␤»
13:19 PerlJam ihrd: install mod_speling in your brain and/or fingers :-)
13:19 ihrd Perljam: you are right, I need one
13:21 ihrd rakudo: multi trait_mod:<is> (Container $r, doc, $text) {...}
13:21 p6eval rakudo 30e2cf: OUTPUT«Malformed routine definition at line 2, near "trait_mod:"␤in Main (src/gen_setting.pm:146)␤»
13:21 ihrd rakudo: multi trait_mod:<is> () {...}
13:21 p6eval rakudo 30e2cf:  ( no output )
13:23 ihrd rakudo: role doc {}; multi trait_mod:<is>(Container $c, doc, $text) { $c does doc($text) }
13:23 p6eval rakudo 30e2cf: OUTPUT«Malformed routine definition at line 2, near "trait_mod:"␤in Main (src/gen_setting.pm:146)␤»
13:24 ihrd it is exactly what I see in talk :(
13:26 masak ihrd: 'doc' is missing a sigil.
13:27 masak oh wait.
13:27 ihrd ::?
13:27 masak perhaps not.
13:27 ihrd this example have many confused parts for me
13:28 PerlJam ihrd: I could have sworn it worked at one point, but rakudo was very picky about the exact syntax.
13:28 ihrd how should work does role($foo)?
13:33 frederico joined #perl6
13:38 masak ihrd++ # "does" is somehow not generating creating an updated meta-class or something
13:41 ihrd I gonna look at LolDispatch, it use trait_aluxiliary:<is>...
13:49 abra joined #perl6
13:50 ihrd actually LolDispatch do not work too, with same issue
13:51 ihrd "No applicable candidates found to dispatch to for 'trait_mod:is'"
13:53 SmokeMachine joined #perl6
13:54 masak that sounds familiar.
13:54 masak ihrd: maybe look at the spectests, and see how it's done there?
13:56 Ananth joined #perl6
14:02 pmichaud good morning, #perl6
14:02 PerlJam morning Pm
14:02 ihrd masak: woow. it works
14:02 masak moning, pm.
14:02 masak ihrd: :)
14:03 ihrd example is broken, or mb, it is a little bit modern
14:04 masak it's possible there have been spec shifts in the meantime, yes.
14:10 rfordinal joined #perl6
14:11 ihrd I should sleep now, bye
14:11 ihrd left #perl6
14:12 hanekomu joined #perl6
14:12 abra joined #perl6
14:17 KyleHa joined #perl6
14:17 Psyche^ joined #perl6
14:19 * jnthn back
14:19 rfordinal left #perl6
14:19 masak jnthn: so, what's on the agenda? more signature refactors?
14:20 jnthn Fixing up spectest brekage fallout from this refactor first.
14:21 jnthn After that, I'm ready to start on the new binder.
14:21 jnthn I'm really not sure how long that is going to take me to get good enough.
14:21 jnthn Should allow us to close a bunch of tickets though.
14:21 jnthn Once it's done.
14:22 jnthn (like, the binding nameds to positionals one.)
14:22 moritz_ including a very old one by diakopter++ :-)
14:22 PerlJam jnthn: stop jabbering to us and get back to coding!  ;)
14:22 moritz_ that's the one I was thinking of, yes
14:22 masak ooh, binding-nameds-to-positionals! \o/
14:22 jnthn PerlJam: I'm enjoying jabbering in a langauge I speak well for a bit, after spending the last hour and a half jabbering in one that I speak badly. :-P
14:23 masak I have a new favorite problem ticket, by the way: http://rt.perl.org/rt3/Tic​ket/Display.html?id=69438
14:23 pmichaud names-to-positionals.... what's the approach there?
14:23 moritz_ when that's done we have to go through the setting and see if the names of the parameters agree in setting and spec
14:23 masak it's always possible to work around it, but it's often a bit of extra work.
14:23 pmichaud since we don't have :callsig yet ?
14:23 masak I think I'll take a look at it myself to try to figure out what the cause is.
14:24 jnthn pmichaud: Debating that a bit still, but one of:
14:24 masak moritz_: and if the names in the spec could be improved.
14:24 moritz_ masak: aye
14:24 abra_ joined #perl6
14:24 jnthn 1) Take slurpies and process those instead of callsig for now. Easy migration path then.
14:24 justatheory joined #perl6
14:25 jnthn 2) Just do what Perl6MultiSub does to get the args. But that is actually further away from what :callsig will give us.
14:25 jnthn And also only works if we're invoked from PIR.
14:25 pmichaud I'm fine with either of those.
14:25 jnthn Actually I'm really surprised we've never hit an issue where we try to invoke a Perl 6 multi from anywhere other than PIR. We've got very lucky there.
14:26 PerlJam jnthn: or we've constructed the maze just so we don't fall into the traps  :)
14:26 jnthn pmichaud: I'm still pondering exactly how I want a lot of this to look though.
14:27 jnthn pmichaud: Most specifically, when do we bind.
14:27 pmichaud jnthn: ack
14:27 jnthn pmichaud: There's a certain level of temptation to do it inside invoke.
14:27 pmichaud I think I like them separate
14:28 pmichaud I'm still in favor of a "bind_params" dynop
14:28 jnthn That's the obvious way, but I'm a tad "hmm" on it. :-)
14:28 pmichaud okay.
14:28 jnthn I mean.
14:28 jnthn The problem I have is...
14:29 jnthn We really need a way to be able to potentially bind a signature
14:29 jnthn But being able to fall back out if we fail to.
14:29 jnthn And have that cheap.
14:29 jnthn I think we have to create a full on lexical context for that anyway though.
14:30 jnthn But if we don't fall back into the runloop until after we've bound, the control flow gets a bit easier to manage.
14:31 jnthn Well
14:31 jnthn Maybe it doesn't actually matter.
14:31 jnthn Anywhere can invoke the ret cont to make it as if we never called in there.
14:31 jnthn The fun is in the multiple dispatch though.
14:31 jnthn We don't want to re-do a bunch of checks.
14:32 pmichaud seems like we want a continuation
14:32 jnthn It only gets tricky in that if we are invoked in a single rather than a multi dispatch, we still need to do all the checks.
14:32 jnthn And depending on the nature of the multi-dispatch, we may either
14:33 jnthn 1) Know that we can just find and be done with it or
14:33 jnthn 2) Have already done a full bind because we needed to know that we could
14:33 jnthn s/find/bind/
14:33 jnthn Yes, continuations may well be the answer here.
14:34 pmichaud iwbni there's an easy way for the binding operation to know if it's single or multi dispatch
14:34 jnthn Indeed, I'm still trying to work out a clean way to do that.
14:34 pmichaud i hate to suggest it, but perhaps a flag on the sub pmc?
14:34 jnthn Since contexts are PMCs now, though...
14:34 jnthn No, *not* the sub.
14:34 jnthn Imagine a bunch of recursive calls.
14:35 jnthn Some multi, some not.
14:35 jnthn Or in a threaded context.
14:35 ruoso joined #perl6
14:35 pmichaud but wouldn't we have to complete binding into a call before we can recurse?
14:35 jnthn It's about the current invocation rather than every invocation. So I think the flag wants to go on the context PMC.
14:36 jnthn Not if something in one of the constraints calls it, which would yes be contrived.
14:36 pmichaud ah
14:36 jnthn But anyway, contexts are PMCs, we can flag them.
14:36 pmichaud sure, flagging the context works nicely also
14:36 pmichaud er, wait
14:36 pmichaud hmmm
14:36 pmichaud flagging the caller context or the newly created context?  I guess caller.
14:36 jnthn Newly created, surely?
14:37 jnthn As in, the current invocation.
14:37 pmichaud ...how do you flag it before it exists?
14:37 jnthn By the time we get to binding, it has to exist.
14:37 jnthn And if we have already started binding, it already exists.
14:37 pmichaud I'm missing a step, just a sec
14:37 jnthn Binding needs the lexpad.
14:37 pmichaud the dispatcher calls invoke on a sub
14:38 pmichaud that creates a new context
14:38 pmichaud when we get back from invoke, aren't we already in the new sub's context ?
14:38 jnthn Right.
14:38 jnthn Yes.
14:38 jnthn Oh wait
14:38 jnthn Which caller did you mean?
14:38 jnthn :-)
14:38 pmichaud I don't know which caller I meant
14:39 jnthn Heh, I don't know which you meant either. :-)
14:39 pmichaud I'm just wondering when/if the dispatcher gets control after calling the invoke vtable
14:39 jnthn It'd depend.
14:39 jnthn There's two cases.
14:39 pmichaud so that it could flag the newly created context
14:39 pmichaud because prior to the invoke vtable, the new context doesn't exist
14:39 pmichaud if the dispatcher doesn't regain control, it doesn't have an opportunity to flag the context to say "this is multidispatch"
14:39 jnthn Wait, there's three cases. Let me enumerate them.
14:40 jnthn 1) A single dispatch. The multi-dispatcher hasn't been invoked at all. The binder needs to do all checks and binding work.
14:40 jnthn In this case, nothing has been flagged up at all. No flags set = do everything.
14:41 kent\n joined #perl6
14:42 jnthn 2) A multi-dispatch where the dispatch cache on the nominal types made a decision for us. We didn't actually bind anything, but we know that we only have positional arguments and that we don't need to do any type checks on them, just bind them, because we know from the type-based cache that it's fine.
14:42 jnthn In this case, the multi-disptacher's invoke vtable method after deciding this is the candidate to invoke calls VTABLE_invoke on the chosen candidate. At this point, we get an opportunity to set a flag saying "you've got a simple positional unchecked binding to do, go do it fast"
14:43 pmichaud okay.
14:43 jnthn 3) A multi-dispatch where we have constraints or named parameters. In this case, we need to actually try doing the binding to see if it will work out.
14:43 pmichaud don't we still need to do the remaining type checks, though, in case they have any side effects?
14:43 jnthn The key phrase was "nominal types" - let me expand on that...
14:43 jnthn These are the types that we cache based on already.
14:44 jnthn They are a simple "isa" or "does" check.
14:44 jnthn There's no side-effect.
14:44 jnthn If there's constraints, case (2) does not apply.
14:44 pmichaud even if the nominal types were sufficient to make a decision, we're not in case (2) if any of the checks weren't strictly nominal ?
14:45 jnthn Correct.
14:45 pmichaud then case #2 should read:   a multi dispatch wehre all of the type checks are nominal
14:45 jnthn We already have a bunch of stuff in Perl6MultiSub that says "is it OK to cache this"
14:45 jnthn Correct.
14:45 pmichaud okay
14:45 jnthn Case 3 is the interesting one in a copule of ways.
14:46 pmichaud the piece I was missing was that multisub's invoke gets control after doing the sub invoke.
14:46 pmichaud yes, I'd suggest setting a flag on the context there
14:46 jnthn - We need to actually try to bind. That means we need to invoke, because we need a lexpad. The question is if we then enter the runloop or not.
14:46 jnthn Or really, "can I get hold of the call sig without doing so".
14:47 pmichaud if the multisub sets a flag on the called context
14:47 jnthn We'd then set a flag saying to the bind_params dynop "oh, already bound, you has no work, go relax, has a beer"
14:47 pmichaud then the binding opcode can check for that flag, and throw an exception or otherwise get control back to the multidispatcher
14:48 jnthn Well, we do exceptions today. But erm, I didn't figure out how on earth to catch exceptiosn in C. :-)
14:48 pmichaud right
14:48 pmichaud might not be easily doable
14:48 jnthn Which is why I'm wary of re-entering the runloop.
14:48 jnthn I think if it was easily doable, I'd have found a way by now. :-)
14:48 TimToady surely Parrot catches exceptions in C :)
14:48 zaphar_ps joined #perl6
14:48 Matt-W You'd think so...
14:48 jnthn TimToady: Well, yeah, but returning to the right point in C is more fun. :-)
14:49 TimToady yes, thinking about how Perl 5 does it, I can see the difficulty
14:49 jnthn pmichaud: Anyway, the other thing I am guessing is that when you do an invoke, it creates a return continuation.
14:49 TimToady if Parrot uses setjmp/longjmp
14:50 TimToady or something like it
14:50 jnthn pmichaud: In theory then, if we fail to bind, then we can just invoke that to clear up, and try binding the next thing.
14:50 moritz_ is it a "I want to sleep tonight, don't tell me" thing?
14:50 jnthn TimToady: yes, it uses those.
14:50 jnthn pmichaud: But this means control never falls back into the Parrot runloop.
14:50 jnthn Well
14:50 jnthn It does for constraints.
14:50 jnthn But they're quite clean enter/exit.
14:51 pmichaud I don't understand "clear up"
14:51 * TimToady wonders how to mix longjmp with continuations and will probbly not sleep tonight :)
14:51 jnthn pmichaud: Invoke creates a new context and makes it the current one.
14:51 pmichaud okay.
14:51 jnthn pmichaud: We need the lexpad available in that when trying to do the binding.
14:51 pmichaud yes, I understand that invoke creates the lexpad needed for binding.
14:51 jnthn pmichaud: However, if we fail to bind, we need to throw away that context.
14:52 jnthn Because we're not going to use it.
14:52 pmichaud s/throw away the context/return to the caller context/
14:52 jnthn Invoking the return continuation stashed within the context PMC will do that.
14:52 jnthn pmichaud: Exactly.
14:52 pmichaud we don't have to explicitly "throw it away", gc will do that.
14:52 jnthn Yes, bad phrasing on my part.
14:52 pmichaud we just need to get back to the caller context
14:53 jnthn Anyway, what I'm getting at is it won't be degree level gymnastics, just calling vtable methods. :-)
14:53 pmichaud hmmmm
14:53 jnthn So we won't be fiddling too deeply.
14:53 pmichaud how evil would it be for the binding opcode to actually put us back in the outer context if binding fails?
14:53 pmichaud instead of throwing an exception or something that has to be caught?
14:53 jnthn pmichaud: Let me back up a bit.
14:54 jnthn My plan for this case (3) was that we would *not* enter the runloop and call the binding opcode.
14:54 jnthn We call VTABLE_invoke, and then enter the binder directly.
14:54 pmichaud from within the called sub's VTABLE_invoke?
14:54 jnthn No
14:55 pmichaud from the multi's vtable_invoke, then?
14:55 jnthn Yes
14:55 pmichaud okay
14:55 jnthn Well, something called from...
14:55 jnthn but yes
14:55 pmichaud I think I'd be okay with that
14:55 jnthn I think it's relatively clean.
14:55 pmichaud (need more precision about _which_ invoke is doing what :-)
14:55 jnthn And makes me *very* happy that contexts are now PMCs so we actually can flag this.
14:55 jnthn In a cheap and easy way.
14:55 pmichaud yes, that was an important change.  I'm surprised we didn't take a bigger speed hit.
14:55 jnthn Me too.
14:56 jnthn Anyway, I expect that we're going to win a bunch of startup too.
14:56 pmichaud which I've been taking to be an important lesson (more)
14:56 pmichaud we keep doing things that I think ought to be big speed hits but aren't, thus invalidating all of our concerns about optimizing around them
14:56 jnthn Because trait_mod goes on a non-nominal dispatch, so we have to do a bindability check.
14:56 jnthn Well, trait_mod:<is> does.
14:57 jnthn And at the moment those are really, really not cheap.
14:57 jnthn pmichaud: I may try sig construction via methods, once I've got it working via the ops, just to see what the real win is, at some pint.
14:57 jnthn *point
14:58 PerlJam jnthn: beer on the brain?  ;)
14:58 pmichaud okay, that'd be good.
14:58 jnthn PerlJam: Not enough beer, I suspect.
14:58 pmichaud it'd be useful to know what the relative costs are there.
14:58 jnthn pmichaud: Yeah. The thing is...
14:58 jnthn ...I think that something other than that is what is really swamping startup time at the moment.
14:58 KyleHa I'm almost always surprised by where performance problems actually are vs. where I thought they'd be.
14:59 jnthn And I rather suspect it may be that the trait mod invocations are costly.
14:59 masak KyleHa: that's why the "premature optimization" meme exists in the first place. :)
14:59 PerlJam sounds like we're back to mentioning that we need better profiling tools
14:59 KyleHa masak++ : Agreed.
15:00 jnthn PerlJam: Thing is, we have some now. ;-)
15:00 jnthn PerlJam: Just need to use them. :-)
15:00 PerlJam perhaps profiling should be integrated in the same way that testing is
15:01 PerlJam Though with testing, you run the tests for the results right then, but with profiling you're going to want to look at history more.
15:02 PerlJam Didn't Alias mention something like this WRT benchmarking perl a few months ago?
15:02 jnthn pmichaud: Anyway, seems I now have a way forward that you're not going to disagree with too strongly. :-)
15:02 jnthn Or maybe even like. :-)
15:03 pmichaud I don't envision a better way forward anytime soon :)
15:04 jnthn OK, let's try this one then.
15:04 jnthn Man is this going to be "fun" to implement. :-)
15:04 jnthn But at least it's not a regex engine.
15:04 jnthn ;-)
15:05 TimToady it bothers me that you're talking about applying traits at binding time
15:05 * jnthn is at this point *very* happy with the current devision of labor.
15:05 jnthn TimToady: Erm.
15:05 jnthn TimToady: We weren't.
15:05 jnthn TimToady: Well, I wasn't...
15:05 TimToady okay, need more coffee
15:05 jnthn TimToady: I was talking about the fact that applying traits uses multiple dispatch.
15:05 jnthn TimToady: And the way it makes use of multiple dispatch is currently a way that is rather slow in Rakudo.
15:06 TimToady 'kay, but that's still just compile time, so not in anyone's tight loop
15:06 TimToady except maybe the testor's :)
15:06 jnthn No, it's not in a tight loop, but it affects startup time.
15:06 pmichaud for the setting it's at "load type", though.
15:06 pmichaud *"load time"
15:06 pmichaud i.e., it's a cost incurred at startup
15:07 jnthn We currently run 450 test files, or there abouts.
15:07 jnthn Before I started working on things a couple of days back, for me Rakudo had a startup time of just over a second.
15:08 jnthn If we can pull that down to 0.5s, then I save over three minutes on a spectest run.
15:09 masak \o/
15:09 TimToady eventually we'll just find a way to mmap the (presumably immutable) setting structure into memory
15:09 jnthn Then with pmichaud++'s parsing speed improvements, we can parse the tests a bunch faster.
15:09 pmichaud we haven't found a good way to do that yet.
15:10 jnthn Then we have more time to go to the pub.
15:10 pmichaud (mmap)
15:10 TimToady std just pulls it in with Storable
15:10 TimToady 'course, you're pulling a lot more in
15:10 jnthn erm, I mean, then we can test faster and implement new features faster...
15:10 infrared joined #perl6
15:10 pmichaud basically doing something like mmap means we need a linker
15:11 TimToady but a setting can be linked ahead of time
15:11 pmichaud so that we can tie the references in the setting structure to wherever things happened to be loaded
15:11 pmichaud I mean for the things that the setting refers to that aren't part of the setting
15:11 jnthn It's not impossible, but it's not on a Rakudo * timescale either.
15:12 TimToady just thinking about how it might play out
15:12 TimToady waiting for the blood to hit my coffeestream
15:15 nihiliad joined #perl6
15:18 drbean joined #perl6
15:18 NorwayGeek joined #perl6
15:21 ejs joined #perl6
15:22 * jnthn digs in to fixing the various spectest failures in the switch over to the new signature representation.
15:23 * TimToady looks at why class stubs don't work
15:23 drbean_ joined #perl6
15:24 * diakopter is just sayin'
15:32 crythias joined #perl6
15:33 mberends joined #perl6
15:34 iblechbot joined #perl6
15:37 TimToady .öÖ(King Diakopter the Just Sayin')
15:38 crythias howdy
15:42 masak crythias: oh hai there.
15:48 crythias Hee :)
15:50 crythias Convicted of the crime of trying to split light into many colors, he found his eureka moment when he went to prism.
15:51 jnthn Woo. My fails list has been trimmed down muchly by two fixes. :-)
15:51 * jnthn groans
15:51 jnthn crythias: that's *terrible*
15:51 * masak throws crythias a punny
15:52 TimToady I had classified you as Chaotic Good, but now I'm not so sure...
15:52 crythias I'll try my saving throw.
15:52 * pmichaud wonders about his classification.
15:53 crythias When you put it into perspective, a rectangle is a trapezoid.
15:53 TimToady and a trapezoid is a rectangle, sometimes
15:53 masak sorry, you just crack me up. srsly.
15:55 * crythias is so chaotic that he throws two 1d20. The first determines the saving throw requirement of the second.
15:56 pugs_svn r28662 | lwall++ | [Cursor] remove setting storage bug installed yesterday
15:56 pugs_svn r28662 | [STD] check for yada on class declarations too
15:59 Woodi joined #perl6
15:59 meppl joined #perl6
16:02 cdarroch joined #perl6
16:02 TimToady std: class A {...}; class A {}
16:02 p6eval std 28658: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol GLOBAL::<A> (from line 1) at /tmp/i8GCnQO0py line 1:␤------> [32mclass A {...}; class A[33m⏏[31m {}[0m␤FAILED 00:01 96m␤»
16:02 TimToady I actually broke the build-from-scratch at 28659, TimToady--
16:06 TimToady std: 28662
16:06 p6eval std 28658: OUTPUT«ok 00:01 94m␤»
16:09 diakopter std: class A {...}; class A {}
16:09 p6eval std 28658: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol GLOBAL::<A> (from line 1) at /tmp/zEshZy3YD4 line 1:␤------> [32mclass A {...}; class A[33m⏏[31m {}[0m␤FAILED 00:02 96m␤»
16:09 diakopter so p6eval needs a make clean?
16:10 TimToady I think it does that eventually via cron
16:10 jnthn rakudo: &kv.candidates>>.signature>>.perl>>.say
16:10 p6eval rakudo 30e2cf: OUTPUT«:(Object *@values)␤:(Mapping self)␤»
16:20 TimToady std: 28662
16:20 p6eval std 28662: OUTPUT«ok 00:01 94m␤»
16:20 TimToady std: class A {...}; class A {}
16:20 p6eval std 28662: OUTPUT«ok 00:01 96m␤»
16:20 TimToady was just never implemented on classes
16:21 TimToady std: class A {...}; subset A of Int where 0..9;
16:21 p6eval std 28662: OUTPUT«ok 00:02 98m␤»
16:21 TimToady std: class A {}; subset A of Int where 0..9;
16:21 p6eval std 28662: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol A (from line 1) at /tmp/zLd8o8NBoz line 1:␤------> [32mclass A {}; subset A [33m⏏[31mof Int where 0..9;[0m␤FAILED 00:02 96m␤»
16:23 TimToady std: package A {...}; subset A of Int where 0..9;
16:23 p6eval std 28662: OUTPUT«ok 00:01 98m␤»
16:24 jnthn Eww.
16:24 TimToady std: subset A where {...}; subset A of Int where 0..9;
16:24 p6eval std 28662: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol A (from line 1) at /tmp/P2nUUnWErb line 1:␤------> [32msubset A where {...}; subset A [33m⏏[31mof Int where 0..9;[0m␤FAILED 00:02 97m␤»
16:24 TimToady maybe I should make that one work
16:25 TimToady std: package A {...}; constant A = 0x10;
16:25 p6eval std 28662: OUTPUT«ok 00:01 98m␤»
16:25 pmichaud for those who are interested in playing with the nqp-rx development:  http://github.com/perl6/nqp-rx/blob/master/STATUS  describes where things stand at the moment
16:25 TimToady all typenames and constant names are created equal, as far as STD is concerned
16:26 TimToady std: package A {}; constant A = 0x10;
16:26 p6eval std 28662: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol A (from line 1) at /tmp/uCedAf7d0o line 1:␤------> [32mpackage A {}; constant A [33m⏏[31m= 0x10;[0m␤    expecting any of:␤  constant_declarator␤      declarator␤       multi_declarator␤ typename␤FAILED 00:01 96m␤»
16:27 TimToady std: subset A; subset A of Int where 0..9;
16:27 p6eval std 28662: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol A (from line 1) at /tmp/mIFfCs2GCa line 1:␤------> [32msubset A; subset A [33m⏏[31mof Int where 0..9;[0m␤FAILED 00:01 95m␤»
16:27 TimToady std: proto subset A; subset A of Int where 0..9;
16:27 p6eval std 28662: OUTPUT«ok 00:01 98m␤»
16:27 TimToady heh
16:30 jnthn std: multi subset A of Int where 0..9;
16:30 p6eval std 28662: OUTPUT«ok 00:01 98m␤»
16:30 jnthn std: multi subset A of Int where 0..9; multi subset A of Str where 'A'..'Z'
16:30 p6eval std 28662: OUTPUT«ok 00:02 98m␤»
16:30 jnthn heh heh
16:31 TimToady perhaps not for 6.0.0
16:32 TimToady but one could view it as an | type
16:33 slavik2 jnthn: what is that? Perl understands SQL like things?
16:33 jnthn slavik2: heh, I was more seeing if std would accept it :-)
16:34 slavik2 oh ...
16:34 jnthn slavik2: I'm not sure what it'd mean semantically if it did though.
16:34 jnthn TimToady: well, perhaps that, yes...
16:34 jnthn Not 6.0.0. :-)
16:35 TimToady subset A of Any where Int & 0..9 | Str & 'A'..'Z'
16:35 TimToady so maybe trivial
16:36 TimToady fsdo trivial...
16:37 TimToady anyway, we can declare names without necessarily knowing the exact type
16:37 TimToady but they should be known by CHECK time
16:38 TimToady I should make STD check for unrequited stubs
16:38 TimToady well, maybe not
16:39 TimToady optional check for when you think you're done maybe
16:41 jnthn Oh gah, something in the setting is using the (currently not spec'd and likely something we want to change) signature introspection interface.
16:42 moritz_ the series operator, yes
16:42 jnthn moritz_: Aye.
16:42 moritz_ feel free to regress on that if necessary
16:43 jnthn I'm pondering that we may want to have something more object-y
16:43 jnthn So instead of a hash of data, we have a bunch of descriptors.
16:43 jnthn I knew we'd have to re-do this interface, I just hadn't realized that somebody relied on it.
16:43 jnthn Anyway, it's not a lot of work to re-do it now.
16:44 * moritz_ apologizes
16:44 jnthn moritz_: No, no worries. :-)
16:44 jnthn It's one of those "expected to have to do it at some point, and now is no biggy".
16:45 jnthn Ignoring series and arity.t, which also calls .params, I've got 5 spectests that have some issues now.
16:46 jnthn That's not bad to say we've completely changed the internal representation of signatures, and shuffled a load of stuff we used to deal with at runtime to be compile time decisions in with it.
16:47 stephenlb joined #perl6
16:51 moritz_ pmichaud: is it intentional that [ab] produces two separate atoms in nqp-rx?
16:51 moritz_ table tennis match, bbiafh&
16:52 ewilhelm left #perl6
16:53 payload joined #perl6
16:57 NorwayGeek|Away joined #perl6
16:59 ejs joined #perl6
17:00 icwiener joined #perl6
17:08 arthur-_ joined #perl6
17:09 alfieANDfred joined #perl6
17:13 * colomon wishes he could easily test his C++ code using Perl 6...
17:17 colomon int data [] = { -5, 0, 3, 72 };
17:17 colomon for (unsigned int i = 0; i < 4; i++)
17:17 pmichaud moritz_: if you mean it produces two separate atoms on the parse, then yes.
17:17 colomon versus
17:17 colomon for (-5, 0, 3, 72) -> $i
17:17 pmichaud moritz_: however, in the resulting PAST tree you'll see that it's combined back to a single atom :)
17:18 pmichaud moritz_: and in STD.pm each individual character ends up being its own atom
17:22 REPLeffect joined #perl6
17:25 TimToady colomon: the parens aren't necessary
17:26 TimToady std: for -5, 0, 3, 72 -> $i {...}
17:26 p6eval std 28662: OUTPUT«ok 00:02 105m␤»
17:26 colomon rakudo: for -5, 0, 3, 72 -> $i { say $i }
17:26 p6eval rakudo 30e2cf: OUTPUT«-5␤0␤3␤72␤»
17:26 colomon TimToady: that is so nice it makes me want to cry....
17:27 colomon My perl 6 version which was oodles better than the C++ version still wasn't as good as Perl 6 can get....
17:36 Chillance joined #perl6
17:38 TimToady rakudo: for <-5 0 3 72> { .say }
17:38 p6eval rakudo 30e2cf: OUTPUT«-5␤0␤3␤72␤»
17:38 crythias joined #perl6
17:39 TimToady bugs me that that doesn't turn into List of Int
17:41 jnthn A typed one?
17:42 jnthn Or just that they're integers?
17:42 jnthn erm, Ints.
17:42 mberends rakudo:<-5 0 3 72>>>.say
17:42 TimToady : <
17:43 jnthn .oO( eyes, legs and no body? )
17:44 mberends rakudo: <-5 0 3 72>>>.say
17:44 p6eval rakudo 30e2cf: OUTPUT«-5␤0␤3␤72␤»
17:44 TimToady it ought to randomize those just to keep people honest
17:45 TimToady s/those/the order/
17:45 colomon : rakudo: for <-5 0 3 72> { say .WHAT }
17:46 TimToady ^ that's strange
17:47 PerlJam leading colon+space == confused bot
17:48 PerlJam rakudo: for <-5 0 3 72> { say .WHAT }
17:48 p6eval rakudo 30e2cf: OUTPUT«Str()␤Str()␤Str()␤Str()␤»
17:48 TimToady only in random order :)
17:49 jnthn oh argh
17:50 * jnthn has made himself a fascinating bug...
17:50 PerlJam TimToady: so ... >> is random only by virtue of asynchronicity, right?
17:51 TimToady it's random by virtue of promising that you don't care about the order
17:51 TimToady which is what "hyper" means
17:51 * ruoso .oO( maybe we could accept that if the hyper is NYI as hyper, it should really randomize )
17:51 lambdabot ruoso: You have 1 new message. '/msg lambdabot @messages' to read it.
17:51 jnthn (note, order of the calls, not order of the results)
17:52 TimToady hyper for <-5 0 3 72> { .say } would make similar promises
17:52 PerlJam jnthn: right.
17:52 TimToady .say is side effect
17:52 jnthn Indeed.
17:52 TimToady so depends on order of calls, not order of results
17:53 PerlJam I think I would want what ruoso just said to remind myself of the fact.
17:53 TimToady I wonder if we should define a .yaml to go with .perl
17:53 abra joined #perl6
17:54 TimToady PerlJam: that's what I was suggesting above
17:54 ruoso in a completely different matter... I was wondering yesterday if we could somehow have auto-threading that really uses fork instead of threads...
17:54 PerlJam TimToady: yes ... my brain is a little slow right now because I'm eating.  For some reason I can't eat and think at the same time  :)
17:54 ruoso which would basically mean some time of iterator that knows how to serialize and deserialize the objects that are sent from/to the iterator
17:55 jnthn ruoso: Sounds like a pragma.
17:55 jnthn use hyperfork;
17:55 jnthn ;-)
17:55 TimToady why would it be a pragma if it's the default?
17:55 jnthn Why would it be the default?
17:56 * ruoso .oO( ouch )
17:56 TimToady to randomize hypers?
17:56 jnthn TimToady: No, I was talking about the forking idea.
17:56 TimToady or to reorder randomized hypers?
17:56 TimToady ah, missed that
17:56 jnthn pmichaud: ping
17:57 ruoso maybe it would not be about serialization
17:57 * TimToady .= kid_transport_mode()
17:57 riffraff joined #perl6
17:58 ruoso but maybe it would
17:58 * ruoso thinking about objects pointing to file descriptors
17:58 abra joined #perl6
17:59 ruoso I think the trick would be to somehow detect that the object it is receiving was alive before the fork, and then somehow access that object
18:00 ruoso instead of creating a new one
18:00 * ruoso feels that he's getting closer to Erlang
18:01 ruoso or maybe some objects "belong" to a specific process
18:01 ruoso and others are "clonned" to other processes
18:01 ruoso and for the objects that belong to a different process, talking to it would require sending a message to the owner process
18:02 PerlJam ruoso: if you can import any good ideas from Erlang into Perl 6, that  would be great :)
18:03 ruoso the point is that I don't like threads
18:03 ruoso but forking usually makes it really hard to share data
18:04 ruoso Erlang model is really sane in that respect
18:05 ruoso ok... I think I had an idea...
18:05 abra joined #perl6
18:06 ruoso the process always store the current "version" of the memory... which only needs to be incremented after a "fork", since it marks that the new child won't have access to the memory that is allocated after that
18:06 ruoso then we have two types of object
18:06 ruoso the Imutable values, which store the "version" at which they were created
18:07 ruoso and the mutable values, which store their "owner process"
18:08 ruoso when an iterator sends an object from one process to another
18:08 pmichaud jnthn: pong
18:08 ruoso it checks
18:08 rblasch joined #perl6
18:09 ruoso 1) if it is immutable, it will check if the target process have a link to this value
18:09 jnthn pmichaud: Don't worry, I think I found the answer.
18:09 pmichaud jnthn: okay, glad I have less to worry about.  :)
18:10 jnthn pmichaud: I was using :inline(...) # yeah, bad me, I know
18:10 omega joined #perl6
18:10 cosimo joined #perl6
18:10 jnthn And, er, wondered why the code genreated for '%named' was going all so wrong. :-)
18:10 jnthn Anyway, using signatured pirop now...if only I can write the signature I want. :-)
18:11 abra joined #perl6
18:11 pmichaud you should be able to
18:11 pmichaud which op?
18:11 jnthn set_signature_elem ;-)
18:12 jnthn yes, got it :-)
18:12 jnthn :pirop('set_signature_elem vPisiPPPP'),
18:12 pmichaud yup
18:12 pmichaud PCT fwt
18:12 pmichaud *ftw
18:12 jnthn pct++ pmichaud++
18:13 jnthn OK, down to three test files to worry about.
18:13 jnthn Plus two after that to spec and implement a new signature introspection interface for.
18:23 jnthn \o/
18:23 jnthn Just one now. And it's the one file I expected to have problems. :-)
18:23 abra joined #perl6
18:23 PerlJam (reality matching expectations)++
18:24 * jnthn is *really* happy that he decided to do this in small steps.
18:25 jnthn Of course, the next step is the *really* big one.
18:25 jnthn (switching to a new binder)
18:26 jnthn But knowing that signatures are in the format the new binder will expect, plus having everything else using that already, will be a big help.
18:28 krishna_ joined #perl6
18:29 jnthn OK, it's nom time.
18:30 lumi joined #perl6
18:34 abra joined #perl6
18:40 pugs_svn r28663 | fglock++ | [mp6] Javascript - 'token' statement works
18:42 i-blis joined #perl6
18:42 i-blis hello folks
18:42 i-blis does anyone know: is pugs dead?
18:43 TimToady it's hibernating
18:44 i-blis long and cold winter?
18:45 TimToady more like one of those crawly things that waits until the once-every-few-years rainstorm
18:46 KyleHa That's patience.
18:46 i-blis i see
18:46 TimToady and also impatience :)
18:47 obra_ There's definitely also some laziness and hubris in there ;)
18:47 i-blis :)
18:47 TimToady the problem with pugs is that it's bus-number was too low, and kinda got bussed
18:48 TimToady but the moment someone picks it up and starts playing with it again, I suspect it will liven up again
18:48 lumi joined #perl6
18:48 TimToady we just need to find that special person who can't make up their mind whether they like Haskell or Perl 6 better :)
18:48 i-blis sad in a way. haskell has been in my way these last months
18:49 TimToady "in my way" usually has negative connotations; did you mean it that way?
18:50 TimToady explain yourself, and give three examples  :)
18:51 |theJackal| joined #perl6
18:51 i-blis bad english. i meant, i encountered haskell because of high-order style in perl, 've been playing with it
18:52 TimToady cool
18:52 i-blis very cool language. plays well with perl in my opinion. (many ways to do it)
18:52 TimToady nobody here would be upset if you woke pugs back up
18:53 i-blis to heavy for me, I guess
18:53 TimToady that's kinda why the bus-number stayed at one, alas
18:53 colomon oooo.... if The Book could contain an example of something Higher-Order Perl-ish, but in p6, that would be awesome.
18:53 i-blis i am an average perl hacker with less than one year of functional programming
18:54 i-blis which Book? Erdös's? :)
18:54 TimToady We are trying to steal the promethean fire from functional programming without stealing the procrustean bed.
18:54 i-blis ho I see
18:55 i-blis it seemed to me that p6 has done a lot in that direction
18:56 i-blis to permit clearer high-order perl
18:57 TimToady mostly a matter of keeping mutable/immutable distinctions clear, and making it easy to express things without gratuitous sequentiality
18:58 i-blis what do you mean by _gratuitous_ sequentiality?
18:58 TimToady like having to increment an index variable when you could just talk about a list of values as a whole
18:59 i-blis perl is already good at that, isn't it?
18:59 TimToady or, to take a misfeature of most FP languages, having to talk about a list in terms of head and tail
19:00 i-blis i see your point now
19:00 i-blis what needed p5 i think was a better parameter handling
19:00 i-blis and p6 brings that
19:01 i-blis this is almost enough for perl-ish fp
19:02 TimToady yes, we want to be able to spec pattern matching with sigs
19:02 i-blis streams are easy to implement any way why bother with "gratuitous sequentiality" as you called it
19:03 i-blis this is a very important feature imho
19:05 TimToady but yes, Olin Shivers described Perl 5 as one of the successful FP languages at HOPL3
19:06 i-blis i read about that
19:07 TimToady I've also liked Guy Steele's recent talk at ICFP, http://research.sun.com/projects/plrg/​Publications/ICFPAugust2009Steele.pdf
19:08 i-blis this was indeed the point that dominus tried to make a couple of years before hopl3 even
19:08 TimToady indeed, he didn't just try, but succeeded :)
19:08 i-blis :)
19:08 i-blis yes, certainly
19:09 i-blis thnaks for the link
19:09 TimToady which is one of the reasons that so many things he had to hack around in Perl 5 are just built-in to Perl 6
19:12 crythias Xistence is Supple. Let's Re-Engineer Perl.
19:13 TimToady already had both xs and lrep
19:13 crythias yes, but this is perl six backwards.
19:13 TimToady not unless you capitalize the I
19:14 TimToady someone might capitalize the E instead....
19:14 crythias fine, fine: Xistence is Supple. Let's Re-Engineer Perl
19:14 crythias what?
19:14 crythias I cap..
19:14 crythias grr
19:15 crythias Xistence Is Supple. Let's Re-Engineer Perl.
19:15 crythias I just don't understand. It's like I'm talking to a ...
19:15 crythias sorry.
19:15 TimToady Life is a bitch, and it's not your bitch.
19:16 crythias indeed.
19:17 [particle] damn The Man.
19:18 TimToady In my experience, people who are bad to the bone usually have pretty good bones to compensate.
19:19 i-blis @TimToady, the presentation of Steele is very instructive (and very clear), thanks
19:19 lambdabot Unknown command, try @list
19:20 i-blis in the same vein: http://www.cs.nott.ac.uk/~gmh/bib.html#fold
19:20 TimToady it makes me glad that we have list-associativity in Perl 6, and also that [op] doesn't specify l or r
19:21 TimToady rakudo: say [+] ^10
19:21 p6eval rakudo 30e2cf: OUTPUT«45␤»
19:21 TimToady it's free to do that fold in any order
19:21 i-blis you may need it with (possibly infinite) streams though
19:21 TimToady sure, though [+] is by definition eager
19:21 TimToady maybe [\+] to get the running sum
19:21 i-blis on the other hand there is no right associative ops in perl 6 (am i right?)
19:22 TimToady rakudo: say [**] 2, 3, 4
19:22 p6eval rakudo 30e2cf: OUTPUT«4096␤»
19:23 TimToady where associativity matters, the algorithm is free to reorder only to the extent that a correct result is assured :)
19:24 TimToady however, I think [**] is quite unlikely to be seen in Real Code®
19:25 TimToady on the other hand, assignop precedence is also r2l
19:25 TimToady which matters mostly for =>
19:25 TimToady hmm
19:26 TimToady rakudo: say [=>](1..5).perl
19:26 p6eval rakudo 30e2cf: OUTPUT«say requires an argument at line 2, near " [=>](1..5"␤in Main (src/gen_setting.pm:2536)␤»
19:26 TimToady rakudo: [=>](1..5).perl.say
19:26 p6eval rakudo 30e2cf: OUTPUT«Syntax error at line 2, near "[=>](1..5)"␤in Main (src/gen_setting.pm:146)␤»
19:26 TimToady std: [=>](1..5).perl.say
19:26 p6eval std 28663: OUTPUT«ok 00:02 102m␤»
19:26 TimToady missing op in rakudo
19:27 i-blis hmm
19:27 TimToady => is more or less equiv to . in Lisp
19:27 i-blis p6eval is a parrot build?
19:28 i-blis i see
19:28 TimToady no, it runs several implemenations
19:28 diakopter nations indeed
19:28 TimToady perl6: say ~ ^10
19:28 p6eval pugs, rakudo 30e2cf: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
19:28 p6eval ..elf 28663: OUTPUT«Undefined subroutine &GLOBAL::prefix__94 called at (eval 125) line 3.␤ at ./elf_h line 5881␤»
19:28 p6eval ..sprixel 28663: OUTPUT«Sprixel Error: Symbolic_unary prefix__S_Caret not yet implemented; srsly!!?!??␤»
19:29 TimToady otoh
19:29 TimToady perl6: say ~^10
19:29 p6eval rakudo 30e2cf: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
19:29 p6eval ..sprixel 28663: OUTPUT«Sprixel Error: Symbolic_unary prefix__S_TildeCaret not yet implemented; srsly!!?!??␤»
19:29 p6eval ..elf 28663: OUTPUT«Undefined subroutine &GLOBAL::prefix__126_94 called at (eval 123) line 3.␤ at ./elf_h line 5881␤»
19:29 p6eval ..pugs: OUTPUT«ÎÏ␤»
19:30 TimToady pugs is the correctest there
19:30 pmichaud need spectest?
19:31 TimToady assuming one can convert 10 to a buffer and flip its bits
19:31 TimToady probably has one that is fudged or skipped
19:31 TimToady but feel free to check
19:31 i-blis ok
19:32 TimToady i-blis: the tests and specs are also in the pugs repo, if you want to hack on them
19:32 TimToady do you have a pugs repo commit bit?
19:32 i-blis Steeve's presentation is quite hard to follow toward the end :)
19:33 TimToady if not, /msg me your email and preferred svn nick
19:33 i-blis no i don't
19:33 i-blis i don't need commit i think
19:33 TimToady yes, well, he's talking to some *very* *bright* people at ICFP
19:33 TimToady that doesn't matter, you oughta have a commit bit anyway
19:34 TimToady just to keep on your countertop in case you decide you need one
19:35 TimToady if you start reading tests/specs it's almost certain you'll run across something you'll want to fix
19:36 TimToady commitbit sent
19:37 i-blis ok, i'll see
19:37 TimToady it's customary to add yourself to AUTHORS to test the bit
19:37 TimToady around here we do forgiveness rather than permission
19:37 TimToady so if you screw up, we'll just fix it
19:37 i-blis good
19:37 i-blis i msg'ed you
19:39 jamtech joined #perl6
19:48 jnthn My word, while I was away in Asia I think they installed the brightest lighting rig ever around the city castle.
19:48 jnthn Between it and the new white-ish restored stonework, you almost need sunglasses to look at it by night now.
19:51 jnthn TimToady: I'm planning to pop something in the spec about signature introspection.
19:52 jnthn TimToady: I'm thinking .params gets you an array of SignatureItem objects (plz improve name ;-)) with properties like "name", "type", "slurpy", etc.
19:52 jnthn TimToady: Does that sounds like a reasonable direction/starting point?
19:52 jnthn (BTW, anyone else welcome to chime in too ;-))
19:53 TimToady why not just Parameter objects?
19:53 jnthn TimToady: See, this is why I ask you to name stuff. :-)
19:53 jnthn Parameter it is.
19:54 * jnthn feels silly for not thinking of that now.
19:55 TimToady it would be nice if there was a way to bind to the front of an argument lists and return the position where it stopped
19:55 TimToady then you wouldn't need any introspection to do C<for>
19:55 jnthn Use case?
19:56 jnthn We need that now?
19:56 TimToady optional params
19:56 TimToady for @list -> $x, $y? { ... }
19:56 jnthn Oh, you mean work through an iterator up to the point where the signature has taken all it can?
19:57 TimToady yes
19:57 TimToady I think that should be some kind of primitive
19:57 Lorn joined #perl6
19:57 TimToady and not dependend on polling the sig for .arity or .count
19:57 TimToady *ent
19:57 TimToady just something to bear in mind
19:57 jnthn Well, the only real difference is that you don't panic when you find you have some stuff still in the list.
19:58 TimToady right, and find a way to give the pos back
19:58 TimToady or iterate the iterator
19:58 jnthn If it's an iterator, it manages the pos though?
19:58 TimToady presumably, if it's destructive readout
19:59 TimToady some forms of binding want to give the whole thing back if they dont match completely
19:59 jnthn I guess then it's just making sure the binder can handle an iterator as input rather than a capture.
19:59 jnthn erm
19:59 jnthn as well as
19:59 jnthn I don't see that being too hard to achieve.
20:00 jnthn Hmm. Give the whole thing back is a little trickier though.
20:00 TimToady I just see that as a more natural approach than introspecting
20:00 jnthn Yeah, it likely is.
20:00 TimToady well, but you have to do that when trying against multiple candidates
20:00 jnthn oh hmm
20:00 jnthn yes.
20:01 jnthn That wouldn't play nice with multi dispatch otherwise.
20:01 TimToady I almost envision it as an extra * parameter that just binds the rest of the list
20:02 jnthn That could work too.
20:02 TimToady so for @list -> $x, $y turns into -> $x, $y, *@rest, and then we replace @list with @rest and continue
20:02 TimToady assuming binding to slurpy is also lazy
20:02 jnthn Not sure how the last step would look
20:02 jnthn (replace...)
20:02 jnthn Well, that is also an assumption... :-)
20:07 SmokeMachine joined #perl6
20:12 hercynium joined #perl6
20:13 jnthn (though not an assumption that I find unreasonable)
20:13 * jnthn was distracted sorting out laundry
20:22 jnthn TimToady: Where does the sig introspection spec belong?
20:22 jnthn TimToady: S06?
20:24 moritz_ you could also put it in S32::$somewhere, but then nobody would take it serious ;-)
20:24 jnthn :-P
20:26 sbp tell them the S stands for Serious
20:26 moritz_ it stands for Speculation
20:29 sjohnson heh
20:29 sjohnson S == Srsfknbzns
20:30 TimToady rakudo: sub myfor (@list,&block) { 1 while block(|@list) }; myfor(0..10, -> $x, $y?, *@x where { @CALLER::list = @x } { say $x, $y//'undef' })
20:30 TimToady that almost works
20:30 p6eval rakudo 30e2cf: TIMED_OUT
20:30 TimToady says 01 over and over
20:30 moritz_ no CALLER yet
20:31 TimToady ah
20:31 jnthn Aye, it'll be putting it - quite literally - into the package CALLER. :-)
20:31 snearch joined #perl6
20:31 TimToady but you get the idea
20:31 jnthn Yes.
20:31 TimToady course, it shouldn't work anyway for at least two other reasons
20:32 jnthn One being @list isn't a context var?
20:32 TimToady and the other is that @list is not rw
20:33 TimToady well, in any case, we can't rely on the user to tack on the *@x parameter
20:34 TimToady so we need some way for 'for' to request the transformation on the block's sig
20:34 payload joined #perl6
20:37 jnthn Feels like we're a generalization away from a neat solution.
20:37 jnthn Or something.
20:39 TimToady it's either some special invoke that assumes the extra slurpy, or some way to derive a block/sig with the return path via a wrap or some such indirection
20:40 TimToady or a way to pull out the block's sig and use it as part of a larger sig
20:41 TimToady anyway, my point is that we should treat the need for .arity and such to be a design smell
20:42 TimToady nap &
20:49 pugs_svn r28664 | jnthn++ | First cut of specification for signature introspection.
20:52 payload1 joined #perl6
21:04 pugs_svn r28665 | jnthn++ | [spec] Add missing invocant and multi_invocant traits from signature introspection interface.
21:10 moritz_ jnthn++
21:13 pmurias joined #perl6
21:14 quietfanatic joined #perl6
21:17 jnthn moritz_: In theory, this makes the signature operator fix deleting two characters. ;-)
21:19 pugs_svn r28666 | kyle++ | typo fix
21:20 Whiteknight joined #perl6
21:20 moritz_ jnthn: ;-)
21:21 PerlJam (progress by removing things)++
21:22 jnthn ...while I like typo fixes, I can't see the typo in that diff?
21:22 jnthn oh
21:22 jnthn way
21:22 jnthn :-)
21:22 jnthn meh
21:23 jnthn thanks kyle :-)
21:23 KyleHa *bow*
21:25 dalek rakudo: 10069b6 | chromatic++ | src/ops/perl6.ops:
21:25 dalek rakudo: [ops] Fixed some compiler warnings by casting malloc() results.
21:25 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1​0069b6dc905cd5070c877cc420e9ea10a713b76
21:26 KyleHa When I build Rakudo with 'make' it works, but with 'make -j 3|5', it breaks.  Undeclared dependency somewhere?
21:26 moritz_ KyleHa: it works with make -j 3 (and 2 cores) here... how does it fail for you?
21:27 KyleHa perl6_ops.c:29:38: error: ../pmc/pmc_p6lowlevelsig.h: No such file or directory
21:27 jnthn Oh hmm
21:27 jnthn Maybe PMCs have to come before ops is not enforced.
21:28 ShaneC1 joined #perl6
21:29 moritz_ how do I write a multi that takes an undef as its  only argument? ($x where undef)?
21:29 jnthn moritz_: Should work, if smart-matching agaisnt undef checks undefinedness.
21:30 moritz_ it does
21:30 jnthn Then yes, should work.
21:30 moritz_ rakudo: say undef ~~ undef, 0 ~~ undef;
21:30 p6eval rakudo 30e2cf: OUTPUT«10␤»
21:30 jnthn Should do what you want them. :-)
21:30 jnthn I don't think you'll get away with...
21:30 moritz_ just wandering if there was a cooler way ;-)
21:30 jnthn std: multi foo(undef) { }
21:30 p6eval std 28665: OUTPUT«[31m===[0mSORRY![31m===[0m␤Invalid typename undef at /tmp/ixjQYhJGNa line 1:␤------> [32mmulti foo(undef[33m⏏[31m) { }[0m␤FAILED 00:02 100m␤»
21:30 jnthn aye
21:30 jnthn 'fraid not. :-)
21:31 moritz_ rakudo: multi sub foo(undef) { say '\\o/' }; foo(undef)
21:31 p6eval rakudo 30e2cf: OUTPUT«Malformed routine definition at line 2, near "foo(undef)"␤in Main (src/gen_setting.pm:146)␤»
21:33 quietfanatic std: multi foo(Any:U) {...}
21:33 p6eval std 28665: OUTPUT«[31m===[0mSORRY![31m===[0m␤Invalid typename Any at /tmp/CWGlMiJEUK line 1:␤------> [32mmulti foo(Any:U[33m⏏[31m) {...}[0m␤    expecting circumfix␤FAILED 00:01 99m␤»
21:33 moritz_ now that's a bit LTA error message ;-)
21:33 quietfanatic That's not quite the error I expected.
21:34 moritz_ rakudo: multi a(Int $x) { say 'Int' }; multi a(Object $x) { say 'Object' }; a(3|4)
21:34 p6eval rakudo 30e2cf: OUTPUT«Object␤»
21:37 jnthn rakudo: multi a(Int $x) { say 'Int' }; multi a(Any $x) { say ' }; a(3|4)Any'
21:37 p6eval rakudo 30e2cf: OUTPUT«Unable to parse block; couldn't find final '}' at line 2, near ""␤in Main (src/gen_setting.pm:146)␤»
21:37 jnthn rakudo: multi a(Int $x) { say 'Int' }; multi a(Any $x) { say 'Any' }; a(3|4)
21:37 p6eval rakudo 30e2cf: OUTPUT«Int␤Int␤»
21:37 jnthn \o/
21:37 tak11 joined #perl6
21:38 payload joined #perl6
21:40 Intensity joined #perl6
21:41 jnthn moritz_: Yay. Series fixed. :-)
21:42 moritz_ \o/
21:42 jnthn Hey, this means we can write Signature.perl in Perl 6.
21:43 moritz_ \o/
21:45 jnthn Time to re-triage the bugs.
21:52 rgrau joined #perl6
21:53 quietfanatic rakudo: sub add ($a, $b) {$a + $b}; sub wrapper (*@_) {add(@_[])}; wrapper(3,4)
21:53 p6eval rakudo 30e2cf: OUTPUT«too few arguments passed (1) - 2 params expected␤in sub add (/tmp/tP7MizKgkh:1)␤called from sub wrapper (/tmp/tP7MizKgkh:2)␤called from Main (/tmp/tP7MizKgkh:0)␤»
21:54 quietfanatic rakudo: sub add ($a, $b) {$a + $b}; my @x = 3, 4; add(@x[])
21:54 p6eval rakudo 30e2cf: OUTPUT«too few arguments passed (1) - 2 params expected␤in sub add (/tmp/leGcr4PgkW:1)␤called from Main (/tmp/leGcr4PgkW:0)␤»
21:54 quietfanatic rakudo: sub add ($a, $b) {$a + $b}; my @x = 3, 4; add(@x.values)
21:54 p6eval rakudo 30e2cf: OUTPUT«too few arguments passed (1) - 2 params expected␤in sub add (/tmp/oAetf5H0DR:1)␤called from Main (/tmp/oAetf5H0DR:0)␤»
21:54 quietfanatic What's wrong with what I'm doing?
21:55 moritz_ arrays don't flatten automatically in argument lists
21:55 moritz_ you have to do that with |@_
21:55 quietfanatic I thought the [] or .values would flatten...
21:55 moritz_ not in argument lists.
21:55 quietfanatic rakudo: sub add ($a, $b) {$a + $b}; my @x = 3, 4; add(|@x)
21:55 p6eval rakudo 30e2cf:  ( no output )
21:55 moritz_ they are essentially slice context
21:56 quietfanatic I guess I haven't quite got my head around the flattening/nonflattening business.
21:57 moritz_ it's a hairy business
21:59 quietfanatic Hmm, still not working for what I'm doing...
22:04 quietfanatic Perhaps it doesn't work on Parrot NCI functions.
22:06 jnthn That wouldn't be entirely surprising. :-/
22:07 quietfanatic In which case, I shall have to know the number of parameters ahead of time.
22:07 quietfanatic It can be done.  It's just a bit harder.
22:09 quietfanatic This is odd.
22:09 quietfanatic rakudo: my @x = 3, 4; say |@x.perl
22:09 p6eval rakudo 10069b: OUTPUT«argument doesn't array␤in sub say (src/gen_setting.pm:1730)␤called from Main (/tmp/QYB3fZHi1v:0)␤»
22:09 quietfanatic "argument doesn't array"
22:09 quietfanatic I came upon this by accident, but...
22:10 moritz_ @x.perl returns a string
22:10 lambdabot Unknown command, try @list
22:10 jnthn rakudo: my @x = 3, 4; say |(@x.perl)
22:10 p6eval rakudo 10069b: OUTPUT«argument doesn't array␤in sub say (src/gen_setting.pm:1730)␤called from Main (/tmp/aBW29d9j4b:0)␤»
22:10 moritz_ |Str doesn't make any sense
22:10 jnthn rakudo: my @x = 3, 4; say (|@x).perl)
22:10 quietfanatic rakudo: say |"Str"
22:10 p6eval rakudo 10069b: OUTPUT«Syntax error at line 2, near ")"␤in Main (src/gen_setting.pm:146)␤»
22:10 p6eval rakudo 10069b: OUTPUT«argument doesn't array␤in sub say (src/gen_setting.pm:1730)␤called from Main (/tmp/jSdUGar7Fl:0)␤»
22:10 jnthn rakudo: my @x = 3, 4; say (|@x).perl
22:10 p6eval rakudo 10069b: OUTPUT«[3, 4]␤»
22:10 quietfanatic That was how it happened, yes. I removed the parens.
22:11 quietfanatic And forgot to remove the |
22:11 dalek rakudo: 36e82b6 | chromatic++ | src/pmc/p6lowlevelsig.pmc:
22:11 dalek rakudo: [PMC] Fixed compiler warnings in P6LowLevelSig PMC.
22:11 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3​6e82b661521ed6d394849d64cae6f285fee3937
22:11 dalek rakudo: 77088bc | chromatic++ | src/pmc/perl6multisub.pmc:
22:11 dalek rakudo: [PMC] Fixed compiler warnings in Perl6MultiSub PMC.
22:11 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​7088bc7e4de0b9912df397990f4121b9b826d94
22:11 jnthn Precedence strikes.
22:11 dalek rakudo: 4f997a0 | chromatic++ | src/pmc/p6opaque.pmc:
22:11 dalek rakudo: [PMC] Fixed a compiler error in the P6Opaque PMC.
22:11 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/4​f997a0ae6c491028779b1b7a6d06719d93a8d7d
22:11 jnthn chromatic++ fixes my crappy C code :-)
22:11 quietfanatic But that error message is weirder than I could've hoped for. :)
22:14 * jnthn does a spectest run, hoping this means his branch is mergable.
22:15 justatheory joined #perl6
22:16 Whiteknight joined #perl6
22:16 TopoMorto joined #perl6
22:17 * jnthn reads the regex actions.pm file and is impressed
22:17 Lorn joined #perl6
22:18 jnthn method metachar:sym<$>($/) { # ah, so that's how we define actions for 'em. :-)
22:21 jnthn quietfanatic: btw, was it you that was asking about signature introspection?
22:22 quietfanatic Yes.
22:22 jnthn quietfanatic: I put something in the spec this evening.
22:22 jnthn quietfanatic: And implemetned said bit of spec in my branch.
22:22 jnthn If the current spectest run passes, I'll merge. :-)
22:22 quietfanatic I see.  I shall pull and try it.
22:22 quietfanatic Hmm
22:22 quietfanatic Your branch...how do I get that branch?
22:23 jnthn quietfanatic: Wait 30 mins or so, with luck it'll be master soon. :-)
22:23 quietfanatic Or maybe I'll wait for the merge then.
22:23 jnthn If you git pull and then git checkout llsig though
22:23 jnthn Then you'll probably have it.
22:25 moritz_ ah, now I also get the parallel build failures
22:25 * jnthn grabs a beer and relaxes a bit
22:26 quietfanatic I am almost done with a preliminary-version Link::C module.
22:27 jnthn quietfanatic: ooh, nice
22:27 moritz_ jnthn: how are you supposed to get the sigil of a parameter through introspection?
22:27 quietfanatic It only works with functions on native data types right now.
22:27 jnthn .name.substr(0, 1)
22:27 quietfanatic (such as int, char *, but no structs)
22:27 moritz_ ok, so it's in name
22:28 jnthn moritz_: yes
22:28 jnthn moritz_:   name           The name of the lexical variable to bind to, if any
22:28 moritz_ ok
22:28 jnthn The name of the lexical includes its sigil.
22:28 jnthn Though
22:28 jnthn heh
22:28 moritz_ that implies sigil, right
22:28 jnthn This definition is kinda sucky once we hit attributive parameters.
22:29 jnthn So it'll likely want a tweak of some kind.
22:29 jnthn Anyway, now there's a spec, if anybody fancies writing some tests for sig introspection, that'd be great.
22:30 jnthn A "git pull" updates all branches, yes?
22:31 moritz_ all tracked branches
22:31 i-blis joined #perl6
22:40 NorwayGeek joined #perl6
22:42 Lorn_ joined #perl6
22:55 pugs_svn r28667 | lwall++ | [S12] revise type subset pair notation a bit
22:58 jnthn OK, going for merge!
22:58 jnthn Of course, it's the next branch where The Real Fun happens. :)
22:58 pmichaud branch*es* :)
22:59 jnthn ;-)
22:59 jnthn Well, the next one is The Really Big One for the binding changes.
23:00 jnthn But yes, for other stuff I see many more. :-)
23:00 * Juerd really needs to learn how to use revision control thingies, so he can decipher the other half of irc.
23:00 jnthn I expect to do some more things in master first.
23:01 jnthn Cleanups, preparation, etc.
23:02 jnthn Merged. Please note re-configure needed.
23:02 dalek joined #perl6
23:02 jnthn And this includes the parameter introspection stuff.
23:03 jnthn quietfanatic: ^^
23:03 quietfanatic Yay!
23:04 jnthn No doubt we'll extend and tweak it a bit.
23:05 obra_ 2C
23:06 i-blis left #perl6
23:12 quietfanatic I can't clone...no doubt the fault of my college's network...
23:13 quietfanatic Oh there we go, never mind.
23:17 payload joined #perl6
23:19 NorwayGeek joined #perl6
23:25 quietfanatic rakudo: .type.say for (sub (Int $a, Str $b) {...}).signature.params
23:25 p6eval rakudo 4f997a: OUTPUT«Attributes of type 'struct llsig_element **' cannot be subclassed from a high-level PMC.␤current instr.: 'perl6;Perl6Role;!select' pc 5073 (src/classes/Role.pir:55)␤»
23:25 lumi joined #perl6
23:25 quietfanatic Worked over here.
23:25 quietfanatic anyway, jnthn++
23:25 jnthn quietfanatic: If that works for you, I suspect it's just that rakudo bot here is not updated yet.
23:26 quietfanatic makes sense
23:28 Confield joined #perl6
23:35 dalek joined #perl6
23:50 NorwayGeek joined #perl6
23:51 pugs_svn r28668 | lwall++ | [S06,S12] clarify when yada is taken to be a stub
23:51 pugs_svn r28668 | [S06] clarify semantics of package subs
23:51 pugs_svn r28668 | [S06] document that subs default to 'my' scope now
23:53 jnthn TimToady: Subs are now lexical by default?
23:53 jnthn TimToady: How much else is going to become lexical by default?
23:54 mepplock joined #perl6
23:55 jnthn Well, better phrased, are the other things you expect to become...
23:55 pugs_svn r28669 | lwall++ | [STD] improve message on unrecognized type names
23:55 pugs_svn r28669 | [STD] recognize :D, :U, and :_ type modifiers
23:55 pugs_svn r28669 | [STD] allow sub &*foo form of contextual sub declaration
23:56 TimToady I've been parsing subs as 'my' by default for a month or two now, and it doesn't seem to cause too much indigestion
23:56 TimToady I don't expect classes to become lexical only, since people want to mention those globally often
23:56 jnthn TimToady: OK, makes sense.
23:57 jnthn TimToady: One other thing. You mention :D and :U are syntactic sugar for a where constraint.
23:57 jnthn TimToady: Does this definition allow for a compile to do something smarter, though?
23:57 aleK69 joined #perl6
23:57 TimToady sure
23:57 jnthn OK
23:58 TimToady .defined is deep magic in any case :)
23:58 jnthn I note that this definition means that :(Int:_) and :(Int:D) sort to the same level in the multi-dispatch ordering.
23:58 jnthn Oh, wait
23:58 jnthn They don't
23:59 jnthn Since :_ is a no-op
23:59 TimToady otoh, it means nearly all sigs are constrained, which is a problem
23:59 jnthn In fact, I'm curious why we even have :_
23:59 jnthn Since it's the default.
23:59 jnthn Well, not really
23:59 TimToady reread the section, it's not always
23:59 jnthn You normally don't care, no?
23:59 TimToady we currently default non-invocant args to :D
23:59 TimToady but that's negotiable, I suppose

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

Perl 6 | Reference Documentation | Rakudo