Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-01-25

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 FROGGS gnight
00:44 Pleiades` joined #perl6
00:47 am0c joined #perl6
00:47 Swarley_ joined #perl6
00:57 Pleiades` joined #perl6
01:04 Targen joined #perl6
01:09 hypolin joined #perl6
01:14 anuby joined #perl6
01:18 benabik joined #perl6
01:32 diakopter :7
01:48 MikeFair_ joined #perl6
02:45 hash_table joined #perl6
02:53 MikeFair_ joined #perl6
03:00 hlin_ joined #perl6
03:10 skids joined #perl6
03:14 balders_dod joined #perl6
03:31 bluescreen__ joined #perl6
03:37 MikeFair joined #perl6
03:56 orafu joined #perl6
04:06 fgomez joined #perl6
04:17 preflex_ joined #perl6
04:21 aindilis joined #perl6
05:15 telex joined #perl6
05:37 telex joined #perl6
05:49 alec__ joined #perl6
05:54 moritz \o
05:58 sorear o/ moritz
05:59 SamuraiJack joined #perl6
06:01 balders_1od joined #perl6
06:07 dayangkun joined #perl6
06:26 erkan joined #perl6
06:26 erkan joined #perl6
06:50 kaleem joined #perl6
06:55 daniel-s joined #perl6
07:02 alec__ joined #perl6
07:14 wk_ joined #perl6
07:34 Swarley_ joined #perl6
07:35 araujo joined #perl6
07:35 araujo joined #perl6
07:35 Swarley_ How would i express this, ( source-character+ ) but not ( source-character* line-terminator source-character* )
07:36 Swarley_ I'm sure I could figure out a way, but I thought that checking for a special perl 6 magic method would be easier
07:38 TimToady we usually use \N+ for that
07:38 TimToady negation of \n
07:38 TimToady or do you mean something else by 'line-terminator'?
07:39 Swarley_ token TkLineTerminator { \x0D? \x0A }
07:39 Swarley_ Directly from an IPA draft of a language specification.
07:39 TimToady \n is supposed to match any of the common line terminators in Perl 6
07:40 TimToady r: say "foo\r\n" ~~ /\N+/
07:40 p6eval rakudo d97ad4: OUTPUT«「foo」␤␤»
07:40 sorear \n also matches some weird line terminators that I have never seen in the wild
07:40 TimToady well, like PARAGRAPH SEPARATOR and such
07:40 sorear if you have a need to include \u2028 as part of your logical lines, \N* is not for you.
07:41 Swarley_ Well, is there a way to do some actual and logic and just negate the second expression?
07:41 TimToady there is a specced way that is probably not implemented, but you can always put an assertion of your own
07:42 sorear I'd do [ <!TkLineTerminator> . ]*
07:42 TimToady or possibly even <-TkLineTermator>*
07:42 Swarley_ Ah.
07:42 TimToady only spelled rigth
07:43 sorear what you wrote first is CYK-think and is less than optimal with the perl 6 grammar engine
07:43 sorear although it can be written
07:44 sorear A !~~ /B/ I think
07:44 Swarley_ r: say "hello world\r\n" ~~ /<-\x0D? \x0A>/
07:44 p6eval rakudo d97ad4: OUTPUT«[31m===[0mSORRY![31m===[0m�Unrecognized regex metacharacter < (must be quoted to match literally)�at /tmp/1zhLtaFy1M:1�------> [32msay "hello world\r\n" ~~ /<-[33m�[31m\x0D? \x0A>/[0m�Unrecognized regex metacharacter - (must be quoted to match literally)�at…
07:44 Swarley_ er
07:44 sorear r: my token nl { \x0D? \x0A }; say "hello world\r\n" ~~ /<-nl>/
07:44 p6eval rakudo d97ad4: OUTPUT«No such method 'nl' for invocant of type 'Cursor'␤  in regex  at /tmp/2tOd5wM1uV:1␤  in method ACCEPTS at src/gen/CORE.setting:10733␤  in block  at /tmp/2tOd5wM1uV:1␤␤»
07:45 sorear you can't just put random stuff between <- and >
07:45 Swarley_ Ah. Well, there is no immediate negation then?
07:45 sorear it has to be a rule name (or something else that can match the "assertion" production)
07:46 sorear Swarley_: you CAN do token line { [.*] !~~ /<nl>/ }
07:46 sorear Swarley_: if you want your rules to take quadratic time, that is.
07:47 TimToady I don't think the inner regex takes //
07:47 Swarley_ er no, i'd prefer that they didn't
07:47 sorear <-nl>* will take linear time and I strongly recommend that you use it instead
07:47 Swarley_ Yes, I'll use that
07:47 sorear this is not CYK
07:50 jnthn morning
07:50 TimToady o/
07:55 * jnthn sips coffee and prepares for the day's teaching :)
07:58 moritz o/
07:59 nwc10 ensuring a proper bootstrap?
07:59 jnthn Something like :)
08:09 FROGGS joined #perl6
08:12 FROGGS morning
08:12 FROGGS is there a tool that let you calculate NQP_REVISION ?
08:16 moritz git describe
08:17 FROGGS cool
08:18 moritz t/spec/S32-exceptions/misc.rakudo                       (Wstat: 0 Tests: 513 Failed: 1) Failed test:  492
08:18 FROGGS moritz: thanks, so I dont have to count be myself :o)
08:19 FROGGS hmmm, this https://github.com/perl6/roast/commit/b​8320565e49e641b570fa10e66c399e5eb1ff478
08:19 FROGGS I'm already running the spectests
08:20 moritz I don't like the approach of X::Constructor::Positional
08:20 moritz with .name, I mean
08:20 moritz it should store the type object directly
08:20 moritz and only .^name it for the message
08:20 moritz that way less information is lost
08:27 FROGGS # Exception message: Could not locate compile-time value for symbol Foo
08:31 FROGGS moritz: I'm trying to fix this, k?  # not that be both spend time on it
08:31 moritz FROGGS: +1
08:32 fhelmberger joined #perl6
08:34 FROGGS rn: say "foobar" ~~ m/$( $_ )/
08:34 p6eval rakudo d97ad4: OUTPUT«「foobar」␤␤»
08:34 p6eval ..niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(6) text(foobar) pos([].list) named({}.hash)>␤»
08:34 FROGGS rn: say "foobar" ~~ m/f $( $_ )/
08:34 p6eval niecza v24-18-gaf64300: OUTPUT«False␤»
08:34 p6eval ..rakudo d97ad4: OUTPUT«#<failed match>␤»
08:34 FROGGS good
08:34 FROGGS rn: say "foobar" ~~ m/f $( $_.substr(1, Inf) )/
08:34 p6eval niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(1) text(f) pos([].list) named({}.hash)>␤»
08:34 p6eval ..rakudo d97ad4: OUTPUT«â�€â�€â�€[â�€â�€â�€3â�€â�€â�€1â�€â�€â�​€mâ�€â�€â�€=â�€â�€â�€=â�€â�€â�€=â�€â�€â�€â�€â�​€â�€[â�€â�€â�€0â�€â�€â�€mâ�€â�€â�€Sâ�€â�€â�€Oâ​�€â�€â�€Râ�€â�€â�€Râ�€â�€â�€Yâ�€â�€â�€!â�€â�€â​�€â�€â�€â�€[â�€â�€â�€3â�€â�€â�€1â�€â�€â�€mâ�€â​�€â�€=â�€â�€â�€=â�€â�€â�€=â�€â�€â�€â�€â�€â�€[â​�€â�€â�€0â�€â�€â�€mâ�€â�€â�€â�¤â�€â�€â�€Uâ�€â�​€â�€nâ�€â�€â�€râ�€â�€â�€eâ�€â�€â�€câ�€â�€â�€oâ​�€â�€â�€gâ�€â�€â�€nâ�€â�€â�€iâ�€â�€â�€z
08:35 FROGGS what the
08:35 FROGGS rn: say "foobar" ~~ m/f { $_.substr(1, Inf) }/
08:35 p6eval rakudo d97ad4: OUTPUT«「f」␤␤»
08:35 p6eval ..niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(1) text(f) pos([].list) named({}.hash)>␤»
08:36 moritz FROGGS: known(-ish) problems with UTF-32 and error messages from qregex
08:37 FROGGS moritz: looks good in my shell, is it a problem in p6eval?
08:37 moritz FROGGS: no, your shell just ignores the extra zero bytes
08:37 FROGGS good shell ;o)
08:37 FROGGS a bit ignorant though
08:38 moritz p6eval replaces them with ␀
08:53 sqirrel joined #perl6
08:54 timotimo FROGGS: thanks for fixing my mistakes :)
08:54 timotimo i thought i had tested the change, though. strange.
08:55 groky joined #perl6
09:00 kresike joined #perl6
09:00 kresike hello all you happy perl6 people
09:14 dalek rakudo/nom: 6b0cea6 | (Tobias Leich)++ | src/core/ (2 files):
09:14 dalek rakudo/nom: pass type object to exception X::Constructor::Positional
09:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6b0cea6e48
09:15 moritz FROGGS++
09:16 rindolf joined #perl6
09:17 dalek roast: 2018e14 | (Tobias Leich)++ | S32-exceptions/misc.t:
09:17 dalek roast: X::Constructor::Positional's attribute is the type object
09:17 dalek roast: review: https://github.com/perl6/roast/commit/2018e14b42
09:21 Harzilein rindolf: interesting username... are you the java mikmod author?
09:22 masak g'morn'n, #perl6
09:22 rindolf Harzilein: yes, I am.
09:22 FROGGS morning masak
09:22 Harzilein rindolf: :D
09:22 rindolf Harzilein: http://www.shlomifish.org/ - that's my home page.
09:23 FROGGS .oO( do I need coffee when doing. mor<tab> morn<tab><tab> morni<tab> ? )
09:23 Harzilein rindolf: i tried to make a sample extractor based on your code a while ago. haven't worked on it in a while though.
09:23 rindolf Harzilein: ah, OK.
09:24 rindolf Harzilein: the Java port ended up in some non-idiomatic Java.
09:24 rindolf And it also used to be much slower than the C code.
09:27 Su-Shee good morning everyone.
09:28 rindolf joined #perl6
09:28 FROGGS morning Su-Shee
09:31 masak morning, Su-Shee
09:32 alec__ joined #perl6
09:48 Psyche^ joined #perl6
09:53 rindolf joined #perl6
09:59 dakkar joined #perl6
10:01 rindolf joined #perl6
10:12 SmokeMachine joined #perl6
10:14 Tene joined #perl6
10:14 Tene joined #perl6
10:16 djanatyn joined #perl6
10:18 xalbo joined #perl6
10:47 nuba joined #perl6
11:05 Su-Shee_ joined #perl6
11:26 awwaiid joined #perl6
11:40 jlaire joined #perl6
12:04 am0c joined #perl6
12:26 masak wow, I really like the "can-cannot-must" format at the top of this page: http://www.tldrlegal.com/license/gn​u-general-public-license-v2-(gpl-2)
12:26 masak feels like that's a good format not just for exaplaining licenses, but to describe interfaces/software contracts as well.
12:27 FROGGS indeed
12:27 FROGGS feels like most of API documentation only covers 2/3
12:30 moritz that's the beauty of design by contract
12:31 moritz it makes it rather easy to formalize most of the pre- and postconditions of APIs
12:33 masak I dunno, I can see the promise of it, but I haven't really seen it work well in practice yet.
12:33 masak not saying it doesn't -- for all I know, it does -- but I haven't seen it.
12:37 moritz I've had some positive experience with it with the Eiffel standard libraries
12:37 moritz (oh, and I also think that one must support DBC to a level comparable to that of Eiffel for it to really make sense)
12:44 jnthn ugh, that $(...) regex fix looks wrong
12:44 moritz (which in turn requires static typing, so nothing that Perl 6 will be able to do easily)
12:44 jnthn I'm pretty sure in STD it falls out of the $ metachar rule
12:45 jnthn r: /$(a+)/
12:45 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![3​1m===[0mâ�¤Non-declarative sigil is missing its nameâ�¤at /tmp/kmPXuAQl0x:1â�¤------> [32m/$[33mâ��[31m(a+)/[0mâ�¤    expecting any of:â�¤        statement listâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤Â»
12:45 jnthn r: / $( a+ ) /
12:45 p6eval rakudo 6b0cea:  ( no output )
12:45 jnthn std: / $( a+ ) /
12:45 FROGGS jnthn: I'm working on it
12:45 p6eval std 7deb9d7: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Bogus term at /tmp/TyK9fOqN9Y line 1:â�¤------> [32m/ $( a+ [33mâ��[31m) /[0mâ�¤Undeclared routine:â�¤   'a' used at line 1â�¤Parse failedâ�¤FAILED 00:00 44mâ�¤Â»
12:45 FROGGS (right now)
12:46 jnthn FROGGS: OK. Please see how STD does it.
12:46 jnthn we should be staying as close to STD as reasonably possible.
12:46 jnthn Apart from in the places STD is unreasonable :)
12:46 FROGGS jnthn: ya, makes sense
12:47 moritz masak: I also like the tldrlegal thing, but I can't help but notice that the most important difference between GPL v2 and v3 (patent stuff) doesn't show up in the summary
12:51 masak hm, weird.
12:51 masak maybe the most important difference is hard to summarize ;)
12:52 moritz or maybe it's simply an omission
12:56 masak by definition, yes ;)
12:56 jnthn .oO( not so optimized for mission after all... )
13:13 dayangkun joined #perl6
13:26 Rix joined #perl6
13:37 masak rn: class Greeter { has $.target; method greet { say "Hello $.target" } }; my $method = Greeter.can('greet')[0]; say $method.^name
13:37 p6eval niecza v24-18-gaf64300: OUTPUT«Bool␤»
13:37 p6eval ..rakudo 6b0cea: OUTPUT«Method␤»
13:38 masak r: class Greeter { has $.target; method greet { say "Hello $.target" } }; my $method = Greeter.can('greet')[0]; say $method( Greeter.new(:target<World>) )
13:38 p6eval rakudo 6b0cea: OUTPUT«Hello World␤True␤»
13:38 masak r: class Greeter { has $.target; method greet { say "Hello $.target" } }; my $method = Greeter.can('greet')[0]; $method( Greeter.new(:target<World>) )
13:38 p6eval rakudo 6b0cea: OUTPUT«Hello World␤»
13:39 moritz "I think it is very interesting, but I don't have time to be interested in everything that's interesting"
13:39 masak ;)
13:40 masak I'm pondering which model I dislike the least, (1) a method can be unbound or bound, you can bind methods, and you can call bound methods, or (2) a method is a sub with one more parameter.
13:40 masak both Python and Ruby have variants of (1), I believe.
13:40 masak JavaScript has (2), except that the parameter is not a positional parameter.
13:41 masak Perl 5 and Perl 6 have (2).
13:42 moritz in javascript, the supplication of the invocant is somewhat magical, no?
13:42 masak in JavaScript, every Function object has .apply and .call methods, with which you can supply the invocant manually.
13:42 masak but usually, what you do is hide this with the obj.meth sugar.
13:43 masak er, obj.meth()
13:43 masak .apply and .call are only really necessary when you want to do library-internal "call the method on an unexpected object" magic.
13:55 Swarley_ joined #perl6
13:59 bluescreen10 joined #perl6
14:01 hash_table joined #perl6
14:10 PacoAir joined #perl6
14:12 atrodo joined #perl6
14:15 PacoAir joined #perl6
14:30 [Coke] I find myself using .apply/.call when construct jquery plugins.
14:31 [Coke] (where
14:31 [Coke] oops
14:33 masak essentially, because .apply does 'this' assignment and applies the function, .apply + anon function = .bind
14:34 masak or, I should say function() { .apply } = .bind
14:36 vividsnow joined #perl6
14:39 SmokeMachine joined #perl6
14:44 cog joined #perl6
14:47 nyuszika7h_ joined #perl6
14:52 alec joined #perl6
14:56 cog joined #perl6
14:57 cog r: < a b >.WHAT
14:57 p6eval rakudo 6b0cea:  ( no output )
14:58 PerlJam cog: need a "say" in there.
14:59 cog ho, I am so used to the shell that outputs the last expression result when nothing is explicitly printed
14:59 cog r:  say < a b >.WHAT
14:59 p6eval rakudo 6b0cea: OUTPUT«Parcel()␤»
15:00 cog I wonder why this composer does not return a list.
15:00 moritz why should it?
15:01 cog well, why should not it?
15:01 moritz you can push to a list, for example. What would be the sense in allowing  < a b >.push: 42  ?
15:02 moritz http://doc.perl6.org/type/Parcel
15:02 moritz http://doc.perl6.org/type/List
15:03 moritz a Parcel is close to what other languages call a Tupel
15:03 cog I did not realise how parcels are now everywhere in Perl  6
15:07 stopbit joined #perl6
15:09 skids joined #perl6
15:17 cog joined #perl6
15:18 kaare_ joined #perl6
15:25 daniel-s joined #perl6
15:28 hash_table joined #perl6
15:30 SunilJoshi joined #perl6
15:37 jnthn decommute &
15:40 masak moritz: "tuple".
15:42 masak cog: I see parcels as having to be there because in Perl 6, lists can either flatten or have fun with sublists and multidimensionality. as long as it is a parcel though, it's still in a superposition between these two states.
15:43 mtk joined #perl6
15:44 [Coke] masak... Great. I finally thought I was beginning to understand lists, and now this. :P
15:44 masak :P
15:45 moritz masak: but not all parcels flatten, a Parcel-in-an-Item does not
15:45 masak the introduction of Parcels in S02 in fact very much supports this view. "not yet committed to flattening"
15:46 [Coke] O_o;
15:46 moritz [Coke]: don't let masak confuse you
15:46 masak moritz: I thought that's what I said.
15:46 masak moritz: it doesn't know yet whether it should flatten.
15:46 [Coke] moritz:  you're not helping. :)
15:46 moritz masak: oh, you're right
15:46 * masak is right and the world is scary
15:46 moritz masak: but the same is true for Lists and Arrays too
15:46 arlinius joined #perl6
15:47 masak fair enough.
15:47 moritz masak: so we don't really need Parcels for the not-yet-committed-to-whether-we-flatten-or-not stuff
15:48 masak oh! S02 also points out that the things in 'rhyme(1,2,3,:mice<blind>)' is syntactically a Parcel.
15:48 masak (but the compiler collapses it down to a Capture)
15:49 masak rn: my $args = \(1,2,3,:mice<blind>); say $args.^name
15:49 p6eval rakudo 6b0cea, niecza v24-18-gaf64300: OUTPUT«Capture␤»
16:01 dayangkun joined #perl6
16:11 kresike bye folks
16:13 Pleiades` joined #perl6
16:28 vividsnow joined #perl6
16:29 FROGGS[mobile] joined #perl6
16:30 Targen joined #perl6
16:32 fgomez joined #perl6
16:39 kaleem joined #perl6
16:41 kivutar joined #perl6
16:46 japhb masak, re: tldrlegal, I like the reverse search feature (though the UI needs a bit of tweaking), and the "click anywhere in background of front page to get a tour" feature.  I don't like the opening to this:  http://www.tldrlegal.com/license/a​rtistic-license-2.0-%28artistic%29
16:50 FROGGS joined #perl6
16:50 Swarley_ joined #perl6
17:07 Pleiades` joined #perl6
17:22 timotimo what's weird about ti? :\
17:34 Pleiades` joined #perl6
17:39 Chillance joined #perl6
17:51 zby_home joined #perl6
17:54 SamuraiJack joined #perl6
18:00 vividsnow joined #perl6
18:07 MayDaniel joined #perl6
18:18 [Coke] . o O (It's so quiet)
18:19 dalek perl6-roast-data: e386aae | coke++ | / (4 files):
18:19 dalek perl6-roast-data: today (automated commit)
18:19 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/e386aaec51
18:20 [Coke] sorear, colomon : S05-substitution/subst.niecza aborted 136 test(s)
18:21 timotimo [Coke]: maybe you have an error that doesn't have enough information that i could improve? :P
18:21 timotimo or i could really try to tackle the optimisation of the junction operators for constants+variables?
18:22 [Coke] r: cool
18:22 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared routine:â�¤    cool used at line 1â�¤â�¤Â»
18:23 [Coke] r: cool $it
18:23 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$it' is not declaredâ�¤at /tmp/HmvZBgIBG8:1â�¤------> [32mcool $it[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
18:23 [Coke] r: my cool $it
18:23 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed myâ�¤at /tmp/NY49iPNMRw:1â�¤------> [32mmy [33mâ��[31mcool $it[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
18:24 [Coke] timotimo: I have a recent RT that masak opened for me that could use some love.
18:24 [Coke] other than that, I don't have any guidance for you atm.
18:26 [Coke] r: given say take uc
18:26 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/DH7UIbc212:1â�¤------> [32mgiven say take uc[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        argument listâ�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        parameterized blockâ�¤Â»â€¦
18:27 timotimo improving those doesn't seem trivial enough for me :P
18:29 [Coke] timotimo: eh, I'm just playing. "my cool $it" seems like the most likely to be improved by getting "Cool" suggested.
18:30 [Coke] r: my Barf $it
18:30 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed myâ�¤at /tmp/Zs8LQOzGNv:1â�¤------> [32mmy [33mâ��[31mBarf $it[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
18:30 [Coke] r: my enum $it
18:30 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed myâ�¤at /tmp/RS7ABPuOiv:1â�¤------> [32mmy enum $it[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
18:48 cog joined #perl6
18:49 jlaire joined #perl6
18:53 timotimo right, that should definitely happen.
18:57 timotimo i wonder how i can handle that, though. from afar it looks like it's already happening in the parsing stage, before any action has been called, so i may have to plug in a closure before the "malformed my" gets emitted that checks if the type is typo'd
18:58 SmokeMachine joined #perl6
19:01 snearch joined #perl6
19:02 xinming joined #perl6
19:06 benabik joined #perl6
19:07 timotimo strangely, i can't seem to find the place where malformed my is thrown
19:08 timotimo oh, it seems i can get a traceback for it, though
19:10 timotimo r: my Foo $a; class Foo { };
19:10 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed myâ�¤at /tmp/2Ol0MwAf_Y:1â�¤------> [32mmy [33mâ��[31mFoo $a; class Foo { };[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
19:10 timotimo ah, so at that point, the type name must already be known. good to know.
19:15 japhb_ joined #perl6
19:17 * timotimo tests the first patch
19:17 mathw Hello!
19:17 timotimo std: my Foo $a; class Foo { };
19:17 p6eval std 7deb9d7: OUTPUT«[31m===[0mSORRY![31m===[0m�In my declaration, typename 'Foo' must be predeclared (or marked as declarative with :: prefix) at /tmp/ehex2PkHnA line 1:�------> [32mmy Foo[33m�[31m $a; class Foo { };[0m�Malformed my at /tmp/ehex2PkHnA line 1:�------> [32mmy [3…
19:18 timotimo i wonder if it would be okay to parse the future of the document to look for post-declared classes and suggest them?
19:19 TimToady sure, all is fair in the quest for good error messages, once you know it's gonna blow up anyway
19:20 timotimo the first idea that comes to mind is pretend we succeeded and use the mystery mechanism that's already in place
19:21 TimToady might work
19:22 timotimo first i'll have to get this typo_longname token to work properly, though
19:22 TimToady or go ahead and introduce a poisoned symbol, then recall <scoped>
19:22 TimToady by the end of the unit we can tell whether they typo'd or meant to postdeclare the unpostdeclarable
19:23 TimToady as long as we don't accidentally accept the program, we're golden
19:24 TimToady errand &
19:24 skids What do we do if a user has put some IO work in a BEGIN block or whatnot?
19:26 TimToady no compiler can fix or even detect all the erroneous code in the world
19:26 TimToady that's why we have the category "erroneous" in the first place
19:26 skids Ah so "don't do that".  Sounds fine.
19:27 timotimo are BEGIN phasers run before the parse has finished?
19:27 TimToady they are run the moment the BEGIN's code is done parsing
19:28 TimToady obviously they cannot refer to anything postdeclared
19:28 timotimo oh, ok
19:28 TimToady likewise macro calls
19:30 skids I guess now that pragmas and such are scoped to the unit we don't have to worry about use statements so much.
19:32 masak mathw! \o/
19:33 Chillance joined #perl6
19:35 MikeFair__ joined #perl6
19:41 timotimo to be honest, i'm not quite sure how to work this :|
19:42 timotimo i'm trying to maoh, maybe there's whitespace i should be matching!
19:45 timotimo great! that fixed it and now suggestions are emitted if possible
19:54 [Coke] maoh?
19:55 bluescreen100 joined #perl6
19:55 timotimo i think i was in the middle of typing "i'm trying to match longname", and then got the idea thet led me to the road towards victory! :)
19:56 [Coke] oh!
19:57 ifim joined #perl6
19:57 masak mid-word insight. :)
19:57 timotimo huh, this is strange. a call on nqp::join("\n    ", @.suggestions) in X::Undeclared.message fails with "elements() not implemented in class 'Array'", but the same code works no-problemo a few lines above it in my token typo_longname - probably because the one is actually nqp and the other one is perl6 code in the setting
19:58 timotimo i wonder if other parts that sahre the undeclared exception and the suggest_* methods from World suffer from the same problem (and i also wonder how it should be fixed)
19:58 moritz @.suggestions looks very much like Perl 6 to me, not nqp
19:58 timotimo r: class C is cool { };
19:58 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤'C' cannot inherit from 'cool' because it is unknown.â�¤Did you mean one of these?â�¤    'Cool'â�¤    'Bool'â�¤â�¤at /tmp/y9zneb_waZ:1â�¤------> â�¤Â»
19:58 moritz if that's the case, just use its .join method
19:59 timotimo OK.
20:01 timotimo ah, great!
20:09 * timotimo spectests
20:26 spider-mario joined #perl6
20:29 benabik joined #perl6
20:31 timotimo huh, whenever there are no suggestions, i seem to be getting "null pmc access in invoke()" when i do "if nqp::elems(@suggestions) > 0 { ... }" but i've tried to make sure @suggestions gets initialised to [] if nothing gets added to it
20:31 timotimo r: class C is uideatrniudtraneudtrainedtriuane {};
20:31 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0m�'C' cannot inherit from 'uideatrniudtraneudtrainedtriuane' because it is unknown.�at /tmp/yE6hidtEWJ:1�------> �»
20:31 benabik joined #perl6
20:33 timotimo but +@l seems to work. not sure why i didn't have that before.
20:36 timotimo no, that doesn't actually help. now i'm confused :|
20:36 moritz is @suggestions a nqp or a Perl 6 array?
20:36 timotimo i created it inside nqp code, in a method of World, using my @suggestions; (and later: my @suggestions := [];)
20:40 timotimo maybe i have to use nqp::elems in the grammar token that creates suggestions and wrap it into a perl6 list before throwing the Undeclared exception?
20:41 moritz now I'm confused
20:41 timotimo as am i
20:41 moritz at the point where you're writing nqp::elems(@suggestions), what is @suggestions?
20:42 moritz is it an Array (Perl 6)?
20:42 moritz or is it a ResizablePMCArray (nqp/parrot)?
20:42 timotimo i think it's a ResizablePMCArray
20:42 timotimo well, pretty sure, i saw an error about that class when i tried .elems()
20:43 moritz and are you sure that the "null pmc access in invoke()" actually comes from the nqp::elems call?
20:43 moritz and not from something inside the if block, for example?
20:43 timotimo somewhat sure, but let me try something else real quick
20:44 timotimo i may not even need the if statement
20:44 GlitchMr masak: just wondering, when the "Tell knights from knaves based on what they say." task blog post will appear.
20:44 GlitchMr I'm wondering what others have done (I already know my entries are bad)
20:45 masak thank you for your interest.
20:46 masak I'll start doing the reviewing in the weekend.
20:46 masak we'll see how far I get. :)
20:46 timotimo masak: i'm also interested! decided not to pester you ;)
20:46 masak heh.
20:46 masak GlitchMr: why do you say your entries are bad? didn't you say in one of the weekly updates that the p6cc problems were easy? :P
20:47 GlitchMr I did?
20:47 masak anyhoo, I'm happy there's general interest.
20:47 GlitchMr Whatever.
20:48 masak "By the way, if you don’t know about Perl 6 Coding Contest, check it out. The challenges are rather easy if you had any programming language experience"
20:48 masak I read that and thought "...wut?" ;)
20:49 GlitchMr They appeared to me to be easier than 2011 challenges.
20:49 GlitchMr Or perhaps they are just more interesting.
20:49 timotimo hm, are you aware of the "amb" operator? the one where you give a bunch of options and you get the right one out if there's a right answer?
20:49 masak I believe they were a bit easier than the 2011 challenges.
20:49 timotimo is that easily doable in perl6?
20:49 masak timotimo: yes, I'm aware of it.
20:49 masak timotimo: you should check out nothingmuch's implementation on CPAN.
20:50 masak (and his blog posts about it)
20:50 masak timotimo: no, there's no easy/nice way that I know of.
20:50 masak timotimo: closest we've got is TimToady++ simulating amb through the backtracking of grammars ;)
20:50 GlitchMr http://rosettacode.org/wiki/Amb
20:50 masak GlitchMr++
20:50 moritz I think that's on rosettac... what GlitchMr said
20:52 masak "At some point we'll wrap this up in nice syntax to let people write in a sublanguage of Perl 6 that looks more like a logic language."
20:52 masak promises, promises. ;)
20:52 masak when is Perl 6 gonna be released already!? </troll>
20:54 timotimo :)
20:55 bluescreen__ joined #perl6
20:56 timotimo "all tests successful", I enjoy reading that
20:56 * [Coke] hopes masak is checking for extensions of the grammar!
20:56 [Coke] (for t1)
20:57 * [Coke] does wish he had spent another hour cleaning up his t1 solution, but thinks it's "ok"
20:58 timotimo huh, why does this already work?!
20:58 timotimo that's pretty cool.
20:58 timotimo r: sub foo(cool $a) { };
20:58 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0m�Invalid typename 'cool' in parameter declaration. Did you mean 'Cool', 'Bool'?�at /tmp/MbYJ1YhVWm:1�------> [32msub foo(cool[33m�[31m $a) { };[0m�»
20:58 GlitchMr For some reason I bet that some code submitted to masak's contest will have code like if (...) { ... } and masak will complain about parens.
20:59 timotimo oh, i already implemented this some time ago? or maybe someone else did.
20:59 rindolf joined #perl6
20:59 GlitchMr timotimo: You did
20:59 GlitchMr http://glitchmr.github.com/​helpful-error-messages.html
20:59 moritz timotimo: I guess there's some special case about expecting a typename rather than a callable as the first thing in a parameter name
20:59 GlitchMr I even wrote a blog post about that feature
21:00 timotimo GlitchMr: :)
21:00 GlitchMr r: sub a($CopyPasta) { $copyPasta }
21:00 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$copyPasta' is not declaredâ�¤at /tmp/SY5Tr0VYZO:1â�¤------> [32msub a($CopyPasta) { $copyPasta[33mâ��[31m }[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
21:00 timotimo that's how you know that you're making an impact on the world
21:00 GlitchMr r: sub a($CopyPastam) { my $CopyPasta = $CopyPastam; $copyPasta }
21:00 timotimo ah, that doesn't work yet?
21:00 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$copyPasta' is not declared. Did you mean '$CopyPasta'?â�¤at /tmp/J1qsScxR9U:1â�¤------> [32m my $CopyPasta = $CopyPastam; $copyPasta[33mâ��[31m }[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
21:00 GlitchMr timotimo: However, I would like the sub a($CopyPasta) { $copyPasta } to work.
21:00 GlitchMr For some reason, your code doesn't see function arguments.
21:00 timotimo yup, ditto
21:01 timotimo maybe because they're incomplete at that time?
21:01 nnunley joined #perl6
21:04 timotimo r: sub foo(--> Strnig) { "a" }
21:04 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/eT5GuJA09q:1â�¤------> [32msub foo(--> [33mâ��[31mStrnig) { "a" }[0mâ�¤    expecting any of:â�¤        statement listâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤        new name to be definedâ�¤Â»â€¦
21:04 timotimo that still needs to be fixed, too. i'll do that first
21:05 * jnthn is home :)
21:05 jnthn evening o/
21:05 nwc10 yay!
21:05 moritz \o jnthn
21:05 jnthn hi moritz :)
21:06 jnthn timotimo: fwiw, I think the undeclared type thing you're looking at may be best handled through the MYSTERY mechanism.
21:08 timotimo jnthn: excuse me, which one exactly?
21:09 jnthn I only implemented it, not remembered where it went :P
21:09 timotimo i meant to ask, which undeclared type thing was i looking at?
21:09 jnthn ah, yeah, search for %*MYSTERY
21:10 timotimo i've seen MYSTERY, i've enhanced it with suggestion code, too ;)
21:10 jnthn the "my Foo $x" one, I thought?
21:10 timotimo ah, yeah i could certainly do that
21:10 timotimo especially since it doesn't die instantly
21:10 jnthn Yeah, for those things we can afford to just be sorry rather than panic :)
21:13 * jnthn wonders why masak is so hysterical in rakudobugs these days :/
21:13 masak I AM!?!?!
21:13 jnthn "omgz it's 2013 and X broke!"
21:13 jnthn "state variables are seriously broken 'cus a weird edge case doesn't work!"
21:14 masak yes, let's rename that one.
21:14 timotimo jnthn: what 'ctx' parameter should i pass? :\
21:14 jnthn lemme remember what ctx is :)
21:14 timotimo :D
21:14 timotimo sometimes 'termish', sometimes 'var'
21:15 jnthn yeah
21:16 masak jnthn: it's now "[BUG] 'state' with anonymous scalars works more like 'my' in Rakudo"
21:16 masak jnthn: thank you for your feedback. I'll try to be less alarmist next time something regresses in Rakudo.
21:16 jnthn masak: I suspect it may be a one line fix or so
21:16 timotimo is it only a use/declare distinction or something? to find out if the thing was post-declared?
21:16 jnthn timotimo: I don't actually see it being used.
21:17 timotimo that's right.
21:17 jnthn Yeah, it looks unused to me. OK, next qestion...I copied it from STD, so what does STD use it for :)
21:17 jnthn masak: Typically they mean "we're missing a test"
21:18 jnthn timotimo: oh...
21:18 jnthn timotimo: It's used in an error message we didn't implement yet.
21:18 jnthn see infix:lambda in STD
21:19 jnthn timotimo: The only think it cares about is whether it's ( or not :)
21:19 jnthn Anyway, put the rule name in :)
21:19 jnthn (scoped or so)
21:19 timotimo OK
21:19 jnthn *thing
21:19 timotimo well, this time it's in a sub-rule, i made a token typo_typename
21:20 jnthn timotimo: Is there a reason to do that and not the way STD does it, ooc?
21:20 jnthn Looking at STD though, it doesn't use mystery for it.
21:21 jnthn But it does call sorry
21:22 timotimo er, dunno
21:22 timotimo hm, throwing a X::Undeclared is worse than a sorry, right?
21:22 jnthn std: my OMGBBQ $x;
21:22 p6eval std 7deb9d7: OUTPUT«[31m===[0mSORRY![31m===[0m�In my declaration, typename 'OMGBBQ' must be predeclared (or marked as declarative with :: prefix) at /tmp/P_V9hlirtc line 1:�------> [32mmy OMGBBQ[33m�[31m $x;[0m�Malformed my at /tmp/P_V9hlirtc line 1:�------> [32mmy [33m�[31mO…
21:22 jnthn timotimo: I'd rather not use $*W.throw directly, use .typed_sorry or so.
21:22 timotimo right, sorry spits out an error, but continues parsing, isn't that right?
21:23 jnthn Yes, but it's still fatal.
21:23 jnthn That is, we keep parsing.
21:23 timotimo i could surely do that. first i'll test if my use of the mystery mechanism was correct
21:23 jnthn But we don't consider the program OK.
21:23 jnthn If we panic we report the sorrows up to that point
21:24 jnthn And if not we panic with the sorrows :)
21:24 japhb_ There's something very poetic about those last two statements, jnthn
21:26 PerlJam japhb_: it reminded me of Metallica's  "Harvester of Sorrow"
21:26 jnthn japhb_: https://github.com/rakudo/rakudo/b​lob/nom/src/Perl6/Grammar.pm#L727 :)
21:26 swarles joined #perl6
21:26 swarles LoL±  ?
21:26 swarles what is that feature?
21:26 japhb_ Oooh, Metallica.  I may have to listen to Map of Metal today
21:26 swarles I would hope it's not "laughing out loud"
21:26 jnthn List of List
21:26 japhb_ swarles, List of Lists
21:27 swarles ah. So like, [[1,2,3],[1,2,3],[1,2,3]]?
21:27 japhb_ $*SORRY_LIMIT ... # when sorrow turns to panic
21:27 japhb_ very nice
21:27 swarles And dare I ask what a shaped array is?
21:28 japhb_ swarles, when you know the size of every dimension
21:28 swarles Oh.
21:28 japhb_ Er, to a first approximation
21:28 swarles Is that just an optimization thing?
21:28 swarles Like, a tuple in a way. Just with variable size?
21:28 swarles Err, not variable
21:28 swarles Variable in the sense of the prefix to that word changes
21:29 japhb_ "multi-dimensional"?
21:29 PerlJam swarles: my int @foo[42];   # shaped to suit the universe
21:29 swarles ah
21:29 swarles That makes sense.
21:29 timotimo jnthn: the mystery mechanism doesn't seem to have worked, at least not the way i tried it
21:30 jnthn timotimo: Yeah, now I see that STD already handles it with sorry, I think we stick with an approach like that. :)
21:30 PerlJam timotimo: maybe you need to call in Shaggy and Scooby?
21:30 japhb_ swarles, search for 'shaped' in the specs.  :-)
21:30 timotimo :)
21:31 swarles Yeah, I found the spec page. I'm pretty sure I understand it now
21:32 japhb_ swarles, I recommend cloning the specs repo and using 'git grep' for great justice.
21:32 swarles Impressive, rakudo seems a lot closer to complete implementation than the last time i checked if my memory served (Probably doesn't)
21:32 swarles Oh right, that's what I was doing
21:32 * swarles goes back to setting up gentoo in vmware
21:32 japhb_ <mr_burns>Excellent ...</mr_burns>
21:33 swarles I lost track of time goofing off while stage-3 was extracting
21:35 swarles -O2 -pipe -fomit-frame-pointer -march=native ... am I missing anything?
21:36 masak japhb_: you're not supposed to use tags with style information. :P
21:37 * masak ponders the semantic way of doing that
21:39 timotimo i'm having trouble using typed_sorry :|
21:39 [Coke] <i data-voice="Mr. Burns">Excellent &hellip;</i>
21:39 timotimo i get a null pmc access in invoke() again when i use it. i'll revert to $*W.throw for the time being
21:40 timotimo [Coke]: the i tag isn't better, try <emph>
21:41 [Coke] timotimo: I will yield to practicality on that one, being able to use a one char tag.
21:42 masak [Coke]++ # semantic
21:43 * swarles waits for portage to update
21:45 benabik_ joined #perl6
21:45 * timotimo makes a clean build and spectests again
21:49 kivutar joined #perl6
21:59 fgomez joined #perl6
22:10 jnthn Hm, why does Rakudo spectest take so long these days...
22:11 cog r:  my  ($abe, $ba, $abc); $abd
22:11 p6eval rakudo 6b0cea: OUTPUT«===SORRY!===␤elements() not implemented in class 'Array'␤»
22:11 jnthn wtf
22:11 cog :)
22:11 jnthn r: $abd
22:11 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$abd' is not declaredâ�¤at /tmp/z9dcbwFIBG:1â�¤------> [32m$abd[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
22:11 jnthn r: my $abc; $abd
22:11 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '$abd' is not declared. Did you mean '$abc'?â�¤at /tmp/f4G3CuM6e1:1â�¤------> [32mmy $abc; $abd[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
22:12 * masak submits rakudobug
22:12 jnthn r: my $abc; my $abe; $abd
22:12 p6eval rakudo 6b0cea: OUTPUT«===SORRY!===␤elements() not implemented in class 'Array'␤»
22:12 jnthn *sigh*
22:12 cog problem is with many approximate candidates with the levenstein distance
22:12 cog nice code btw. :)
22:12 masak cog++
22:13 timotimo jnthn: my suggestion code breaking?
22:13 jnthn The rule is simple. If you're writing Perl 6 code and refer to something with an @, NEVER use nqp:: stuff on it!
22:13 timotimo since i'm at it right now anyway, ...
22:13 jnthn timotimo: I think so.
22:14 timotimo works locally, so when my branch gets pushed to the next time, i'll send the pull-request
22:14 jnthn OK
22:14 timotimo spectesting at this precise moment
22:15 timotimo r: Whaetver.new(); # fixed this locally, too
22:15 p6eval rakudo 6b0cea: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared name:â�¤    Whaetver used at line 1â�¤â�¤Â»
22:15 timotimo (fixed == added suggestions)
22:16 jnthn We only ever invoke the levenstein to generate errors, yes?
22:16 timotimo yes, that's right
22:16 jnthn OK
22:16 timotimo sigh, test failure
22:16 jnthn I need to figure out where the performance regression has come from...
22:17 jnthn spectest taking 30-40 seconds longer is a problem.
22:18 timotimo got rid of the last failure.
22:23 timotimo the pull request is up in case someone wants to review it
22:24 jnthn timotimo: oh, weird
22:24 jnthn https://github.com/timo/rakudo/commit/9​a889fdda2ecaa8058694cecf64fd53e10ad637a
22:24 jnthn We have:
22:24 jnthn $/.CURSOR.sorry("In \"$*SCOPE\" declaration, typename $t must be predeclared
22:24 jnthn ...
22:25 jnthn That should be catching the error you've added handling for
22:25 timotimo yes, i wasn't sure why i didn't see that particular error at all
22:25 jnthn I'd rather that was figured out before merging this
22:26 timotimo ah, because it's missing the <.ws> at the beginning i bet
22:26 timotimo i'll try that
22:26 jnthn OK, we don't need both.
22:26 jnthn And your suggest-y handling is nicer :)
22:26 timotimo do you prefer mine? :)
22:26 jnthn Kinda
22:26 jnthn The suggestions are good
22:26 raiph joined #perl6
22:26 jnthn But I don't like it using $*W.throw
22:26 timotimo should i add a <?before [A..Z]> for mine, too?
22:27 jnthn Yes, it's a good heuristic.
22:27 timotimo can you see how to properly throw a sorry using not $*W.throw?
22:27 jnthn $/.CURSOR.typed_sorry should be possible instead of $*W.throw
22:27 timotimo i tried self.typed_sorry, but that didn't work at all
22:27 timotimo right, i'll try that
22:27 jnthn sorry doesn't throw immediately
22:28 jnthn It tries to parse a bit further
22:28 jnthn Which can help us find other errors and tell the user about them together.
22:29 timotimo yes, adding the <.ws> indeed makes that sorry happen
22:30 jnthn OK :)
22:30 timotimo should i add a <!>, too?
22:30 jnthn 275278 doesn't have the performance regression
22:30 ifim gklew
22:30 jnthn timotimo: yes, plesae. Please try and keep us close to STD.
22:31 jnthn timotimo: Being 100% matching with STD isn't a goal, but we should try and get the same parse that it does.
22:34 timotimo wow, that was unhelpful
22:34 timotimo immediately after the suggestion, it falls back into the "malformed my" error
22:34 timotimo i wonder if it would continue a lot, though?
22:36 jnthn std: my OMG $x;
22:36 p6eval std 7deb9d7: OUTPUT«[31m===[0mSORRY![31m===[0m�In my declaration, typename 'OMG' must be predeclared (or marked as declarative with :: prefix) at /tmp/j1PRILbzCm line 1:�------> [32mmy OMG[33m�[31m $x;[0m�Malformed my at /tmp/j1PRILbzCm line 1:�------> [32mmy [33m�[31mOMG $x;…
22:36 timotimo the new commit is there
22:36 jnthn timotimo: That's what STD does.
22:36 timotimo that's what rakudo does, now, too
22:36 * timotimo runs spectests just to be extra sure
22:37 jnthn Thanks :)
22:38 timotimo sure, no worries (or sorrows or panics)
22:41 timotimo did you check what test exactly takes longer? has S32-io/IO-Socket-Inet always been this slow?
22:42 jnthn timotimo: My current hypothesis is that it's not the tests but a change in Rakudo
22:42 jnthn (making all tests run a bit slower and thus the total time longer)
22:42 timotimo mhm
22:43 jnthn I'm curerntly trying to figure out if the repr compose stuff I changed is something to do with it.
22:43 jnthn If it is, then I'm gonna be rather surprised.
22:43 jnthn Will have the numbers on that soon
22:44 * [Coke] wonders if he should think about trying to capture test run times in the daily roast run.
22:45 * [Coke] imagines that's less than helpful, as both tests and impls are changing.
22:45 * [Coke] heads home
22:46 jnthn Hm, doesn't seem it was that
22:50 timotimo jnthn: the spectest succeeded without errors. i'll push new spectests after the pull request has been merged
22:57 jnthn [ '-->' <.ws> <typename> || '-->' <.ws> <typo_typename> ]?
22:57 jnthn I'm wondering if that shouldn't be
22:57 jnthn [ '-->' <.ws> [ <typename> || <typo_typename> ] ]?
22:58 timotimo i can easily change that. shouldn't make a difference
22:58 jnthn I guess it's equivalent...
22:58 timotimo if you want, i'll change it, test it quickly and commit again
22:59 jnthn Don't worry about it, I think it'll be OK
22:59 timotimo OK :)
22:59 jnthn I mean, feel free to do it but it won't stop me merging this unless I find anything else wrong...
22:59 dalek rakudo/nom: 014f8ca | (Timo Paulssen)++ | src/core/Exception.pm:
22:59 dalek rakudo/nom: use @.suggestions.join instead of nqp::join.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/014f8ca25a
22:59 dalek rakudo/nom: 9a889fd | (Timo Paulssen)++ | src/Perl6/Grammar.pm:
22:59 dalek rakudo/nom: add a token typo_typename and use it in "my" declarations.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9a889fdda2
22:59 dalek rakudo/nom: 0ceef80 | (Timo Paulssen)++ | src/Perl6/Grammar.pm:
22:59 dalek rakudo/nom: throw the sorry anyway, since we did match a longname.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0ceef80c89
22:59 dalek rakudo/nom: b97fb88 | (Timo Paulssen)++ | src/Perl6/Grammar.pm:
22:59 dalek rakudo/nom: suggest names for --> Unknown, too.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b97fb88ecb
22:59 dalek rakudo/nom: 25d87ef | (Timo Paulssen)++ | src/ (2 files):
22:59 dalek rakudo/nom: suggest Types, too for Undeclared::Symbols.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/25d87ef49c
22:59 dalek rakudo/nom: 0ae1e8d | (Timo Paulssen)++ | src/Perl6/Grammar.pm:
22:59 dalek rakudo/nom: throw a sorry instead of an exception, remove old error.
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0ae1e8d5f0
22:59 dalek rakudo/nom: 1553b11 | jonathan++ | src/ (2 files):
22:59 dalek rakudo/nom: Merge pull request #100 from timo/typename_suggestions
22:59 dalek rakudo/nom:
22:59 dalek rakudo/nom: Typename suggestions: in signatures, declarations, return types, ...
22:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1553b11cb9
23:00 timotimo heh, spammmmm :)
23:00 timotimo thank you
23:00 timotimo here's the corresponding spectests
23:00 jnthn thanks for working on this :)
23:00 dalek roast: 73618a5 | (Timo Paulssen)++ | S32-exceptions/misc.t:
23:00 dalek roast: "my cool $a" -> X::Undeclared + suggestions
23:00 dalek roast: review: https://github.com/perl6/roast/commit/73618a57ae
23:00 dalek roast: cc878f5 | (Timo Paulssen)++ | S32-exceptions/misc.t:
23:00 dalek roast: check for Type suggestions in Undeclared::Symbols.
23:00 dalek roast: review: https://github.com/perl6/roast/commit/cc878f5b44
23:00 dalek roast: b059711 | (Timo Paulssen)++ | S32-exceptions/misc.t:
23:00 dalek roast: undeclared types in my are now Come::Group.
23:00 dalek roast: review: https://github.com/perl6/roast/commit/b0597114b8
23:01 timotimo hm, it would be nice if someone put more LHF into LHF.markdown, or give it a general work-over. the lines are from 2011-06 through 2011-07
23:02 timotimo (although i don't very much care for the contents of that file)
23:04 jnthn OK, b49cbe0 lacks the performance regression also
23:06 kshannon joined #perl6
23:07 timotimo huh, only commits from me remain :|
23:07 timotimo or the nqp version bump perhaps
23:07 jnthn oh, I've done all the tests against nqp master
23:08 timotimo huh, strange.
23:08 jnthn I'm wondering if somehow my system was highly loaded when I did the first test with some unkown process
23:11 timotimo can i specifically refer to things from the setting? like a fully qualified name?
23:11 jnthn CORE::
23:11 jnthn Or SETTING::
23:11 jnthn Depending on how you define setting
23:12 timotimo ah, indeed.
23:12 timotimo i probably mean CORE, i think.
23:13 jnthn It's starting to look like my extra-long spectest run was bogus. :(
23:13 jnthn Well, :) in the sense we don't have a big performance regression though...
23:13 jnthn There's only two of your commits and neither of them looks like it could possibly be to blame.
23:13 timotimo those are the best kind of problems ;)
23:14 timotimo so, i'm trying to get the optimiser to improve junctions where all values are known at compile time and i'm trying to identify if the | or ~ that's in use at that point is the one from CORE. i suppose find_lexical("CORE") was a foolish idea - what do i do instead?
23:16 jnthn "~"? Did you mean "&"?
23:16 timotimo er, yes
23:16 jnthn phew :)
23:16 timotimo or sometimes ^
23:17 cognominal joined #perl6
23:18 timotimo the qast that rakudo spits out when i write just CORE::infix<|>(1, 2, 3) is somewhat unhelpful somehow :|
23:18 jnthn yes, I was just trying to figure out what we compile those forms too... :)
23:19 timotimo :D
23:19 timotimo glad to see i'm not the only one who's confused
23:19 timotimo apparently it creates a new PseudoStash and looks it up in there? that's strange to me.
23:19 jnthn ah, yeah
23:20 jnthn Yeah, it makes sense. But it's not so helpful in the optimizer.
23:20 jnthn Though you can potentially do it.
23:20 jnthn find the PseudoPackage symbol
23:20 jnthn oh wait
23:21 jnthn That won't work at all :)
23:21 timotimo it's good i didn't even try yet! :)
23:21 * masak .oO( "Find the PseudoPackage symbol". boringest family game of 2012 )
23:21 timotimo masak: for long car rides? :)
23:21 masak "are we pseudo-there yet?"
23:22 jnthn masak: tbh, pin that tail on the cons cell wasn't much more interesting...
23:22 masak :D
23:23 timotimo :D
23:23 masak though even that was better than "replace the return trip with a continuation".
23:24 jnthn timotimo: oh, I know
23:24 jnthn timotimo: The CORE setting context has a magical lexical called "!CORE_MARKER" installed in it.
23:24 timotimo ooooh
23:24 jnthn timotimo: So if you find the QAST::Block with that in, then you can look at the &infix:<&> inside of that block.
23:24 timotimo great!
23:24 jnthn timotimo: Or you can write an "is_core_symbole"
23:25 jnthn Which tries to find it, then checks the block it finds it in also has that marker.
23:25 timotimo if i may, i'll enhance find_lexical with a :$must-be-core?
23:26 jnthn timotimo: I think that may be more confusing :)
23:26 timotimo hm, ok
23:26 jnthn Just 'cus you *can* re-use code more doesn't always make it a good idea :)
23:28 masak +1
23:29 masak you want to braid code paths and responsibilities together, most of the time.
23:30 masak of course, responsibilities keep changing with the design, so doing this right requires having perfect knowledge of the future.
23:30 jnthn braids are awesome
23:30 masak "dude, you had me at 'braids'"
23:30 jnthn :P
23:30 timotimo found the core! :)
23:31 * masak .oO( zombie jnthn goes "braaaaaaaids" )
23:31 jnthn yay :)
23:31 jnthn :P
23:31 masak 'night, #perl6
23:31 japhb_ He doesn't eat your brains, he ties them in corn rows?
23:31 japhb_ o/ masak
23:32 jnthn OK, my performance regression test results were bogus
23:32 jnthn phew
23:33 * timotimo phews, too
23:33 * swarles swehp
23:39 timotimo mhhh tree-splicing
23:39 timotimo don't quite know how to handle this properly in the code
23:40 fhelmberger joined #perl6
23:41 timotimo i wonder if throwing an exception is a good idea? :|
23:41 timotimo using exceptions for control flow is ... o_O
23:42 jnthn Well, the reason I said make it a is_core_symbol is so you can use it to check if it is one
23:42 timotimo i could put a closure into a dynamically scoped variable that does what's necessary at the right level. that sounds like a crazy hack
23:42 timotimo oh, i wasn't being clear at all
23:42 jnthn So you can write like if ...the qast looks right... && is_core_symbol('&infix:<|>') or so
23:42 timotimo the thing is, i need to look two nodes down the tree for a &infix<|> for instance
23:43 jnthn What are you trying to transform?
23:43 jnthn You can use indexing to look at children.
23:43 timotimo i can't look at parents, though, which would be more helpful
23:43 jnthn What are you trying to transform?
23:44 jnthn if $x == 1 | 2 style things?
23:44 timotimo yes
23:44 timotimo something like Op(if){ Op(chain ==){ Op(infix:<|>) { 1, 2, 3 }, 5 } } into Op(if){ Op(infix<||>) { ... } }
23:45 jnthn OK
23:45 timotimo looking two nodes deep for each Op i encounter seems like a big waste of time
23:45 jnthn You need to be really careful because if you just do the naive thing, you evaluate the $x twice.
23:45 timotimo ah, that's a good point.
23:46 jnthn OK, but you know what only if and unless with a chain immediately below are interesting.
23:46 timotimo hm, nothing else?
23:46 jnthn And you can use a hash to check the name of the chain is something interesting.
23:46 jnthn Well, it's better to start small.
23:46 timotimo suret
23:46 timotimo eeeeenh, my typing has been better :|
23:47 jnthn In fact, I guess any chaining thing is probably interesting.
23:47 jnthn I'd do it by looking down, though.
23:47 timotimo OK
23:47 jnthn Rather than trying to keep context around
23:47 jnthn Trouble with keeping a dynamic around is you gotta reset it somewhere.
23:48 jnthn And exceptions will be more costly too.
23:48 timotimo OK
23:48 jnthn nqp::istype($node, QAST::Op) is pretty cheap
23:48 jnthn So it's almsot certainly the cheapest way.
23:48 jnthn And safest.
23:48 jnthn Inlining just goes of "is it a call op"
23:48 jnthn *off
23:49 jnthn The thing that will make it tricky is that for
23:49 jnthn if $x == 1|2 { }
23:49 jnthn You can't just duplicate the node that looks up $x
23:49 jnthn Sicne it may be
23:49 jnthn if foo() == 1|2 { }
23:49 jnthn And you'd do the side-effects of foo twice.
23:49 timotimo yes
23:49 timotimo is that so very tricky?
23:49 jnthn So you'll need to evaluate it and bind it into a temporary (a QAST::Var with local scope)
23:50 timotimo that's what i figured
23:50 jnthn It's not tricky to deal with.
23:50 jnthn The main problem with working on the optimizer is knowing what you can get away with, tbh :)
23:50 jnthn It's easy to be faster and wronger ;)
23:50 timotimo hehe, yes indeed
23:50 jnthn I think this is a pretty safe transformation overall.
23:50 timotimo is there something like nqp::startswith?
23:51 jnthn No
23:51 timotimo (i've also checked the timings some time ago, it would also be very worthwhile)
23:51 timotimo so i'll do substr(...) == 0?
23:51 jnthn For which bit?
23:51 timotimo that the op name starts with "chain"
23:51 jnthn Oh
23:51 jnthn No, it doesn't start with
23:51 jnthn .op eq 'chain'
23:51 timotimo oh, that easy?
23:51 jnthn Yeah
23:52 jnthn .name is where the name of the chained thing is stored.
23:52 timotimo good to know
23:53 jnthn oh...
23:53 jnthn Hm.
23:53 jnthn no, you're fine
23:54 jnthn There is the slight issue that your optimization may be "beaten"
23:54 jnthn no, it won't be.
23:54 jnthn Ignore me :)
23:54 jnthn $a == $b *can* be inlined
23:54 jnthn *but* not for the Junction variant
23:54 timotimo pardon?
23:54 jnthn So provided you put your stuff after that load of inlining code you're good.
23:54 jnthn see visit_op
23:55 jnthn (which is where in Optimizer you'd need to add code)
23:55 jnthn Of note, around 140
23:55 timotimo ah, the chain will be changed into a non-chain?
23:55 jnthn Kinda
23:56 jnthn It is detecting if it's simple enough to potentially do an inlining optimization.
23:56 jnthn my int $a = 42; if $a == 42 { }
23:56 jnthn In that case it will inline the ==
23:57 timotimo inlined in what way? the chain gets turned into a call, yes?
23:57 jnthn No, it actually eliminates the call completely.
23:57 timotimo oh, ok
23:57 jnthn Simple enough subs have their QAST saved with them
23:57 jnthn If we detect a call to something like that, we just shove the QAST directly in place of the call.
23:58 timotimo mhm, ok
23:58 jnthn We also resolve some multiple dispatches statically
23:58 jnthn Anyway, in the junction case that does not happen.
23:58 jnthn You *may* find that the inline code is eating your lunch though...
23:58 timotimo a chain op can have as many children as it wants, right?
23:59 jnthn No
23:59 jnthn Two
23:59 jnthn But it processes other children that are chains specially
23:59 jnthn In QAST::Compiler
23:59 timotimo ah, and the second one may be a chain op again, if we have something like 1 == 1 == 1?
23:59 jnthn Right
23:59 timotimo OK.
23:59 jnthn You probably want to avoid doing anything with those cases.
23:59 jnthn The inliner doesn't dare touch them.

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

Perl 6 | Reference Documentation | Rakudo