Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-11-11

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:01 cognominal joined #perl6
00:03 kst joined #perl6
00:17 kst joined #perl6
00:24 masak people who write lexers: how much is the lexer allowed to carry state?
00:26 masak example: the issue of reserved words not being allowed after the dot in property lookup in JavaScript. seems that one could have been fixed by the lexer carrying enough state to figure out if it's after a dot or no. how kosher would such a solution be?
00:27 jnthn iirc, lex (as in, one half of lex and yacc) has states
00:27 masak ok.
00:27 jnthn And a token is parsed conditional on being in a state or something...
00:27 jnthn It's been some years... :P
00:29 masak as I see it, there's not a big leap from carrying such state to doing "contextual lexing", and re-inventing sublanguages within the lexer.
00:31 LucyintheSky joined #perl6
00:31 LucyintheSky left #perl6
00:36 sorear masak! \o/
00:36 masak sorear! \o/
00:36 sorear masak: it's quite traditional for lexers to do things they really shouldn't.
00:36 masak hehe.
00:37 sorear so don't feel too bad about it.
00:37 masak sorear: I'm asking because I'm designing a small language right now.
00:37 huf how is this different from *?
00:37 masak so all these things come up as things to consider.
00:37 huf :)
00:38 masak huf: I dunno. I try not to put so much crap into it. in some ways it's a small, clean version of Perl 6.
00:38 masak in other ways not.
00:38 huf i mean, "it's quite traditional for * to do things it really shouldnt"
00:38 huf that's basically a given
00:38 huf for any *
00:39 masak I'm still undecided on whether to separate lexing and parsing from each other.
00:39 huf masak: isnt nqp also a small clean version of p6?
00:39 masak it's more of a subset of p6 than my language.
00:40 huf ah, you'er more daring!
00:40 masak mine keeps some ideas of p6, and rejects others.
00:40 huf so a second second-system? :D
00:40 masak :)
00:40 masak also, it's not ready for public viewing yet, so I'll shut up and go back to designing it. :)
00:43 huf what's the worst that could happen? people will declare it dead before they know anything about it? :)
00:43 huf been done before ... :)
00:44 jnthn 'night o/
00:44 masak 'night, jnthn.
00:44 masak I feel I'm slowly getting into the language implementation business, so this will be a nice first language to try to implement from scratch to completion.
00:45 masak also, I have another language I want to design, but I'm not ready for that yet. need to practice on this one ;)
00:50 huf your "slowly" is a bit puzzling
00:50 huf havent you been part of the core perl6 group for years now?
00:52 masak somehow I make a distinction between that work and holding all the strings myself.
00:53 masak in my opinion, anyone who touches Perl 6 is a Perl 6 language designer. most just don't realize that potential ;)
00:53 huf :)
01:09 kst joined #perl6
01:23 kst joined #perl6
01:32 Chillance joined #perl6
01:47 masak "If you are liberal in what you accept, others will utterly fail to be conservative in what they send." -- Eich's Law
01:48 geekosaur .oO { that would be one way to characterize the Eich, yes... }
01:51 masak 'night, #perl6
01:52 japhb o/
02:19 kst joined #perl6
02:19 japhb It occurs to me that a program does not need to make liberal treatment *free*.  An RPC server might choose to respond more quickly to strictly compliant clients, either by simply giving them priority queuing or artificially delaying response to non-compliant inputs.  Paid services might even offer a discount or higher quotas for strictly compliant clients.
02:20 mikemol joined #perl6
02:21 pattayara joined #perl6
02:21 woosley joined #perl6
02:24 pattayara left #perl6
02:24 sorear japhb: The USPS does that, sort of.
02:28 kst joined #perl6
02:32 dross joined #perl6
02:42 diakopter yeah, address handwriting that isn't machine legible is slowed down by needing human reading
02:43 diakopter ENONCOMPLIANTHANDWRITING
02:45 bapa joined #perl6
02:49 sorear but you get discounts on (bulk) mailing if you pre-barcode your mail so that nobody has to read it
02:52 dross left #perl6
02:58 sizz joined #perl6
03:02 orafu joined #perl6
03:18 PerlJam joined #perl6
03:19 kst joined #perl6
03:32 telex joined #perl6
03:48 clkao_ joined #perl6
03:58 benabik joined #perl6
03:59 orafu joined #perl6
04:22 japhb sorear, Ah yes, a real world example, thank you.
04:23 japhb diakopter, Oddly enough I once had a summer job reading scanned handwritten addresses and typing in the correct data to train banks of machines designed to automatically sort handwritten envelopes.
04:26 japhb Thankfully the training envelopes were taken in batches from particular post offices, and I happened to own a programmable keyboard -- so I could program the keyboard to do the common forms for the last line of the addresses and save a BUNCH of typing.  :-)
04:29 kst joined #perl6
04:38 wk joined #perl6
04:42 colomon joined #perl6
04:51 lorn joined #perl6
04:59 kst joined #perl6
05:16 kst joined #perl6
05:32 telex joined #perl6
05:36 kst joined #perl6
05:54 fgomez joined #perl6
05:57 tokuhiro_ joined #perl6
06:24 kaare_ joined #perl6
06:40 Timbus No such method 'candidates_matching' for invocant of type 'Method' <- err, jnthn, your black magic patch to my IRC module has stopped being so magical
06:41 Timbus $multi.candidates_matching($mod, $event)>>.($mod, $event);  #this line here.
06:47 japhb Timbus, that method has been changed to can_do
06:48 Timbus excellent
06:48 japhb There's a relatively recent diff to src/core/Main.pm where you can see the change (from the point of view of a caller)
06:49 Timbus you lied to me D:
06:49 Timbus No such method 'can_do' for invocant of type 'Method'
06:49 Timbus is it to be called in some other way
06:50 japhb I'm sorry, no underscore, just cando ... and it wants a capture as it's argument.
06:50 japhb my @matching_candidates = $m.cando(Capture.new(list => $p, hash => $n);
06:50 japhb er ... ));
06:51 japhb That's the line from src/core/Main.pm
06:51 Timbus ah
06:51 Timbus i really shouldnt be relying on this :/
06:52 japhb Timbus, well now instead of it being a speculative routine, it is now a spec'ed routine.  :-)
06:52 Timbus oh good
06:54 japhb Ah, here it is: commit da339d2626
06:57 Timbus thanks a bunch!
06:58 japhb np
07:21 SamuraiJack joined #perl6
07:41 domidumont joined #perl6
08:00 domidumont joined #perl6
08:01 robinsmidsrod joined #perl6
08:10 tokuhiro_ joined #perl6
08:12 jaffa4 joined #perl6
08:14 tokuhiro_ joined #perl6
08:14 GlitchMr joined #perl6
08:20 jaffa4 hi
08:20 jaffa4 How would you call perl6 from perl 5?
08:21 diakopter like to do what
08:31 jaffa4 calling perl 6 subs from perl 5
08:32 diakopter is it possible?
08:42 sorear can be done using blizkost callbacks if the top-level is perl 6
08:42 sorear if you want to use a p5 top-level, it's needed to use one of the other implementations, maybe perlito's p5 backend
08:42 sorear doesParrot::Embed still work?
08:52 tokuhiro_ joined #perl6
09:04 fgomez joined #perl6
09:06 arnsholt_ joined #perl6
09:32 rjt_ joined #perl6
09:33 rjt_ Greetings p6
09:37 sorear Hello rjt_.
10:10 betterwo1ld r: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha> ** $0 }
10:10 p6eval rakudo 2c6a52: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 2, near " $0 }"␤»
10:10 betterwo1ld is there a way to make this work?
10:17 MayDaniel joined #perl6
10:18 sorear yes, use +% instead
10:19 sorear wait, no
10:19 sorear n: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha> ** {$0} }
10:19 p6eval niecza v22-19-gd874a8e: OUTPUT«Unhandled exception: Unable to resolve method niecza_quantifier_min in type Match␤  at /tmp/jGSQO9yygM line 1 (ANON @ 10) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2915 (Regex.ACCEPTS @ 10) ␤  at /tmp/jGSQO9yygM line 1 (mainline @ 3) ␤  at /home/p6ev…
10:19 sorear n: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha> ** {+$0} }
10:19 p6eval niecza v22-19-gd874a8e: OUTPUT«Match()␤»
10:20 sorear n: say '3 letters in foo' ~~ token { (<digit>+) " letters in " <alpha> ** {+$0} }
10:20 p6eval niecza v22-19-gd874a8e: OUTPUT«#<match from(0) to(16) text(3 letters in foo) pos([#<match from(0) to(1) text(3) pos([].list) named({"digit" => (#<match from(0) to(1) text(3) pos([].list) named({}.hash)>, ).list.item}.hash)>].list) named({"alpha" => (#<match from(13) to(14) text(f) pos([…
10:20 sorear hmm
10:20 sorear oh, it's expecting whitespace between the letters because of the space arund the quantifier
10:20 sorear n: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha>**{+$0} }
10:20 p6eval niecza v22-19-gd874a8e: OUTPUT«#<match from(0) to(16) text(3 letters in foo) pos([#<match from(0) to(1) text(3) pos([].list) named({"digit" => (#<match from(0) to(1) text(3) pos([].list) named({}.hash)>, ).list.item}.hash)>].list) named({"alpha" => (#<match from(13) to(14) text(f) pos([…
10:21 sorear \o/
10:21 sorear betterwo1ld, the original problem was lack of braces
10:21 betterwo1ld hm, ok thanks
10:21 betterwo1ld still, i cannot seem to make it work in rakudo
10:22 sorear r: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha>**{+$0} }
10:22 p6eval rakudo 2c6a52: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 2, near "{+$0} }"␤»
10:22 sorear I am not quite sure what's up here
10:22 sorear b: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha>**{+$0} }
10:22 p6eval b 922500: OUTPUT«3 letters in foo␤»
10:22 sorear alpha: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha>**{+$0} }
10:23 sorear seems you've found a nom regression
10:23 sorear those are rare these days!
10:23 grondilu joined #perl6
10:23 betterwo1ld lucky me ;)
10:24 betterwo1ld btw, rakudo does not mind the space around "**"
10:24 betterwo1ld r: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha> ** 3 }
10:24 p6eval rakudo 2c6a52: OUTPUT«「3 letters in foo」␤ 0 => 「3」␤  digit => 「3」␤ alpha => 「f」␤ alpha => 「o」␤ alpha => 「o」␤␤»
10:24 Woodi hmm, point for angry perl6 peoples becouse of few rewrites :)
10:25 grondilu I try to set a integer with command line:  my Int $n = @*ARGS[0]   and I get a Type Check assignment error
10:25 Woodi morning everyone :)
10:25 sorear grondilu: @*ARGS[0] isn't an integer, it's a string
10:25 grondilu Isn't it supposed to do the conversion?
10:25 sorear No
10:26 sorear Automatic conversion is only for arithmetic, not assignments
10:26 sorear 0 + @*ARGS[0] would convert
10:26 sorear or do it explicitly: @*ARGS[0].Int
10:32 betterwo1ld b: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha> ** $0 }
10:32 p6eval b 922500: OUTPUT«␤»
10:34 betterwo1ld b: say '3 letters in foo' ~~ rule { (<digit>+) "letters in" <alpha>**$0 }
10:34 p6eval b 922500: OUTPUT«␤»
10:42 spider-mario joined #perl6
10:44 isBEKaml joined #perl6
10:54 azawawi joined #perl6
10:54 azawawi hi
10:58 isBEKaml hello, azawawi
10:58 phenny isBEKaml: 08 Nov 15:34Z <[Coke]> tell isBEKaml that I'm using whatever is installed on feather.
10:59 isBEKaml phenny: tell [Coke] ok, nvm - I'm just about to give up on pugs+windows. :)
10:59 phenny isBEKaml: I'll pass that on when [Coke] is around.
11:04 birdwindupbird joined #perl6
11:20 xinming joined #perl6
11:40 rindolf joined #perl6
11:41 rjt_ Hey, question about meta operator performance. Given:
11:41 rjt_ sub postfix:<ɸ>(Int $a) {
11:41 rjt_ ([*] $a «%« (2,3,5,7)) ?? Nil !! $a;
11:41 rjt_ }
11:42 rjt_ say [+] (^1000)»ɸ;  takes close to 10 seconds on my machine.
11:42 rjt_ If I expand the body of the sub to ($a%2)*($a%3)*($a%5)*($a%7) ?? Nil !! $a; , it takes about 1/10th of that time.
11:43 rjt_ Is that expected, am I doing something wrong, or is that in the list of performance things that still need improvement?
11:43 rjt_ (Rakudo, fresh git pull)
11:44 masak the latter, I would guess.
11:45 rjt_ OK, that was my guess as well, but couldn't rule out programmer stupidity. :-)
11:47 snearch joined #perl6
11:56 masak no, it looks fine ;)
12:03 tadzik good morning #perl6
12:06 GlitchMr https://github.com/GlitchMr/glitchmr.github.com/commit/bb87e54e24cf963f53be2709dc7b0dd429278f7e
12:06 GlitchMr I really should check file names next time
12:16 snearch joined #perl6
12:34 rindolf tadzik: meow.
12:35 Psyche^ joined #perl6
12:37 isBEKaml joined #perl6
12:45 erkan joined #perl6
12:45 erkan joined #perl6
12:49 jnthn afternoon, #perl6
12:51 masak jnthn! \o/
12:53 rindolf jnthn: hi.
12:55 jaldhar_ joined #perl6
12:55 masak std: 1_0; 1__0;
12:55 p6eval std 04216b1: OUTPUT«[31m===[0mSORRY![31m===[0m�Only isolated underscores are allowed inside numbers at /tmp/HrAxMEEv2L line 1:�------> [32m1_0; 1[33m�[31m__0;[0m�Whitespace is required between alphanumeric tokens at /tmp/HrAxMEEv2L line 1:�------> [32m1_0; 1[33m�[31m__0;[0m�…
12:59 masak rn: say 2e0.^name
12:59 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«Num␤»
13:03 grondilu S/quit
13:03 isBEKaml rn: say 1e100.^name; #lazy?
13:03 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«Num␤»
13:05 jnthn 1e100 is a literal
13:05 masak lazy how?
13:05 jnthn It literally has no work to do, lazy or otherwise, at runtime :)
13:05 masak right.
13:05 jnthn .oO( see what I did there... )
13:07 isBEKaml too much beer makes bad puns. :P
13:08 isBEKaml Okay, I didn't think of it as a literal, but that it had to eval something before spitting output. Hence, the ^name;
13:08 masak jnthn: *groan*
13:10 isBEKaml Running it under the perl6 repl, took some delay when I did 1e100.^name; but returned instantly for 2.^name;
13:10 jnthn isBEKaml: Hey, I didn't have any beer yet today :P
13:10 tadzik isBEKaml: the first expression in the REPL is always slower, did you note that?
13:10 isBEKaml tadzik: gah!
13:10 nwc10 jnthn: I have! :-)
13:11 jnthn Oh noes, I'm behind! :P
13:11 isBEKaml jnthn: so we see a slower jnthn? :D
13:11 nwc10 jnthn: then we ran out. At least of beer that I like
13:11 jaldhar_ joined #perl6
13:11 jnthn Ohnoes
13:12 nwc10 (this isn't my house. *I* have a strategic beer reserve now. Just in case.)
13:12 nwc10 we're also onto the UHT milk here, so no more tea for me either...
13:12 * jnthn has plenty of nice stuff to hand, including a limited edition treacle porter...
13:13 isBEKaml tadzik: that caught me out! Thanks for reminding me (might need that again, sometime) :)
13:13 nwc10 oooh, that sounds interesting
13:13 jnthn oak aged too ;)
13:13 nwc10 The landlord of The Gunmakers (in London) told me who makes porter in these parts, but I've forgotten where he said. (Pesky beer festival)
13:13 nwc10 so I'm going to have to ask again, and *write it down*
13:14 isBEKaml hmm, we still have last; quitting the repl. :)
13:14 nwc10 Porter and cider seem to be the two obvious things that are hard to source.
13:14 tadzik I wonder how had would it be to write a non-parrot, user-levelish repl
13:14 tadzik bah, too many things I started doing and never finished
13:15 nwc10 (I have a strategic cider reserve too, but it will eventually run dry)
13:15 isBEKaml Hah! Too many things I had in mind, never committed to stuff.
13:16 nwc10 topic? What's that? :-)
13:17 jnthn isBEKaml: hah! Probably because the REPL sits in a while loop reading user input, the last is caught by the loop exception handler for that loop :D
13:17 isBEKaml jnthn: yeah, I know and I also remember quite a few of us surprised back when we brought in this repl. :)
13:18 masak nwc10: we don't really do the topic thing in here...
13:18 masak :)
13:18 masak (so don't worry)
13:18 jnthn isBEKaml: Well, I don't think the REPL implementation has changed much in a long while.
13:18 jnthn Aside from being ported from PIR to NQP at some point.
13:18 jnthn And even that didn't change the overall approach.
13:19 isBEKaml jnthn: speaking of nqp, how hard would it be write an nqp to jvm translator?
13:19 tadzik heh, grammars :)
13:19 jnthn isBEKaml: I've been looking at that a bit.
13:19 isBEKaml tadzik: well, that's only one from nqp side, right? I'm talking of direct bytecode translation to jvm.
13:20 tadzik ah
13:20 jnthn isBEKaml: It's fiddly in places.
13:20 jnthn Figuring out how to port 6model and have it efficient is one of the harder parts.
13:20 isBEKaml jnthn: Oh, I assume you're talking of the thing that was done with jasmin?
13:21 isBEKaml (before 6model came into force)
13:21 jnthn isBEKaml: No, just speaking more generally.
13:21 jnthn The C implementation of 6model used in Rakudo relies on being able to do something the JVM disallows.
13:21 jnthn (Passing around interior pointers)
13:22 jnthn Well, used in NQP too.
13:22 isBEKaml jnthn: I think we can work around that with JNI (No idea, have to check)
13:22 jnthn No, that's a bad answer.
13:22 jnthn Better to have the REPRs do runtime class generation.
13:23 isBEKaml jnthn: yeah, it can quickly get out of hand - too many fiddling quotients.
13:23 jnthn That way you work in terms of the primitives the JVM understands and knows how to optimize well.
13:23 isBEKaml jnthn: What do we use interior pointers for?
13:24 jnthn Any case where one representation is nested inside of another.
13:24 tokuhiro_ joined #perl6
13:24 jnthn Int is a P6opaque, but has a P6bigint nested inside of it, for example.
13:24 isBEKaml jnthn: hmm, in that case - like you said, we need to build direct representation on JVM side, using classes. But that leads to a large footprint, if we have too many nested levels.
13:25 isBEKaml jnthn: a case of class explosion.
13:25 jnthn isBEKaml: REPRs are orthogonal to the the type system, so you can do caching.
13:26 jnthn Also, P6opaque is allowed to re-order attributes within a class when it figures out the storage.
13:26 jnthn Which could get a higher hit rate.
13:27 masak nr: say 0e1 === -0e1
13:27 jnthn That is, a class Foo { has $!x; has $!y; has int $!z; } could potentially share generated class with a class Bar { has int $!a; has $!b; has $!c; }
13:27 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«True␤»
13:27 jnthn For classes with all object fields, the hit rate is even better.
13:29 isBEKaml hmm, doesn't that mean we have highly specific classes than more general ones. The only thing that comes to mind is Groovy's 22 param methods to represent tuples and Scala's Function0 to Function22.
13:29 isBEKaml (sorry, that first sentence was a question).
13:30 jnthn Well, all you're really doing is using JVM classes to mimic the memory layout computation done in C.
13:30 isBEKaml https://github.com/scala/scala/blob/master/src/library/scala/Function22.scala
13:31 jnthn omg
13:31 jnthn Yeah, I'm talking about generating these things *at bytecode level*, on demand.
13:32 jnthn Not hardcoding them up front.
13:33 isBEKaml jnthn: well, groovy had this sort of thing(not at bytecode level, but at source level) since they were supporting jdk1.4, which didn't have varargs(that came in jdk1.5)
13:33 jnthn Ah, I see.
13:34 jnthn But I'm not talking about argument passing here, just object layout.
13:34 isBEKaml jnthn: and scala, because jvm had certain limitations and they weren't using asm back in 2.7.x days. I'm fuzzy on this and I have to look around.
13:35 sunnavy joined #perl6
13:36 sunnavy joined #perl6
13:38 pmurias joined #perl6
13:44 masak std: 01234
13:44 p6eval std 04216b1: OUTPUT«Potential difficulties:â�¤  Leading 0 does not indicate octal in Perl 6; please use 0o1234 if you mean that at /tmp/5SbhDyqBcu line 1:â�¤------> [32m01234[33mâ��[31m<EOL>[0mâ�¤ok 00:00 41mâ�¤Â»
13:46 isBEKaml groovy had 250 param methods too. https://github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
13:46 isBEKaml *has
13:48 isBEKaml jnthn: sorry, I was a bit misled - there's no real limit on the number of params, but that it had to be made available at runtime. So, dynamic generation at runtime might be something to try out.
13:55 * masak .oO( where the heck are Perl 5 string literals detailed again? oh right, perldoc perlop )
13:55 masak rn: say "\b".ord
13:55 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«8␤»
14:08 bowtie joined #perl6
14:12 grondilu joined #perl6
14:14 pmurias isBEKaml: re porting nqp to jvm, I'm slowly porting nqp to javascript so nqp should be pluggable enough as it is now
14:15 grondilu rn:  enum Suit <♦ ♣ ♥ ♠>; say ♠;
14:15 p6eval rakudo 2c6a52: OUTPUT«===SORRY!===␤Confused␤at /tmp/BQmSSaLISz:1␤»
14:15 p6eval ..niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0m��Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/vsZf1dR5ZQ line 1:�------> [32menum Suit <♦ ♣ ♥ ♠>; say[33m�[31m ♠;[0m��Confused at /tmp/vsZf1dR5Z…
14:16 masak rn:  enum Suit <♦ ♣ ♥ ♠>; say Suit::.keys
14:16 p6eval rakudo 2c6a52: OUTPUT«♦ ♣ ♥ ♠␤»
14:16 p6eval ..niecza v22-19-gd874a8e: OUTPUT«0␤»
14:16 masak rn:  enum Suit <♦ ♣ ♥ ♠>; say Suit::<♠>
14:16 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«♠␤»
14:16 jnthn r: say '♠' ~~ /<alpha>/
14:16 p6eval rakudo 2c6a52: OUTPUT«#<failed match>␤»
14:16 isBEKaml pmurias: oh, that's great - It's all up in the clouds right now for me. ;)
14:17 isBEKaml (for lack of time and quick-to-run-away motivation)
14:19 grondilu isn't http://rosettacode.org/wiki/Playing_cards#Perl_6 broken or something?
14:22 isBEKaml|2 joined #perl6
14:23 pmurias CATCH doesn't catch null pmc access?
14:26 jnthn Pretty sure it does
14:27 jnthn nqp: { nqp::null().foo(); CATCH { say('caught') } }
14:27 p6eval nqp: OUTPUT«caught␤»
14:28 nyuszika7h joined #perl6
14:28 PacoAir joined #perl6
14:39 isBEKaml|2 left #perl6
14:40 isBEKaml joined #perl6
14:43 isBEKaml|2 joined #perl6
14:44 isBEKaml|2 left #perl6
14:44 grondilu nr:  class Foo { has Str $!bar; method gist { $!bar } }; say my Foo $x .= new: :bar("hi");
14:44 p6eval rakudo 2c6a52: OUTPUT«use of uninitialized variable $v of type Str in string context  in block  at /tmp/__hzMcCreL:1␤␤␤»
14:44 p6eval ..niecza v22-19-gd874a8e: OUTPUT«Potential difficulties:â�¤  $x is declared but not used at /tmp/dGcswWYIR1 line 1:â�¤------> [32mar; method gist { $!bar } }; say my Foo [33mâ��[31m$x .= new: :bar("hi");[0mâ�¤â�¤â�¤Â»
14:45 brrt joined #perl6
14:52 SamuraiJack joined #perl6
14:53 masak nr: sub hep(*@) { say "hep!" }; hep 1, 2, 3
14:53 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«hep!␤»
14:53 masak nr: sub hep(*@) { say "hep!" }; hep
14:54 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«hep!␤»
14:54 masak nr: sub hep(*@) { say "hep!" }; my $i = 5; hep while --$i
14:54 p6eval rakudo 2c6a52, niecza v22-19-gd874a8e: OUTPUT«hep!␤hep!␤hep!␤hep!␤»
14:57 GlitchMr perl6: my Array of Str %hash; %hash<a> = ["b"];
14:57 p6eval rakudo 2c6a52: OUTPUT«Type check failed in assignment to '$v'; expected 'Array+{TypedArray}' but got 'Array'␤  in block  at /tmp/91S41HGtpw:1␤␤»
14:57 p6eval ..niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Coercive declarations NYI at /tmp/oFkHPoh3io line 1:â�¤------> [32mmy Array of Str[33mâ��[31m %hash; %hash<a> = ["b"];[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5)…
14:57 GlitchMr perl6: my Positional of Str %hash; %hash<a> = ["b"];
14:57 p6eval rakudo 2c6a52: OUTPUT«Type check failed in assignment to '$v'; expected 'Positional' but got 'Array'␤  in block  at /tmp/LKZ2P_Hrik:1␤␤»
14:57 p6eval ..niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Coercive declarations NYI at /tmp/alkW2dlpQI line 1:â�¤------> [32mmy Positional of Str[33mâ��[31m %hash; %hash<a> = ["b"];[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die…
15:19 masak associativity is specified per precedence level in S03. and yet we specify them per operator when defining operators. there's a "hang on the wrong hook" in there somewhere.
15:20 GlitchMr I still end using more parens in Perl 6 than in Perl 5...
15:22 am0c joined #perl6
15:25 masak TimToady: S03:80: "(In standard Perl there are no unaries that can take advantage of associativity, since at each precedence level the standard operators are either consistently prefix or postfix.)"
15:25 masak TimToady: what about prefix:<++> and postfix:<++>?
15:25 masak std: my $a; ++$a++
15:25 p6eval std 04216b1: OUTPUT«[31m===[0mSORRY![31m===[0m�"++" and "++" are not associative at /tmp/BpSePrW0LZ line 1:�------> [32mmy $a; ++$a++[33m�[31m<EOL>[0m�"++" and "++" are not associative at /tmp/BpSePrW0LZ line 1:�------> [32mmy $a; ++$a++[33m�[31m<EOL>[0m�FAILED 00:00 42m�»…
15:26 masak given that the "Autoincrement" level has "N" associativity, the above STD output looks right to me.
15:26 masak but the paragraph in S03 seems wrong.
15:27 masak oh, I see now that S03 addresses the case of differing associativity on the same precedence level. so that's OK, I guess.
15:38 jkbbwr joined #perl6
15:38 jkbbwr Can someone here read kanji?
15:41 PacoAir_ joined #perl6
15:41 jkbbwr left #perl6
15:43 leont joined #perl6
15:44 masak you mean hanzi? :P
15:44 masak oh, ey left.
15:47 blue_ joined #perl6
15:52 pmurias jnthn: self can be a container in nqp?
15:52 pmurias jnthn: does it only happen when called from perl6 code?
15:56 PacoAir joined #perl6
15:59 Chillance joined #perl6
16:02 PacoAir joined #perl6
16:03 PacoAir joined #perl6
16:04 brrt left #perl6
16:04 jnthn pmurias: Yes
16:05 jnthn pmurias: Another option is to deal with it - as Rakudo does - when binding self, I guess.
16:05 jnthn That'd probably be better; not sure why it's not like that already.
16:07 PacoAir joined #perl6
16:09 PacoAir joined #perl6
16:22 cosimo_ joined #perl6
16:36 _jaldhar_ joined #perl6
16:51 cosimo hey!
16:51 tadzik hey hey
16:52 cosimo who's running the p6/std/niecza eval bots?
16:53 cosimo I'd like to know what was done to avoid things like system("rm -rf /") and such
16:54 cosimo p6eval: say system('whoami')
16:54 cosimo rakudo: say system('whoami')
16:54 p6eval rakudo 2c6a52: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&system' called (line 1)␤»
16:55 PacoAir joined #perl6
16:56 tadzik cosimo: https://github.com/rakudo/rakudo/blob/nom/src/RESTRICTED.setting
16:56 tadzik r: run "foo"
16:56 cosimo rakudo: say run('whoami')
16:56 p6eval rakudo 2c6a52: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting:2␤  in sub run at src/RESTRICTED.setting:8␤  in block  at /tmp/INOHx2vn81:1␤␤»
16:56 p6eval rakudo 2c6a52: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting:2␤  in sub run at src/RESTRICTED.setting:8␤  in block  at /tmp/taMuG9EpSS:1␤␤»
16:57 cosimo tadzik: how do I run in this restricted mode then?
16:57 tadzik cosimo: perl6 --setting=RESTRICTED I think
16:59 cosimo tadzik: excellent
16:59 jnthn Beware - it's not particularly strong protection.
16:59 cosimo where are the actual eval bots running?
17:00 tadzik r: say CORE::run('whoami')
17:00 p6eval rakudo 2c6a52: OUTPUT«No such method 'Any' for invocant of type 'Str'␤  in  at src/gen/BOOTSTRAP.pm:839␤  in any  at src/gen/BOOTSTRAP.pm:836␤  in block  at /tmp/WlmkCBDgOq:1␤␤»
17:00 tadzik whew :)
17:00 cosimo i mean, can I use these already running services with an API of some sort?
17:00 cosimo r: my $x = 'whoami' ;say CORE::run($x)
17:00 p6eval rakudo 2c6a52: OUTPUT«No such method 'Any' for invocant of type 'Str'␤  in  at src/gen/BOOTSTRAP.pm:839␤  in any  at src/gen/BOOTSTRAP.pm:836␤  in block  at /tmp/gdRpiky0hl:1␤␤»
17:00 tadzik cosimo: they run on feather1 I think, and are accessible on the irc
17:01 tadzik you can /msg them
17:01 tadzik there's an IRC bot which puts your code in a file and runs it
17:01 tadzik with some restrictions
17:07 Moukeddar joined #perl6
17:07 masak Moukeddar! \o/
17:08 Moukeddar hello there, i missed you :)
17:08 Moukeddar \o/
17:08 Moukeddar how are you doing ?
17:08 cosimo tadzik: do you know which bot is supposed to be running that? there's lots of stuff there
17:08 masak Moukeddar: I can only speak for myself. I'm doing well, thank you. :)
17:09 masak Moukeddar: hope you're doing well too.
17:09 Moukeddar things are looking up :D
17:11 tadzik cosimo: https://github.com/perl6/evalbot I think
17:11 masak rn: class Things { method looking-up { say self.^name ~ " are " ~ &?ROUTINE.name.subst("-", " ") } }; Things.looking-up
17:12 p6eval niecza v22-19-gd874a8e: OUTPUT«Things are Things.looking up␤»
17:12 p6eval ..rakudo 2c6a52: OUTPUT«Things are looking up␤»
17:14 masak ooh, a discrepancy.
17:14 cosimo r: say "Cosimo is testing"; sleep 10; say "Test done"
17:14 p6eval rakudo 2c6a52: OUTPUT«Cosimo is testing␤Test done␤»
17:16 masak cosimo! \o/
17:16 cosimo found :)
17:21 cosimo ideally, I could send an XHR request with some rakudo code to evaluate and I'd get back the result
17:21 cosimo ...
17:21 am0c_ joined #perl6
17:22 tadzik cosimo: are you reinventing try.rakudo.org? :)
17:22 tadzik (which doesn't function, I think)
17:22 cosimo tadzik: such a thing exists or not?
17:22 tadzik cosimo: code exists. Site did work
17:23 tadzik who had this on github, hm
17:24 tadzik https://github.com/moritz/try.rakudo.org
17:24 masak moritz++ # having things on github
17:25 masak folks, there's no one signed up for releasing Rakudo 2012-11-22!
17:26 masak I'll make a deal with you. someone take that date, and I'll take the 2012-12-20 date. how's that sound?
17:27 tadzik tuesday, eh?
17:28 tadzik I don't contribute enough recently, sign me up :)
17:28 jnthn 22nd is a Thursday
17:28 jnthn and, tadzik++
17:28 tadzik oh, thursday. That interferes with Thursday Beer
17:28 tadzik sign me up anyway :)
17:29 masak will do.
17:29 jnthn Thursday beer! That sounds good!
17:29 isBEKaml joined #perl6
17:30 dalek rakudo/nom: cb07076 | masak++ | docs/release_guide.pod:
17:30 dalek rakudo/nom: [docs/release_guide.pod] signed up tadzik and masak
17:30 dalek rakudo/nom:
17:30 dalek rakudo/nom: For November and December compiler releases, respectively.
17:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cb07076842
17:30 isBEKaml masak: 2012-12-20 -- special date, eh? :)
17:31 masak it is?
17:31 isBEKaml 2012 - (rev 2012)
17:32 isBEKaml sort of. :)
17:32 isBEKaml dd -MM - yyyy , reads like that. 20 - 12 - 2012
17:32 tadzik yeah
17:32 tadzik do the release on 20:12
17:33 masak oh, you international people with your non-ISO ymd orders... :)
17:33 isBEKaml 20-12-2012:20:12 UTC. done deal.
17:34 masak I could do that.
17:34 masak would probably fit quite well with my schedule, in fact.
17:37 isBEKaml masak++, tadzik++ ## release anchors.
17:39 am0c joined #perl6
17:40 masak I'd love for someone to sign up for January, too. laugh those ancient Mayans in the face.
17:41 isBEKaml lol. We are an ancient race, don't ever predict our downfall! :)
17:42 * isBEKaml meekly raises his hand
17:43 masak nice. shall I make the commit, or do you want to?
17:43 isBEKaml I haven't done anything, let me do something anyway.
17:43 isBEKaml I don't have a commitbit to rakudo.
17:44 masak hm, that may be... a tricky situation when doing a release.
17:44 am0c joined #perl6
17:44 jnthn Only for uploading the tarball.
17:45 masak and stuff like pushing the announcement.
17:45 tadzik you can figure out the CLA stuff in those 2 months :)
17:45 jnthn The commits can be handled by doing it in a forked repo and sending a pull request. :)
17:45 masak jnthn: oh!
17:45 * masak writes isBEKaml++ on the list
17:45 ranguard left #perl6
17:45 jnthn It's like git is distributed or something... :P
17:46 masak :D
17:46 dalek rakudo/nom: 72a27fc | masak++ | docs/release_guide.pod:
17:46 dalek rakudo/nom: [docs/release_guide.pod] signed up isBEKaml
17:46 dalek rakudo/nom:
17:46 dalek rakudo/nom: For the January compiler release.
17:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/72a27fc9b6
17:46 isBEKaml tadzik: the only things that stopped me from actively contributing to rakudo were lack of time and a bloody ancient machine.
17:47 isBEKaml tadzik: I can't say much about the first, but I got a newer, faster machine now. :)
17:47 masak isBEKaml: consider yourself actively challenged by the channel to become a contributor ;)
17:47 masak isBEKaml: if you want, I can help you hunt down low-hanging RT tickets to attack.
17:47 isBEKaml masak: part of the reason why I'm here :)
17:47 masak \o/
17:47 masak I mean, we've worked on Perl 6 compilers together before, right? :P
17:47 isBEKaml masak: yapsi, yeah. :)
17:48 masak good times.
17:48 isBEKaml (if you don't count something called proto)
17:48 masak not among compilers, no.
17:48 isBEKaml man, that feels so long ago.
17:48 masak :)
17:49 isBEKaml first, I got to get cygwin up in beating shape. I ain't so comfy with msvc.
17:50 pmurias jnthn: is there a way to get the type object from a how?
17:50 pmurias (not recreate it)
17:50 jnthn No
17:50 pmurias ok
17:51 jnthn Not unless the meta-object stores it explicitly or something, but it doesn't need it; the object we're operating on is always passed in as the first argument, and you can .WHAT that.
17:51 isBEKaml .oO(I still hit C-u to undo all my typing in windows... hmm, force-of-habit )
17:52 masak isBEKaml: I sometimes do ^W in web forms, because I have that bound as "delete word" in both vim and Emacs. in browsers it means "close tab or window", though :/
17:53 isBEKaml Maddingue: yeah, that too
17:53 isBEKaml d'oh, I hit ma<tab> and C-u, it underlined the rest of it!
17:53 isBEKaml masak: ^^
17:54 masak ;)
17:55 isBEKaml masak: I'm running emacs in cygwin, and notepad++ natively. Still miss vim, might as well put it up.
18:08 isBEKaml ISTR there were some sprints where a couple of folks got around to marking bugs as [LHF], is that still on these days?
18:09 isBEKaml rn: say @a[];
18:09 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable @a is not predeclared at /tmp/6pCLEU1YYU line 1:â�¤------> [32msay [33mâ��[31m@a[];[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza…
18:09 p6eval ..rakudo 72a27f: OUTPUT«===SORRY!===␤Variable @a is not declared␤at /tmp/RB_dq7hPUL:1␤»
18:09 isBEKaml rn: say "@a[]";
18:09 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable @a is not predeclared at /tmp/IYtkyURy7Z line 1:â�¤------> [32msay "[33mâ��[31m@a[]";[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niec…
18:09 p6eval ..rakudo 72a27f: OUTPUT«Null PMC access in find_method('postcircumfix:<[ ]>')␤  in block  at /tmp/V2am28teBu:1␤␤»
18:09 isBEKaml NPMCA - oh, wow.
18:18 ifim joined #perl6
18:20 ifim r: (-> $x, *@rest { say $x; say @rest.join: ', ' })(<Tres Tristes Tigres>);
18:20 p6eval rakudo 72a27f: OUTPUT«Tres Tristes Tigres␤␤»
18:21 ifim n: (-> $x, *@rest { say $x; say @rest.join: ', ' })(<Tres Tristes Tigres>);
18:21 p6eval niecza v22-19-gd874a8e: OUTPUT«Tres Tristes Tigres␤␤»
18:23 ifim perl6: (-> $x, *@rest { say $x; say @rest.join: ', ' })(<Tres Tristes Tigres>, <Tragaban Trigo>);
18:23 p6eval rakudo 72a27f, niecza v22-19-gd874a8e: OUTPUT«Tres Tristes Tigres␤Tragaban, Trigo␤»
18:27 masak ifim: unline Perl 5, lists in argument lists don't automatically flatten.
18:29 ifim masak: yeah, I've come to realize that now
18:35 muckerr joined #perl6
18:41 ifim how can I explicitly flatten a list in such case?
18:46 masak r: sub f($a, $b, $c) { say [$a, $b, $c].perl }; f( |<foo bar baz> )
18:46 p6eval rakudo 72a27f: OUTPUT«["foo", "bar", "baz"]␤»
18:46 masak using prefix:<|>.
18:46 masak or, don't flatten and accept a positional parameter.
18:47 masak r: sub f(*@x) { say @x.perl }; f( <foo bar baz> )
18:47 p6eval rakudo 72a27f: OUTPUT«Array.new("foo", "bar", "baz")␤»
18:47 masak r: sub f(@x) { say @x.perl }; f( <foo bar baz> )
18:47 p6eval rakudo 72a27f: OUTPUT«("foo", "bar", "baz")␤»
18:48 xinming_ joined #perl6
18:50 ifim masak: thanks for the insight
18:51 tadzik masak: what browser do you use?
18:51 tadzik in Gtk-based stuff it's usually doable
18:56 araujo joined #perl6
18:56 araujo joined #perl6
18:56 masak tadzik: what browser do I use when I hit Ctrl+W ? usually Chrome. and yes, Ctrl+Shift+T can be a blessing. especially if it restores my form data.
18:57 tadzik masak: echo 'gtk-key-theme-name = "Emacs"' >> ~/.gtkrc-2.0
18:57 tadzik C-w still closes tab when focus is outside a form of some sort
18:57 tadzik in form, C-w, C-u and all friends work
18:59 masak schweet.
19:00 sizz joined #perl6
19:07 cognominal joined #perl6
19:10 isBEKaml joined #perl6
19:10 spider-mario joined #perl6
19:14 isBEKaml has anyone ever seen this on recent parrot? https://gist.github.com/4055922
19:16 spider-mario joined #perl6
19:18 isBEKaml|2 joined #perl6
19:29 isBEKaml|2 Okay, I had an older downloaded parrot tarball (4.7) that built successfully from command prompt(cmd.exe). Recent checkout failed on cygwin though.
19:33 masak isBEKaml|2: haven't seen that, no.
19:35 isBEKaml|2 masak: I'm building rakudo now, pointing to parrot4.7.
19:35 isBEKaml|2 masak: It's currently checking out nqp, let's see how that goes.
19:37 sorear o/
19:38 isBEKaml hello, sorear
19:39 masak sorear! \o/
19:39 sorear masak!
19:49 cosimo moritz: ping
19:52 pmurias \o
19:53 isBEKaml I'll give this another round tomorrow. g'night, folks!
19:56 pmurias what's the maximum recursion depth in nqp?
19:57 pmurias sorry was looking at head of a stacktrace and got confused
20:08 obra joined #perl6
20:09 cosimo small retouch of camelia, http://i.imgur.com/eCSNB.png
20:11 japhb cosimo, what did you change?
20:11 masak the eyes, I think.
20:11 masak oh, and the mouth.
20:12 bruges joined #perl6
20:12 masak cosimo: I think the mouth is meant to be askew.
20:12 jnthn mouth is more symmetric now :)
20:12 jnthn .oO( The mouth is meant to askew a question )
20:12 benabik joined #perl6
20:13 masak I've kinda gotten used to the mouth being a bit non-symmetric.
20:20 cosimo it is still, just more subtle
20:21 cosimo japhb: eyes have a catchlight, and mouth line slightly more regular
20:27 masak r: class N { has $.n; method plus($c: $other) { N.new( $c.n + $other.n ) } }; say N.new(:n(40)).plus( N.new(:n(2)) ).n;
20:27 p6eval rakudo 72a27f: OUTPUT«Default constructor only takes named arguments␤  in method new at src/gen/CORE.setting:708␤  in method plus at /tmp/HqOK5PmSD9:1␤  in block  at /tmp/HqOK5PmSD9:1␤␤»
20:28 masak r: class N { has $.n; method plus($c: $other) { N.new( :n($c.n + $other.n) ) } }; say N.new(:n(40)).plus( N.new(:n(2)) ).n;
20:28 p6eval rakudo 72a27f: OUTPUT«42␤»
20:36 tokuhiro_ joined #perl6
20:43 cognominal joined #perl6
20:47 cognominal_ joined #perl6
20:47 TimToady yes, all the asymmetry in Camelia is intentional
20:48 TimToady including both mouth and eyes
20:48 TimToady otherwise she looks sterile
20:50 TimToady and those asymmetries are in support of the fundamental asymmetry of the P and the 6
20:51 TimToady lunch &
20:56 kurahaupo joined #perl6
21:04 cognominal_ http://www.theatlantic.com/technology/archive/2012/11/noam-chomsky-on-where-artificial-intelligence-went-wrong/261637/?single_page=true
21:04 cognominal_ may interest some people here.
21:05 * masak .oO( 2022: AI on where Noam Chomsky went wrong )
21:05 jnthn *lol*
21:06 tadzik :D
21:08 cognominal_ masak : I will believe it when such article will be written but some computer. I don't hold my breath.
21:09 masak *nod*
21:09 masak AI is hard, no doubt.
21:10 masak today I realized that we may never get household robots in the way they're sometimes depicted in futurist fiction. probably we'll just get better and better appliances, but they'll keep looking like vacuum cleaners and microwave ovens.
21:10 jnthn But I want a fridge with arms so it can hand me my beer!
21:11 cognominal_ interestingly enough,  fake articles are generated by computer to fool Google and the very statistical methods criticized by Chomsky,
21:12 masak wasn't this the article that Norvig had written a response to?
21:12 cognominal_ masak, url?
21:13 * geekosaur sends jnthn Gallegher's robot
21:13 masak well, there's http://norvig.com/chomsky.html -- but I believe there was also something newer.
21:14 cognominal_ masak: this is linked by the article I pointed to.  :)
21:15 masak I'm sure. maybe I simply got the ordering wrong, and Chomsky's reply is the latest one.
21:15 masak I should read both, because these things interest me.
21:24 spider-mario joined #perl6
21:27 sorear have y'all seen SCIgen?
21:29 masak no.
21:29 masak oh, that one. yes. :)
21:30 cognominal_ jnthn, I don't want a fridge with arms, that will strangle me because some guy from Anonymous has hacked it. Probably because he was pissed off by my criticism about  faceless milicia
21:30 japhb OK, I'm thinking myself into a corner here, and I think part of the key is understanding something in src/core/Cool.pm.  To whit: Why do some methods coerce with .Str and others with .Stringy?
21:31 cognominal_ *militia
21:32 spider-mario joined #perl6
21:33 jnthn japhb: .Str promises to give you back something you can unbox into a native string
21:34 jnthn japhb: .Stringy means something with a string nature; a Cat (when we have 'em) will also be Stringy.
21:34 jnthn japhb: In general, anything that goes on to nqp::unbox_s something wants to have called .Str. In other places, .Stringy should be enough.
21:34 cognominal_ what is a Cat, I forgot. Is that a lazy stream that could be lazy matched?
21:35 jnthn cognominal_: Yeah.
21:35 japhb That matches my current mental model of Str and Stringy, but still doesn't explain why some things want one or the other even when they contain no nqp:: ops
21:35 japhb For instance, .capitalize and .wordcase (yes, I know the former is DEPRECATED; my point is why the different coercion inside)
21:35 cognominal_ a Cat chasing a Rat; yes I am irrationnal
21:36 jnthn japhb: There may be some things that use Str now that perhaps should use Stringy.
21:36 cognominal_ that would be Cool…. Whatever.
21:36 jnthn japhb: I wouldn't read too much into those that aren't trying to use the thing as something unboxable.
21:38 jnthn I'm a little surprised by some of the things in Cool, tbh.
21:38 jnthn As in, surprised they're doing the real work rather than .Stringy.foo to delegate.
21:39 sorear cognominal_: we'll know the singularity is here when your refrigerator decides to hack Anonymous
21:40 jnthn japhb: Yeah, looking at this...I'm dubious everything is in the right place.
21:40 cognominal_ sorear++
21:40 japhb I was wondering if the promise of "unbox to native str" also implied "promise to be non-lazy".  Which may be true in itself, but I think some of the code assumes that Stringy is going to be lazy, and that some ops "can't" be done on lazy structures.  Hence chop and chomp using .Str.
21:40 japhb jnthn, agreed with dubiousness of real work in Cool.
21:41 jnthn japhb: True, but in that case it's better handled by Cat either not implementing the method or implementing it to throw an exception to say you can't do it.
21:41 jnthn I think the Numeric stuff in Cool is a much better example though: just straight .Numeric coercion and then delegation.
21:42 japhb I agree.  I was (badly, I know) saying I think the assumption that you'd have to use .Str to combat laziness in a method that does no unboxing is a bad assumption.
21:42 japhb Right.
21:43 cognominal_ the Cool motto is : "it is cool to cast and delegate" :)
21:43 jnthn japhb: Yes, agree on bad assumption.
21:44 jnthn .chars is a valid question to ask a lazy thing for example. Though it has the same consequence as asking a lazy list .elems
21:45 japhb What's the most efficient way to say in NQP/Parrot "I want a Perl 6 view of the thing you would get by unboxing self as a num"?  Is it: nqp::p6box_n(nqp::unbox_n(self))?  Or is there something that triggers something faster at the PIR level?
21:47 japhb If that's the best sequence, how is the bigint version spelled?  It wasn't clear to me what the bigint version is, as opposed to the native int version.
21:48 japhb .oO( Bet nobody can guess what I've been banging at ... )
21:49 japhb I did manage to find a fast way to get Rakudo to eat all RAM.  Really, really fast, actually.
21:50 japhb Though it likely falls under DIHWIDT
21:51 sorear Congratulations?
21:51 japhb I guess.  Happy with the behavior of the OOM killer, at least.  So far it consistently kills the right thing.  :-)
21:54 jnthn http://electure-ms.studiumdigitale.uni-frankfurt.de/vod/clips/mako67J3Gj/flash.html # video of my Rakudo Debugger lighting talk at YAPC::EU, up at last!
21:54 jnthn And done nicely so you can read what's on my screen :D
21:54 japhb OOooh, that will be fun to watch
21:54 japhb jnthn++
21:55 jnthn japhb: I'm kinda confused about the question...
21:55 jnthn japhb: What do you have in self? What are you writing this in?
21:56 jnthn nqp::p6box_n expects a native. Note you can only use nqp::unbox_n on some 6model objects that boxes a num. It's *not* in any sense coercive.
21:56 jnthn That is, if you do nqp::unbox_n on an Int it won't work 'cus an Int can't unbox to a floating point number.
21:57 masak autopun lightning talk: http://electure-ms.studiumdigitale.uni-frankfurt.de/vod/clips/yzjmg0a8pR/flash.html
21:57 leont left #perl6
21:57 japhb jnthn, well for instance while learning about how Bool works, I came across .HOW.set_boolification_mode and .HOW.publish_boolification_mode.  After some experimentation, I discovered that several ways of looking at a boolean value use .Bool, but ?? !! uses the boolification mode directly.  I kinda wondered if there were back doors like that for int, num, and bigint, where they don't hit methods, but operate purely at the 6model level.
21:58 japhb I apologize, coercive doesn't make sense for the existing types.  But I'm working on dual variables, so in a sense I coerce when I want to get an Int from an IntStr.
21:59 jnthn An IntStr will need to be something that can box an Int and a Str
21:59 japhb Yes, sure.
21:59 japhb And I recall your box_target info.
22:00 japhb But what does 3 * $a do, if $a is an IntStr?
22:00 japhb s/does/should/, I guess
22:00 japhb Or even just $a.Int
22:00 jnthn r: class IntStr is Int is Str { }; say nqp::box_s('blah', IntStr);
22:00 p6eval rakudo 72a27f: OUTPUT«0␤»
22:01 jnthn r: class IntStr is Int is Str { }; say nqp::box_i(42, IntStr);
22:01 p6eval rakudo 72a27f: OUTPUT«42␤»
22:01 jnthn That alone gets you something that can box both, but there's no way to get it to do both at once yet other than from C land...
22:01 jnthn Hm, what it does in that case will be down to multiple dispatch semantics.
22:02 jnthn r: class IntStr is Int is Str { }; multi m(Int) { say 'i' }; multi m(Str) { say 's' }; multi m(Cool) { say 'c' }; m(IntStr)
22:02 p6eval rakudo 72a27f: OUTPUT«Ambiguous call to 'm'; these signatures all match:␤:(Int )␤:(Str )␤␤  in block  at /tmp/7bAhvQEhTt:1␤␤»
22:02 jnthn Ah, yeah. Hmmmmm.
22:02 japhb .oO( jnthn is beginning to see why I've been going in circles trying to find an exit )
22:04 jnthn oh
22:04 jnthn It's apparently, says S02, not our problem.
22:04 jnthn "In case multiple dispatch determines that it could dispatch as either string or number, a tie results, which may result in an ambiguous dispatch error. You'll need to use prefix + or ~ on the argument to resolve the ambiguity in that case."
22:04 japhb Bah, have to run, sorry.
22:04 japhb &
22:04 jnthn r: class IntStr is Int is Str { }; say 3 * nqp::box_i(42, IntStr);
22:04 p6eval rakudo 72a27f: OUTPUT«126␤»
22:05 jnthn japhb: ^^ just works because there's no ambiguity.
22:08 masak jnthn: nice debugger lightning talk :)
22:09 jnthn masak: You should totally come to my debugger full-length talk at London Perl Workshop! :P
22:12 Krunch jnthn: when is that?
22:14 masak jnthn: I'll have to check my schedule... :P
22:18 benabik joined #perl6
22:28 jnthn Krunch: 24th I believe
22:30 masak Note: there is a new version of cabal-install available.
22:30 masak To upgrade, run: cabal install cabal-install
22:30 masak this made me smile for some reason. :)
22:30 Krunch jnthn: yeah, just found the site; wasn't aware of this, i might come; thanks
22:30 jnthn :)
22:32 cognominal_ jnthn talks are definitively worth it.
22:39 fgomez joined #perl6
22:47 masak 'night, #perl6
22:56 benabik joined #perl6
23:04 fgomez joined #perl6
23:13 tokuhiro_ joined #perl6
23:35 dayangkun joined #perl6
23:41 aindilis joined #perl6
23:45 aloha joined #perl6
23:53 fgomez joined #perl6
23:54 cognominal_ jnthn, an oddity with the span of an infix EXPR match  https://gist.github.com/cdc05adc82ad98272ea7
23:56 japhb r: class IntStr is Int is Str { }; my $dual = nqp::box_i(42, IntStr); say $dual.Int.WHAT;
23:56 p6eval rakudo 72a27f: OUTPUT«IntStr()␤»
23:56 cognominal_ phenny, tell jnthn, an oddity with the span of an infix EXPR match  https://gist.github.com/cdc05adc82ad98272ea7
23:56 phenny cognominal_: I'll pass that on when jnthn is around.
23:56 japhb jnthn, TimToady, I realized I've been thinking that the above behavior is wrong, because we want $foo.Int to be an actual Int, not a subtype of Int.
23:57 japhb Is this actually correct behavior?

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

Perl 6 | Reference Documentation | Rakudo