Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-05-14

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:05 frew joined #perl6
00:30 bacek__ joined #perl6
00:33 ElectricHeavyLan joined #perl6
00:53 drbean_ joined #perl6
00:55 dalek joined #perl6
00:55 Tene pmichaud: pushed HLL changes.  You can change RAKUDO_HLL after review.
00:57 PhatEddy left #perl6
01:02 AzureStone_ joined #perl6
01:02 pmichaud Tene: changes look good.
01:03 kirillm_ joined #perl6
01:03 jnthn joined #perl6
01:03 buu joined #perl6
01:03 Maddingue joined #perl6
01:04 skids Robot Lords of Tokyo: Smile! Chase Kittens!
01:05 moritz_ joined #perl6
01:05 spx2 joined #perl6
01:05 jiing joined #perl6
01:05 cls_bsd joined #perl6
01:05 jrockway joined #perl6
01:05 lisppaste3 joined #perl6
01:05 zev joined #perl6
01:06 d4l3k_ joined #perl6
01:06 kane__ joined #perl6
01:06 viklund joined #perl6
01:06 ilogger2 joined #perl6
01:06 betterworld joined #perl6
01:06 charsbar joined #perl6
01:06 breinbaas joined #perl6
01:06 frettled joined #perl6
01:06 buubot joined #perl6
01:06 lumi joined #perl6
01:06 patmat joined #perl6
01:06 shachaf joined #perl6
01:06 edenc joined #perl6
01:06 Matt-W joined #perl6
01:06 Bucciarati joined #perl6
01:06 pnu joined #perl6
01:06 BinGOs joined #perl6
01:16 meehav joined #perl6
01:16 Caelum joined #perl6
01:16 PerlJam joined #perl6
01:19 IRSeekBot joined #perl6
01:21 meteorjay joined #perl6
01:26 amoc joined #perl6
01:27 ray joined #perl6
01:31 Caelum joined #perl6
01:39 alc joined #perl6
01:41 amoc joined #perl6
02:15 dalek rakudo: bf281cf | pmichaud++ | src/parser/ (2 files):
02:15 dalek rakudo: Add ability to recognize operator subs.  The ability to define
02:15 dalek rakudo: operator subs comes in the next commits.
02:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/bf281cf178c58c023bad0e90ea27476d8673d1ae
02:15 dukeleto joined #perl6
02:31 autin joined #perl6
02:51 dbezborodov joined #perl6
02:54 dbezborodov left #perl6
02:59 sri_kraih joined #perl6
03:08 nihiliad joined #perl6
03:20 donaldh joined #perl6
03:31 kst joined #perl6
03:49 orafu joined #perl6
04:30 eternaleye joined #perl6
04:34 Jedai joined #perl6
04:37 sri_kraih joined #perl6
04:38 eternaleye joined #perl6
04:49 s1n moritz_: http://s1n.dyndns.org/index.php/2009/05/14/more-sub-confusion/
05:01 sparc joined #perl6
05:31 Topic for #perl6is now »ö« | http://perl6-projects.org/ | nopaste: http://sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: http://irc.pugscode.org/ | UTF-8 is your friend!
05:31 Tene There, now we have Camelia to watch over us.
05:53 ejs joined #perl6
06:05 amoc joined #perl6
06:18 LadyLunacy joined #perl6
06:22 patmat Welcome LadyLunacy!!
06:27 ElectricHeavyLan joined #perl6
06:27 ElectricHeavyLan left #perl6
06:29 moritz_ good morning
06:31 mberends joined #perl6
06:32 mberends whoz op ?
06:32 patmat hey moritz_!
06:32 moritz_ OH HAI P6BUGS ;-)
06:34 Tene I'm op, what's up?
06:36 mberends ok Tene s op. how do u make your own chanle?
06:36 ab5tract joined #perl6
06:36 Tene I saw this before from masak I think... I think I missed something.
06:37 mberends im being polite, not using caplock. so how do u?
06:37 moritz_ ;-)
06:38 moritz_ Tene: just a funny incident with somebody not used to IRC
06:38 Tene ah
06:38 Tene OK
06:39 mberends Tene: but srsly, how is the blogserver doing?
06:40 moritz_ Tene: http://irclog.perlgeek.de/perl6/2009-05-12#i_1138627 if you're interested ;-)
06:40 Tene mberends: I haven't touched it since i put it up.
06:40 Tene http://blogs.gurulabs.com/stephen/2009/05/blog-speed-run.html
06:40 Tene http://pleasedieinafire.net:2080/
06:41 mberends Tene: tried, that's why I was curious. Hmm, my post is gone :(
06:42 Tene I'd really enjoy feedback. :)
06:42 Tene mberends: oh, I put it up earlier from a different server.
06:42 Tene yeah, I see your post here in /tmp on my laptop. :)
06:43 mberends I was collaborating with masak on Yarn, any chance of merging the two sources?
06:43 Tene probably
06:43 mberends :) I'd like to add registration, authentication etc.
06:43 Tene Well, probably not.  It wasn't really meant to be a serious blog.  Mostly just an experiment.
06:44 DemoFreak joined #perl6
06:44 Tene I'll probably use it to test out features like that, and different ways of integrating them.
06:46 Tene so, I don't have any real feelings of trying to work to make something good, yet.
06:47 mberends fine. On another topic, I tried mimicking a Net::SMTP and hd socket IO problems. Could you help troubleshoot the parrot bits?
06:47 mberends *had # gah
06:48 Tene yes
06:49 mberends great, I'll reduce the failing code to a tiny test case later
06:49 Tene mberends: if you email it to me, I can take a look at it during the day.
06:50 Tene I'll be offline during work
06:50 mberends thanks, in a few hours
06:50 Tene that will be great.
06:51 Tene and it doesn't need to be *too* minimal, btw.
06:51 Tene if you can't get it minimal, just send what you can.
06:53 mberends ok, but I have @family.life() & to multithread
06:53 pugs_svn r26824 | pmichaud++ | [t/spec]:  Rakudo fudge a test we now regress.
06:53 Tene you've got 7 hours before I start waking up. :)
06:54 mberends that's doable
06:54 ejs joined #perl6
06:58 mberends Tene: it was already all at http://gitorious.org/net-smtp/mainline/trees/master
06:59 Tene thx
07:01 dukeleto joined #perl6
07:03 ejs1 joined #perl6
07:10 mikehh_ joined #perl6
07:14 Matt-W Morning
07:15 mberends morning; afk &
07:16 iblechbot joined #perl6
07:17 pmichaud yay, I have operators in rakudo -- just need to run spectests and then push.  :-)
07:18 Tene pmichaud++
07:18 Tene pmichaud: I will see about getting pugs' Set.pm running on rakudo
07:19 pmichaud we're still limited in that the tighter/equiv/looser traits aren't implemented yet.
07:19 pmichaud I'll work on that tomorrow.
07:20 ElectricHeavyLan joined #perl6
07:20 donaldh joined #perl6
07:24 Matt-W pmichaud++
07:56 dalek rakudo: 8349d75 | pmichaud++ | src/parser/ (2 files):
07:56 dalek rakudo: Add ability to define operator subs.
07:56 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8349d75a321cf52d4e30fafba74bda85f15e558b
07:56 dalek rakudo: ad9e008 | pmichaud++ |  (2 files):
07:56 dalek rakudo: Add ability to declare infix: subs.
07:56 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/ad9e0081511a86b4b6b341614e0b0701215477e7
07:56 dalek rakudo: 9dcaf47 | pmichaud++ | src/parser/actions.pm:
07:56 dalek rakudo: Update parse table both immediately and in saved code.
07:56 dalek rakudo: Add a simplistic views of prefix: and postfix: ops.
07:56 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9dcaf47c5b2736d758355a6ae882effa21c60e55
07:58 pmichaud rakudo: sub postfix:<!>($n) { [*] 1..$n };  say 7!;
07:58 jferrero joined #perl6
07:58 p6eval rakudo bf281c: OUTPUT«Malformed routine definition at line 1, near "postfix:<!"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
07:58 pmichaud rakudo:  say &infix:<+>(3,4);
07:58 p6eval rakudo bf281c: OUTPUT«7␤»
07:59 moritz_ rakudo: sub infix:<foo>($a, $b) { say $a + $b }; 3 foo 4
07:59 p6eval rakudo bf281c: OUTPUT«Malformed routine definition at line 1, near "infix:<foo"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
07:59 pmichaud hasn't updated yet
07:59 moritz_ aye
08:00 moritz_ anyway, pmichaud++
08:00 pmichaud rakudo:  say 'ready yet?'
08:00 p6eval rakudo bf281c: OUTPUT«ready yet?␤»
08:00 pmichaud (not yet.)
08:01 pmichaud rakudo: sub postfix:<!>($n) { [*] 1..$n };  say 7!;
08:01 p6eval rakudo bf281c: OUTPUT«Malformed routine definition at line 1, near "postfix:<!"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
08:01 pmichaud rakudo:  say 'ready yet?'
08:01 p6eval rakudo bf281c: OUTPUT«ready yet?␤»
08:01 pmichaud (sigh)
08:01 moritz_ pmichaud: I'm starting the rebuild now
08:02 pmichaud Impatience is a virtue.
08:02 pmichaud Doesn't the rebuild normally start by itself at the top of the hour...?
08:03 eMaX joined #perl6
08:03 pmichaud rakudo: sub postfix:<!>($n) { [*] 1..$n };  say 7!;
08:03 p6eval rakudo bf281c: OUTPUT«./perl6: error while loading shared libraries: libparrot.so.1.1.0: cannot open shared object file: No such file or directory␤»
08:03 moritz_ pmichaud: it needs to recompile parrot, takes a while on a single CPU machine
08:04 * pmichaud goes back to playing solitaire.  :-)
08:09 pmichaud rakudo: sub postfix:<!>($n) { [*] 1..$n };  say 7!;
08:09 p6eval rakudo bf281c: OUTPUT«sh: ./perl6: No such file or directory␤»
08:09 pmichaud oh well.  I need sleep, so will try it out tomorrow.
08:09 moritz_ it compiles gen_settings.pm right now
08:09 moritz_ good night
08:11 moritz_ rakudo: sub postfix:<!>($n) { [*] 1..$n };  say 7!;
08:11 p6eval rakudo 9dcaf4: OUTPUT«5040␤»
08:11 moritz_ pmichaud+++
08:18 autin joined #perl6
08:18 tombom joined #perl6
08:19 moritz_ rakudo: my $a; &infix:<=>($a, 4); say $a
08:20 p6eval rakudo 9dcaf4: OUTPUT«4␤»
08:20 moritz_ rakudo: my Str $a; &infix:<=>($a, 4); say $a
08:20 p6eval rakudo 9dcaf4: OUTPUT«Type mismatch in assignment; expected something matching type Str but got something of type Int()␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
08:20 moritz_ rakudo: my Int $a; &infix:<=>($a, 4); say $a
08:20 p6eval rakudo 9dcaf4: OUTPUT«4␤»
08:23 pnu joined #perl6
08:27 pugs_svn r26825 | moritz++ | [t/spec] unfudge assign.t, and extend a bit (you know, 318 assignment test just were not enough)
08:30 moritz_ pmichaud: the form with french quotes (infix:«something») also needs to be done ;-)
08:30 Matt-W rakudo: sub infix:<pointless>($a, $b) { $b ~ $a }; say "world" pointless "hello "
08:30 p6eval rakudo 9dcaf4: OUTPUT«hello world␤»
08:31 Matt-W that is so cool
08:31 Matt-W pmichaud++
08:36 masak joined #perl6
08:36 masak I'm on my way to work. just stopping by to say pmichaud++ pmichaud++ pmichaud++
08:36 pugs_svn r26826 | moritz++ | [t/spec] fudge sub.t for rakudo
08:41 dalek rakudo: 1af7e29 | moritz++ | t/spectest.data:
08:41 dalek rakudo: we pass an operator definition/overloading test
08:41 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1af7e293c7efe622115bfbe3f2ef42bb565f8579
08:50 Matt-W @tell masak Clearly there is a lot of love for pmichaud++ at the moment
08:50 lambdabot Consider it noted.
08:52 baest joined #perl6
08:53 pugs_svn r26827 | moritz++ | [t/spec] unfudge proto.t for rakudo
08:54 meppl joined #perl6
08:54 kane_ joined #perl6
08:55 kane___ joined #perl6
08:57 wollmers joined #perl6
09:17 wollmers S01: 'Perl is written in Unicode.'
09:18 wollmers Yesterday IRC log: Text files are in Unicode.
09:18 moritz_ we certainly have a Unicode bias in here ;-)
09:20 wollmers There is no save way to autodetect UTF-8 versus UTF-16 for text files, for perl source - maybe, because source contains chars in the ASCII rabge.
09:20 wollmers *range
09:21 moritz_ wollmers: the presence of a BOM makes it rather safe
09:21 moritz_ wollmers: and the spec is quite clear that if it's not UTF-16, UTF-8 is the fallback
09:21 moritz_ i'm not 100% happy with it, but it seems to mostly work
09:21 moritz_ lunch &
09:22 wollmers I cannot find it in the specs ...
09:22 Matt-W unicode is always a nasty mess it seems
09:24 wollmers Matt-W: Encoding is the most simple thing, but mostly underestimated as a main source of problems.
09:29 jnthn H H
09:34 jnthn pmichaud++ # yay!
09:41 mikehh_ I've been getting failures in spectest for the last few days - both on Kubuntu Jaunty Amd64 and Ubuntu Jaunty i386
09:42 mikehh_ t/spec/S32-io/IO-Socket-INET.t  fails test 2-3 - but when I run ./perl6 t/spec/S32-io/IO-Socket-INET.t  it passes
09:43 mikehh_ t/spec/S09-subscript_slice/slice.rakudo passes all the tests says #Fudged and then segfaults
09:45 wollmers mikehh_: cd rakudo; make  t/spec/S32-io/IO-Socket-INET.t
09:45 wollmers mikehh_: runs here on Debian/Sid
09:47 mikehh_ wolmers: that passes
09:48 mikehh_ it just seems that when I run make spectest the test fails - maybe a threading problem?
09:50 autin joined #perl6
09:51 mikehh_ it has consistently failed on my last few builds both on Amd64 and i386
09:56 mikehh_ sorry that should have been wollmers
09:56 Kyosuke_Kiryu joined #perl6
10:00 jnthn mikehh: I see the slice.t one too - I looked into it a bit, but it ain't gonna be easy to fix, I fear. :-(
10:05 wollmers mikehh: IO-Socket-INET.t does ugly things (look into source); the reasons for the difference can be many ...
10:09 TRM_PEMROGRAMAN_ joined #perl6
10:14 mberends mikehh: ugliness is my bad. I'd like to improve it...
10:15 mberends wollmers: the problem I had writing it, was determining an available port number on the fly.
10:18 mikehh jnthn: as far as I can see it in the exit code
10:19 mikehh all the other tests pass
10:20 jnthn mikehh: It doesn't make it through all of them for me, crashes along the way.
10:20 jnthn mikehh: I hunted it down a bit and it looks like a GC bug.
10:20 jnthn In which case it's liable to manifest itself in different ways in different places.
10:21 mikehh jnthn: thats what I think too
10:21 mikehh It seems to be in the gc cleanup
10:23 jnthn I thought so far that was mostly re-naming things, but maybe not.
10:23 mikehh anyway I'm trying to debug now - will let you know if I find anything
10:25 jnthn mikehh: Thanks. I did also write a ticket on this that you may wish to look up.
10:25 jnthn With some initial analysis.
10:29 jnthn mikehh: It was this one: http://rt.perl.org/rt3/Ticket/Display.html?id=65396
10:33 cognominal joined #perl6
10:39 pastorn joined #perl6
10:40 mikehh jnthn: when I run as per the ticket I get maximum recursion depth exceeded then similar output
10:42 pugs_svn r26828 | moritz++ | [t/spec] unfudge postfix:<!> test for rakudo
10:43 mikehh with -G that is
10:49 mikehh jnthn: when I run the test -> ../parrot.t/parrot -G perl6.pbc t/spec/S09-subscript_slice/slice.rakudo  the same stuff happens
10:51 mikehh jnthn: but it fails after ok 7 - slice from array slice, part 2, maximum recursion depth exceeded
10:53 mikehh jnthn: without the -G it gets past the say "# FUDGED!" then Segmentation fault
10:57 zamolxes joined #perl6
10:57 jnthn mikehh: I know.
10:58 amoc joined #perl6
10:58 jnthn mikehh: The ticket gives a smaller example too.
10:59 mikehh jnthn: ok and now for something completely different - or something to that effect :-}
10:59 masak joined #perl6
11:00 masak oh hai
11:00 lambdabot masak: You have 1 new message. '/msg lambdabot @messages' to read it.
11:00 masak whoz user-defined op?
11:00 masak @messages
11:00 lambdabot Matt-W said 2h 9m 27s ago: Clearly there is a lot of love for pmichaud++ at the moment
11:00 masak pmichaud++
11:00 moritz_ rakudo: sub postfix:<!>($x) { [*] 1..$x }; say 5!
11:00 p6eval rakudo 1af7e2: OUTPUT«120␤»
11:01 moritz_ rakudo: { sub postfix:<!>($x) { [*] 1..$x }; }; say 5!
11:01 p6eval rakudo 1af7e2: OUTPUT«120␤»
11:01 masak I have a few edge cases I'd like to discuss.
11:01 masak rakudo: sub infix:<,> { 42 }; say 5, 5
11:01 p6eval rakudo 1af7e2: OUTPUT«55␤»
11:01 masak I think this one should at least warn of overriding.
11:01 masak (secondly, it doesn't work.)
11:02 moritz_ it's not lexically scoped yet
11:02 Matt-W it just... doesn't do anything noticeable
11:02 masak moritz_: that is neither here nor there.
11:02 jnthn mikehh: I tried to debug it a bit but it's kinda hard. :-|
11:02 moritz_ masak: a warning isn't that easy...
11:02 * Matt-W lunch &
11:02 moritz_ masak: because the setting will define a 'proto infix:<,>'
11:02 moritz_ masak: so that any 'sub infix:<,>' is automatically a multi sub
11:02 masak moritz_: oh.
11:02 moritz_ masak: and adding a new multi never warns
11:03 masak moritz_: well, then it shouldn't warn.
11:03 masak moritz_: but I bet it shouldn't not work either.
11:03 masak rakudo: sub infix:<#> { 42 }; say 5 # 5
11:03 p6eval rakudo 1af7e2: OUTPUT«5␤»
11:03 moritz_ masak: it should do an ordinary multi dispatch
11:03 masak along the same lines...
11:03 masak moritz_: aye.
11:03 masak moritz_: and probably ambig-fail.
11:03 moritz_ rakudo: sub infix:<,>(Int $x where 1, Int $y where 1) { 42 }; say 1, 1
11:03 p6eval rakudo 1af7e2: OUTPUT«11␤»
11:04 masak rakudo: sub infix:<+> { 42 }; say 5 + 5 # so should this
11:04 p6eval rakudo 1af7e2: OUTPUT«42␤»
11:04 moritz_ now *that* should be tighter, and give 42
11:04 * masak submits rakudobug
11:04 zamolxes joined #perl6
11:04 moritz_ masak: a sub without a signature has slurpy @_
11:05 masak oh, right.
11:05 moritz_ masak: so that it's not very specific, and will practically never match in the multi dispatch
11:05 masak rakudo: sub infix:<+>() { 42 }; say 5 + 5 # so should this
11:05 p6eval rakudo 1af7e2: OUTPUT«42␤»
11:05 moritz_ that should be 10, no?
11:05 masak I think so.
11:05 masak rakudo: sub infix:<+>($a, $b) { 42 }; say 5 + 5
11:05 jnthn I think the issues with overloading existing rather than defining new, may be an interaction between the existing ones using Parrot's MMD.
11:05 p6eval rakudo 1af7e2: OUTPUT«42␤»
11:06 jnthn And the new ones using Rakudo's.
11:06 masak aha.
11:06 masak jnthn: is there a plan to do something about that?
11:06 moritz_ rakudo: multi sub infix:<+>() { 42 }; say 5 + 5
11:06 p6eval rakudo 1af7e2: OUTPUT«Null PMC access in find_method()␤current instr.: '_block18' pc 78 (EVAL_20:54)␤»
11:06 moritz_ masak: ^^
11:06 * masak bug
11:07 jnthn masak: Oh, actually, that bug is exactly coming up because of this issue.
11:07 jnthn masak: The other issue is that since we're not really defining a proto yet, your sub is just supplanting the existing operator.
11:07 jnthn masak: And yes, plan is to define all operators in Perl 6. (With inline PIR, no doubt.)
11:08 jnthn When that happens, the special-cased auto-threading froms can go away too. :-)
11:16 masak rakudo: sub postfix:<km>($n) { $n ~ ' kilometers' }; say 42\km
11:16 p6eval rakudo 1af7e2: OUTPUT«Statement not terminated properly at line 1, near "\\km"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
11:17 masak rakudo: sub postfix:<km>($n) { $n ~ ' kilometers' }; say 42km
11:17 p6eval rakudo 1af7e2: OUTPUT«42 kilometers␤»
11:17 masak \o/
11:18 masak but the first one should work too, right?
11:19 jnthn masak: Yes
11:19 jnthn rakudo: sub postfix:<km>($n) { $n ~ ' kilometers' }; say 42 \km
11:19 p6eval rakudo 1af7e2: OUTPUT«Statement not terminated properly at line 1, near "\\km"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
11:19 * masak submits a slam dunk
11:19 jnthn oh
11:19 jnthn rakudo: sub postfix:<km>($n) { $n ~ ' kilometers' }; say 42\ km
11:19 jnthn I meant that.
11:19 p6eval rakudo 1af7e2: OUTPUT«42 kilometers␤»
11:19 masak oh, ah.
11:20 masak well, I un-submit then.
11:20 jnthn My previous one should not work.
11:20 masak no.
11:20 masak and the case of \ without ensuing ws is already in RT.
11:21 donaldh joined #perl6
11:22 jnthn aye
11:22 jnthn I think I know where to fix that too.
11:22 jnthn Ouch, LolDispatch abuses Rakudo guts.
11:23 moritz_ aye
11:23 jnthn That's gonna break in not too long. Happily, first I'm going to make the Right Way work. :-)
11:25 masak LolDispatch is cool.
11:25 masak but I was really surprised that what it does works already.
11:25 masak turns out it cheats. :P
11:26 jnthn masak: I'm going to write an example very much like loldispatch and make it work the proper way.
11:26 masak yay!
11:30 wollmers rakudo: sub infix:<cut> ($a, $b) { "Prolog: $a,!,$b." }; say 'a' cut 'b';
11:30 p6eval rakudo 1af7e2: OUTPUT«Prolog: a,!,b.␤»
11:31 * masak senses a new era in Rakudo hacking is about to begin...
11:33 * jnthn needs to blog about some of the stuff he's been doing on his not-yet-approved grant at some point...
11:39 ejs1 joined #perl6
11:50 jnthn woo, got cut-down LolDispatch-y thing working the Official Way.
11:50 jnthn With one annoying quirk that I can now fix hopefully...
11:55 masak ok, here's what I'd like: a Perl 6 project on github or wherever which took a Perl 6 source file as input, and gave a parse tree as output. it might be built on either STD or Rakudo, doesn't matter. the parse tree might be made of Match objects or just plain hashes, doesn't matter.
11:56 jnthn http://gist.github.com/111625
11:56 masak my main requirement is mainly that I don't have to do the dirty work of joining the piping together. :)
11:56 moritz_ once Perl6::Grammar returns a proper match object, that's a piece of cake.
11:56 masak indeed.
11:57 masak that's a legit solution too.
11:57 jnthn @tell Tene Here is the more proper way to do LolDispatch: http://gist.github.com/111625 - am comitting the changes to enable this Real Soon Now. Will not break the previous hacky way...yet.
11:57 lambdabot Consider it noted.
11:57 moritz_ jnthn: I don't think you need to worry about loldispatch
11:57 moritz_ jnthn: if I understood Tene correctly it's meant as a throw-away thingy for now anyway
11:58 masak jnthn: is 'handler' in the signature a type?
11:58 jnthn masak: Yes
11:58 masak oh.
11:58 * masak sees now
11:58 masak it's defined at the top.
11:58 jnthn See role handler { }
11:58 jnthn Yeah
11:58 jnthn But in Rakudo we're I think more liberal on the parse at the moment than STD
11:59 jnthn std: sub foo() is nonexistantthing { }
11:59 p6eval std 26828: OUTPUT«ok 00:02 35m␤»
11:59 jnthn oh, maybe not. :-)
11:59 masak um. that feels like a STDbug.
11:59 moritz_ IMHO that should be an error
11:59 masak TimToady: is it?
12:00 iblechbot joined #perl6
12:00 jnthn Yeah, I was expecting STD to complain there, but I suspect it may more be out of pragmatism/incompleteness that it doesn't do so yet.
12:00 * masak likes how the power of backlogging allows us to send messages through time
12:00 jnthn Or maybe it's to give the compiler a shot at handling special ones.
12:00 moritz_ oh wait
12:00 masak jnthn: maybe it's so that the subs can be defined before the handlers.
12:00 moritz_ it should be a compile time error, but does it have to be a parse time error?
12:01 masak moritz_: maybe not.
12:01 moritz_ I mean is thing after the 'is' always a type name?
12:01 jnthn moritz_: I'm not 100% clear on that.
12:01 jnthn S14 says
12:01 pmichaud good morning, #perl6
12:01 jnthn To define a trait handler for an "is xxx" trait, define one or
12:01 jnthn more multisubs into a property role like this:
12:01 jnthn Suggesting that xxx is a type name.
12:01 * masak , for one welcomes our op overlord pmichaud
12:01 jnthn pmichaud: oh hai
12:01 mizioumt joined #perl6
12:01 masak s/s//
12:03 * jnthn spectests his intial patch to get us started on the road to traits
12:05 payload joined #perl6
12:10 orafu joined #perl6
12:12 pmichaud masak:   in   "say 5,5"  the infix:<,> is never called.
12:13 pmichaud say (5,5)  would call infix:<,> however.
12:13 masak pmichaud: is that specced?
12:13 moritz_ and, more interestingly, why? ;-)
12:15 pmichaud I don't know if it's specced that way.  But   "say 5,5"  passes two arguments to the say() function.
12:15 pmichaud i.e., it never forms a list (it does form a capture)
12:15 moritz_ that's... weird
12:15 pmichaud "say (5,5)"  sends one argument to the say() function; that one argument is the result of infix:<,> on two values.
12:16 * jnthn doesn't find that surprising
12:16 jnthn It's like you'd not expect :($x, $y) to call it 'cus it's a signature.
12:17 jnthn I guess we know when we're expecting to parse a capture and when not.
12:17 Matt-W would say(5,5) pass two arguments?
12:17 jnthn yes
12:17 Matt-W good
12:17 masak jnthn: but isn't the ',' within the signature also an operator?
12:17 jnthn masak: No.
12:17 jnthn It's just a parameter seperator
12:17 masak ok.
12:18 masak fair enough.
12:18 jnthn (As are ;; and :)
12:18 masak aye.
12:18 jnthn See param_sep in STD.pm
12:19 masak oh, oh, how does the thing with trailing commas in lists really work, by the way?
12:19 masak they can't be pure infix if they're trailing.
12:21 pmichaud PGE handles it by having a notion of a "null term"
12:21 pmichaud I'm not sure how STD.pm handles it yet
12:21 moritz_ which implies they're probably a special syntactic form (in STD.pm)
12:23 masak rakudo: sub foo($a,) {}; say &foo.arity
12:23 p6eval rakudo 1af7e2: OUTPUT«1␤»
12:23 masak seems to work in sigs as well.
12:23 orafu joined #perl6
12:24 masak meeting &
12:24 jnthn Probably has to for method foo($inv:) {} to work.
12:26 Matt-W I'd expect so
12:26 Matt-W unless : was excessively special-cased
12:36 elmex_ joined #perl6
12:48 payload joined #perl6
12:49 jnthn -> slovak class, bbiab
12:53 lichtkind joined #perl6
13:01 ejs2 joined #perl6
13:15 skids joined #perl6
13:23 ruoso joined #perl6
13:27 mizioumt1 joined #perl6
13:31 ruoso Hello!
13:31 masak ruoso: oh hai.
13:32 masak ruoso: I read through your Faz source code yesterday, before blogging.
13:32 ruoso masak, how does the trait handler works in LoLDispatch?...
13:32 ruoso masak, I've just read your blog post...
13:32 masak ruoso: very well, thank you? :)
13:32 dalek rakudo: 705cb2b | pmichaud++ | src/parser/grammar.pg:
13:32 dalek rakudo: Fix use of � � and << >> in postcircumfix (and operator definitions). moritz++
13:32 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/705cb2b46dc0753f2348d96fd5b10cf50f0bdc85
13:32 masak ruoso: actually, it works by cheating, AFAIU.
13:33 masak ruoso: I had the impression Faz would use .reduce, but it does not seem to do that at all...
13:33 ruoso masak, we need .reduce to support different arity in the multies
13:33 ruoso but we can have a different dispatcher as well
13:34 exodist joined #perl6
13:34 masak ruoso: actually, Faz feels like a more syntax-rich LolDispatch.
13:34 ruoso masak, plus the chained dispatch
13:34 masak yes, I noticed the word 'chained'.
13:35 masak does that mean several things can match, in order?
13:35 ruoso yes
13:35 ruoso note the %*stash<posts> is populated at the root action's begin
13:35 ruoso which is re-used by both create and inde
13:35 ruoso *index
13:36 masak that seems to presuppose an application which survives single requests.
13:37 ruoso what do you mean?
13:38 ruoso masak, the regex of the chained actions are concatenated
13:38 ruoso so...
13:38 ruoso if root regex is / ^  /
13:38 ruoso and index regex is / \/? $ /
13:38 ruoso the full regex that will match index is
13:38 ruoso /^ \/? $/
13:38 ruoso then create also chains root... so, in the end, you get a regex like
13:39 masak ruoso: ah, nice.
13:39 masak that makes a lot of sense.
13:39 ruoso / ^ [ \/?  $ { make $index } | \/create \/? $ {make $create} ] /
13:39 ruoso actually
13:40 ruoso there are some named captures in the way, so I can get parameters in the middle
13:40 ruoso so the capture of the regex for that specific action is used as the capture when calling the closures for that action
13:43 LadyLunacy joined #perl6
13:43 plu joined #perl6
13:45 sjn joined #perl6
13:54 pmurias joined #perl6
13:54 ruoso masak, I'm adding a view_post action in Faz' Yarn, so you can see the capture in action
13:55 ruoso hi pmurias
13:56 masak ruoso: nice.
13:56 pmurias ruoso: hi
13:57 ruoso pmurias, I think now we can just try to fix the tests, and the refactoring is over
13:59 pmurias we mostly have sigantures and perl 5 integration to restore
14:00 sjn left #perl6
14:02 pmurias ruoso: and we have a leak in re-smop :(
14:02 masak mberends: ping.
14:02 ruoso pmurias, a new one?
14:05 pmurias yes
14:06 mberends masak: OH HAI
14:06 masak mberends: oh hai, whoz op?
14:07 masak so I attempted the Ecosystem patch yesterday.
14:07 masak ran into a smallish number of interesting issues.
14:08 * mberends git-pulls
14:08 masak haven't pushed anything from that yet.
14:08 masak the last issue is kind of a blocker...
14:09 mberends I'm going to distil yesterday's todo list into PIONEER and README, for your comment. What's the blocker?
14:10 ruoso masak, just pushed the version using the capture....
14:10 masak mberends: PERL6LIB not set when compiling lib/Installer.pm
14:10 masak mberends: I think we need that full-fledged build system.
14:10 masak ruoso: ok, will check.
14:17 mberends lib/Installer.pm did not nest any 'use' commands, therefore it compiled anyway. You could insert PERL6LIB into proto:59.
14:17 moritz_ rakudo: say ?("ab" ~~ /a <!after b>/)
14:17 p6eval rakudo 705cb2: OUTPUT«1␤»
14:17 moritz_ rakudo: say ?("ab" ~~ /a <!before b>/)
14:17 p6eval rakudo 705cb2: OUTPUT«0␤»
14:17 moritz_ rakudo: say ?("ab" ~~ /<!after a> b/)
14:17 p6eval rakudo 705cb2: OUTPUT«0␤»
14:18 masak mberends: yes, I'll try doing that first. but I do think that a full build system is the long-term solution.
14:18 alester joined #perl6
14:18 mberends masak: agreed
14:19 mberends 'env -i ...' would be even better, rtfm
14:20 masak :)
14:20 masak yes, ISTR someone said I should use env, because the env-less form is bash-specific or some such.
14:23 mberends Bourne and Korn do it env-less too, but the -i is FTW
14:23 iblechbot joined #perl6
14:23 ruoso masak, btw... wait a bit more before checking Faz Yarn... I'm doing some other cool thing now
14:23 * jnthn back
14:23 masak ruoso: :)
14:24 ruoso masak, it seems you're working on some kind of templating engine... is it?
14:24 jferrero joined #perl6
14:24 pugs_svn r26829 | moritz++ | [t/spec] unfudge infix:«...» test for rakudo
14:30 LadyLunacy joined #perl6
14:31 * masak is fascinated by the tests in t/spec/S01-perl-5-integration
14:33 jnthn livemocha++ # most interesting site I've found in a while
14:33 jnthn OK, back to debugging my test fail from my traits patch...
14:33 pugs_svn r26830 | pmurias++ | [re-smop] ported over Attribute
14:33 pugs_svn r26831 | pmurias++ | [re-smop]
14:33 pugs_svn r26831 | pmurias++ | started porting over DefaultBlockSignature
14:33 pugs_svn r26831 | pmurias++ | t/control_exception.t passes
14:34 pmurias ruoso: what is Faz Yarn?
14:34 ruoso pmurias, Faz is an Action Dispatcher in Perl 6
14:35 ruoso and Yarn is a blog engine masak started and that I later ported to Faz
14:35 masak there's also LolDispach Yarn, but it goes under the name "omgblog". :)
14:36 ruoso http://github.com/ruoso/faz/blob/a7a806ed8b4a599d5866b6bd70858d581487fcc7/examples/yarn/lib/Yarn.pm
14:36 ruoso that's the latest version... that does fair use of Chained actions and of the different steps of the processing
14:36 masak jnthn: yes, livemocha seems really cool. will probably get a language partner on that site once my afk language partner has left town...
14:37 ruoso masak, now you can look at it ;)
14:37 masak ruoso: well, after my workday finishes, I can. :)
14:39 * pmurias is remainded that he should be working on his project for uni rather than making smop pass tests...
14:39 ruoso the cool part is around line 91\
14:39 pmurias * reminded
14:40 jnthn masak: Yeah, I'm getting some additional Slovak practice with it. Seems to work well. :-)
14:40 masak jnthn: sounds promising.
14:41 pmichaud rakudo:  sub postfix:<<!>>($x) { [*] 1..$x };  say 7!;
14:41 p6eval rakudo 705cb2: OUTPUT«5040␤»
14:41 masak wow, that trick never gets old. :)
14:41 pmichaud rakudo:  sub postfix:«!»($x) { [*] 1..$x };  say 7!;
14:41 p6eval rakudo 705cb2: OUTPUT«5040␤»
14:42 moritz_ masak: it used to work only with <>, not with <<>> or «»
14:42 pmichaud rakudo:   say «hello world»;
14:42 masak oh!
14:42 p6eval rakudo 705cb2: OUTPUT«helloworld␤»
14:42 masak pmichaud++
14:42 Matt-W wow. Livemocha looks really interesting.
14:42 moritz_ pmichaud: we have tests for «...», but not for <<...>> I think
14:42 pmichaud rakudo:  my $foo = 'hello world';   say «$foo».elems
14:42 p6eval rakudo 705cb2: OUTPUT«1␤»
14:42 pmichaud oops.
14:42 pmichaud oh well :-)
14:43 moritz_ it's not yet christmas ;-)
14:43 jnthn pmichaud: I added trait_auxiliary as a category, and it all Just Worked on the parsing side. Thanks! :-)
14:43 * masak submits rakudobug
14:44 ruoso masak, please consider adding .redirect in the Web::Response module...
14:45 masak ruoso: I've been wanting that too. so yes.
14:45 nihiliad joined #perl6
14:47 mberends nice, � � were bad in Pod::Parser, they might start working too
14:48 masak mberends: please check the encoding settings in your IRC client. :)
14:48 masak (quoting /topic: "UTF-8 is your friend!")
14:48 jnthn masak: They looked fine to me. ;-)
14:49 payload joined #perl6
14:49 pmichaud jnthn: (trait_auxiliary)  I should probably fix it so that rakudo doesn't attempt to add those as tokens.
14:49 jnthn pmichaud: Oh? Would that be in the category action?
14:49 masak jnthn: ok. Emacs does the Right Thing often enough that I just tend to assume that it's right and other clients are wrong. :)
14:49 jnthn I didn't commit yet...
14:49 pmichaud jnthn: no, it's in the add_optoken sub (actions.pm)
14:49 mberends it's XChat, cannot see what might need changing
14:50 moritz_ they look fine here too, but my irssi is configured to do some latin1/utf8 autodetection
14:50 pmichaud you can go ahead and commit, I'll fix it up.  I have other things to fix there also.
14:50 jnthn masak: If you used vi it'd do the right thing even more often. ;-)
14:50 * jnthn runs off back to his Visual Studio
14:50 masak jnthn: I do use vi. just not for IRC.
14:50 masak jnthn: I do most of my Perl 6 coding in vim, actually.
14:51 masak practically all of it.
14:51 jnthn masak: I know what :q does ;-)
14:51 masak jnthn: it's, er, a smiley. :q
14:51 jnthn .oO( sticking out a tongue with a tongue-ring )
14:51 masak heh.
14:52 jnthn Or "licking nose" perhaps
14:52 moritz_ on #perlde we have a bot that responds to :q ;-)
14:52 moritz_ 16:51 <@moritz> :q
14:52 moritz_ 16:51 <+dustpuppy> moritz: E37: No write since last change (add ! to override)
14:52 jnthn :!q ?
14:52 Matt-W moritz_++
14:52 Matt-W But shouldn't it use the German translation?
14:53 * Matt-W ponders setting his laptop to be in German and seeing how long it takes him to learn how to use it
14:53 moritz_ Matt-W: dunno, dustpuppy mixes the languages a bit
14:53 * ruoso now needs to implement both Model and View in Faz... the controller part is set already...
14:53 moritz_ Matt-W: but I fear that most people wouldn't recognize the German translation ;-)
14:53 Matt-W moritz_: quite possible
14:54 * Matt-W home &
14:54 mberends dutch IT people hate using dutch-localized software
14:58 masak I'd say it depends among Swedes, but I sure don't enjoy running software in non-English localisation.
14:59 masak English is the lingua franca of software development.
14:59 moritz_ isn't that lingua anglica, or so? ;-)
15:00 Tene jnthn: please don't bother worrying about keeping loldispatch working.  It was a 10-minute hack to see if I could do it.  Thank you for making the right way work.
15:00 lambdabot Tene: You have 1 new message. '/msg lambdabot @messages' to read it.
15:01 masak moritz_: no, because 'lingua franca' was lexicalized at the time when the Frankish tongue was predominant.
15:01 masak moritz_: in the same way, my collegues order a Coke with their food and are happy with getting a Pepsi.
15:02 pmichaud ick, Pepsi.
15:02 skids joined #perl6
15:02 moritz_ masak: that wasn't entirely serious
15:02 masak moritz_: I know. :)
15:02 moritz_ (man smiley ;-)
15:02 pmichaud Whenever offered a Pepsi in lieu of a Coke, I choose water.
15:02 masak moritz_: I just felt like giving a serious answer.
15:02 moritz_ masak: I know that feeling
15:02 masak pmichaud: I tend go directly for the water. YMMV.
15:03 moritz_ masak: I also answer rhetorical questions sometimes, when I feel like
15:03 masak moritz_: aye. moi aussi.
15:03 dalek rakudo: 90dbe0b | pmichaud++ | docs/spectest-progress.csv:
15:03 dalek rakudo: spectest-progress.csv update: 388 files, 11258 passing, 1 failing
15:03 dalek rakudo: (failing test in S04-declarations/multiple.t has already been fudged)
15:03 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/90dbe0b8bb14b10cfe40ce1a7ba6327993266901
15:03 masak moritz_: dictionary.com suggests that 'franca'/Frankish might have meant something more like 'European' at some point.
15:10 kidd joined #perl6
15:12 mofino joined #perl6
15:13 mofino evalbot: 'perl6: say 3;'
15:13 moritz_ perl6: say 3
15:13 mofino oh
15:13 mofino haha
15:13 p6eval elf 26831, pugs, rakudo 90dbe0: OUTPUT«3␤»
15:14 masak perl6: loop { print 'a' }
15:14 moritz_ masak: pfui!
15:14 masak was that bad? :P
15:14 moritz_ masak: "pfui" is what we say to a dog that does something forbidden ;-)
15:15 masak oh. we have 'fy!' in Swedish. must be parellel.
15:15 dalek rakudo: 612bcf3 | moritz++ | docs/ChangeLog:
15:15 dalek rakudo: [docs] ChangeLog updates
15:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/612bcf3d6f1824bf6b82ba8efc286a62c9c4028f
15:16 jnthn Tene: It was not going to break too soon more out of because I have to refactor other bits first more than trying to keeo loldispatch working ;-)
15:16 alester Anyone else getting any traffic out of google/gmail/etc now?
15:17 masak alester: gmail works here.
15:20 donaldh joined #perl6
15:20 p6eval pugs, rakudo 612bcf:
15:20 p6eval ..OUTPUT«aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
15:20 p6eval ..elf 26831: OUTPUT«Can't call method "match_hash" on an undefined value at ./elf_h line 3238.␤»
15:21 masak ok, I won't do that again, promise.
15:21 jnthn lol
15:21 jnthn Talk about delayed reaction...
15:21 pmichaud rakudo:  say "masak:  s{ 'u' x 100 }re you won't."
15:21 p6eval rakudo 612bcf: OUTPUT«masak:  suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuure you won't.␤»
15:22 masak :P
15:22 eternaleye joined #perl6
15:23 jnthn rakudo: sub infix:<ö>($x, $y) { say "flyyy" }; (1,2,3) »ö« (4,5,6)
15:23 masak (why do I get the feeling that pmichaud might have been slightly sarcastic?)
15:23 p6eval rakudo 612bcf: OUTPUT«Statement not terminated properly at line 1, near "\x{bb}\x{f6}\x{ab} (4,5,6"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
15:24 jnthn aww.
15:24 masak is that a new bug?
15:24 jnthn Yes. No.
15:24 moritz_ jnthn: I think meta-ops are pre-generated
15:24 masak I mean, apart from being a known butterfly.
15:24 jnthn (Can't parse unicode hypers is none.)
15:24 jnthn erm, known
15:24 masak ok.
15:24 moritz_ rakudo: sub infix:<ö>($x, $y) { say "flyyy" }; (1,2,3) >>ö<< (4, 5, 6)
15:24 p6eval rakudo 612bcf: OUTPUT«Statement not terminated properly at line 1, near ">>\x{f6}<< (4, "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
15:25 jnthn But as moritz_ said, we don't handle generating meta-op forms yet.
15:25 jnthn For user defined ops.
15:25 pmichaud ....but we might be able to do so.
15:25 moritz_ aka it's a "todo bug" ;-)
15:25 jnthn Oh, I'm sure we can.
15:25 jnthn It's just whether it's worth hacking it in now, or waiting for when we can parse them the more STD-ish way, if that's teh plan.
15:26 moritz_ heh, rakudo now parses STD.pm up to line 163
15:26 * masak submits TODO bug
15:27 TimToady sounds like it's about time for a rakudo emitter for viv
15:27 * alester is getting 500ms+ pings to google.com and gmail.com :-(
15:27 moritz_ but I can't figure out why it stops parsing there
15:27 pmichaud google.com was slow for me a bit earlier.
15:27 mofino alester, flush out your tubes
15:28 mofino google is fine from the end
15:28 mofino this
15:28 TimToady oh, bizarre
15:28 moritz_ there's nothing obvious advanced in that region
15:29 alester I am not the Tube Keeper.
15:29 TimToady when I ping google.com, it only returns every packet for which the seq# is !%5
15:29 TimToady but it's consistently 86 ms
15:29 pmichaud heh
15:29 mofino TimToady, yeah
15:30 pmichaud that is weird.  I only get the packets where %5 == 1|2
15:30 mofino TimToady, it is weird
15:30 mofino I suspect they treat ICMP with very low priority
15:30 TimToady but they've obviously got it running on some kind of commutator
15:30 TimToady maybe they're under ping attack :)
15:30 pmichaud oh, now I'm getting every packet.
15:31 TimToady so am I
15:31 TimToady weird
15:31 pmichaud from a different IP, though.
15:31 TimToady yes
15:31 jnthn TimToady: Should trait_auxiliary eventually be looking for a type name?
15:31 pmichaud 74.125.67.100 gives me 40% of the packets.
15:31 jnthn TimToady: So is Foo requires Foo to be a typename?
15:32 jnthn (or checking what <longname> hands back is a typename, perhaps.)
15:33 TimToady STD doesn't check trait_auxiliary:<is> for semantics currently
15:33 pmichaud jnthn:  what about something like    sub infix:<xyz> is equiv(&infix<+>) ...
15:33 TimToady it doesn't even care whether hte name exists
15:33 pmichaud would "equiv" need to be a type name there?
15:34 TimToady shouldn't care right now
15:34 TimToady std: sub infix:<xyz> is equiv(&infix<+>) {...}
15:34 p6eval std 26831: OUTPUT«ok 00:03 47m␤»
15:34 TimToady std: sub infix:<xyz> is elephant(&infix<+>) {...}
15:34 p6eval std 26831: OUTPUT«ok 00:03 47m␤»
15:34 pmichaud yes, but if we fix trait_auxiliary:<is> to require a typename, would that pose a problem?
15:34 pmichaud s/fix/change/
15:35 pmichaud or would we expect "equiv" to be a role/type name
15:35 jnthn pmichaud: I would expect that equiv would be yes.
15:35 jnthn pmichaud: Unless there are some that we magically recognize in the parser and don't try to dispatch.
15:35 jnthn ERm, in the actions...
15:35 jnthn And don't emit a dispatch for.
15:35 masak TimToady: do I recall correctly that forward gotos were problematic due to not-declared-yet-ness?
15:36 TimToady yes, we require goto "label" for forward goto
15:36 masak ah, quotes.
15:36 masak worksforme.
15:36 masak goto <label>
15:36 pmichaud jnthn: if "equiv" is a type or role name, does that pose difficulties with creating a sub named 'equiv' ?
15:36 pmichaud i.e., are we eating up major portions of the namespace?
15:37 jnthn pmichaud: I think so; that's one of the things I'm bothered about.
15:37 jnthn pmichaud: But unless we special case some traits, I'm not quite sure how we handle this.
15:38 M_o_C joined #perl6
15:38 jnthn I'm just going on what S14 says for user-defined traits.
15:38 jnthn Which is that you do it by introducing a role or class of that name (though I figure any typename will do...)
15:39 TimToady S14 doesn't really connect all the dots
15:39 TimToady as you have noticed
15:39 TimToady typenames doesn't feel quite right to me for some reason
15:39 pmichaud same here.
15:39 jnthn TimToady: Are they connected elsewhere, or do you have a sense of how you want them connected? :-)
15:40 TimToady well, I've never thought about how they actually show up in your lexical scope
15:40 jnthn I'm fine with use not parsing a typename there. I do need to know what we should do with the <longname> we parse there though.
15:41 jnthn I'd guessed they were just roles that were in the setting, just like any other role.
15:42 TimToady well, but the intent was to do things beyond what roles normally do
15:42 pmichaud +1
15:42 pmichaud (beyond what roles normally do)
15:42 pmichaud afk for a bit
15:42 * TimToady will try drinking more coffee and see if it helps...
15:43 jnthn So far as I can follow S14, the main point of introducing something is so you have a name to write for the type of the first param to trait_auxiliary
15:44 jnthn TimToady: Also while you are pondering over your coffee, I'm also curious in:
15:44 jnthn multi trait_auxiliary:<is>(xxx $trait, Class $container; $arg?) {...}
15:44 jnthn What Class is there.
15:45 TimToady I suspect that means any typename
15:46 jnthn Can it be a subset?
15:46 jnthn I can probably do it easily enough as one.
15:47 TimToady it's just intended to let you multi dispatch on different kinds of containers
15:47 jnthn Sure
15:47 TimToady where "container" is subject to negotiation
15:47 TimToady since pretty much any object could be considere a container of sorts
15:48 skids pmichaud++ operator subs booyah!
15:48 jnthn The name Class is just curious since there is no class class :-)
15:48 TimToady we didn't know that back then
15:48 jnthn Ah, OK.
15:48 TimToady that's actually very ancient doc
15:48 Psyche^ joined #perl6
15:48 ab5tract joined #perl6
15:48 TimToady pre protoobject, pre STD, almost prehistoric
15:48 jnthn I guess now you could write it as $container where { .BUILT }
15:49 jnthn erm
15:49 jnthn !(.BUILT)
15:49 jnthn To get type objects.
15:49 TimToady we're not trying to get a type object, I don't think
15:50 TimToady we're trying to get the actual container, like the array or hash object
15:50 TimToady since that's what has to be modified
15:50 jnthn What about the class Foo is Bar { } style thing though?
15:50 jnthn We'd like to be able to do a meta-class call to add_parent on Foo to add Bar.
15:51 jnthn And I figured we'd call trait_auxiliary:<is>(Bar, Foo)
15:52 jnthn And Foo at that point is the type-object of the currently-under-construction class.
15:52 jnthn I maybe figured wrong though. :-)
15:52 TimToady well, but maybe a trait on class passes the metaobject, not the typeobject
15:53 jnthn Well, at least in the smop world there is no meta-object.
15:53 TimToady because that's the actual container the trait is being applied to
15:53 jnthn So far as I understand it.
15:53 TimToady indeed, and that's why class Foo {...} fails there
15:53 jnthn The meta-class is more "singleton" rather than an instance.
15:54 jnthn Did you see the meta-class being something we have an instance of per class that gets declared?
15:54 jnthn That's how Rakudo currenlty does it, fwiw.
15:54 TimToady I think of it as an instance whose attribute values define the class
15:55 jnthn How does that play into the representation stuff?
15:56 TimToady I don't know what you're meaning by "play into"
15:56 jnthn OK, maybe a better question then
15:56 jnthn What does it mean to create a class based on a P5Hash?
15:56 jnthn ERm, an instance?
15:56 jnthn phone
15:57 jnthn back
15:58 TimToady I don't really care what it means, as long as it works :)
15:59 jnthn Yes, but I't not convinced I know what "works" means in this case.
15:59 jnthn Do you see a class based upon a P5Hash as using that hash for its attribute storage?
15:59 TimToady I'm not in a mental state this morning yet to generate the alternatives
15:59 TimToady as opposed to what?
16:01 TimToady and are you speaking of P5Hash as a type or a representation that .CREATE knows about?
16:01 jnthn I haven't really figured out how they separate out yet.
16:01 TimToady the argument to .CREATE is just a string, as far as I know
16:02 jnthn Is there something that basically says "here is how to use the type P5Hash for instance storage"?
16:02 jnthn Which allows it to work as a representation?
16:02 TimToady how that picks the right MOP is beyond my ken
16:04 TimToady it seems to be that different VMs are going to differ in how you write a RI, so this is beyond the design of P6
16:04 jnthn That's fair enough, I just want to try and make sure I've got the relationship between the parts worked out.
16:05 TimToady I don't guarantee that ruoso sees it the same way I do :)
16:06 TimToady but it stands to reason that the implementation of P5Hash is going to be very different on a platform which supports P5 than on one that doesn't...
16:06 justatheory joined #perl6
16:06 TimToady as a limiting case
16:06 jnthn On one it's non-existent? ;-)
16:07 pmichaud rakudo:  say 11258-10467;
16:07 p6eval rakudo 612bcf: OUTPUT«791␤»
16:07 pmichaud not bad for May release.  :-)
16:08 jnthn I hadn't known for sure up to now though, that you viewed the metaclass as "an instance whose attribute values define the class"
16:08 moritz_ I once calcualted that 690 or os is the average number of new passing tests per month
16:08 moritz_ http://perlgeek.de/blog-en/perl-6/rakudo-rocks.writeback
16:08 TimToady just because I view it that way doesn't mean it's the right way forward, but the data about the class has to be stored somewhere
16:08 TimToady and I don't think it's the undefined type object
16:09 pmichaud moritz_: yes, but April was a bit of an anomaly, and I was thinking that we might see a slowdown after that spike.
16:09 jnthn A model where the meta-class knows this stuff fits well for me.
16:09 TimToady a given metaclass may well delegate a lot of this to the RI, of course
16:09 masak rakudo: say (16000 - 11300) / 715
16:09 p6eval rakudo 612bcf: OUTPUT«6.57342657342657␤»
16:10 masak we're running out of tests. o_O
16:10 moritz_ pmichaud: yes, but April wasn't part of may analysis
16:10 moritz_ so the anomaly didn't make it into the average
16:10 pmichaud moritz_: sure; I just knew that we were averaging ~700 tests per month, and I had been expecting May release to be somewhat less than that.  Looks like it won't be.  :-)
16:11 moritz_ pmichaud: ;-)
16:11 mberends May + 6.5 months < Christmas ;)
16:11 jnthn TimToady: OK, that makes sense.
16:11 pmichaud rakudo:  say 11258/16584
16:11 p6eval rakudo 612bcf: OUTPUT«0.678847081524361␤»
16:12 masak mberends: :)
16:12 masak rakudo: enum Month <Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>; say May + 6.5
16:13 p6eval rakudo 612bcf: OUTPUT«10.5␤»
16:13 masak is there any way I can get a month back from that?
16:13 jnthn TimToady: So I guess if we have a way of knowing if something is a metaclass, we can write that into our trait_auxiliary signature.
16:13 moritz_ masak: NYI I think
16:13 masak moritz_: but theoretically possible?
16:13 moritz_ masak: the spec says Month(10.5.int)
16:13 masak moritz_: ooh, nice.
16:14 pmichaud rakudo: enum Month <Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>; say Month((May + 6.5).int).name;
16:14 p6eval rakudo 612bcf: OUTPUT«invoke() not implemented in class 'Perl6Role'␤current instr.: '_block30' pc 93 (EVAL_21:54)␤»
16:14 pmichaud rakudo: enum Month <Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>; say (May + 6.5).int;
16:14 p6eval rakudo 612bcf: OUTPUT«10␤»
16:14 * masak submits TODO ticket
16:15 jnthn Need postcircumfix...
16:15 jnthn erm
16:15 jnthn postcircumfix:<( )>
16:15 jnthn And invoke in Parrot to be fixed.
16:15 jnthn Or at least, need to be able to pun...
16:15 jnthn And invoke the pun.
16:15 pmichaud I'll have to think about that one.
16:16 jnthn pmichaud: Yeah, I suspect we're blocked on doing anything implementation wise until Parrot's invoke overriding is fixed though. :-)
16:16 jnthn erm
16:16 jnthn :-(
16:16 pmichaud we could recognize it syntactically.
16:16 jnthn So I've really not given it a lot of thought yet.
16:16 jnthn Yeah, that's probably one way.
16:16 ruoso jnthn, TimToady, my vision for building an object with a Hash or P5Hash is that you're going to need a RI specific to support using that object as the representation
16:16 pmichaud In particular, I wonder if     (Month)(10)   works
16:16 pmichaud (according to the spec)
16:17 TimToady it should
16:17 pmichaud okay.
16:17 pmichaud Then yes, we'll need to fixup Parrot invoke.
16:17 pmichaud jnthn: "fixing Parrot invoke" is one of those things we should put on our "important to Rakudo" list.
16:17 TimToady in fact, Month(10) is exactly the same, since Month doesn't look for args
16:18 ruoso TimToady, additionally, selecting the MOP is a different issue than selecting the representation... you can interchange them, in the way I see things (that's what the REPR API is all about)
16:18 TimToady (since types never do, or you couldn't say May + 6.5
16:18 jnthn ruoso: That's fine, the issue here is more that it looks like meta-classes need to be instantiable if they're to be used as "the thing we send over to trait_auxiliary".
16:18 TimToady )
16:19 ruoso jnthn, they can be... even in SMOP...
16:19 masak pmichaud: speaking of which -- and I don't mean to stress you out unnecessarily -- how's the ROADMAP coming?
16:19 pmichaud I'm thinking it'll be today's task.
16:19 ruoso the question is wether the type metadata will be stored in the HOW object or in the type object
16:19 masak yay!
16:19 ruoso in SMOP, it currently stores it in the type object
16:19 jnthn ruoso: I'm thinking that'll be up to the HOW.
16:19 pmichaud Since I got operators done yesterday, I feel like I've accomplished something code-wise .
16:19 ruoso jnthn, oh... certainly it is...
16:19 TimToady the HOW decides where to store it
16:19 ruoso yes
16:19 ruoso yes
16:19 ruoso it's the HOW who receives the .add_method calls
16:20 jnthn Right, agree
16:20 jnthn But the issue I'm trying to get at is
16:20 ruoso but that's unrelated with choosing the represetnation
16:20 jnthn class Foo { method bar() { } }
16:20 jnthn argh
16:20 jnthn class Foo is Bar { }
16:20 ruoso you should be able to use whatever representation you want with whatever HOW you want
16:21 TimToady that doesn't seem obvious to me
16:21 jnthn When we dispatch on trait_auxiliary:<is>(Bar, Foo) what is passed for Foo.
16:21 jnthn If it's the meta-class that's fine, but in that case, and if the meta-class is delegating to the representation, how does that representation come to exist.
16:21 ruoso Foo.HOW.add_parent(Foo, Bar)
16:22 ejs joined #perl6
16:22 jnthn ruoso: No, you missed the point.
16:22 jnthn We need to do a multi-dispatch to trait_auxiliary:<is>
16:22 ruoso ok
16:22 ruoso oh... I see..
16:23 ruoso the problem is that usually you have a symbol for the trait
16:23 ruoso like
16:23 ruoso is export
16:23 ruoso or
16:23 ruoso is foo
16:23 jnthn Right, so it's a two fold issue.
16:23 ruoso in this case you have what usually would be an argument to the trait
16:23 jnthn 1) What do we pass for Foo - the thing that is currently under construction?
16:23 ruoso yes
16:23 jnthn 2) What do we write in the signature of the multi?
16:24 ruoso I guess there can be some catch in the syntax to realize that this is a specialized trait
16:24 ruoso and generate the equivalent to
16:24 jnthn Ugh, no.
16:24 ruoso is subclass_of Bar
16:24 jnthn Yeah but
16:24 jnthn That still doesn't solve the problem of users writing traits of their own.
16:25 TimToady syntax knows whether Bar is type or not
16:25 ruoso it doesn't?
16:25 jnthn class Foo is MyThingy { }
16:25 TimToady the syntax could map that differently depending on the typehood of MyThingy
16:25 jnthn multi trait_auxiliary:<is>(MyThingy $trait, ??? $class) { }
16:25 TimToady so the multi only sees non-type traits
16:25 NoirSoldats_ joined #perl6
16:26 TimToady is one possibility
16:26 TimToady it's more in line with the original thought than to make all traits into types
16:26 jnthn TimToady: Here I'm not wanting to inherit from MyThingy, but write my own custom trait.
16:26 TimToady but doesn't solve the namespace problem
16:26 jnthn Which applies to classes.
16:26 ruoso I guess the syntax can reserve some uses for the "is"
16:26 pmichaud (jnthn:  class Foo is mytrait(...) { ... }  )
16:26 TimToady in that case, *don't* make it a type, and it dispatches to the multi
16:27 jnthn In which case I need to know what to write for ???
16:27 FurnaceBoy joined #perl6
16:27 TimToady well, the incipient type object is sufficient to get at anything else
16:28 TimToady (in this case)
16:28 TimToady since the container is really mediated by .HOW
16:28 jnthn What does incipient mean?
16:28 TimToady "about to come into being"
16:28 jnthn ah, ok
16:29 TimToady but I still don't know what namespace mytrait sits in
16:29 ruoso I guess if it isn't a type, it's a sub
16:30 TimToady doesn't follow
16:30 ruoso (that's how it works everywhere else, afaics)
16:30 jnthn So this means that the thing we pass along is the incipient type object, and thus what goes in the signature is the same thing we use anywhere else to check if we've been passed a type object.
16:30 ruoso when you parse: Foo.bar
16:30 ruoso if there is a type with the name "Foo"
16:30 ruoso that's just a method call on the type object
16:30 jnthn ruoso: I'm not sure the problem is with it being a type, it's about namespace pollution.
16:30 ruoso but if there isn't a type,
16:30 TimToady std: rw
16:30 p6eval std 26831: OUTPUT«Undeclared routine:␤   rw used at 1 ␤ok 00:02 35m␤»
16:30 TimToady that is as it should be
16:30 TimToady there is no rw sub
16:30 ruoso ok
16:30 ruoso point taken
16:31 pmichaud and we don't necessarily want to preclude the definition of a "rw" sub.
16:31 TimToady it's got it's own namespace somewhere
16:31 TimToady a sigil or a subpackage
16:31 TimToady like export tags do
16:31 ruoso a sigil is more interesting...
16:31 ruoso because it's lexical
16:32 TimToady well, I'm always fascinated when a new sigil or twigil is proposed; we usually add it, and then remove it later :)
16:32 moritz_ we didn't remove the : sigil yet
16:32 ruoso well... the other option would be to accept a bare
16:32 jnthn ruoso: I guess it works if we can write role £rw { } or something.
16:32 moritz_ although I've never seen it in use
16:32 moritz_ erm, twigil
16:32 moritz_ (except in tests)
16:33 jnthn ruoso: I'd prefer subpackage myself.
16:33 jnthn role TRAIT::rw { ... }
16:33 ruoso but then you loose it as being lexically scoped
16:33 TimToady moritz_: well, okay, some of them stick :)
16:33 TimToady why?
16:33 jnthn my role TRAIT::rw { ... } # :)
16:33 ruoso er
16:33 TimToady names containing :: can be lexically scoped these days
16:34 ruoso they can?
16:34 Trey msg [particle]-: hey there... quick q i thought you might know of the top of your head. if an uploaded CPAN module had no license information anywhere in it, either in the meta or the makefile.pl or the text docs, is there a default license?  or can one just not use it legally in a redistributed product?
16:34 TimToady std: my class Foo::Bar {...}; my Foo::Bar $x;
16:34 p6eval std 26831: OUTPUT«ok 00:02 36m␤»
16:34 ruoso and what if the traits are stored in the lexical scope without a sigil?
16:34 ruoso just as types are
16:35 TimToady then you'd get hash key collisions
16:35 TimToady symbol tables are just hashes
16:35 ruoso but do you really want to allow traits and types to have clashes?
16:35 jnthn I guess lexical names just act as flat names in the lexpad rather than packages per se though?
16:35 Trey oops, sorry about that missend.  i need an extra slash... does TimToady, can you remove a slash from some feature so I can use it to message [particle]?
16:35 TimToady ruoso: huh?  I'm trying to prevent clashes
16:36 TimToady jnthn: no, they make subpackages
16:36 jnthn Trey: You use @tell on this channel
16:36 ruoso TimToady, I mean... is it ok to define both a type MyTrait and a trait MyTrait?
16:36 jnthn ruoso: No, thus the suggestion of TRAIT::MyTrait instead.
16:37 ruoso so my point is to store both in the lexpad without sigils... so you can't define both
16:37 TimToady oh, no that level.  but generally classes will be uppercase and traits lowercase, so I'm not worried about type clashes much
16:37 TimToady but sub clashes are more likely
16:37 ruoso subs are stored with &
16:37 ruoso so no clash
16:37 TimToady right, in which case they might as well be types
16:38 TimToady hmm
16:38 ruoso but they aren't types
16:38 ruoso so they get parsed different
16:38 jnthn huh?
16:38 ruoso their use get parsed different
16:39 ruoso is <type> # parses one way
16:39 jnthn ruoso: A trait name is just so far as I can tell something you can look up and then use in a multi-dispatch.
16:39 ruoso exactly
16:39 jnthn But in a signature
16:39 ruoso is <somethingelse> # parses other way
16:39 jnthn :(Foo $x) # Foo should be a typename here
16:40 ruoso right
16:40 TimToady but if they're not types, why not just give them their own sigil in the symbol table so as to prevent confusion with sub rw
16:40 TimToady (when called without &)
16:40 ruoso but nobody looks in the lexpad without the &
16:40 masak two questions: is someone willing to be grant manager for my Collections grant proposal? are there any general guidelines for knowing what amount of money to request?
16:40 TimToady otherwise parsing a bare rw has to figure out what rw is
16:40 ruoso except when the parser knows it is a Type
16:41 ruoso and I'm proposing that it also looks when it's a trait
16:41 jnthn ruoso: I don't understand "when it's a trait".
16:41 TimToady I think a sigil would be cleaner here
16:41 ruoso jnthn, is something # something is either a type or a trait
16:42 ruoso but I'm ok with a sigil as well...
16:42 jnthn TimToady: So supposeing we chose £ as the sigil (I guess we won't ;-)) then
16:43 jnthn is rw # actually looks up £rw
16:43 [particle] joined #perl6
16:43 ruoso yes
16:43 TimToady going up the lexical scope till it finds it, or doesn't
16:43 jnthn And you could write a role £rw { ... } or whatever you wanted to introduce that label?
16:44 TimToady or maybe it's just exported that way, maybe
16:44 ruoso bare £rw;
16:44 jnthn ?
16:44 ruoso since it's just used for identity
16:44 ruoso my bare rw; # declares  £rw
16:45 jnthn Well, if you read S14 note that you often want to introduce a role so you can mix in it as part of applying the trait.
16:45 jnthn In fact, well-behaved traits generally should.
16:46 jnthn I guess you could declare a separate role too, but when where would it go?
16:46 jnthn It's probably better to hang everything off the same name.
16:46 TimToady the question is whether the role itself needs to be exported, or just the £rw that knows about it
16:47 TimToady a trait isn't required to use a role
16:47 jnthn TimToady: Sure, S14 says a class is just fine too.
16:47 TimToady it doesn't have to use a class either
16:47 jnthn I guess you can alias whatever to £rw
16:48 TimToady £rw just knows how to call the trait_auxiliary multi, and that's what has to be visible in the user's scope
16:48 ruoso it's just used for identity
16:48 jnthn TimToady: OK, but it needs to be something you can write in a signature, no?
16:48 TimToady it?
16:48 ruoso you can write a bare value in a signature
16:48 TimToady there are too many its floating around
16:49 TimToady as a constraint? yes
16:49 ruoso std: multi foo(1) { }; multi foo(2) { };
16:49 p6eval std 26831: OUTPUT«ok 00:02 38m␤»
16:49 TimToady and £rw is a bare value, you're saing
16:49 TimToady *saying
16:49 ruoso yes
16:49 ruoso we can even omit the sigil
16:50 jnthn I'd seen more £rw as an alias to something.
16:50 ruoso std: multi trait_auxiliary:<is>(export, $code)
16:50 p6eval std 26831: OUTPUT«##### PARSE FAILED #####␤Malformed block at /tmp/5lgy1jOZHl line 1:␤------> [32mmulti trait_auxiliary:<is>([31mexport, $code)[0m␤    expecting any of:␤   parameter␤        signature␤        type_constraint␤  typename␤       whitespace␤FAILED 00:02 37m␤»
16:50 ruoso right... it wasn't meant to be sent to std
16:50 * ruoso 's brain--
16:51 TimToady that only works if "export" is a type, or an enum-like value
16:51 TimToady which parses like a type
16:51 alester joined #perl6
16:51 TimToady but happens not to be undefined
16:51 ruoso my point is that it would look for bare names as well
16:52 TimToady I'd still like to keep bare trait names out of the user's normal namespace, if possible
16:52 TimToady generally it can only lead to confusion
16:52 TimToady since most people aren't going to be writing trait handlers
16:52 ruoso it is out of the normal namespace
16:52 ruoso only certain things look for it
16:53 TimToady you can't write bare export in a signature without it being there in the namespace, it seems
16:54 jnthn You could write £export perhaps, though.
16:54 ruoso yes... but it only look for "bare" in a few specific sport
16:54 ruoso *spots
16:54 TimToady list of exceptions, bah
16:54 ruoso it's the same list of exceptions that Types have
16:54 jnthn Aye, just seeing that we are about to parse a trait_auxiliary should not make us parse the signature differently...
16:55 cdarroch joined #perl6
16:58 TimToady shower &
16:59 jnthn cooking dinner &
17:09 DemoFreak joined #perl6
17:09 masak what'll happen to the Perl 6 spec after Christmas?
17:11 masak moritz_: how's the implementation of infix:<...> going?
17:20 hercynium joined #perl6
17:21 jnthn masak: iirc it neeeded laziness too
17:22 jnthn s/e//
17:23 masak jnthn: oh, right.
17:24 masak couldn't laziness be faked in this case?
17:24 masak (implemented in pure Perl 6 in some way)
17:26 jnthn Perhaps.
17:26 jnthn Well, I don't know exactly what moritz_ has in mind. :-)
17:27 jnthn Anyway, I hope laziness ain't *that* far off.
17:27 jnthn We've put it off for quite a while already. ;-)
17:29 jnthn rakudo: my @a = -1,2,-3; for @a { .= abs }; say @a.perl;
17:29 p6eval rakudo 612bcf: OUTPUT«Unable to parse block; couldn't find final '}' at line 1, near ".= abs }; "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
17:29 jnthn rakudo: my @a = -1,2,-3; for @a { .=abs }; say @a.perl;
17:29 p6eval rakudo 612bcf: OUTPUT«[1, 2, 3]␤»
17:29 jnthn masak: Not sure if you missed it, but that works now. :-)
17:29 jnthn (remember you asking about it)
17:29 jnthn Though of course this is shorter...
17:30 jnthn rakudo: my @a = -1,2,-3; @a>>.=abs; say @a.perl;
17:30 p6eval rakudo 612bcf: OUTPUT«[1, 2, 3]␤»
17:33 masak jnthn: that's great. I'll update the pun README, then.
17:33 masak jnthn: well, pun can only use the first variant.
17:35 jnthn oh wow, PayPal finally caught up with Slovakia having joined the euro...
17:35 jnthn Only took a few months. :-|
17:39 jnthn BTW, anyone who has requests for Rakudo day tomorrow, please let me know.
17:39 jnthn Other than any "help with moving to .HLL" tasks, I don't have anything planned yet.
17:39 * masak browses through the recent RT tickets
17:40 masak jnthn: if you have a minute, I'd appreciate if you'd skim through this: http://gist.github.com/111790
17:40 mberends jnthn: with luck, there might be a first cut of Temporal.pm to add to setting
17:41 jnthn mberends: Ooh, I'm happy to help on that.
17:41 jnthn (On getting it into the setting, that is.)
17:41 mberends :)
17:41 jnthn I guess it'll win us some spectests too?
17:41 TimToady at some point we need to move rakudo's setting to lexically outside of the user's program
17:42 TimToady dunno how close that is to doable
17:42 jnthn masak: Ah, I can do that today. In fact, now, amongst dealing with preparing dinner...
17:42 masak excellent.
17:42 masak I must detach soon to do likewise, but I will backlog.
17:43 mberends jnthn: the Pugs time.t is P5 style obsolete, I'm making new tests
17:43 jnthn mberends: Great. :-)
17:43 jnthn TimToady: It's probably not so bad in some senses. But none of the built-ins are lexical yet.
17:43 jnthn Plus we didn't get lexical importation working.
17:44 jnthn S11 may need a little clarification on the route to that.
17:44 masak jnthn: I wouldn't mind if you took a look at [perl #65208], on the theory that the less broken Match objects are the more pleasant they are to work with. OTOH, maybe it's pmichaud's area of expertise, I dunno.
17:44 jnthn I've been working on some issues to get us closer - lexical multis now essentially work.
17:45 jnthn And lexical subs etc. Lexical classes/roles shouldn't be much harder.
17:45 jnthn But we probably gotta fix the "can't see lexicals outside a class" issue...
17:46 [particle]2 joined #perl6
17:46 masak jnthn: [perl #64876] is slightly disturbing.
17:47 masak jnthn: but, to be honest, I don't actually have any wtf bugs right now, not that I can remember.
17:47 masak oh, [perl #64656] is "unfortunate".
17:48 * masak ponders building his own nomenclature of bug severity
17:48 masak anyway, food &
17:51 jnthn Oh, 64876 I think I know how to fix.
17:52 jnthn rakudo: module A { sub foo() { return 42 }; say foo }
17:52 p6eval rakudo 612bcf: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;A;foo' pc 200 (EVAL_22:99)␤»
17:52 moritz_ Matt-W: it still waits on lazy lists
17:52 jnthn rakudo: module A { sub foo() { 42 }; say foo }
17:52 moritz_ sorry, meant masak
17:52 p6eval rakudo 612bcf: OUTPUT«42␤»
17:52 moritz_ Matt-W: ignore me ;-)
17:52 jnthn Aye, I know about that bug.
17:52 jnthn (or why we have it, at least)
17:56 Morpheus^ joined #perl6
18:01 pmichaud 16:40 <ruoso> but nobody looks in the lexpad without the &
18:01 pmichaud fwiw, rakudo doesn't store its subs with the &   (there are a variety of parrot-related reasons for this)
18:02 pmichaud it will probably convert to using the &, but at present it does not.
18:02 ruoso but that's not correct in terms of spec, is it?
18:02 pmichaud I don't believe the spec is specific about that point, other than one needs to be able to look up subs using the sigil in a namespace or symbol table.
18:02 ruoso rakudo: sub foo { say OUTER::<&foo>.WHAT }; foo();
18:02 pmichaud But an overload of postcircumfix:<{ }> could achieve this.
18:02 p6eval rakudo 612bcf: OUTPUT«Could not find non-existent sub OUTER␤current instr.: 'foo' pc 107 (EVAL_18:71)␤»
18:02 ruoso rakudo: sub foo { say CALLER::<&foo>.WHAT }; foo();
18:02 p6eval rakudo 612bcf: OUTPUT«Could not find non-existent sub CALLER␤current instr.: 'foo' pc 107 (EVAL_18:71)␤»
18:02 ruoso meh
18:03 jnthn Aye, I'm not sure the spec is specific on that either.
18:03 * jnthn -> nom
18:04 TimToady the & must be used with .{} to look up a sub name in a symtab
18:04 pmichaud correct.
18:04 pmichaud that part I knew about.
18:04 ruoso hm?
18:04 ruoso you mean it's different than other variables?
18:05 TimToady no, it's not
18:05 TimToady OUTER::<$foo>
18:05 TimToady OUTER::<&foo>
18:05 TimToady just the same
18:05 ruoso ah
18:05 ruoso ok
18:05 TimToady S11 even gives some examples
18:06 ruoso but...
18:06 ruoso sub foo { }; say MY::<foo>; should not return the sub
18:06 TimToady that is correct
18:07 pmichaud that's my understanding as well.
18:07 TimToady if foo is not a type or a named value, it shouldn't find it
18:07 ruoso but if you store the sub without the '&'
18:07 TimToady then you have to patch up that side too
18:08 pmichaud correct.
18:08 TimToady so certainly we'll be pushing parrot in that direction
18:08 pmichaud I'm not saying that rakudo is taking the most straightforward or easiest approach here -- but for a variety of parrot-related reasons I'm not entirely at liberty to suddenly switch everything to using the &'s
18:08 ruoso right... so conceptually, rakudo does store with the '&'
18:08 TimToady at least for Perl 6, if not for other langauges
18:08 pmichaud and in some languages we can't use the &
18:09 TimToady conceptually, rakudo implements Perl 6 :P
18:09 justatheory joined #perl6
18:12 [particle]2 in theory, theory and practice are the same.  only in practice do they differ.
18:13 TimToady only if you practice enough, in theory
18:13 TimToady but sometimes you can get lucky
18:13 justatheory TimToady: I am not a woodshed.
18:13 TimToady no, you just need to be taken out to one :)
18:13 [particle]- just a framework
18:15 TimToady while we're refactoring traits, I still wonder if we should also rename them...
18:15 * [particle]- loads his shotgun
18:15 [particle]- ...couldn't afford an electron gun...
18:16 TimToady just shoot yourself
18:16 justatheory TimToady: I saw something nasty in the woodshed.
18:17 TimToady well, if you'd patched the roof like I asked you to, there wouldn't be fungus growing on the woodpile
18:17 [particle]- well, heck, if we get some mold growing, we won't even have to paint it
18:18 justatheory heh
18:18 ruoso I like mold... I even deprecated slime in favor of it in SMOP...
18:18 TimToady woodsheds mold character
18:19 TimToady so maybe we should rename traits to characteristics
18:19 TimToady just to discourage people
18:19 TimToady characteristic_auxiliary:<is>
18:19 justatheory or distinctions
18:19 ruoso I think the _auxiliary:<is> part is discouraging enough
18:20 * jnthn <- nom
18:20 justatheory http://www.imdb.com/title/tt0112701/quotes
18:25 pmichaud masak: (RT #65208)   I know why .print isn't working on Match objects... I'm not quite sure how to fix/resolve it, though.
18:25 jnthn @tell masak I just looked through your grant proposal - looks good overall.
18:25 lambdabot Consider it noted.
18:27 pmichaud .print on match objects is conflicting with the predefined <print> subrule.
18:27 jnthn TimToady: I wouldn't be against re-naming them.
18:28 * ruoso likes trait as well
18:28 pmichaud print(A.parse('foo'))  works, however.
18:29 jnthn pmichaud: What's the <print> subrule?
18:29 pmichaud matches a printable character
18:29 pmichaud like <upper> matches an uppercase character
18:29 jnthn ah, ok
18:30 pmichaud also,  A.parse('foo').Str.print works, though, as does (~A.parse('foo')).print
18:30 jnthn No shortage of work-arounds then. :-)
18:36 pmichaud (updated ticket)
18:44 * moritz_ just held a talk about Perl 6 regexes/grammars
18:44 moritz_ called "regexes on crack"
18:44 moritz_ it was received quite well
18:44 pmichaud excellent.  Maybe I can borrow some notes/slides for my talk(s) on regexes/grammars?
18:45 plu joined #perl6
18:46 moritz_ pmichaud: they are quite rudimentary, but it might give you some inspiration
18:46 moritz_ oh, and they are in German ;-)
18:46 pmichaud well, I've given talks on regexes/grammars before, but it's always good to grab examples/ideas from others
18:46 pmichaud German is no problem, I think I can read the code at least.
18:46 pmichaud and I can often decipher my way through the german
18:47 moritz_ http://moritz.faui2k3.org/tmp/slides.vroom
18:48 moritz_ you can view them with vim + Vroom::Vroom ;-)
18:48 moritz_ the theme is "why don't you write parsers in regular expression?"
18:49 pmichaud got it, thanks!
18:49 mizioumt joined #perl6
18:49 moritz_ you're welcome
18:49 pmichaud heh, I like this part:
18:49 pmichaud +* Backtracking
18:49 pmichaud +* Backtracking
18:49 pmichaud +* Backtracking
18:50 moritz_ ;-)
18:51 moritz_ each + makes that line appear on the next slide
18:51 pmichaud right, similar to Spork.
18:51 pmichaud (which is what I typically use for my presentations)
18:51 masak joined #perl6
18:51 masak radical suggestion: how about renaming the subrule "printable"?
18:51 lambdabot masak: You have 1 new message. '/msg lambdabot @messages' to read it.
18:52 moritz_ I should look into that too
18:52 masak @messages
18:52 lambdabot jnthn said 26m 28s ago: I just looked through your grant proposal - looks good overall.
18:52 masak jnthn: thank you.
18:52 moritz_ masak: what's the URL?
18:52 moritz_ I can look throug it too, if you want
18:52 pmichaud masak:  I think the subrules were original intended to correspond with the ctype function names
18:52 masak moritz_: http://gist.github.com/111790
18:52 pmichaud like isalpha, isupper, isspace, isprint, isgraph, etc.
18:52 masak pmichaud: I'd be happy if you have a look at http://gist.github.com/111790 too :)
18:53 masak pmichaud: I see.
18:53 literal you're applying for a TPF grant?
18:53 masak literal: a Hague grant.
18:53 literal cool
18:54 masak pmichaud: well, collision with an already defined method might or might not be considered a sufficient reason to deviate from the rule...
18:54 [particle]- <:print> would be better, maybe, or <printable> or <isprint>
18:54 pmichaud masak: Overall I agree; I'm just not sure what @Larry will settle on.  :-)
18:55 masak pmichaud: understood. :)
18:56 moritz_ masak: (re grant, Buf) you could mention that Buf is the thing that keeps binary data / blobs in Perl 6
18:56 moritz_ masak: I'm not sure how well the people now Perl 6 and Str
18:57 moritz_ and know about decoded and undecoded stuff etc.
18:57 pmichaud "the people" tends to be rdice and the folks he passes the proposal to
18:57 masak moritz_: based on your previous comments, I added a bit about the deconding/encoding. I could add something about blobs and binary data too.
18:57 pmichaud it would be good to mention blobs/binary data
18:58 moritz_ masak: I revise my previous comment ;-)
18:58 masak :)
18:58 pmichaud especially since I just switched open() to default to text/utf8
18:58 mizioumt2 joined #perl6
18:58 pmichaud it would be good to have some way to treat files as blobs again :-)
18:58 masak I'll probably also add a few details about what we know about Set et al.
18:58 masak pmichaud: oh, I'll mention that. thanks.
18:59 pmichaud (and yes, I'll happily serve as grant manager for this project)
18:59 masak \o/
19:00 masak pmichaud: I forgot to ask; making you read the proposal draft wasn't a circumspect way of asking. :P
19:01 pmichaud masak: it's no problem, really :-)
19:01 moritz_ masak: you could also mention your impressive number of submitted tickets in your bio
19:01 moritz_ masak: IMHO it proves some of your qualification
19:01 masak moritz_: good idea.
19:02 masak by last count (before Oslo) I had submmitted 314 tickets.
19:02 masak should be over 350 by now.
19:03 moritz_ masak: you also had 76 commits to t/ and 85 to docs/ in pugs, an 40 in the rakudo repo ;-)
19:04 masak moritz_: thank you. :)
19:04 moritz_ git log|grep|wc -l is a nice combination ;-)
19:04 masak is it 40 already on Rakudo? I wouldn't have guessed.
19:04 moritz_ (which makes you the top 9 commiter in rakudo)
19:05 pmichaud overall the grant proposal looks pretty good to me.
19:05 masak moritz_: could you paste that list? sounds interesting.
19:05 moritz_ masak: http://nopaste.snit.ch/16549
19:06 moritz_ (no attempt was made at unifying multiple email addresses)
19:06 Infinoid There's also https://www.ohloh.net/p/rakudo/contributors
19:06 moritz_ you can also run `perl tools/commit-stats.pl' in the rakudo repo
19:06 Infinoid But I think that's affected by rakudo's history in the parrot repo.
19:06 Tene jnthn: defining a multi sub in a class fails
19:06 Tene I know why, but can't fix now
19:07 masak moritz_: thank you. I like to make similar statistics, but I've mainly attempted it on RT and the different Perl 6 projects.
19:07 masak moritz_: ooh!
19:07 * masak does so
19:07 moritz_ Infinoid: sure it is
19:07 Tene rakudo: class A { multi sub foo { ... } }
19:07 p6eval rakudo 612bcf: OUTPUT«No method named 'foo' to remove in class 'A'.␤current instr.: '!TOPERL6MULTISUB' pc -5310275 ((unknown file):-1)␤»
19:07 Infinoid Which explains why I'm on there, despite not being sure whether I have a rakudo commit bit. :P
19:07 moritz_ masak: ticket!
19:07 Tene can someone make ticket?
19:07 Tene I must teach now
19:08 masak rakudo: class A { multi foo() {} }
19:08 p6eval rakudo 612bcf: OUTPUT«No method named 'foo' to remove in class 'A'.␤current instr.: '!TOPERL6MULTISUB' pc -5310275 ((unknown file):-1)␤»
19:08 * masak makes a ticket!
19:09 masak uuh, flaky connection...
19:09 jnthn Ah, yes. We actually re-bless blocks now so that's an easy fix too (wasn't really fixable back when multis were first put in...)
19:12 ejs joined #perl6
19:20 donaldh joined #perl6
19:23 masak` joined #perl6
19:23 masak joined #perl6
19:54 nihiliad joined #perl6
20:00 TimToady pmichaud: I believe the distinction between Cursor and Match objects will solve the .print problem
20:00 pmurias joined #perl6
20:01 TimToady $cursor.print is <print>, whereas $match.print is Any.print
20:01 TimToady a Match is basically a "dead" Cursor
20:02 TimToady with not much more interface than Capture
20:03 TimToady and it's the .parse boundary that kills the returned Cursor and makes it a Match
20:04 pmichaud would it be (more) correct to say that we build a Match from the returned Cursor ?
20:04 TimToady possibly
20:04 pmichaud okay.
20:04 pmichaud I like that distinction.  It makes several things much easier.
20:04 TimToady maybe the Match is just a Capture plus link to the returned Cursor
20:04 TimToady to which we delegate .from and .to
20:05 TimToady and it makes it possible to continue a match from a Match object using Match.parse, maybe
20:05 pmichaud currently PGE has Match.next (but Match.parse would be fine)
20:05 mib_5ckh6m joined #perl6
20:06 TimToady well, whatever, we just want to keep the accidental collisions down
20:06 pmichaud Agreed, and that explanation (plus the one you gave last week) is a huge help.
20:06 TimToady anyway, that seems to be closer to the STD model of Cursor vs Match
20:06 jnthn I think I even sort of get it now. :-)
20:07 jnthn TimToady: I'm guessing on the traits, it's best if I leave you to ponder exactly what to do there for a while, and look out for some updates to S14, before digging in with implementation.
20:07 TimToady yeah, still puzzling that out
20:07 jnthn OK, thanks. :-)
20:08 pmichaud I'm wondering how I can get the Cursor/Match distinction into PGE without breaking too much existing code.
20:08 ingy 5hola
20:08 pmichaud I guess I should start by (re)writing it the way I want it to ultimately look, and then I'll figure out what shims I need for backwards compat
20:08 ingy hmmm
20:08 TimToady pmichaud: you could rebless for now
20:09 TimToady we've been ingified!
20:09 ingy hi gang
20:09 pmichaud well, I can certainly get Rakudo to do something close to the right thing, by giving Rakudo its own Match class (which it has) that treats PGE's Match class as if it is a Cursor
20:09 TimToady what's cookin'?
20:09 ingy y'all headed to YAPC?
20:09 jnthn hi ingy
20:10 TimToady which one?
20:10 jnthn wh...? :-)
20:10 pmichaud instead of making Rakudo's Match class as a subclass of PGE's Match
20:10 ingy I was thinkng PA
20:10 jnthn Ah, not me.
20:10 pmichaud I'm headed to ::NA and (hopefully) ::EU
20:10 TimToady YAPC::PA  haven't heard of that one
20:10 jnthn I'm doing ::EU and ::Asia.
20:10 ingy YAPC Perl America
20:10 TimToady ::Asia is the only doubtful one currently
20:11 justatheory joined #perl6
20:11 TimToady well, not even doubtful, just a bit doubted
20:11 ingy jnthn: awesome. look forward to seeing you in tokyo
20:11 TimToady just haven't planned autumn at all yet
20:11 ingy TimToady: you are BIG in Japan
20:11 TimToady only among the grannies
20:12 pmichaud yapc::asia would be fun.
20:12 TimToady the youngsters tend to be larger
20:12 ingy TimToady: I been cooking on this http://testml.org/spec/
20:12 TimToady ah, yes
20:12 pmichaud I don't have a September trip planned yet :-).  So far I've had a trip every month this year.
20:12 jnthn pmichaud: BTW, I plan to go wonder around Japan and South Korea for a few weeks after YAPC::Asia.
20:12 TimToady I try to keep it to once a month
20:12 pmichaud (and have one-per-month through August)
20:13 jnthn pmichaud: So don't expect too much of me on Rakudo in sep. ;-)
20:13 ingy pmichaud: do tokyo!
20:13 pmichaud jnthn: okay, I'll try not to expect too much.
20:13 TimToady jnthn: you won't be done by then?
20:13 pmichaud ingy: depends on funding.  :-)
20:13 ingy I'll buy you some soba and beer
20:14 jnthn TimToady: Depends on the spec being done by then. ;-)
20:14 TimToady oh well...
20:14 ingy seen masak
20:15 moritz_ @seen masak
20:15 lambdabot I saw masak leaving #perl6 51m 6s ago, and .
20:15 ingy thx
20:15 pmichaud That dangling conjunction leaves a lot of room for imagination... :-)
20:15 jnthn pmichaud: I'm having some bits of vacation in June and July too, but be doing bits when I'm around. :-)
20:15 pmichaud jnthn: Good.
20:15 pmichaud vacation++
20:16 jnthn Yeah, will want it.
20:16 * ingy is on permanent vacation
20:16 pmichaud I'm doing vacations in June/July as well.  After YAPC::NA Paula and I are doing some travelling in PA
20:16 jnthn Ah, that overlaps with when I'm away too.
20:17 * moritz_ is away most of June
20:17 moritz_ in beautiful norway
20:17 jnthn moritz_: You must learn to hate beer before you travel there.
20:17 TimToady or hate money
20:17 moritz_ jnthn: I already do.
20:18 pmichaud jnthn: due to quality or cost?  ;-)
20:18 jnthn pmichaud: Cost. The quality is pretty OK. ;-)
20:18 jnthn (And sometimes very OK.)
20:18 dalek rakudo: bd9fafc | pmichaud++ | src/builtins/match.pir:
20:18 dalek rakudo: Update make() to give a slightly more useful warning when $/ not set.
20:18 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/bd9fafce44108da269e352167121dd94ffc90d69
20:18 ingy beer is frickin expensive in .no
20:19 jnthn yeah...makes Sweden look like good value.
20:19 ingy :)
20:19 Eevee joined #perl6
20:19 pmichaud hey, dalek, where's the other commit?!?
20:20 pmichaud Hmmpf.
20:20 jnthn dalek has selective interests.
20:20 moritz_ pmichaud CAN HAZ COMMIT, BUT DALEK EATED IT
20:20 wtm joined #perl6
20:21 jnthn oh, hmm, I think I forgot to push some stuff I comitted earlier..
20:21 jnthn oh yes, I did. fail
20:21 Tene pmichaud: any chance you can get export working on ops?
20:22 pmichaud Tene: it doesn't work?
20:22 Tene not as of this morning
20:22 pmichaud I'm surprised.  Seems like it shouldn't make a difference.
20:22 pmichaud can you post a simple example, when you get a chance?
20:23 jnthn fwiw I exported a trait_auxiliary and it worked...
20:23 moritz_ it works here
20:23 jnthn Tene: Is it a new operator or an overload of an existing one?
20:23 moritz_ (for a new operator)
20:24 dalek rakudo: 52d8f28 | jnthn++ | src/builtins/guts.pir:
20:24 dalek rakudo: First crack at applying custom user traits to blocks. Hopefully we can eventually get rid of the special cases. A spectest fails if we blow up on unknown triats, so for now we'll just warn.
20:24 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/52d8f28d4ef0f8380b46f5d014a06665be716657
20:24 dalek rakudo: ce81644 | jnthn++ | src/parser/ (2 files):
20:24 dalek rakudo: Start parsing and emitting trait_auxiliary definitions.
20:24 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/ce81644557cd90ffb2a3f45cf990934234ff1c41
20:24 jnthn dalek. I totally comitted those in the _opposite_ order.
20:24 pmichaud dalek often gets them backwards.
20:24 moritz_ http://nopaste.snit.ch/16550
20:25 Tene Foo.pm: multi sub infix:<±> { ... }
20:25 Tene test.pl: use Foo; 1 ± 2
20:26 Tene even with an "is export" which is implied by multi
20:26 moritz_ Tene: look at my nopaste above
20:26 pmichaud I don't know if Rakudo has "multi implies export" yet.
20:26 Tene moritz_: can't conveniently.
20:27 TimToady do you have it in a module or a role?
20:27 Tene oh, it works for infix:<xxxxx>
20:27 Tene but not for ±
20:27 moritz_ module Foo { multi sub postfix:<!>(Int $x) is export(:DEFAULT) { ... } };
20:28 Tene but works for ± if deffined in the same file
20:29 moritz_ Tene: Unicode doesn't work on -e ...
20:29 jnthn Tene: You ain't pre-compiling at all?
20:29 Tene moritz_: no -e
20:29 Tene files
20:29 Tene no pre-compiling
20:29 moritz_ ah, I can reproduce it here
20:29 pmichaud I can reproduce it also.  But it doesn't quite make sense to me.
20:30 Tene I'm playing with set ops... :)
20:30 jnthn pmichaud: Maybe it's losing its unicode-ness somewhere during the export?
20:30 jnthn (Don't ask me where... :-|)
20:30 jnthn (But it wouldn't entirely surprise me...)
20:30 pmichaud I'm wondering if this is more of that weird Parrot bug we once found
20:31 jnthn The hashes one?
20:31 pmichaud yes.
20:31 jnthn Namespaces are based on hashes.
20:31 pmichaud but it's also not working for me with  infix:<abc>
20:31 jnthn So entirely possible.
20:31 pmichaud (which doesn't have any unicodeness)
20:31 pmichaud No applicable candidates found to dispatch to for 'infix:abc'
20:32 moritz_ but it parses infix:abc, no?
20:32 pmichaud yes.
20:32 jnthn pmichaud: What are you defining? a multi in a class|role|module?
20:33 pmichaud yes, in a module.
20:33 jnthn OK
20:33 pmichaud http://gist.github.com/111891
20:34 jnthn looking
20:35 jnthn pmichaud: Well no wonder
20:35 jnthn You wrote an arity 0 multi candidate.
20:36 pmichaud multis require a signature?
20:36 pmichaud okay.
20:36 jnthn multi sub infix:<abc>($x, $y) is export(:DEFAULT) { 1 }
20:36 jnthn # works fine
20:36 jnthn No, but if you're going to define an infix operator you need to define parameters to tkae the two operands, surely?
20:37 pmichaud no, with no signature it should default to  (*@_, *%_)
20:37 jnthn ugh
20:37 pmichaud ....which might not be properly implemented yet
20:37 pmichaud because I still haven't finished fixing @_ and %_
20:37 jnthn rakudo: sub foo { }; say &foo.signature.perl
20:37 pmichaud (which are seriously broken)
20:37 p6eval rakudo 52d8f2: OUTPUT«:()␤»
20:37 jnthn Ah
20:37 moritz_ rakudo: sub foo { }; foo(3)
20:37 pmichaud rakudo:  sub foo { @_ };  say &foo.signature.perl
20:37 jnthn I think it's jsut that they're not defining a signature.
20:37 p6eval rakudo 52d8f2:  ( no output )
20:37 p6eval rakudo 52d8f2: OUTPUT«:(Any *@_)␤»
20:38 pmichaud see?  @_ is broken :-)
20:38 moritz_ that's wrong.
20:38 moritz_ why the Any?
20:38 moritz_ anyway
20:38 * moritz_ works on tests for exporting operators
20:38 jnthn pmichaud: Once those get signatures the MMD should be happy.
20:38 pmichaud because subs assume Any on their parameters.  I agree it should be Object.
20:39 pmichaud okay, so we know why the infix:<abc> was failing and now works.  Now for unicode.
20:40 pmichaud http://gist.github.com/111898
20:40 jnthn heh, my first attempt got me
20:41 jnthn Malformed UTF-8 string
20:41 pmichaud I'm almost certain it's the hash issue again.
20:42 pmichaud oh, perhaps not.  Hmmm.
20:42 moritz_ rakudo: sub infix:<a>($a, $b) { $a + $b }; say eval '3 a 5'
20:42 p6eval rakudo 52d8f2: OUTPUT«8␤»
20:42 * ruoso often still types $foo.'bla' instead of $foo ~ 'bla'
20:42 moritz_ ruoso: you don't write enough Perl 6 ;-)
20:44 jnthn pmichaud: OK, now after getting my editor not to save it was the wrong thing it works... :-)
20:44 jnthn erm
20:44 jnthn damm
20:44 jnthn it gives the same error as your'e seeing
20:45 pmichaud "name" => "infix:\x{c2}\x{b1}",
20:46 moritz_ that loos so wrong.
20:46 moritz_ *looks
20:46 pmichaud yes, it's saving the utf-8 version.
20:47 jnthn ah.
20:47 pmichaud I don't understand why/how, though.
20:47 jnthn pmichaud: Is that in the call to the parser to register the token?
20:47 ruoso does rakudo tries to load .pbc files first when in "use"?
20:48 pmichaud ruoso: yes.
20:48 ruoso cool
20:48 pmichaud jnthn: no
20:48 pmichaud here's the call to register the token (that is in the Foo PIR)
20:48 pmichaud $P45."newtok"(unicode:"infix:\x{b1}", "infix:+" :named("equiv"))
20:48 pmichaud but there are two calls.
20:48 moritz_ perl6: say chr(:16('b1'))
20:48 p6eval pugs, rakudo 52d8f2: OUTPUT«±␤»
20:48 p6eval ..elf 26831: OUTPUT«Unknown rule: rad_number␤It needs to be added to ast_handlers.␤ at ./elf_h line 2850␤»
20:49 pmichaud there's a call to add the token to the optable immediately after parsing the signature
20:49 pmichaud and then of course the generated code has one that occurs at :load :init
20:49 jnthn Yes, and one in the PIR for the PBC.
20:50 jnthn OK, and the one to do it immediately is wrong?
20:50 pmichaud I can't see how.  If it was wrong, then it wouldn't work in the case where we're defining a token in the same file.
20:50 jnthn pmichaud: If I pre-compile Foo.pm to Foo.pir it works.
20:50 pmichaud yes.
20:51 pmichaud but there must still be something else happening here.
20:51 pmichaud when I do 'use Foo.pm', it should still be invoking the :load :init calls that are generated in the PIR
20:51 pmichaud and that should be adding the token to the optable.
20:51 jnthn Right, 'cus they are :init
20:51 pmichaud er, "use Foo" (from the .pm)
20:52 jnthn pmichaud: It couldn't be that the second time causes a problem because it fails to detect the token is already registered or something?
20:52 pmichaud as far as the optable is concerned, they should be different tokens.
20:52 jnthn Wait, that still wouldn't make sense...hmm
20:52 pmichaud because they have different names.
20:54 pugs_svn r26832 | moritz++ | [t/spec] importing operators
20:59 pmichaud what really confuses me is that it does all seem to work for « and »
20:59 dalek rakudo: fe54884 | moritz++ | t/spectest.data:
20:59 dalek rakudo: test importing of operators
20:59 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/fe5488445114a408cad76b4c8912217a4b09a719
21:00 moritz_ rakudo: sub infix:< ab >($a, $b) { say $b, $a }; 3 ab 4;
21:00 p6eval rakudo fe5488: OUTPUT«43␤»
21:00 jnthn pmichaud: Those are also in Latin-1 - wonder if there's some confusion somewhere...
21:00 moritz_ rakudo: sub infix:« ab    »($a, $b) { say $b, $a }; 3 ab 4;
21:00 p6eval rakudo fe5488: OUTPUT«43␤»
21:01 pmichaud \xb1 is latin-1 also, though.
21:01 jnthn ah, true
21:01 ZuLuuuuuu joined #perl6
21:03 jnthn pmichaud: In perl6.pir we do
21:03 jnthn ##  tell PAST::Var how to encode Perl6Str and Str values
21:03 jnthn We're not somehow missing this setup (or other encoding related setup) when we invoke PAST::Compiler, are we?
21:03 pmichaud that just tells PAST that it needs to escape strings.
21:04 pmichaud it's global, and by the time PAST::Compiler is run from actions.pm it's been long setup.
21:04 jnthn OK.
21:04 pmichaud if that was missing, then Perl6Str and Str would end up completely unquoted (and we'd have PIR syntax errors)
21:04 jnthn Ah, true.
21:05 pmichaud i.e., the pir output would say   (bare)  infix:+-   instead of unicode:"infix:\x{b1}"
21:06 jnthn Right.
21:06 jnthn Hmm.
21:06 pmichaud Oh!
21:06 pmichaud I might know the problem.
21:08 pmichaud a-ha!
21:08 pmichaud result = 'evalfile'(realfilename, 'lang'=>'Parrot')
21:08 pmichaud it's not reading it as utf-8
21:08 pmichaud (this is inside of 'require', which is called by 'use')
21:09 jnthn Ah!
21:09 jnthn That'd do it.
21:10 pmichaud in particular
21:11 pmichaud .tailcall compiler.'evalfiles'(filename)
21:11 pmichaud I think HLLCompiler needs some attributes to indicate what its preferred input encoding and transcoding are
21:12 pmichaud instead of requiring them from the options
21:12 jnthn That could be a neater way, yes.
21:12 pmichaud well, 'evalfile' takes a :lang parameter, and other languages might not assume utf8, so we really shouldn't be forcing it.
21:13 [particle]- you should look it up in the lang, then
21:13 pmichaud no, just let the compiler itself decide.
21:14 pmichaud for a Perl 6 compiler, it would default to utf8
21:14 pmichaud actually, each HLLCompiler should probably have a hash of any defaults it wants to set.
21:14 ruoso hmmm... interesting... even after having everything compiled down to pbc... it still takes a huge time to start...
21:14 pmichaud instead of separate attributes for each possible option.
21:15 pmichaud ruoso: parsing speed is no longer our only bottleneck.
21:15 ruoso but I mean... it still takes a huge time...
21:15 ruoso oh wait...
21:15 ruoso the Web.pm files are not compiled
21:17 pmichaud http://gist.github.com/111930  # now works!
21:18 moritz_ pmichaud: I also committed a test file for that
21:18 jnthn pmichaud: Nice!
21:18 moritz_ 20 minutes ago or so
21:18 ruoso pmichaud, :DEFAULT is now the default in the spec
21:18 pmichaud I'll go ahead and push this change without doing a spectest first -- it's really minor.
21:18 ruoso (or did someone revert that?)
21:19 pmichaud ruoso: yes, :DEFAULT may be the default -- I was just being extra-explicit to reduce number of potential variables.
21:19 jnthn ruoso: Shouldn't need to write :DEFAULT in Rakudo.
21:19 ruoso ok then
21:19 [particle]- ruoso: he was testing unicode operators there, not export tags, in case you missed it
21:20 ruoso ah...
21:22 pmichaud yes, it works without :DEFAULT
21:22 pmichaud (running a complete spectest now, too)
21:23 dalek rakudo: c223b06 | pmichaud++ | src/builtins/eval.pir:
21:23 dalek rakudo: When reading Perl 6 files, evalfiles needs to assume utf8 encoding.
21:23 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c223b065072357a5ae21e544fb55d2927934d99d
21:23 dalek rakudo: f7dbcce | pmichaud++ | :
21:23 dalek rakudo: Merge branch 'master' of git@github.com:rakudo/rakudo
21:23 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f7dbcce271b8ee4c0ba171b242688b87e62d06d6
21:25 moritz_ wow, compiling perl6 with optimization really needs much memory
21:25 moritz_ like, 1.3G or so
21:27 moritz_ pmichaud: you'll see a plan failure in imported-subs.t
21:28 moritz_ pmichaud: that's my error, no need to worry ;-)
21:28 pugs_svn r26833 | moritz++ | [t/spec] unfudge and fix imported-subs.t
21:32 * ruoso hits some weird bug again
21:32 hercynium joined #perl6
21:36 frew joined #perl6
21:36 moritz_ assign.t segfaults after 166 tests here
21:39 moritz_ rakudo: say (1..10).reduce: &infix:<+>
21:39 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;P6object;WHAT' pc 83 (runtime/parrot/library/P6object.pir:114)␤»
21:39 moritz_ rakudo: say &infix:<+>(3, 4)
21:39 p6eval rakudo f7dbcc: OUTPUT«7␤»
21:39 moritz_ rakudo: say &infix:<+>(3, 4, 5)
21:39 p6eval rakudo f7dbcc: OUTPUT«too many arguments passed (3) - 2 params expected␤current instr.: 'infix:+' pc 22572 (src/builtins/op.pir:292)␤»
21:40 moritz_ rakudo: say (1..10).list.reduce: &infix:<+>
21:40 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;P6object;WHAT' pc 83 (runtime/parrot/library/P6object.pir:114)␤»
21:41 * ruoso getting invoke() not implemented in class 'ResizablePMCArray' when trying to invoke a method in a object... any idea of what it can be?
21:41 * ruoso getting that line twice, which is the most strange part
21:41 moritz_ I'm sure I've seen that before...
21:42 moritz_ ruoso: are junctions involved?
21:42 ruoso no...
21:43 moritz_ rakudo: my $p = &infix:<+>; say (1..10).list.reduce: $p;
21:43 p6eval rakudo f7dbcc: OUTPUT«Parameter type check failed; expected something matching Code but got something of type Array() for $expression in call to reduce␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
21:43 ruoso it's a plain method call, and I have a line with say $action.WHAT just before the failure
21:44 moritz_ rakudo: my $p = &infix:<+>; say $p.PARROT
21:44 p6eval rakudo f7dbcc: OUTPUT«Perl6Scalar->Perl6Array␤»
21:44 moritz_ rakudo: my $p = &infix:<+>; say $p.perl
21:44 p6eval rakudo f7dbcc: OUTPUT«[{ ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }]␤»
21:44 moritz_ rakudo: my $p = &infix:<+>; say $p.map: { .WHAT }
21:44 p6eval rakudo f7dbcc: OUTPUT«Code()Code()Code()Code()Code()Code()Code()Code()␤»
21:44 moritz_ rakudo: my $p = &infix:<+>; say $p.map: { .signature.perl }
21:44 p6eval rakudo f7dbcc: OUTPUT«undefundefundefundefundefundefundefundef␤»
21:45 moritz_ "Huh."
21:45 jnthn joined #perl6
21:45 Maddingue joined #perl6
21:45 buu joined #perl6
21:47 pasteling "ruoso" at 189.97.48.190 pasted "failure when trying to invoke a method...." (2 lines, 133B) at http://sial.org/pbot/36622
21:48 pmichaud rakudo:  say Multi ~~ Code;
21:48 p6eval rakudo f7dbcc: OUTPUT«1␤»
21:48 pmichaud rakudo:  say &infix:<+>.WHAT;
21:48 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in find_method()␤current instr.: '!dispatch_method' pc 17954 (src/builtins/guts.pir:113)␤»
21:49 pmichaud rakudo:  say &infix:<+> ~~ Code;
21:49 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;P6object;WHAT' pc 83 (runtime/parrot/library/P6object.pir:114)␤»
21:50 pmichaud I'm guessing that infix:<+> isn't blessed as a Perl6MultiSub
21:51 amoc joined #perl6
21:51 frew if I have a class method, (A.bar vs $a.bar) how do I distinguish which is being called in the method?
21:52 moritz_ if self === A { class method } else { instance method }
21:52 moritz_ but usually you don't need any distinction
21:52 * ruoso commits his last version of Faz+Yarn and pushes...
21:53 frew I was just curious
21:53 moritz_ curiosity is good ;-)
21:53 frew and is there a modifier to do that with dispatch?
21:53 pmichaud also potentially use defined
21:53 * ruoso decommute &
21:53 pmichaud if .defined { class method } else { instance method }
21:53 pmichaud er, backwards
21:54 pmichaud if .defined { instance method } else { class method }
21:54 pmichaud to do it in a signature, perhaps
21:54 moritz_ pmichaud: $.defined, not .defined
21:54 frew gotcha
21:54 pmichaud method bar($_ where .defined:) { ... }
21:54 moritz_ pmichaud: uhm, can there be any more constraints on the invocant?
21:55 moritz_ rakudo: class A { multi method bar ($_ where .defined:) { say "a" } }; A.new.bar
21:55 p6eval rakudo f7dbcc: OUTPUT«a␤»
21:55 moritz_ rakudo: class A { multi method bar ($_ where .defined:) { say "a" } }; A.bar
21:55 p6eval rakudo f7dbcc: OUTPUT«Could not locate a method 'bar' to invoke on class 'A'.␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
21:55 pmichaud :-)
21:55 frew I'm surprised that there's no sugar for class vs instance methods
21:55 moritz_ frew: that's because it's usually not needed
21:55 frew but that's still multi dispatch, so in my mind, still turtles
21:56 frew yeah, definitely
21:56 moritz_ frew: if one needs it, there's always the option of writing a module for that (for example via a trait)
21:56 frew I don't think I've actually used Class methods at work ever
21:56 moritz_ frew: I'm sure you did ;-)
21:56 frew sure, and I'm all for that.  I never said it should be in the language
21:56 moritz_ frew: constructors are usually class methods, in some sense
21:56 frew ok, those don't count
21:56 moritz_ ;-)
21:57 frew although I think the config stuff I do probably is
21:57 payload joined #perl6
21:57 pmichaud I've used class methods a fair bit, but rarely in situations where I needed them to be completely separate from instance methods.
21:57 pmichaud There was discussion last week about  method, metamethod, and meta to distinguish the invocants
21:57 frew interesting
21:57 moritz_ "I never metamodel not obsessed with reflection" -- chromatic
21:58 pmichaud http://irclog.perlgeek.de/perl6/2009-05-08#i_1128584
21:58 frew well, the where thing is fine for starters and if it becomes a need using an attribute would prorbaly be fine
21:58 frew that doesn't parse...should it?
21:58 moritz_ frew: what?
21:59 frew what chromatic said
21:59 frew it seems like it's missing a word or something...
21:59 moritz_ frew: metamodel and met a model
21:59 moritz_ frew: it's an intional pun/misparse
21:59 moritz_ http://perlgeek.de/blog-en/perl-6/custom-operators-in-rakudo.writeback
22:00 frew got it
22:02 Tene I'm going to implement "is autodispatched" for methods for s1n.
22:02 pmichaud Tene: hmmm?
22:02 Tene afk, driving.
22:05 lichtkind moritz_: why you dont use macro in the example in >http://perlgeek.de/blog-en/perl-6/custom-operators-in-rakudo.writeback ?
22:05 moritz_ Tene: if you have some spare tuits, I'd know a good task: 'class Foo is also' is now called 'augment class Foo', and we're regresssing on a few tests there.
22:05 moritz_ lichtkind: because macros are not yet implemented
22:05 plu joined #perl6
22:05 lichtkind moritz_: gute antwort :)
22:05 pmichaud I do have to say that changing 'is also' to 'augment' is (to me at least) very non-trivial.
22:06 frew plus, isn't defining an operator cleaner than a macro?
22:06 frew rakudo: say [*] 1..8
22:06 p6eval rakudo f7dbcc: OUTPUT«40320␤»
22:06 moritz_ pmichaud: that's why I ask Tene to do it, and don't try myself ;-)
22:06 frew rakudo: say [*] 1..3
22:06 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:06 frew rakudo: say [+] 1..3
22:06 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:06 frew rakudo: say [~] 1..3
22:06 p6eval rakudo f7dbcc: OUTPUT«123␤»
22:06 lichtkind frew: macros are sub called at compiletime
22:07 frew ah, got it
22:07 frew I can see how that could be good I guess
22:07 frew rakudo: say (1..3).reduce({ $^a + $^b })
22:07 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:07 frew rakudo: say (1..3).reduce({ $^a * $^b })
22:07 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:07 frew how does it know the initial value?
22:08 moritz_ macros can also have more syntactic freedom than operators
22:08 pmichaud frew:  it's   (1 + 2) + 3
22:08 moritz_ frew: it just takes the first item as initial value (reduce, at least)
22:08 pmichaud frew:  and  (1 + 2) * 3
22:08 pmichaud er,
22:08 pmichaud (1 * 2) * 3
22:08 moritz_ rakudo: say [+] ()
22:08 p6eval rakudo f7dbcc: OUTPUT«0␤»
22:08 moritz_ rakudo: say [*] ()
22:08 p6eval rakudo f7dbcc: OUTPUT«1␤»
22:09 moritz_ those are hard-coded for now
22:09 pmichaud oh, for the reduction operators -- yes, they're defined by the spec.
22:09 moritz_ the spec says we just call nullary infix:<+>()
22:09 moritz_ which returns the initial value
22:09 frew that's cool
22:10 moritz_ so that when you define new operators, you can also provide your own initial value
22:10 frew rakudo: my $c = 3; say (1..3).reduce({ $^a + $^b * $c-- })
22:10 p6eval rakudo f7dbcc: OUTPUT«13␤»
22:10 moritz_ rakudo: say 1 + (2*3) + (2*2)
22:10 p6eval rakudo f7dbcc: OUTPUT«11␤»
22:11 moritz_ rakudo: say 1 + (2*3) + (3*2)
22:11 p6eval rakudo f7dbcc: OUTPUT«13␤»
22:11 jnthn (backlogging) (operators not Perl 6 multi subs) I figured that'd come when we could define the operators in Perl 6
22:11 moritz_ it helps not to mis-type ;-)
22:11 frew and if I wanted to set the first one?
22:11 pmichaud jnthn: I'm experimenting with registering MultiSub as Multi
22:12 moritz_ frew: what do you mean by "set the first one"?
22:12 frew the initial value, sorry
22:12 frew just change the list?
22:12 moritz_ yes
22:12 frew hmmm
22:13 pmichaud but even then it doesn't get us as far as we'd probably like
22:13 pmichaud multi sub a(Int $x, Int $y) { return 1; }
22:13 pmichaud multi sub a(Str $x, Str $y) { return 'foo'; }
22:13 pmichaud say <1 2 3>.reduce(&a);
22:13 pmichaud Unknown introspection value 'pos_required'
22:13 frew the reason was that I was thinking I could refactor this: http://rafb.net/p/DP9Eqm13.html to use a reduce
22:14 frew and in p5 it actually turned out to be harder to use a reduce than a regular for loop
22:14 frew but I guess that is really because it has side effects
22:14 jnthn (still backlogging) (augment) I've been thinking that gets cleaner with context vars
22:15 pmichaud jnthn: (context vars)  yes, but we have to be able to define and set them in the grammar.
22:15 moritz_ frew: there's something better for Perl 6, I guess..
22:15 pmichaud sure, the checkdigit is easier in perl6
22:15 moritz_ rakudo: say (1, 0, 1, 0 »*« 1..4).perl
22:15 frew ...
22:15 p6eval rakudo f7dbcc: OUTPUT«Multiple Dispatch: No suitable candidate found for 'cmp', with signature 'PP->I'␤current instr.: 'parrot;Range;!to_test' pc 9563 (src/classes/Range.pir:250)␤»
22:15 jnthn pmichaud: Registering multisub (parrot's) as multi probably won't help.
22:16 frew moritz_: is that really equiv?
22:16 pmichaud [+] @digits[*] >>*<< 1..@digits
22:16 moritz_ rakudo: say (1, 0, 1, 0 »*« (1..4).list).perl
22:16 p6eval rakudo f7dbcc: OUTPUT«[1, 0, 1, 0, 0, 0, 0]␤»
22:16 lichtkind_ joined #perl6
22:16 pmichaud my @digits = <1 2 3 4>;   say @digits >>*<< 1..@digits;
22:16 pmichaud rakudo: my @digits = <1 2 3 4>;   say @digits >>*<< 1..@digits;
22:16 moritz_ uhm... that looks wrong
22:16 p6eval rakudo f7dbcc: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
22:16 jnthn pmichaud: Either we can move operators to the setting, or we need to do the equivalent of giving the blocks a loadinit kinda thing.
22:17 pmichaud rakudo: my @digits = <1 2 3 4>;   say @digits[*] >>*<< 1..@digits;
22:17 p6eval rakudo f7dbcc: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
22:17 pmichaud rakudo: my @digits = <1 2 3 4>;   @digits[*].perl.say
22:17 jnthn pmichaud: That calls !TOPERL6MULTISUB
22:17 p6eval rakudo f7dbcc: OUTPUT«["1", "2", "3", "4"]␤»
22:17 moritz_ rakudo: say 1, 2, 3 >>*<< 3, 4, 5
22:17 p6eval rakudo f7dbcc: OUTPUT«12945␤»
22:17 moritz_ rakudo: say 1, 2, 3 >>*<< 3..5
22:17 pmichaud jnthn: for the problem I'm trying to resolve, even converting to Perl6MultiSub doesn't help.
22:18 p6eval rakudo f7dbcc: OUTPUT«Multiple Dispatch: No suitable candidate found for 'cmp', with signature 'PP->I'␤current instr.: 'parrot;Range;!to_test' pc 9563 (src/classes/Range.pir:250)␤»
22:18 jnthn pmichaud: I think I missed the problem?
22:18 pmichaud jnthn: suppose we want    @list.reduce(&infix:<+>)
22:18 frew rakudo: say (1..3) >>*<< (3..5)
22:18 p6eval rakudo f7dbcc: OUTPUT«3815␤»
22:18 pmichaud there's not presently a way to determine .arity of &infix:<+>
22:18 pmichaud (or of any Multi)
22:19 jnthn rakudo: multi foo() { }; multi foo($x) { }; say &foo.candidates>>.arity
22:19 moritz_ rakudo: my @a = 4, 2, 3, 1; say @a »+« (1..@a)
22:19 p6eval rakudo f7dbcc: OUTPUT«01␤»
22:19 p6eval rakudo f7dbcc: OUTPUT«5465␤»
22:19 jnthn pmichaud: Like that.
22:19 pmichaud jnthn: in which case .reduce needs to know to call >>.arity instead?
22:20 moritz_ rakudo: my @a = 4, 2, 3, 1; say [+]  @a »+« (1..@a)
22:20 p6eval rakudo f7dbcc: OUTPUT«20␤»
22:20 moritz_ frew: see above ;-)
22:20 jnthn pmichaud: What does reduce need to know?
22:20 jnthn pmichaud: The arities of the available candidates?
22:20 pmichaud how many arguments to pass to the sub provided as an argument
22:20 frew moritz_: it doesn't seem to be doing what I expect, but I'm playing with it
22:20 frew either way, I see what you mean
22:21 jnthn pmichaud: Even if you define .arity on multi, there's no one answer so I guess you'd get a junction back.
22:21 pmichaud jnthn: right.
22:21 pmichaud rakudo:  say &infix:<+>.candidates>>.arity;
22:21 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in find_method()␤current instr.: '!dispatch_method' pc 17954 (src/builtins/guts.pir:113)␤»
22:21 jnthn pmichaud: Thing is, you can't easily know even then because what if the multi has an arity 2 that was incompatible with the types you were offering?
22:22 pmichaud jnthn: right, I'm saying it's a place where the spec doesn't quite dwim (for various values of "im")
22:22 pmichaud i.e., people will expect one thing but not get quite what they expect.
22:22 jnthn pmichaud: The other thing about a multi in reduce is that if there's different types in the list things are gonna get fun too.
22:23 frew what does @f >>*<< @f[*] do?
22:23 jnthn You won't even dispatch to the same variant each time then...and again, in the worst case, the arity available would depend on types...
22:23 frew $x * index_of_$x ?
22:23 pmichaud frew:  gives you an array of the squares
22:23 jnthn frew: Shouldn't it be the same as @f >>*<< @f?
22:24 frew I don't know
22:24 moritz_ rakudo: my @a = 1..5; @a».sqrt; say @a.perl
22:24 pmichaud my @a = <1 2 3 4>;  say [+] @a >>*<< (1..@a)
22:24 p6eval rakudo f7dbcc: OUTPUT«[1, 2, 3, 4, 5]␤»
22:24 moritz_ rakudo: my @a = 1..5; @a».=sqrt; say @a.perl
22:24 p6eval rakudo f7dbcc: OUTPUT«[1, 1.4142135623731, 1.73205080756888, 2, 2.23606797749979]␤»
22:24 pmichaud rakudo: my @a = <1 2 3 4>;  say [+] @a >>*<< (1..@a)
22:24 p6eval rakudo f7dbcc: OUTPUT«30␤»
22:25 pmichaud rakudo: my @a = <4 3 2 1>;  say [+] @a >>*<< (1..@a)
22:25 p6eval rakudo f7dbcc: OUTPUT«20␤»
22:25 moritz_ bed &
22:25 frew what if I want to do this:
22:25 frew rakudo: [+] @a >>*<< (@a..1)
22:25 p6eval rakudo f7dbcc: OUTPUT«Scope not found for PAST::Var '@a' in ␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)␤»
22:25 pmichaud frew:  @a >>*<< (1..@a)  produces  ($a[0]*1, $a[1]*2, $a[2]*3, $a[3]*4, ...)
22:26 pmichaud rakudo:  my @a = <4 3 2 1>;  say [+] @a >>*<< (1..@a).reverse
22:26 frew right, what if I want the reverse of that, so $a[0] * @a.elems
22:26 p6eval rakudo f7dbcc: OUTPUT«30␤»
22:26 frew ahh
22:26 frew nice
22:26 pmichaud rakudo doesn't implement it yet, but one could also do    @a..1 :by(-1)
22:27 frew for some reason the check digit isn't working...
22:27 LadyLunacy joined #perl6
22:27 frew I need to play with it some thing
22:27 frew thanks guys
22:27 pmichaud have an example input?
22:27 frew yeah
22:27 frew 773218 should check to 5
22:28 frew and http://rafb.net/p/NsOkuA12.html
22:28 frew that's the algorithm we use at work
22:28 pmichaud rakudo: my @digits = '773218'.split('');  @digits.perl.say;
22:28 p6eval rakudo f7dbcc: OUTPUT«["7", "7", "3", "2", "1", "8"]␤»
22:28 pmichaud rakudo: my @digits = '773218'.split('');  say [+] @digits >>*<< 1..@digits;
22:28 p6eval rakudo f7dbcc: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
22:28 * jnthn is a little confused by that error
22:28 pmichaud rakudo: my @digits = '773218'.split('');  say [+] @digits >>*<< (1..@digits);
22:29 p6eval rakudo f7dbcc: OUTPUT«91␤»
22:29 frew rakudo: my @digits = '773218'.split('');  say [+] @digits >>*<< (1..@digits) % 10;
22:29 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:29 pmichaud rakudo: my @digits = '773218'.split('');  say [+] @digits.reverse >>*<< (1..@digits);
22:29 p6eval rakudo f7dbcc: OUTPUT«105␤»
22:29 frew rakudo: my @digits = '773218'.split('');  say [+] @digits.reverse >>*<< (1..@digits) % 10;
22:29 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:29 frew should be 5
22:30 pmichaud rakudo: my @digits = '773218'.split('');  say [+] @digits >>*<< (1..@digits).reverse;
22:30 p6eval rakudo f7dbcc: OUTPUT«105␤»
22:30 pmichaud rakudo: my @digits = '773218'.split('');  say ([+] @digits >>*<< (1..@digits).reverse) % 10;
22:30 p6eval rakudo f7dbcc: OUTPUT«5␤»
22:30 frew rakudo: my @digits = '773218'.split('');  say [+] (@digits.reverse) >>*<< (1..@digits) % 10;
22:30 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:30 frew wow
22:30 frew er
22:30 frew rakudo: my @digits = '773218'.split('');  say [+] @digits >>*<< ((1..@digits).reverse) % 10;
22:30 p6eval rakudo f7dbcc: OUTPUT«6␤»
22:30 frew oh
22:30 frew parens
22:31 pmichaud you want to %10 the entire sum, not just the last part
22:31 eternaleye joined #perl6
22:31 frew right
22:31 frew rakudo: my @digits = '773218'.split('');  say ([+] @digits.reverse >>*<< (1..@digits)) % 10;
22:31 p6eval rakudo f7dbcc: OUTPUT«5␤»
22:31 frew wow
22:31 frew that is awesome
22:32 eternaleye perl6: sub infix:<...> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; return( &generator.( |@tmp) ); }; }; .say for ( 1, 1 ... { $^a + $^b } );
22:32 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;Role;perl' pc 255242 (src/gen_metaop.pir:23)␤»
22:32 p6eval ..pugs: OUTPUT«1␤<SubPointy(<anon>)>␤»
22:32 p6eval ..elf 26833: OUTPUT«/home/evalenv/pugs/misc/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤   from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `each'␤      from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `map'␤       from
22:32 p6eval ../home/evalenv/pugs/mi...
22:32 skids joined #perl6
22:32 frew rakudo: my @digits = '773218'.split('');  say ([+] @digits.reverse >>*<< (1..@digits)) % 10 == 5;
22:32 p6eval rakudo f7dbcc: OUTPUT«1␤»
22:32 eternaleye perl6: sub infix:<...> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; return( &generator.( |@tmp) ); }; }; .().say for ( 1, 1 ... { $^a + $^b } );
22:32 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;Role;perl' pc 255242 (src/gen_metaop.pir:23)␤»
22:32 p6eval ..elf 26833: OUTPUT«/home/evalenv/pugs/misc/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤   from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `each'␤      from /home/evalenv/pugs/misc/STD_red/match.rb:140:in `map'␤       from
22:32 p6eval ../home/evalenv/pugs/mi...
22:32 p6eval ..pugs: OUTPUT«*** Cannot cast from VInt 1 to Pugs.AST.Types.VCode (VCode)␤    at /tmp/z2qne2sG1B line 1, column 189-197␤»
22:33 eternaleye Hm. I've got most of it figured, but how can I get it to return a lazy list?
22:34 eternaleye Maybe...
22:34 pmichaud eternaleye: note that in order for that to work, infix:<...> would have to have lower precedence than infix:<,>
22:34 eternaleye Ah
22:34 pmichaud you could parenthesize, though.
22:34 eternaleye perl6: sub infix:<...> is looser infix<,> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; return( &generator.( |@tmp) ); }; }; .say for ( 1, 1 ... { $^a + $^b } );
22:34 p6eval rakudo f7dbcc: OUTPUT«Malformed routine definition at line 1, near "infix:<..."␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:34 p6eval ..pugs: OUTPUT«*** ␤    Unexpected "infix"␤    expecting trait or block␤    at /tmp/kApkTwJlws line 1, column 27␤»
22:34 p6eval ..elf 26833: OUTPUT«Parse error in: /tmp/xWhYjKJvb1␤panic at line 1 column 16 (pos 16): No previous operator visible to adverbial pair ([#<Match:0x81c80b0 @on_str="sub infix:<...> is looser infix<,> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i {
22:34 p6eval .....
22:34 eternaleye perl6: sub infix:<...> is looser infix:<,> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; return( &generator.( |@tmp) ); }; }; .say for ( 1, 1 ... { $^a + $^b } );
22:34 p6eval rakudo f7dbcc: OUTPUT«Malformed routine definition at line 1, near "infix:<..."␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:34 p6eval ..pugs: OUTPUT«*** ␤    Unexpected "infix"␤    expecting trait or block␤    at /tmp/6u5aLhNXHk line 1, column 27␤»
22:34 p6eval ..elf 26833: OUTPUT«Parse error in: /tmp/Yi989QbUpw␤panic at line 1 column 16 (pos 16): No previous operator visible to adverbial pair ([#<Match:0x81c7624 @on_str="sub infix:<...> is looser infix:<,> ( Object @starter, Code &generator ) { -> { my Object @tmp = (); for 1 .. &generator.arity() -> $i
22:34 p6eval ..{...
22:35 [particle]- eternaleye: use rakudo: instead of perl6: to reduce noise
22:35 eternaleye Okay
22:35 pmichaud and rakudo doesn't implement is looser/tighter/etc yet.
22:36 pmichaud rakudo:  multi sub a() { 1; };  multi sub a($x) { $x; };  say &a ~~ Callable;
22:36 p6eval rakudo f7dbcc: OUTPUT«0␤»
22:37 pmichaud rakudo:  multi sub a() { 1; };  multi sub a($x) { $x; };  sub b(&x) { &x() };  b(&a);
22:38 jnthn :-( That's a ticket.
22:38 p6eval rakudo f7dbcc: OUTPUT«Parameter type check failed; expected something matching  but got something of type Multi() for x in call to b␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
22:38 jnthn And that's the upshot of the first problem.
22:38 jnthn pmichaud: If you file, I can fix that tomorrow.
22:38 * pmichaud files ticket.
22:39 jnthn pmichaud: Do you expect we'll move operators to the setting, once is tighter and is looser traits are in place?
22:40 eternaleye rakudo: sub infix:<...> ( Object @starter, Code &generator ) { return( gather { while Bool::True { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; take( &generator.( |@tmp) ); } }; ); }; .say for ( 1, 1 ... { $^a + $^b } );
22:40 p6eval rakudo f7dbcc: OUTPUT«Statement not terminated properly at line 1, near "( gather {"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:40 pmichaud jnthn: operators don't depend on tighter/looser
22:41 pmichaud but beyond that, I'm getting very concerned about our startup time.
22:41 eternaleye rakudo: sub infix:<...> ( Object @starter, Code &generator ) { return( -> { gather { while Bool::True { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; take( &generator.( |@tmp) ); }; }; }; ); }; .say for ( 1, 1 ... { $^a + $^b } );
22:41 p6eval rakudo f7dbcc: OUTPUT«Statement not terminated properly at line 1, near "( -> { gat"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:42 pmichaud (operators do depend on equiv)
22:42 eternaleye rakudo: sub infix:<...> ( Object @starter, Code &generator ) { -> { gather { while Bool::True { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; take( &generator.( |@tmp) ); }; }; }; }; .say for ( 1, 1 ... { $^a + $^b } );
22:42 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;Role;perl' pc 255242 (src/gen_metaop.pir:23)␤»
22:42 eternaleye Well that's something different.
22:42 pmichaud anyway, I'd be okay with beginning to move selected operators into the setting to see how it goes.
22:42 eternaleye rakudo: sub infix:<...> ( Object @starter, Code &generator ) { -> { gather { while Bool::True { my Object @tmp = (); for 1 .. &generator.arity() -> $i { @tmp.unshift( @starter[-$i] ); }; take( &generator.( |@tmp) ); }; }; }; }; .().say for ( 1, 1 ... { $^a + $^b } );
22:42 p6eval rakudo f7dbcc: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;Role;perl' pc 255242 (src/gen_metaop.pir:23)␤»
22:43 pmichaud I'm still a little uncertain about how some of the basic operators will fare.  We can certainly try them.
22:43 jnthn pmichaud: Are you thinking of keeping grammar-oper.pg?
22:44 pmichaud only to define the base precedence tokens.
22:44 jnthn pmichaud: And having that define the precedence?
22:44 jnthn OK.
22:44 pmichaud Either that or we add "is precedence(...)" to the setting.
22:44 jnthn *nod*
22:44 jnthn On startup time...
22:44 jnthn I have a few ideas for that.
22:45 pmichaud I think I somewhat prefer the precedence identifiers to remain in grammar-oper.pg for now.  That most closely matches STD.pm's approach, I think.
22:45 frew rakudo: sub foo ( $bar where { $bar ~~ 'test' } ) { say 'test'; }; foo('test')
22:45 p6eval rakudo f7dbcc: OUTPUT«test␤»
22:45 frew rakudo: sub foo ( $bar where { $bar ~~ 'test' } ) { say 'test'; }; foo('tes')
22:45 p6eval rakudo f7dbcc: OUTPUT«Parameter type check failed; expected something matching all(Any, { ... }) but got something of type Str() for $bar in call to foo␤current instr.: 'die' pc 16712 (src/builtins/control.pir:225)␤»
22:45 jnthn 1) Can we collapse all of the loadinits into a single Parrot sub rather than having one for everything?
22:45 pmichaud jnthn: we can start to move that direction, yes.  Having them separate makes for slightly easier debugging, though.
22:46 pmichaud I might be able to add annotations to simplify it when in loadinit.
22:46 jnthn pmichaud: We could have a "turn it off" flag somewhere.
22:46 jnthn e.g. it's an opt
22:46 jnthn Yes, or annotations.
22:46 pmichaud annotations would probably be sufficient.  Or even :inline('# comment identifying block being loadinited')
22:46 frew rakudo: 1 ~~ /(\d)/;
22:46 p6eval rakudo f7dbcc:  ( no output )
22:46 jnthn That would mean we don't have to fall in and out of the runloop but also means we get to unpack a bunch less Sub PMCs on load.
22:46 frew rakudo: if 1 ~~ /(\d)/ { say 'true' };
22:46 p6eval rakudo f7dbcc: OUTPUT«true␤»
22:46 jnthn And our .pbc would shrink too.
22:47 frew rakudo: if 1 ~~ /(\d{1,8})/ { say 'true' };
22:47 p6eval rakudo f7dbcc: OUTPUT«Statement not terminated properly at line 1, near "~~ /(\\d{1,"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:47 frew rakudo: if 1 ~~ /(\d<1-8>)/ { say 'true' };
22:47 p6eval rakudo f7dbcc: OUTPUT«Statement not terminated properly at line 1, near "~~ /(\\d<1-"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)␤»
22:47 pmichaud I had tested combining the loadinits into one previously (with only a few problems) -- I can see about doing it again.
22:47 jnthn Another thing is trying to work out what takes time during the loadinit, since I suspect that's our main source of performance issues.
22:48 jnthn Startup performance issues, I mean.
22:48 pmichaud I suspect it's largely that there's a huge amount of work to be done :-|
22:49 pmichaud a profiler would help.  :-)
22:49 pmichaud er, :-(
22:49 skids oprofile seems to work OK
22:49 jnthn I'd kind of hoped we'd not have to approach the issue too soon, but in the long run I liked to hope that we'd not construct classes and signatures at startup eventually, but instead freeze them as PMCs.
22:50 pmichaud I've never quite figured out how that's going to work
22:50 jnthn :immediate can run a chunk of code and then it replaces the sub PMC with the PMC that the sub returned.
22:51 jnthn so a .const (in theory at least) can get at it.
22:51 pmichaud I understand that part
22:51 pmichaud but how does it maintain references to the things that aren't part of the class?
22:51 pmichaud for example, how does the frozen PMC keep the fact that it 'isa P6object' ?
22:52 jnthn Aye, freezing the parents list for parents outside of the assembly gets tricky.
22:52 pmichaud and it's not just parents -- it might have references to other things
22:52 jnthn I don't think Parrot gives us what we need to do this today.
22:53 pmichaud that aren't actually loaded/constructed until runtime
22:53 pmichaud namespace entries come to mind.
22:53 jnthn And we might need to be selective in what we can do.
22:53 eternaleye I can't figure out how to make the coderef '&generator' be triggered by an access beyond the lazy list's bounds. Is there some way to tie accesses to a list to a callback which extends the list?
22:53 pmichaud eternaleye: we don't implement laziness yet.
22:53 justatheory joined #perl6
22:54 jnthn pmichaud: I suspect a bunch of our expense at the moment is in signature object creation.
22:54 frew is $1 etc implemented in rakudo?
22:54 jnthn frew: yes, should be
22:54 frew and I still capture with () ?
22:54 pmichaud I agree with that.  Even there, I'm not sure exactly how to freeze those, since they depend on a (dynamically-created) Signature class.
22:54 eternaleye Drat. I can't wait until we have laziness; I'm looking forward to the Coolest Perl6 Operator ( AKA infix:<...> )
22:55 pmichaud capture with () yes, but the first one is  $0
22:55 jnthn pmichaud: Worse, if you have a type that is a Class, then to freeze the sig you'd need a frozen reference to that.
22:55 pmichaud jnthn: exactly.
22:55 frew cool
22:55 pmichaud jnthn: which is why I've been concerned that the ability to freeze PMCs is far more limited than anyone had expected.
22:56 pmichaud I should rephrase that
22:56 frew should it be giving warnings about uninitialized values because of $0 et al?
22:56 pmichaud jnthn: which is why I've been concerned that the ability to freeze ['parrot';'Object'] (and descendents) ....
22:56 pmichaud frew: if you use $0 and it hasn't been set, you get the warning, yes.
22:57 frew hmmm
22:57 frew I'm trying to validate my input in the signature constraint
22:57 frew is that a bad idea?
22:58 pmichaud depends on the use case; in general, having pattern-match signature constraints is supposed to be supported, yes.
22:58 frew and being able to get at the $0 from the match?
22:58 frew inside the method?
22:59 pmichaud that probably won't work, since it's a different lexical scope.
22:59 frew ah, ok
22:59 pmichaud oh, it might be made to work somehow.  I'd have to play with it a bit.
23:00 jnthn pmichaud: To construct a signature at the moment takes quite a bunch of method calls. And those - including parameter passing - ain't awessomely fast. :-(
23:00 pmichaud jnthn: well, this is one of the reasons I wasn't a big fan of signature objects :-|
23:00 pmichaud (I agree we need them.  But they're expensive at startup.)
23:02 jnthn Aye. :-|
23:03 pmichaud if we can come up with a constant string-or-other implementation that could be quickly decoded to build the signature, or at least big parts of it, that might be useful.
23:04 jnthn The main things we can't freeze are the type references.
23:04 pmichaud even nicer would be if we could build signatures lazily. :-)
23:04 jnthn Being able to build them without a bunch of method calls would help too...
23:05 pmichaud well, we could certainly turn those method calls into (private) sub calls.
23:05 pmichaud but I don't know if that's more or less expensive.
23:05 jnthn Avoids the method dispatch cost but not the parameter passing cost.
23:05 pmichaud and I don't think the method dispatch cost ought to be that high here.
23:06 pmichaud looking up a method shouldn't be much more expensive than searching lexical+package+global scopes.
23:07 pmichaud (which is what a sub call would do)
23:07 jnthn Right, especially as they are defined right in the child hash anyway so would be a direct hit on the method table.
23:07 pmichaud exactly.
23:07 pmichaud otoh, we could look up the sub once (at the beginning of the loadinit) and then use it thereafter
23:08 pmichaud so there'd be no lookups, just argument passing.
23:08 jnthn ooh, that's true.
23:08 pmichaud of course, I guess we could do that with the method as well :-)
23:08 jnthn find_method ... ;-)
23:08 jnthn Yeah!
23:08 pmichaud anyway, I suspect method dispatch (in this case single dispatch) is negligable to the argument passing cost
23:09 jnthn Me too.
23:09 jnthn Argument passing is known to be slow.
23:09 pmichaud anyway, in the next few days I'll see about moving the loadinits to one sub and see what we get.
23:09 jnthn It can't hurt, and it may make a reasonably sized difference.
23:10 pmichaud well, if it fails it can hurt :-|
23:10 pmichaud it shouldn't fail, but...
23:10 TimToady well, setting everything up when you compile CORE.pm should have much the same effect
23:11 TimToady when you dump the setting, it should have precompiled everything it can
23:12 pmichaud TimToady: agreed in theory; in practice, Parrot doesn't give us a lot of options for storing precompiled data structures, so we end up building them at load-time.
23:12 TimToady well, that's gonna bite
23:13 TimToady on arity, we can probably take minimum arity from the proto
23:13 pmichaud Agreed.  I've been bristling about it for some time but haven't see any relief on the horizon
23:13 TimToady also &[x] form is defined to be arity 2 regardless of the underlying operaotr
23:15 pmichaud for example, it bugs me that the way we currently build operator precedence tables is by loading the tokens one-at-a-time.
23:15 pmichaud (at program startup)
23:15 TimToady e.g. &[~] is concatenate two things even though ~ itself is list assoc
23:15 pmichaud IWBNI Parrot gave me a way to easily serialize data structures in PIR or some other representation.
23:16 pmichaud we might need to look at adding libyaml or something like that to do that.
23:16 pmichaud anyway, dinner time here, $wife is calling
23:16 pmichaud bbl
23:16 TimToady chow
23:16 jnthn pmichaud: At startup, Parrot loops through all of the subs looking for loads or inits or whichever it wants. When it finds one, it calls do_1_sub_pragma which then works out what needs to be done and runs the sub. Since in theory it may be a :immediate it invokes it with Parrot_runops_fromc_args which involves playing the calling conventions game. We then call runops_args which along the way creates a return continuation PMC plus a context.
23:17 eternaleye joined #perl6
23:17 jnthn ...so doing that once rather than for every single method/sub in the setting might just be cheaper. ;-)
23:18 jnthn (I approximate us currently to do this 150 times from a quick grepping.)
23:18 jnthn (Plus once for every class.)
23:19 TimToady one begins to see why many Smalltalk implementations just provide a way to dump/restore the whole memory image...
23:20 TimToady the setting notion isn't so far off of that
23:20 donaldh joined #perl6
23:20 jnthn TimToady: Aye, the challenge is how that dump is linked up with objects from other dumps.
23:21 TimToady just compile, say, CORE.pm, and all its dependencies, then dump everything visible to the lexical scope at YOU_ARE_HERE
23:21 jnthn TimToady: We already to compile, the problem is the data structures rather than the code (e.g. signatures).
23:21 TimToady it all ends up in the one dump, because the use made everything in the other dump visible
23:22 jnthn Sadly, while it's fairly easy to say that, achieving it is slightly harder. ;-)
23:23 TimToady all data structures are visible to the setting's lexical scope, because GLOBAL is just a part of CORE
23:23 TimToady details, details :)
23:23 jnthn Yeah, but it does back to what pm said - Parrot's support for freezing the data structures at the moment isn't giving us what we want.
23:24 jnthn Or rather, what we need.
23:24 TimToady but anyway, it's one of the reasons officially installed modules are considered immutable
23:24 TimToady so we don't have to worry about recompiling them every time
23:24 jnthn To allow pre-compilation?
23:24 jnthn Right.
23:24 TimToady and not just pre-comp of themselves, but their incorporation into CORE
23:24 TimToady the *use* is also precompiled
23:25 TimToady anyway, that's the ideal
23:25 jnthn Aye.
23:25 TimToady the current approach is a bit like not taking invariant code out of the loop when you could
23:26 jnthn I agree with you on the ideal. I just know the work involved in getting there.
23:27 jnthn And I mostly hold to, it'll be better to do all of Perl 6.0.0 and then optimize, rather than run a subset fast.
23:27 TimToady well, sure, up until the point where people are depending on the bugs for production code
23:28 Tene jnthn: did you see my comments earlier about how rakudo is slower when in .HLL 'perl6' ?
23:28 jnthn Tene: I saw them. Do you have much thought about why?
23:28 TimToady things in parrot that prevent atomicity of startup will tend to prevent other things as well
23:28 Tene none whatsoever.
23:30 jnthn Tene: OK. Did you measure how much slower?
23:31 TimToady I wonder how long it would take to (pseudo-)fork a parrot interpreter that was preloaded with the compiler...
23:31 jnthn TimToady: Parrot certainly has issues.
23:32 Tene jnthn: http://nopaste.snit.ch/16544
23:32 Tene 'make test' times compared similarly
23:33 jnthn TimToady: Much as I would love to dig in and help be a part of solving them sooner, trying to commit to Parrot as I do with Rakudo right now just ain't going to happen. At least, not without burning me out in the process.
23:34 jnthn And that'd probably be worse.
23:34 jnthn Tene: Looking.
23:35 jnthn Tene: Ouch. Notable.
23:36 jnthn Tene: Think we'll have to just accept it.
23:36 jnthn For now anyways.
23:39 jnthn When I finally stop procrastinating and implementing fun things, I'll eventually get around to the refactor that method dispatch needs, and we'll be less slow on quite a few bits...
23:40 jnthn Tene: BTW, the trait version of your LolDispatch should run just fine now on Rakudo. :-)
23:40 jnthn Impressive cheat though!
23:41 Infinoid jnthn: Are there parrot tickets for the things rakudo needs?
23:41 jnthn Infinoid: Yes, some, though we could maybe do with somehow tagging them.
23:41 jnthn Infinoid: Some are just more general though. Like, calling performance.
23:42 Infinoid true, that effects everyone
23:42 jnthn I'm hoping that Allison's latest work on this will deliver us performance wins.
23:43 jnthn Parrot seems to have got people in the right order.
23:43 jnthn We had somebody how came along and optimized the hell out of stuff. Then we had someone come along and work out the architecture for 1.0. :-|
23:43 jnthn (Yes, I know it's more complex than that really. :-))
23:43 bacek_ joined #perl6
23:44 TimToady Fire! Aim! Ready! is good XP
23:44 jnthn Привет, bacek :-)
23:45 * jnthn uses XP every day.
23:45 jnthn ;-)
23:46 bacek_ jnthn: с добрым утром!
23:47 jnthn bacek_: Как дела?
23:47 jnthn .oO( my Russian probably runs out of steam in another sentence or two :-( )
23:49 meppl good night
23:51 s1n Tene: 'is autodispatched' sounds like a good idea :)
23:52 s1n pmichaud: ping
23:52 pmichaud s1n: pong
23:52 Tene s1n: "method foo(...) is autodispatched { ... }" meaning "There's a 'sub' form of foo that looks up 'self' in the caller and calls the 'foo' method on it" sound about right?
23:53 s1n pmichaud: what was wrong with $.method?
23:53 pmichaud s1n: nothing, as it turns out, other than rakudo has a known bug with it.
23:53 s1n oh okay
23:54 s1n $.method is much better
23:54 pmichaud but from a Perl 6 perspective, $.method is just fine.
23:54 bacek_ jnthn: отлично!
23:54 s1n Tene: sounds like a decent idea
23:54 Tene s1n: so I'm misremembering you having an objection to $.method ?
23:54 s1n pmichaud: yeah, it's much better than self.method, but I like Tene's idea
23:55 s1n Tene: well, it's just not fully huffmanized :)
23:55 s1n that idea of yours sounds somewhat reasonable
23:55 Tene "All is fair if you predeclare."
23:55 pmichaud 23:36 <jnthn> Tene: Think we'll have to just accept it.
23:55 s1n Tene: yeah, i'll agree with that
23:55 pmichaud Given that, I'm fine with switching Rakudo over to .HLL 'perl6' at your convenience.
23:56 Tene pmichaud: OK, I'll commit now then.
23:56 pmichaud be sure to spectest with latest changes :-)
23:56 s1n Tene: i saw your LolDispatcher
23:56 s1n i wanted to ask about that, it looks pretty amazing, can you explain how that works to me?
23:56 pmichaud (or prepare to hear lots of flames if spectest breaks :-)
23:57 Tene s1n: sure.  lemme move it to use the real syntax...
23:57 pmichaud "No!! Not THE REAL SYNTAX!!!"  :-P
23:57 dalek rakudo: b41e13b | tene++ | perl6.pir:
23:57 dalek rakudo: Migrate Rakudo to use .HLL 'perl6'
23:57 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/b41e13b7810e80288d676167c779a85c892f85ed
23:57 Tene pmichaud: spectest is clean for me... this is the only way to get anyone else to actually test it. :)
23:58 jnthn pmichaud: It sucks to perform even worse, but putting off something that needs to happen when we have a patch ready to make it happen seems like a potential missed opportunity.
23:58 pmichaud I have to disappear for a bit, I'll run a spectest while gone.
23:58 Tene jnthn: there are tests for sub traits now?
23:58 pmichaud jnthn: I agree -- I only wanted to get your opinion before pulling the trigger.
23:59 jnthn Tene: No, I didn't get to writing the tests yet, mostly because TimToady++ wants to review traits anyway and I've decided to hold fire on further traits stuff until he's done so.
23:59 jnthn Tene++ for HLL stuff. :-)
23:59 pmichaud Indeed.
23:59 jnthn As in, *really* Tene++. :-)
23:59 pmichaud Now we should start trying 'hll_map' :-)

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

Perl 6 | Reference Documentation | Rakudo