Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-02-14

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 am0c joined #perl6
00:00 noam joined #perl6
00:13 betterworld joined #perl6
00:20 benabik joined #perl6
00:30 retupmoca #perl6! I decided to write something in perl 6, so I attempted a port of Email::Simple at https://github.com/retupmoca/p6-Email-Simple
00:30 retupmoca so
00:31 retupmoca is there a defined way to get this into the modules list?
00:36 [Coke] retupmoca++
00:39 kmwallio joined #perl6
00:42 sorear I think you have to talk to tadzik
00:43 TimToady plus whatever is on http://modules.perl6.org/
00:45 TimToady unfortunately our most modular people are asleep in some other hemisphere...
00:45 retupmoca the only thing I see on modules.perl6.org is #perl6, and the guide says to poke a maintainer
00:45 TimToady there's a link to a guide there
00:46 sorear "a maintainer" means tadzik these days.
00:46 TimToady 3rd paragraph
00:46 sorear 0146 Warsaw time atm
00:46 TimToady which point to http://ttjjss.wordpress.com/2010/08/09​/so-you-want-to-write-a-perl-6-module/
00:46 retupmoca yeah, I saw that
00:46 retupmoca was following it, but all it says is to poke a maintainer
00:47 retupmoca who seems to be asleep
00:48 TimToady there's probably a serkit git repo that has to be tweaked
00:48 TimToady and yes, the docs appear to be a bit haphazard on that subject so far :)
00:49 retupmoca https://github.com/perl6/ecosystem maybe
00:49 retupmoca hrm
00:49 retupmoca I need a META.info
00:50 japhb joined #perl6
00:52 TimToady do you have a github id?
00:52 benabik joined #perl6
00:52 retupmoca yeah
00:52 retupmoca retupmoca
00:54 TimToady hmm, github is being slow, but I think I can add you
00:55 retupmoca otherwise I could do a fork / pull request
00:56 TimToady github has been suffering from DoS attacks lately, so maybe that's why it's being sluggish
00:56 retupmoca yeah, it's been sporadically slow
00:57 TimToady okay, I think I did it
00:57 TimToady you can now destroy^Wcontribute to any of the Perl 6 projects, welcome aboard
00:57 retupmoca github says read+write access
00:57 retupmoca yay!
00:57 retupmoca TimToady++
00:59 TimToady as we say, have the appropriate amount of fun, which may from time to time be negative, but hopefully mostly positive
01:00 dalek ecosystem: ffd609f | (Andrew Egeler)++ | META.list:
01:00 dalek ecosystem: Add Email::Simple
01:00 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/ffd609f3d7
01:02 TimToady retupmoca++
01:03 retupmoca ok, so it should show up next time modules.perl6.org updates then
01:03 TimToady \o/
01:04 retupmoca hrm, now that I have this access, I'll have to write more modules
01:04 TimToady or tests, or docs, or webpages, or...  :)
01:04 retupmoca yes indeed
01:05 TimToady we could also use more porting of modules back and forth between rakudo and niecza
01:06 diakopter mmm .meth
01:06 scott_ joined #perl6
01:07 kcw joined #perl6
01:07 TimToady careful, I don't want to end up on some proscribed list for buying decongestants :)
01:09 TimToady I have a trick sinus that doesn't like to go up in airplanes
01:09 TimToady well, actually, it's fine going up, but coming back down sometimes feels like an icepick in the forehead
01:10 * TimToady is looking forward to flying on the more-pressurized 787's to see if that helps
01:11 TimToady but maybe I shouldn't mention airplanes either... :)
01:13 cooper joined #perl6
01:14 cooper joined #perl6
01:54 kmwallio joined #perl6
01:58 shinobicl___ joined #perl6
02:23 wolfman2000 joined #perl6
02:42 shinobicl___ left #perl6
02:51 lxping joined #perl6
02:59 unobe joined #perl6
03:14 colomon ==> Testing Email::Simple
03:14 colomon t/basic.t .. ===SORRY!===
03:14 colomon Can only provide exactly one initial value to a mixin at /Users/colomon/.panda-niecza/src/Emai​l__Simple/lib/Email/Simple/Header.pm6 line 90:
03:14 colomon ------>     return @values but @values[0]⏏;
03:20 colomon I don't think niecza likes the @values but @values[0] construct.
03:26 sorear @values but @values[0] eh...
03:27 sorear o/ colomon
03:27 colomon \o
03:27 colomon does that make sense, even?
03:28 sorear I'm not sure
03:28 sorear it's not entirely clear what the semantics of the implied @values.clone would be
03:29 sorear (the error message, OTOH, is clearly bogus)
03:29 jaldhar joined #perl6
03:32 colomon oh, I thought it was complaining there were too many values (ie more than one) in @values
03:36 orafu joined #perl6
03:36 birdwindupbird joined #perl6
03:42 Teratogen joined #perl6
03:47 colomon bedtime
03:48 TimToady o/
04:15 araujo joined #perl6
04:34 retupmoca ok, Email::Simple doesn't use @values but @values[0] anymore
04:34 retupmoca if someone wants to test it on niecza
04:34 retupmoca I would, but I don't have it installed yet
04:44 kcw I'm not sure if I've found a bug with gather/take or I'm doing something wrong...
04:44 kcw > my @spam = gather loop { take 'eggs'; last }
04:45 kcw Method 'eager' not found for invocant of class 'Integer'
04:45 kcw in rakudo, that is
04:46 TimToady perl6: my @spam = gather loop { take 'eggs'; last }; say @spam
04:46 p6eval rakudo bd5adb: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in block <anon> at /tmp/B6jpxyUQ0v:1␤␤»
04:46 p6eval ..pugs b927740, niecza v14-42-g1d02da9: OUTPUT«eggs␤»
04:46 TimToady I'd say you're right
04:47 TimToady the eager likely comes from the assignment, but I've no idea where the Integer comes from--looks like a Parrot type
04:48 kcw k. I'll submit it to perlbug. Glad to see I'm not just misunderstanding something; I've been trying to figure out why this doesn't work for a while.
04:49 TimToady nom: my @spam = gather while 1 { take 'eggs'; last }; say @spam
04:49 p6eval nom bd5adb: OUTPUT«eggs␤»
04:49 TimToady hmm
04:49 TimToady nom: my @spam = gather loop (;1;) { take 'eggs'; last }; say @spam
04:49 p6eval nom bd5adb: OUTPUT«eggs␤»
04:49 TimToady seems like there's a hint
04:50 TimToady nom: my @spam = gather loop (;;) { take 'eggs'; last }; say @spam
04:50 p6eval nom bd5adb: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in block <anon> at /tmp/7pxw9NGc3l:1␤␤»
04:50 TimToady I'd say the default condition is a Parrot type rather than a Perl type
04:51 sorear btw, kcw, welcome
04:52 sorear is nbrown one of us?
05:01 alvis joined #perl6
05:02 yertalert joined #perl6
05:12 birdwindupbird joined #perl6
05:15 xinming joined #perl6
05:21 Teratogen yeesh
05:21 sorear ?
05:21 Teratogen is this a netsplit in disguise?
05:21 sorear certainly net issues
05:21 Teratogen happening on #perl and #java too
05:22 sorear not necessarily *freenode* issues, but BGP instability is a big deal these days
05:22 Teratogen bet it's a netsplit
05:22 sorear np
05:22 sorear no
05:22 sorear "netsplit" is a specific technical term in IRC
05:22 sorear this is not a netsplit
05:22 sorear this is an Internet-split
05:22 Teratogen ah
05:22 sorear some trunk line is having issues
05:23 rafl joined #perl6
05:23 sorear of the people who've recently pinged out, most/all of them are in Germany, Sweden, Iceland, or Denmark
05:24 xinming joined #perl6
05:24 * skids remembers to encourage himself to resume work on his network nomenclature diagram.
05:26 bonsaikitten joined #perl6
05:27 _sri joined #perl6
05:27 skids Networking seems to be one of the areas where words invert their meanings entirely in different contexts.  e.g. trunk(Cisco == link carrying multiplexed traffic, HP == LACP bond == multiplexed links carrying traffic)
05:28 avar joined #perl6
05:28 avar joined #perl6
05:29 jfried joined #perl6
05:29 xinming_ joined #perl6
05:29 ilogger2 joined #perl6
05:30 Gothmog_ joined #perl6
05:30 jnthn joined #perl6
05:30 mathw joined #perl6
05:31 broquaint joined #perl6
05:32 thou joined #perl6
05:34 wolverian joined #perl6
05:34 literal joined #perl6
05:53 kaleem joined #perl6
05:58 snearch joined #perl6
06:13 xinming joined #perl6
06:23 avar joined #perl6
06:23 avar joined #perl6
06:27 woosley joined #perl6
07:03 wtw joined #perl6
07:10 packetknife joined #perl6
07:16 noam joined #perl6
07:29 birdwind1pbird joined #perl6
08:16 woosley left #perl6
08:16 kaleem joined #perl6
08:20 Teratogen I'm working on a book
08:20 Teratogen "Parsing HTML with Regular Expressions for Fun and Profit"
08:21 woosley1 joined #perl6
08:23 sorear there's nothing wrong with being a fan of Gabriel.
08:23 sorear troll failed. :D
08:27 Teratogen AND IIIIIEIIIIIIIEIIIIII WILL ALWAYS LOVE YOOOUUUEUUUUUEUUUU
08:27 Teratogen gah
08:28 Teratogen can't get that song out of my head
08:41 shak joined #perl6
08:49 mj41 joined #perl6
08:59 satyavvd joined #perl6
09:12 masak me neither.
09:12 masak good #perl6, morning.
09:14 sorear masak morning. good.
09:15 sorear .oO( forwhy is masak mo(u)rning?)
09:17 * jnthn becomes vaguely concious-ish
09:17 sorear o/ jnthn
09:18 jnthn o/
09:18 * jnthn sees somebody found a code-gen bug
09:21 jnthn .oO( the masakbot is slow to see the word "bug" today... )
09:21 masak heh :)
09:21 masak I haven't backlogged yet. I'll get to it.
09:23 masak retupmoca: welcome! retupmoca++
09:26 masak nom: my @spam = gather loop { take 'eggs'; last }; say @spam
09:26 p6eval nom bd5adb: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in block <anon> at /tmp/QoVvAM5Irq:1␤␤»
09:26 * masak submits rakudobug
09:28 masak oh, submitted already by kcw++
09:28 jnthn oh!
09:33 moritz masak: any feedback for the bt printer?
09:47 moritz one thing I noticed is that it's fairly useless for debugging the setting
09:48 moritz maybe I can change that without making the normal user experience worse
09:48 jnthn moritz: I guess for that we can use --ll-exception or add a --debug-setting flag or something
09:48 jnthn --setting-exception
09:49 sorear fwiw, this sort of thing is a lot of the reason I haven't touched niecza's bt printer yet
09:49 moritz jnthn: well, I think it's a fairly artificial thing to exclude the setting
09:49 sorear I don't think I can improve it without making it unusable for all the uses I haven't thought of
09:49 jnthn moritz: True
09:50 moritz jnthn: currently I exclude the setting when searching for the first "interesting" call frame
09:50 jnthn moritz: Maybe we should include it but mark various of the list guts as excluded
09:50 moritz jnthn: but if we are consequent with usage of 'is hidden_from_backtrace', then I can drop that condition
09:51 jnthn moritz: That trait doesn't bother me.
09:51 moritz sorear: well, you can just sit back and watch us experiment, and copy whatever workable thing we come up with
09:52 sorear moritz: that's what I'm doing :D
09:53 dakkar joined #perl6
09:53 moritz jnthn: if things work out the way I am imagining right now, we don't need to special-case the list guts at all to keep them out of the vast majority of backtraces
09:53 jnthn moritz: OK :)
09:54 masak moritz: haven't been toying around with it yet; been too busy.
10:00 lestrrat joined #perl6
10:01 moritz \o/ seems to work
10:15 tarch joined #perl6
10:29 dalek rakudo/nom: d43594e | moritz++ | src/core/Backtrace.pm:
10:29 dalek rakudo/nom: stop special-casing the setting in the bt printer
10:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d43594ed62
10:32 daxim joined #perl6
10:42 JimmyZ joined #perl6
10:44 am0c joined #perl6
10:56 TimToady joined #perl6
10:57 kshannon joined #perl6
10:57 ashleydev joined #perl6
10:57 Yappoko___ joined #perl6
11:32 ashleydev joined #perl6
11:32 JimmyZ joined #perl6
11:32 tarch joined #perl6
11:32 satyavvd joined #perl6
11:32 wolverian joined #perl6
11:32 jnthn joined #perl6
11:32 ilogger2 joined #perl6
11:32 jfried joined #perl6
11:32 _sri joined #perl6
11:32 bonsaikitten joined #perl6
11:32 birdwindupbird joined #perl6
11:32 alvis joined #perl6
11:32 araujo joined #perl6
11:32 Teratogen joined #perl6
11:32 jaldhar joined #perl6
11:32 japhb joined #perl6
11:32 skids joined #perl6
11:32 retupmoca joined #perl6
11:32 rsimoes1 joined #perl6
11:32 mtk joined #perl6
11:32 au joined #perl6
11:32 fhelmberger joined #perl6
11:32 jerome_ joined #perl6
11:32 Helios joined #perl6
11:32 hundskat` joined #perl6
11:32 jferrero joined #perl6
11:32 drbean joined #perl6
11:32 buubot_backup joined #perl6
11:32 overrosy_ joined #perl6
11:32 p6eval joined #perl6
11:32 nsh joined #perl6
11:32 DarthGandalf joined #perl6
11:32 scottp joined #perl6
11:32 clkao joined #perl6
11:32 Woodi joined #perl6
11:32 yeltzooo joined #perl6
11:32 pmichaud joined #perl6
11:32 pnu joined #perl6
11:32 lumi___ joined #perl6
11:32 hillu joined #perl6
11:32 athomason_ joined #perl6
11:32 [Coke] joined #perl6
11:32 zb joined #perl6
11:32 snarkyboojum joined #perl6
11:32 integral joined #perl6
11:32 jasonmay joined #perl6
11:32 silug_ joined #perl6
11:32 LoRe joined #perl6
11:32 dju joined #perl6
11:32 risou joined #perl6
11:32 krakan joined #perl6
11:32 tadzik joined #perl6
11:32 Tene joined #perl6
11:32 bacek_at_work joined #perl6
11:32 masak joined #perl6
11:32 daemon joined #perl6
11:32 charsbar___ joined #perl6
11:32 felher joined #perl6
11:33 phenny joined #perl6
11:35 y3llow joined #perl6
12:00 araujo joined #perl6
12:04 am0c joined #perl6
12:04 literal joined #perl6
12:04 jnthn joined #perl6
12:04 jfried joined #perl6
12:04 mathw joined #perl6
12:04 avar joined #perl6
12:05 ilogger2 joined #perl6
12:05 Gothmog_ joined #perl6
12:07 _sri joined #perl6
12:09 bonsaikitten joined #perl6
12:09 jnthn joined #perl6
12:09 broquaint joined #perl6
12:11 fridim_ joined #perl6
12:12 wolverian joined #perl6
12:22 Trashlord joined #perl6
12:39 tokuhirom joined #perl6
12:40 bluescreen10 joined #perl6
12:54 pernatiy joined #perl6
13:11 timotimo joined #perl6
13:11 JimmyZ \o, dyncall build works now
13:11 masak \o/
13:13 masak wow, END phasers in Perl 5 run both after a 'die' and after an 'exit'.
13:16 * JimmyZ wants to update dyncall to v0.7, and commit some fixs to nqp
13:17 jnthn JimmyZ: +1
13:17 ab5tract joined #perl6
13:17 jnthn (on the 0.7 upgrade)
13:18 jnthn I just hadn't got there yet
13:18 jnthn oh but...
13:18 jnthn I think we have some additional patches on top of what 0.7 has
13:18 JimmyZ jnthn: but that also needs to make some changes to dyncall makefile
13:18 jnthn JimmyZ: Have you submitted those changes upstream to the dyncall folks?
13:19 moritz you should upgrade dyncall by applying the diff between the old and the new version
13:19 moritz not by overwriting stuff
13:20 JimmyZ jnthn:  well, dyncall.org doesn't seem to be open enough, I should email the patch to authors ?
13:20 jnthn JimmyZ: Yes, they've responded to emails from me before.
13:20 jnthn They seem quite friendly and happy to accept patches/input :)
13:21 JimmyZ it's odd that 'as' can't compile .S file
13:21 moritz https://gist.github.com/1826725 # my experiments with ObjHash
13:22 moritz binding works, but assignment doesn't. Seems I've misunderstood $!whence.
13:30 jnthn moritz: Two things.
13:30 jnthn moritz: whence runs before the actual storage is done. So $v won't have its value there
13:30 jnthn moritz: Second, you need to bind it into %!keys and %!values
13:31 jnthn moritz: Otherwise you'll re-containerize.
13:31 jnthn moritz: https://gist.github.com/1826773 works for me
13:32 moritz jnthn: cool, thanks
13:33 moritz ah right, that's the difference between Proxy and whence
13:34 benabik joined #perl6
13:35 jnthn moritz: Also one of efficiency.
13:35 jnthn (the whence mechanism is *way* faster)
13:36 masak whereas the Proxy one is more flexible, I guess?
13:36 jnthn masak: Yes.
13:36 jnthn masak: They're kinda apples and oranges in a way.
13:36 jnthn masak: You could build the stuff we do with $!whence on top of Proxy.
13:36 * masak .oO( apples are way faster, whereas oranges can be peeled in countless ways )
13:37 jnthn masak: But it'd look quite different.
13:37 jnthn :P
13:46 masak nom: sub fp($x, &c) { c($x) === $x ?? $x !! fp(c($x), &c) }; for ^10 { repeat while fp(my $s, *.subst("[]", "")) { $s = "[]".comb.roll(10).join }; say $s }
13:46 p6eval nom bd5adb: OUTPUT«[[]][][][]␤[[]][[]][]␤[][[]][][]␤​[][][[[]]]␤[[[[[]]]]]␤[][][[[]]]␤[[[[[]]​]]]␤[[[]]][][]␤[[[[]]][]]␤[][][[]][]␤»
13:47 * masak <3 Perl 6
13:49 masak nom: sub fp($x, &c) { c($x) === $x ?? $x !! fp(c($x), &c) }; sub shuffle { @^list.pick(*) }; for ^10 { repeat while fp(my $s, *.subst("[]", "")) { $s = "[[[[[]]]]]".comb.&shuffle.join }; say $s }
13:49 p6eval nom bd5adb: OUTPUT«[][[[[]]]]␤[[]][[[]]]␤[[]][[[]]]␤​[[][][]][]␤[[][][]][]␤[][[[][]]]␤[[[][[]​]]]␤[][][[]][]␤[][[]][][]␤[[][[]]][]␤»
13:53 xinming joined #perl6
13:53 MayDaniel joined #perl6
13:53 GlitchMr joined #perl6
13:54 kaleem joined #perl6
13:59 bluescreen10 joined #perl6
14:00 masak Whirlpool. http://domainlanguage.com/ddd/whirlpool/
14:03 xinming joined #perl6
14:18 xinming joined #perl6
14:25 xinming joined #perl6
14:26 timotimo masak: that snippet creates random balanced bracket terms by shuffling a balanced bracket term randomly and then checking if it's balanced by replacing "[]" with "" until nothing changes?
14:27 timotimo and the "until nothing changes" part is done via recursion inside fp, as far as i can tell
14:27 masak timotimo: yes.
14:27 masak yes.
14:27 timotimo rather, fp does that with any callable
14:27 rafl joined #perl6
14:27 masak "fp" as in "fixed point".
14:27 timotimo that's pretty cute actually
14:27 jnthn joined #perl6
14:27 timotimo wouldn't generating balanced bracket terms be easier, though? is there a reason for why you like this better than something else?
14:28 jfried joined #perl6
14:29 bonsaikitten joined #perl6
14:29 ilogger2 joined #perl6
14:30 _sri joined #perl6
14:31 masak timotimo: the goal is to generate any such fixed-length balanced string with equal probability.
14:31 avar joined #perl6
14:31 avar joined #perl6
14:31 masak timotimo: it's been up for discussion before. TimToady++ w/ family figgered out how to do it using an auxiliary table.
14:32 literal joined #perl6
14:32 broquaint joined #perl6
14:32 timotimo i see
14:33 timotimo in that case i believe your solution works pretty well
14:33 masak my version above "fails" in that it has to reject a certain percentage of candidates. the table approach always succeeds but is longer.
14:33 masak I can't help thinking that there is a short, simple solution out there.
14:33 timotimo mhm
14:34 mathw joined #perl6
14:36 Gothmog_ joined #perl6
14:36 xinming joined #perl6
14:49 GlitchMr joined #perl6
14:52 [Coke] .u *face*
14:52 phenny ValueError: Broken regexp: '*FACE*' (file "/home/sbp/Dropbox/inamidst.com​/phenny/modules/codepoints.py", line 58, in codepoint_extended)
14:52 [Coke] ZOMG, PHENNY IS MADE OF PYTHON!
14:53 PacoAir joined #perl6
14:53 jnthn .u fa.*
14:53 phenny U+0618 ARABIC SMALL FATHA (◌ؘ)
14:53 phenny U+063D ARABIC LETTER FARSI YEH WITH INVERTED V (ؽ)
14:53 phenny U+063E ARABIC LETTER FARSI YEH WITH TWO DOTS ABOVE (ؾ) [...]
14:58 masak .u (((((((((((.*)*)*)*)*)*)*)*)*)*)*)*
14:58 phenny masak: Sorry, your input is too long!
14:58 masak :)
15:00 timotimo heh
15:04 MayDaniel joined #perl6
15:07 moritz masak: also it's pretty pointless; only regexes that fail to match actually backtrac
15:07 moritz k
15:08 masak troo
15:08 masak I'm not too good at being malicious.
15:08 jnthn phenny: .u (\w* \d* \s* XX)+
15:08 jnthn That one's more...oops. :)
15:09 jnthn dammit, I didn't mean to actually send it!
15:09 moritz http://perlgeek.de/blog-en/perl-tips/i​n-search-of-an-exponetial-regexp.html
15:09 jnthn That one is straight out of my C# regexes course...
15:09 jnthn Well. Regexes for C# programmers.
15:11 masak jnthn: I think it's harmless if you write 'phenny: ' as you did.
15:11 benabik phenny: .u t
15:11 benabik .u t
15:11 phenny U+0074 LATIN SMALL LETTER T (t)
15:11 masak right.
15:11 jnthn masak: er, I didn't cyrillic it this time :P
15:11 jnthn But I'm happy phenny is still alove. :)
15:11 jnthn *alive
15:12 masak phenny: en ru "I'm doing science and I'm still alive."?
15:12 phenny masak: "Я делаю науку , и я все еще жив." (en to ru, translate.google.com)
15:14 jnthn oh, Russian...thanks for the reminder...
15:14 * jnthn afk :)
15:15 masak hee hee
15:17 masak perl6: say "Happy Valentine's \x2665"
15:17 p6eval pugs b927740: OUTPUT«Happy Valentine's ♥␤»
15:17 p6eval ..rakudo bd5adb, niecza v14-42-g1d02da9: OUTPUT«Happy Valentine's ♥␤»
15:20 masak there's something the matter with the way Pugs output gets presented.
15:21 moritz aye
15:22 bluescreen10 joined #perl6
15:23 moritz I promise to investigate whem pugs is again actively developed
15:23 masak deal :)
15:24 masak setting up an environment on feather where Pugs can be actively developed will be good for everyone.
15:25 fsergot joined #perl6
15:26 moritz feather has fairly recent ghc and cabal-install packages
15:26 moritz not sure what else we need
15:27 moritz I also have no ideas which pugs repo is the most recent
15:28 masak https://github.com/audreyt/Pugs.hs , most likely.
15:29 masak activity 11 days ago.
15:30 * masak clones that one into his home directory
15:30 masak oh, but the hacking file says to use https://github.com/perl6/Pugs.hs
15:31 masak which has an identical HEAD.
15:31 moritz so it's already synchronized?
15:34 masak guessing au-chan does stuff in her repo, then pushes to the perl6 one.
15:34 masak so perl6/Pugs.hs is the "upstreamest" one.
15:36 moritz .oO( the ups and downs in the life of a stream ... )
15:38 * masak .oO( The Upstremiest Repo That Ever Lived )
15:38 masak Upstreamiest*
15:41 overrosy joined #perl6
15:42 moritz ok, successfully built a Pugs.hs from source
15:43 moritz on feather, that is
15:43 y3llow_ joined #perl6
15:43 moritz and that Unicode problem is also present on the command line
15:43 moritz so it's not an evalbot thing
15:43 hillu joined #perl6
15:43 Psyche^ joined #perl6
15:44 au joined #perl6
15:44 birdwindupbird joined #perl6
15:45 clkao joined #perl6
15:45 integral joined #perl6
15:45 integral joined #perl6
15:45 z-b joined #perl6
15:46 [Coke] moritz: does every user have their own cabal ... downloads?
15:46 Helios joined #perl6
15:46 timotimo there is no cabal!
15:46 DarthGandalf joined #perl6
15:47 dju joined #perl6
15:48 * [Coke] guesses so, as he's now installing packages with cabal.
15:50 moritz [Coke]:  yes
15:51 TimToady std: Happy ♥'s Day
15:51 p6eval std 52f3895: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confused at /tmp/i1su4d3F_Y line 1:â�¤------> [32mHappy [33mâ��[31m♥'s Day[0mâ�¤    expecting any of:â�¤ bracketed infixâ�¤        infix or meta-infixâ�¤    statement modifier loopâ�¤Undeclared name:â�¤       'Happy' used at line 1â�¤Parse failedâ�¤FAILED 00:01
15:51 p6eval ..109m␤»…
15:53 masak \♥/
15:55 [Coke] https://gist.github.com/1827728 - pugs build failure on feather
15:56 colomon Conversation just had here: Jen: "You should thank TimToady not to give you an STD."  colomon: "std is standard, dear!"  Jen: "STDs are *not* standard!"
15:56 moritz :-)
16:00 masak [Coke]: that's odd. what's the GHC version?
16:01 [Coke] looks like it might be 7.4.1
16:01 [Coke] "whatever is installed on feather". ;)
16:02 masak yeah, getting 7.4.1 on feather too.
16:03 masak and the last thing that happened to Pugs.hs was that it got updated for 7.4.1 compatibility.
16:03 masak which indicates that it *should* work on 7.4.1 :)
16:04 moritz and it does, here
16:05 daxim ooh, opensuse packagers are slacking
16:05 moritz [Coke]: what commit is your Pugs.hs repo on?
16:05 [Coke] 08f0e5052cfccf839f852c883a913298697d146e
16:06 moritz ok, same as mine
16:06 [Coke] mine's in ~coke/sandbox/Pugs if that helps.
16:06 masak moritz: it worksforyou on feather?
16:07 moritz masak: it compiled.
16:07 masak then the more interesting question is how your setup and [Coke]'s differ.
16:07 moritz and the resulting 'pugs' binary seems to be able to evaluate basic expressions
16:08 masak wohoo!
16:08 moritz what I did is run 'cabal update', and then 'cabal install <packages>' for all the packages that 'make' complained about
16:08 masak sounds easy enough.
16:08 [Coke] moritz: did you specify the > < modifiers also?
16:08 masak I'll try it here too.
16:08 [Coke] (one of them had a < requirement.)
16:09 moritz [Coke]: nope
16:09 [Coke] cabal doesn't have a "list of installed" ?
16:10 benabik cabal list --installed
16:10 [Coke] http://feather.perl6.nl/~coke/cabal.txt
16:12 moritz same as mine
16:14 [Coke] O_o
16:14 moritz my karma is just better :-)
16:15 masak karma moritz
16:15 aloha moritz has karma of 2965.
16:15 masak karma [Coke]
16:15 aloha [Coke] has karma of 0.
16:15 masak that would explain it, yes.
16:15 benabik karma Coke
16:15 aloha Coke has karma of 575.
16:16 moritz [Coke]++
16:16 moritz karma [Coke]
16:16 aloha [Coke] has karma of 0.
16:16 moritz karma Coke
16:16 aloha Coke has karma of 575.
16:16 moritz wtf?
16:16 PerlJam Coke++
16:16 [Coke] That's fine.
16:16 PerlJam Pepsi--
16:16 PerlJam :)
16:16 [Coke] I'm not [Coke] anyway. it's just a stupid wrapper I have to wear on freenode.
16:18 masak it's the adapter pattern.
16:18 thou joined #perl6
16:21 masak I followed moritz' instructions. I'm getting [Coke]'s error. :(
16:21 masak karma masak
16:21 aloha masak has karma of 629.
16:22 wolverian joined #perl6
16:23 benabik make IGNORE_KARMA=Yes
16:32 _ilbot joined #perl6
16:32 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: http://irc.perl6.org/ | UTF-8 is our friend!
16:34 [Coke] I'm using git@github.com:perl6/Pugs.hs.git
16:38 * masak too
16:39 masak moritz is using git://github.com/perl6/Pugs.hs.git
16:39 masak I can't imagine the difference matters though, since it's the same HEAD.
16:39 benabik Those should be the same repo (although the git:// URL is read-only)
16:39 masak right.
16:53 moritz I don't have any suspicious environment variables either
16:54 masak curiouser and curiouser, thought Alice.
16:55 PacoAir joined #perl6
16:58 * masak decommutes
16:59 * [Coke] tries to figure out how to call excel from visual basic from java on windows.
16:59 bluescreen10 joined #perl6
16:59 * [Coke] gets a little dizzy.
17:07 noam joined #perl6
17:13 slavik joined #perl6
17:21 kaare_ joined #perl6
17:33 colomon joined #perl6
17:34 foodoo joined #perl6
17:40 dukeleto joined #perl6
17:42 phenny joined #perl6
17:42 bluescreen10 joined #perl6
17:42 buubot_backup joined #perl6
17:43 Gothmog_ joined #perl6
17:44 Psyche^ joined #perl6
18:03 au joined #perl6
18:08 _jfried joined #perl6
18:08 retupmoca joined #perl6
18:08 jasonmay joined #perl6
18:08 nsh joined #perl6
18:08 jferrero joined #perl6
18:08 p6eval joined #perl6
18:08 baest joined #perl6
18:08 snarkyboojum joined #perl6
18:08 silug_ joined #perl6
18:08 `patch` joined #perl6
18:08 szbalint joined #perl6
18:08 mattp_ joined #perl6
18:08 doy joined #perl6
18:08 kcwu joined #perl6
18:08 cxreg joined #perl6
18:08 tomaw joined #perl6
18:08 shachaf joined #perl6
18:08 s1n joined #perl6
18:08 moritz joined #perl6
18:08 pyrimidine joined #perl6
18:08 Util joined #perl6
18:08 perimosocordiae joined #perl6
18:08 Lorn joined #perl6
18:08 ruoso joined #perl6
18:08 BinGOs joined #perl6
18:08 cosimo joined #perl6
18:08 jtpalmer_ joined #perl6
18:08 Timbus joined #perl6
18:08 huf joined #perl6
18:08 aloha joined #perl6
18:08 chra joined #perl6
18:08 djanatyn joined #perl6
18:08 prammer joined #perl6
18:08 ranguard joined #perl6
18:08 kst joined #perl6
18:08 rsimoes joined #perl6
18:08 cognominal_ joined #perl6
18:08 Guest6426 joined #perl6
18:08 tty234 joined #perl6
18:08 awwaiid joined #perl6
18:08 Khisanth joined #perl6
18:08 ocharles joined #perl6
18:08 BooK_ joined #perl6
18:08 frettled joined #perl6
18:08 sirhc joined #perl6
18:08 krunen joined #perl6
18:08 cj joined #perl6
18:08 sorear joined #perl6
18:08 sunnavy joined #perl6
18:08 c1sung joined #perl6
18:08 PerlJam joined #perl6
18:08 PZt joined #perl6
18:08 Juerd joined #perl6
18:08 szabgab joined #perl6
18:08 diakopter joined #perl6
18:08 dalek joined #perl6
18:08 mikemol joined #perl6
18:08 zamolxes joined #perl6
18:08 jlaire joined #perl6
18:08 renormalist joined #perl6
18:08 zostay joined #perl6
18:08 robinsmidsrod joined #perl6
18:08 revdiablo joined #perl6
18:08 geekosaur joined #perl6
18:08 gfldex joined #perl6
18:08 yves joined #perl6
18:08 pochi joined #perl6
18:08 takesako joined #perl6
18:08 wooden joined #perl6
18:08 HarryS joined #perl6
18:08 pomysl_ joined #perl6
18:08 sudokode joined #perl6
18:08 sftp_ joined #perl6
18:08 rhr joined #perl6
18:08 jrockway joined #perl6
18:08 cotto joined #perl6
18:08 ingy joined #perl6
18:08 Grrrr joined #perl6
18:08 nebuchadnezzar joined #perl6
18:08 SHODAN joined #perl6
18:08 [particle] joined #perl6
18:08 arnsholt joined #perl6
18:08 Maddingue joined #perl6
18:08 jevin_ joined #perl6
18:08 mtths joined #perl6
18:08 mls joined #perl6
18:08 stepnem joined #perl6
18:08 tokuhirom3 joined #perl6
18:08 BooK joined #perl6
18:08 kthakore joined #perl6
18:08 ascent_ joined #perl6
18:08 pjcj joined #perl6
18:08 imarcusthis joined #perl6
18:08 flussence joined #perl6
18:08 retup-work joined #perl6
18:08 etneg_ joined #perl6
18:08 `10 joined #perl6
18:08 sjn joined #perl6
18:08 felipe joined #perl6
18:08 preflex joined #perl6
18:08 apejens joined #perl6
18:08 emss joined #perl6
18:08 sivoais joined #perl6
18:08 Vlavv_ joined #perl6
18:08 pothos joined #perl6
18:08 simcop2387 joined #perl6
18:08 betterworld joined #perl6
18:08 kcw joined #perl6
18:08 cooper joined #perl6
18:08 unobe joined #perl6
18:08 orafu joined #perl6
18:08 lestrrat joined #perl6
18:08 TimToady joined #perl6
18:08 kshannon joined #perl6
18:08 Yappoko___ joined #perl6
18:08 araujo joined #perl6
18:08 Trashlord joined #perl6
18:08 pernatiy joined #perl6
18:08 timotimo joined #perl6
18:08 ab5tract joined #perl6
18:08 rafl joined #perl6
18:08 jnthn joined #perl6
18:08 jfried joined #perl6
18:08 bonsaikitten joined #perl6
18:08 ilogger2 joined #perl6
18:08 _sri joined #perl6
18:08 avar joined #perl6
18:08 literal joined #perl6
18:08 broquaint joined #perl6
18:08 mathw joined #perl6
18:08 GlitchMr joined #perl6
18:08 fsergot joined #perl6
18:08 y3llow joined #perl6
18:08 hillu joined #perl6
18:08 clkao joined #perl6
18:08 integral joined #perl6
18:08 DarthGandalf joined #perl6
18:08 wolverian joined #perl6
18:08 PacoAir joined #perl6
18:08 noam joined #perl6
18:08 slavik joined #perl6
18:08 colomon joined #perl6
18:08 foodoo joined #perl6
18:08 dukeleto joined #perl6
18:08 phenny joined #perl6
18:08 bluescreen10 joined #perl6
18:08 buubot_backup joined #perl6
18:08 Gothmog_ joined #perl6
18:08 Patterner joined #perl6
18:08 au joined #perl6
18:08 rsimoes1 joined #perl6
18:08 alvis joined #perl6
18:08 drbean joined #perl6
18:08 zb joined #perl6
18:08 overrosy_ joined #perl6
18:08 dju joined #perl6
18:08 Chillance joined #perl6
18:08 az5112 joined #perl6
18:08 Helios joined #perl6
18:08 kaare_ joined #perl6
18:08 thou joined #perl6
18:08 benabik joined #perl6
18:08 ashleydev joined #perl6
18:08 tarch joined #perl6
18:08 Teratogen joined #perl6
18:08 jaldhar joined #perl6
18:08 skids joined #perl6
18:08 mtk joined #perl6
18:08 fhelmberger joined #perl6
18:08 jerome_ joined #perl6
18:08 scottp joined #perl6
18:08 Woodi joined #perl6
18:08 yeltzooo joined #perl6
18:08 pmichaud joined #perl6
18:08 pnu joined #perl6
18:08 lumi___ joined #perl6
18:08 athomason_ joined #perl6
18:08 [Coke] joined #perl6
18:08 LoRe joined #perl6
18:08 risou joined #perl6
18:08 krakan joined #perl6
18:08 tadzik joined #perl6
18:08 Tene joined #perl6
18:08 bacek_at_work joined #perl6
18:08 masak joined #perl6
18:08 daemon joined #perl6
18:09 TimToady okay, here's a first whack at my rethink of acceptance types that I promised
18:09 TimToady https://gist.github.com/1828667
18:09 TimToady commuting &
18:12 BooK__ joined #perl6
18:14 simcop2387_ joined #perl6
18:15 moritz hm.
18:18 moritz I think I could warm up to the general direction this is heading
18:18 moritz though of course there are a lot of details to iron out and clarify
18:19 moritz and some which I outright object to; for example a bare  return;  returning a type outside of Any
18:19 moritz I often use 'return;' when the work inside a subroutine is done, not if a failure occured (that's what fail() is for)
18:19 colomon +1
18:20 gfldex_ joined #perl6
18:20 jnthn joined #perl6
18:20 benabik bare return might want to return OK instead of Nil
18:20 pochi_ joined #perl6
18:20 benabik Or maybe just Any
18:21 foodoo joined #perl6
18:21 Yappoko___ joined #perl6
18:21 cooper joined #perl6
18:21 sivoais joined #perl6
18:21 robinsmidsrod joined #perl6
18:21 Khisanth joined #perl6
18:21 ocharles joined #perl6
18:21 frettled joined #perl6
18:21 sirhc joined #perl6
18:21 krunen joined #perl6
18:21 TimToady or maybe ()
18:21 TimToady really commuting &
18:21 moritz TimToady: also I think you got the .can('REALLY') wrong in the last two lines of the table -- if it has payload, it should respond positively to .can('REALLY')
18:21 * moritz now goes and reads a second time
18:24 eviltwin_b joined #perl6
18:25 isBEKaml joined #perl6
18:27 wolv joined #perl6
18:30 ilogger2 joined #perl6
18:30 yves joined #perl6
18:37 moritz also it feels slightly wrong to base the presence of the REALLY method on the presence of the payload
18:37 moritz it means you need to go rather meta jut for instantiating very basic stuff
18:38 isBEKaml masak: I got pugs setup on my machine with GHC 6.12.3, a few months back. :)
18:39 moritz also
18:39 kaleem joined #perl6
18:40 moritz the proposal tries to address the matter of having too many acception/rejection types, but has just as many in the result
18:40 moritz if you count OK/OK+ and Nil/Nil+ as separate types, which it seems you should, because they behave differently
18:41 moritz well, Nil/Nil+ behave differently, OK/OK+ don't do so much
18:41 moritz so 6 -> 5
18:45 zby_home joined #perl6
18:46 isBEKaml perl6: my $x = 42 but False; say "blah" if $x; # nom ?
18:46 p6eval rakudo bd5adb: OUTPUT«blah␤»
18:46 p6eval ..niecza v14-42-g1d02da9:  ( no output )
18:46 p6eval ..pugs b927740: OUTPUT«*** Cannot cast from VBool False to VCode (VCode)␤    at Prelude.pm line 541, column 5-16␤»
18:47 isBEKaml I was confused for a moment when I tried this on nom until I saw niecza. :)
18:47 isBEKaml BTW, is that right what rakudo does? known bug, I presume?
18:47 emss joined #perl6
18:48 birdwindupbird joined #perl6
18:48 jnthn nom: my $x = 42 but False; say $x.WHAT;
18:48 p6eval nom bd5adb: OUTPUT«Int+{<anon>}()␤»
18:48 jnthn nom: my $x = 42 but False; say $x.^methods(:local);
18:48 emss joined #perl6
18:48 p6eval nom bd5adb: OUTPUT«Bool␤»
18:49 jnthn nom: my $x = 42 but False; say $x.Bool
18:49 p6eval nom bd5adb: OUTPUT«False␤»
18:49 moritz I guess that's because Int has a separate boolification protocol?
18:49 jnthn moritz: OH
18:49 jnthn moritz++
18:49 benabik nom: my $x = 42 but False; say ?$x
18:49 p6eval nom bd5adb: OUTPUT«False␤»
18:49 isBEKaml Oh, I have to ?$x when doing it in bool context?
18:49 jnthn isBEKaml: No, we just need to know when to stop cheating. :)
18:49 emss joined #perl6
18:49 moritz one more thing about the proposal... it feels wrong to $regex_match<foo> die in sink context if it has failure information
18:50 moritz isBEKaml: it's a rakudobug
18:50 benabik isBEKaml: ?$x is another way to explicitly ask for the bool.
18:50 moritz std: :72<foo>
18:50 p6eval std 52f3895: OUTPUT«ok 00:01 107m␤»
18:50 jnthn ouch, I think I missed the thingy that's being discussed at the moment due to network failz...
18:50 * jnthn hits the ir clogs
18:50 isBEKaml jnthn: Yeah, I was thinking: "Hey I know this is meant to be used as a bool when I said but False. ?$x is just overdoing it." :)
18:50 moritz jnthn: https://gist.github.com/1828667
18:53 jnthn isBEKaml: Yeah, compiling the "obvious patch" for the issue now to see if it works.
18:53 isBEKaml jnthn++ # great!
18:54 * isBEKaml is a bit sad that he can't try nom/rakudo anymore on his machine as the build requirements are far out of reach for his poor old machine.
18:54 xinming joined #perl6
18:55 isBEKaml .oO(talk about sleepy times and verbosity)
18:56 benabik isBEKaml: That may get better when jnthn finishes his serialization work (*knocks on wood*)
18:57 jnthn It almost certainly will.
18:57 TimToady jnthn: the OKness proposal is basically trying to name your primitive cheating mechanism :)
18:57 jnthn TimToady: I did a o.O as soon as it started talking about roles being inside or out of Any. ;)
18:58 fridim_ joined #perl6
18:58 TimToady where they instantiate to, really
18:58 jnthn (Generally they only pretend to be in any of these so we can pass them around first class)
18:58 jnthn TimToady: OK
18:59 benabik .oO( role OK is instantiates(Mu) {...} )
18:59 jnthn Dang my patch fai...oh...that's because I didn't build the new nqp with op moritz++ added :)
19:00 foodoo left #perl6
19:01 jnthn Failure and Match will both go away as insufficiently general.
19:01 jnthn ==> Match stays in the sense of it being the Match type object though?
19:01 jnthn It's just not what we return on a failed Match?
19:01 isBEKaml benabik,jnthn: that's great! # hopeful
19:02 jnthn A successful match now returns OK instantiated with match info, if any.
19:02 jnthn ==> Are we talking about "top level" matches here? Or all the way down?
19:03 TimToady https://gist.github.com/1828667 has tweaks from some of your suggestions
19:04 jnthn To first approximation, OK/Nil force only truth, definedness, and .REALLY;
19:04 jnthn ==> we're talking .defined level here, not .DEFINITE level?
19:05 TimToady well, I think they track in this case, offhand
19:05 TimToady but OKness is necessarily on a primitive level, so carries .DEFINITE as well as primitive boolean
19:06 jnthn .DEFINITE is *really* low level in 6model
19:06 TimToady only question is whether .defined delegates, and I don't think it does
19:06 jnthn Like, "checks a bit somewhere" level
19:06 jnthn Like, "if you screw this up we segfault" level.
19:07 TimToady I'm hoping with a good enough definition of OKness we can get away from juggling circularity saws, at least on booleans and defineds
19:07 jnthn It's really the "is this a type object" flag.
19:07 jnthn Well, we added .DEFINITE distinct from .defined to be a circularity saw.
19:08 TimToady is there a name for primitive boolean context?
19:08 jnthn TimToady: No. (more)
19:08 jnthn TimToady: I've considered that "primitive" thing as purely an optimization so far.
19:09 jnthn It's leaking out in the "but True" example you showed in just a straight "getting caught cheating" thing.
19:09 jnthn I can imagine a primitive boolean context style operation.
19:09 jnthn But my primary goal was optimization at the low level, rather than different semantics at the high level.
19:10 TimToady sure, just trying to clean up the success/failure semantics to make it easier, and perhaps make it more obvious when we're cheating on purpose
19:10 jnthn *nod*
19:11 TimToady KEEP/UNDO probably simplifies a bit under OKness too
19:11 jnthn Yeah, I'm happy to clear things up. Just need to get my head around the details. :)
19:11 TimToady I probably need some rows in my table for things like type objects, and maybe s'more columns
19:13 TimToady well, except type objects are largely outside of OKness, so they aren't treated as automatic success/failure by smartmatch
19:13 jnthn TimToady: Is there a particular reason OK and Nil are themselves roles?
19:13 jnthn TimToady: That'd imply you could mix them in to things.
19:13 jnthn If you do that, what are the semantics?
19:14 TimToady was originally thinking of instantiation rather than delegation, but I don't think you want to be mixing them into other things; more the other way around, since they're primitive
19:14 TimToady and "delegation" might not be high-level delegation either
19:15 jnthn Delegation tends to imply you have an instance. :)
19:15 TimToady "mixin" likely means something different than high-level mixin
19:15 jnthn (which holds the attribute to delegate to)
19:16 TimToady this is more just trying name the primitives we're already using anonymously, along with trying to straighten out the user-visible namespace
19:17 [Coke] woot. I think I'm going to YAPC!
19:17 TimToady niecza: say <a b c> »~~» /b/
19:17 p6eval niecza v14-42-g1d02da9: OUTPUT«Match() #<match from(0) to(1) text(b) pos([].list) named({}.hash)> Match()␤»
19:17 TimToady I'm trying to get that to come out: Nil OK[stuff] Nil
19:17 skids Slightly OT: Is rakudo's <{fail}> in regexp formally considered a cheat?  It does what I consider to be the right thing and propagates something that explodes down to the root of the returned result, but that's despite the fact that it is tested for truthfulness during the regexp match, which should mark it as "handled" (?)
19:19 TimToady skids: the interaction of normal failure with backtracking is not yet quite nailed down; it might be that only specific kinds of failure induce specific kinds of backtracking
19:20 TimToady but all such failures would be some variant of Nil in the new model
19:20 jnthn Not to mention that the regex engine just does the cheapest thing it can do figure out if the match was a success :-)
19:21 jnthn *.does(OK) & none *.can('REALLY')
19:21 jnthn When would an OK not be able to REALLY?
19:21 TimToady meta-talk really
19:21 TimToady I'm talking about if the "delegate" slot is empty
19:21 jnthn ok
19:21 jnthn Ah, that's what the "payload" column means
19:21 TimToady and perhaps not even allocated
19:22 TimToady i.e. wouldn't need a delegate pointer if the 'delegate exists' bit was false
19:22 xinming joined #perl6
19:22 jnthn "Types outside of OKness must call .Bool to determine truthiness"
19:23 jnthn Actually the boolification cheating I have is to avoid having to call a method when we can very quickly check for zero, which is the case for, say, an Int or Num.
19:23 TimToady trying to nail down when you can just look at the bit, and when you have to ask the object nicely
19:24 TimToady we might find some way of bending that part
19:24 jnthn OK, but in some cases I've wanted to cheat for things that are more than "look at the bit" :)
19:24 MayDaniel joined #perl6
19:24 skids jnthn: RE delegation, well there is the NYI "method foo () handles" which could return a class expecting calls to the class instead of an instance...
19:25 TimToady it's difficult to know when you're breaking Liskov on that though
19:25 jnthn TimToady: Yeah, that's what the "but True" bug just caught us doing :)
19:26 TimToady I don't know whether this is quite sane yet, but I think this is a path toward sanity
19:28 jnthn TimToady: Yes, there's much to like in here. And much to ponder..
19:28 jnthn Match ~~ OK[Match] # ??
19:28 jnthn OK[Match] ~~ Match # ??
19:29 jnthn (using [...] in a handwavey sense here)
19:29 jnthn oh
19:29 jnthn The latter can't be true
19:29 jnthn H
19:29 jnthn Hmm
19:29 jnthn Well
19:29 jnthn Nil[Match] ~~ Match had best be false :)
19:30 PacoAir joined #perl6
19:32 TimToady Types outside of OKness must call .Bool to determine truthiness (though native types and known-non-derived types can generally optimize this away).
19:32 TimToady Along with Bool, OKness types may not be used literally in smartmatching, and will warn when such usage is parsed.
19:32 jnthn Yeah, known non-derived is what blew things here.
19:33 jnthn TimToady: My questions above were not in the smart matching sense, but in the type checking sense
19:33 TimToady that level may also require cheats
19:33 jnthn sub foo(Match $m) { }; foo("abc" ~~ /a/)
19:34 TimToady there is no Match anymore
19:34 fridim_ joined #perl6
19:34 TimToady there's a conjecture that you write that: sub foo(OKness $m)
19:34 jnthn So...there's no class Match { ... } ?
19:34 TimToady nor any class Failure
19:34 jnthn OK, what represents a Match object?
19:34 TimToady these turn notionally into annotated OK and Nil
19:35 TimToady OK with match info inside
19:35 benabik Match info stored in something other than a Match object?
19:35 TimToady such an OK is not much different than our current Match type
19:35 * jnthn wonders if it's a different meta-object
19:35 TimToady benabik: basically it's just a rename of Match to OK
19:35 moritz how can I tell if an OK is a result of a regex match?
19:35 jnthn ok Match { has $!CURSOR; ... }
19:36 TimToady and OK by itself is now generalized success
19:36 jnthn Hm
19:36 jnthn No, not that... :)
19:36 jnthn TimToady: What do you think the definition of the thing that replaces Match will look like?
19:36 TimToady moritz: use case?
19:36 moritz TimToady: debugging
19:37 TimToady well, not many things will be returning OK other than match
19:37 TimToady most .ACCEPTS just return True or False
19:37 moritz can't we just continue to call it Match then?
19:38 moritz and require defined-but-false Match to .gist-ify something that clearly indicates a match failure?
19:38 TimToady Match is not a good name for success, I think
19:38 moritz nom: say 'a' ~~ /b/
19:38 p6eval nom bd5adb: OUTPUT«#<failed match>␤»
19:38 moritz or maybe return a different type from a failed match
19:38 * moritz is kinda fond of Match being returned from a match.
19:39 TimToady so I perceive, but maybe it's just sentimental attachment
19:39 moritz and maybe it's genuine
19:39 TimToady we're trying for clean primitives here, and most languages just give you something vs Nil
19:40 TimToady before it was just handwaving that makes Match work with smartmatching (when it does work)
19:41 moritz yes, I agree that something should be done in that area
19:41 [Coke] Anyone planning to go to YAPC::NA? they're looking for intro talks, wondering if an intro to perl6 would be good.
19:41 TimToady I really do think that people will not find it confusing for matches to return OK or Nil
19:42 TimToady eek, *do not
19:42 TimToady eek, nevermind
19:42 * TimToady can't read
19:42 benabik OK just being able to store random information for the match seems stranger to me.
19:44 skids Yeah it's the part about OK being the type where things like .from and .to are specified that feels a bit icky.
19:44 TimToady well, of course it's stranger till you get used to it...historically most of my strange unifications have been...strange...
19:45 moritz TimToady: do you think of OK as actually delegating to its payload, or more like mixing stuff in?
19:45 TimToady there probably is a "match" object hiding inside of OK that, as the delegate, dispatches all those matchly methods
19:45 skids but cannot exist without an OK wrapping it?
19:46 TimToady moritz: it's really a primitive composition, and doesn't really describe itself well in terms of high-level constructs
19:46 TimToady skids: it can, but won't respond to smartmatching the way you'd think
19:46 jnthn TimToady: So your use of "role" here is just trying to convey the idea rather than say what you really think OK and Nil are?
19:47 TimToady nodnod
19:47 moritz TimToady: creating a new OO construct feels like a bit of a warning sign (not saying it's wrong, but...)
19:47 TimToady sorry for all the misleading metaphors
19:47 TimToady moritz: more trying to describe what's already there on some levels
19:48 TimToady or in some cases ought to be there as primitive as booleanness already is
19:48 jnthn TimToady: It almost feels like you want to apply the decorator pattern at the meta-object level. :)
19:49 jnthn TimToady: That is, we're really defining a class BUT with some set of presumptions that normal classes don't have.
19:50 TimToady yes, just like native types
19:50 TimToady and with similar restrictions on being productive
19:50 TimToady (as well as potential efficiency benefits)
19:51 snearch joined #perl6
19:53 TimToady OK might even delegate the HOW to the "real" object, since OKness is just some bits
19:53 jnthn TimToady: Yes, that's what I was getting at when I said decorator.
19:53 TimToady there might be no effective difference between "0 but OK" and "OK but 0"
19:54 jnthn That seems hard to imagine
19:54 TimToady it would have to be trapped and cheated on, if so
19:55 TimToady or we use other notation for it
19:56 jnthn Yes, because flattening composition normally implies that the meta-object being composed in doesn't play a role beyond the composition (maybe apart from appearing in the type check list of the target type)
19:56 TimToady if we hijack OK[] then we cheat in role space rather than infix:<bug>
19:56 TimToady er, *but  :)
19:57 benabik Does but True and but False become playing with OK and Nil?
19:57 TimToady or we just have some primitive macros that flip bits
19:57 TimToady benabik: perhaps, if we cheat using "but"
19:58 xinming joined #perl6
19:58 TimToady officemates at the door...
19:58 TimToady lunch &
20:10 xinming joined #perl6
20:18 dalek rakudo/nom: d4d4a21 | jnthn++ | src/Perl6/Metamodel/Mixins.pm:
20:18 dalek rakudo/nom: Fix but True / but False.
20:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d4d4a21f1e
20:37 spine joined #perl6
20:54 spine hi #perl6
20:54 masak OK/Nil seems to me like an odd pairing.
20:55 masak spine: hi!
20:55 spine anyone got an idea why my local variables don't get gced on nom?
20:55 spine perl6 -e 'sub a { my $b = "x" x 10_000; }; a() for 1..*;' eats up my memory at 40MB/s.
20:55 masak sounds like a bug.
20:56 jnthn nom doesn't know about sink context yet
20:56 jnthn So it's acting like map and building up a result list
20:57 jnthn It's not a GC bug, it's that we're actually holding on to them until the end of the for loop, when we should be throwing them away.
20:58 jnthn I'll bet if that sub is sub a { my $b = "x" x 10_000; 1; } then it doesn't leak.
20:58 spine jnthn: oh, I see
20:58 masak I like the unification of making fail/succeed semantic cousins.
20:59 masak as well as Nil.anything passing on Nil.
20:59 masak if Nil is now an item, we need a new idiom for the "empty for loop" use case.
21:00 jnthn spine: Yeah. It's a bug, but not about GC of local variables.
21:00 spine jnthn: so I'll just be careful to return something small from my functions for now :)
21:01 PerlJam jnthn: I agree with your assessment, but it still leaks with the return value
21:01 masak bare return still needs to return something that's false and undefined, IMO.
21:01 PerlJam masak: agreed.
21:02 PerlJam (but I may just be agreeing because of my history with Perl 5)
21:02 jnthn PerlJam: er, yeah
21:02 jnthn I shoulda said "leaks a lot slower" rather than "doesn't leak"
21:02 jnthn Nil as the last thing may not leak.
21:03 jnthn But the real answer is "need sink"
21:03 PerlJam aye
21:04 masak PerlJam: yeah, me too. maybe it is as moritz++ says that 'return' now means, 'OK, we're done here, return successfully'.
21:05 masak PerlJam: maybe routines that exit with 'return' should be considered to have done a 'void return', and the value will explode if ever inspected by the caller :)
21:05 dalek nqp/bs: 1cb59b4 | jnthn++ | / (2 files):
21:05 dalek nqp/bs: Sketch out NQPRoutine and NQPSignature, which we'll migrate towards in place of a couple of PMCs. This will ease serialization, eliminate two PMCs and also eliminate our use of :instanceof. Hopefully...
21:05 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/1cb59b49ff
21:05 dalek nqp/bs: 52e0e73 | jnthn++ | / (6 files):
21:05 dalek nqp/bs: Move NQP's multi-dispatcher out of the 6model folder; it's not a core part of 6model.
21:05 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/52e0e73cf9
21:05 dalek nqp/bs: 37c6c88 | jnthn++ | / (2 files):
21:05 dalek nqp/bs: NQPRoutine needs to delegate invocation in order to serve as a code object.
21:05 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/37c6c88b52
21:05 dalek nqp/bs: 22467fe | jnthn++ | src/guts/multi_dispatch.h:
21:05 dalek nqp/bs: Sketch out C struct mappings for NQPRoutine and NQPSignature.
21:05 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/22467febe5
21:06 masak that doesn't sound too Perlish, though.
21:06 PerlJam nope
21:06 PerlJam almost makes me want another keyword ...  "finish"
21:07 PerlJam but maybe we should get rid of return and entirely and just use succeed/fail
21:07 PerlJam s/and//
21:07 [Coke] how would succeed differ from return?
21:08 [Coke] . o O (succeed Failure.new())
21:08 PerlJam [Coke]: mostly in connotation.   "succeed" says more about the result than "return" does
21:12 masak maybe that's the thing. 'return' is neutral. 'succeed' is a successful return. 'fail' is a return in shame.
21:12 masak I could certainly imagine coding like that :)
21:12 PerlJam me too
21:13 PerlJam the only problem is that to "steal" succeed from when blocks like that probably means it will need a replacement :)
21:13 [Coke] meh.
21:14 masak does it.
21:14 masak s/\./?/
21:15 PerlJam (I'd vote for "done")
21:15 masak [Conjecture: fail scopes to topicalizer/sub the same as succeed]
21:15 masak sounds to me we'd get to keep the 'when' block semantics.
21:15 PerlJam I dunno.  that's deeper thoughts than I can give right now.
21:15 masak and 'done' is taken by Test.pm :)
21:16 tk_ joined #perl6
21:16 tk_ hi, so what is the different between rakudo star and rakudo on parrot
21:16 masak tk_: hi!
21:16 PerlJam tk_: rakudo star has a bunch of modules and things
21:16 masak tk_: both of those run on Parrot.
21:17 PerlJam tk_: rakudo star *is* "rakudo on parrot" but with more stuff
21:17 masak Rakudo proper is just the compiler. Rakudo Star bundles a bunch of nice stuff.
21:17 tk_ oh so rakudo star is snapshots of rakudo compiler + modules and stuff?
21:18 MayDaniel joined #perl6
21:18 masak aye.
21:18 tk_ :)
21:18 tk_ appreciate it
21:18 masak rakudo: say "OH HAI, tk_!"
21:18 p6eval rakudo bd5adb: OUTPUT«OH HAI, tk_!␤»
21:18 masak star: say "This is Rakudo Star speaking :)"
21:18 p6eval star 2012.01: OUTPUT«This is Rakudo Star speaking :)␤»
21:19 masak see there, the rakudo gives a git hash (latest commit) as its version, but the star one gives a release version number.
21:19 tk_ :)
21:19 tk_ so cool
21:19 masak so it's wheels within wheels. one develops quickly, the other is more stable.
21:19 [Coke] star: use Nativecall;\
21:19 p6eval star 2012.01: OUTPUT«===SORRY!===␤Could not find Nativecall in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/rakudo-star-2012.01/install​/lib/parrot/3.11.0/languages/perl6/lib, .␤»
21:19 masak yeah, the bots are cool. I forget sometimes how cool they are. :)
21:19 [Coke] star: use Nativecall;
21:19 p6eval star 2012.01: OUTPUT«===SORRY!===␤Could not find Nativecall in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/rakudo-star-2012.01/install​/lib/parrot/3.11.0/languages/perl6/lib, .␤»
21:20 [Coke] star: use NativeCall;
21:20 PerlJam [Coke]: heh, I just did that in /msg
21:20 p6eval star 2012.01:  ( no output )
21:20 [Coke] (ugh!)
21:20 [Coke] rakudo: use NativeCall;
21:20 p6eval rakudo bd5adb: OUTPUT«===SORRY!===␤Could not find NativeCall in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/nom-inst1/lib/parrot​/4.0.0-devel/languages/perl6/lib, .␤»
21:20 [Coke] (there's a concrete example.)
21:20 tk_ [Coke]: tyvm
21:20 tk_ was it difficult updating rakudo to work with parrot 4.0?
21:21 masak star: say "[[[[[]]]]]".comb.pick(*).join
21:21 p6eval star 2012.01: OUTPUT«][[][]][][␤»
21:21 masak tk_: don't think so.
21:21 masak tk_: communication these days flows fairly effortlessly between the Rakudo camp and the Parrot camp.
21:21 tk_ parrot seems like a very difficult project
21:22 PerlJam tk_: like anything else, the hard part is nailing down what "it" is.
21:22 tk_ yes, i admire the vision of the parrot foundation
21:23 masak Parrot is suffering a little bit from lack of a Very Satisfied Customer.
21:23 masak Rakudo is its main customer, but we've had to invent some of the stuff itself because (at the time, at least) Rakudo couldn't wait for Parrot to get them.
21:24 tk_ so was the stuff built on rakudo or contributed to parrot?
21:24 PerlJam tk_: both
21:25 tk_ have anyone here contributed to the perl 6 book?
21:25 PerlJam tk_: you can think of some of the things pioneered with Rakudo as the test run for what gets implemented in Parrot
21:25 masak tk_: most people who have contributed to the Perl 6 book hang out here, yes.
21:26 PerlJam masak: most?  Who doesn't?  ;)
21:26 pernatiy joined #perl6
21:26 tk_ is the virtual machine a new concept for perl?
21:27 tk_ is parrot the first perl virtual machine?
21:27 PerlJam tk_: that it's a separate, well-defined thing is new to Perl
21:27 masak PerlJam: I was pretty sure there are contributors of smaller things who aren't regulars here... :)
21:27 PerlJam tk_: but Perl 5 has a VM of sorts
21:27 tk_ PerlJam: oh?
21:27 masak everyone is so surprised Perl 5 has a VM! :)
21:28 tk_ i had to ask
21:28 masak oh, sure.
21:28 tk_ i hope perl 6 kills java
21:28 masak tk_: Perl 5 code gets compiled into some kind of op tree. the interpreter then runs the op tree.
21:28 PerlJam I hope Perl 6 doesn't kill anything
21:29 PerlJam I hope that Perl 6 lives and thrives and makes its own way in the world
21:29 benabik Oracle's doing a pretty good job of killing Java.  They don't need help.  ;-)
21:29 masak I find it unlikely that everyone doing Java today will do Perl 6 tomorrow. :)
21:29 tk_ they are opposite
21:29 PerlJam benabik: we just have to cross our fingers that Oracles doesn't decide to help Perl 6  ;)
21:30 PerlJam s/les/le/
21:30 tk_ is a virtual machine defined in the specification of perl 6?
21:30 tk_ is it in java?
21:31 benabik Java's VM has a specification.  I don't think the language spec is explicitly tied to it.  (I could be wrong.)
21:31 PerlJam tk_: I don't think that Perl cares how things are implemented as long as they have the proper syntax and semantics.
21:31 xinming joined #perl6
21:32 [Coke] masak: I do java. I'd drop it for perl6 if I could make a convincing business case. (but sadly cannot)
21:32 masak tk_: you'd have a hard time making a fully compliant Perl 6 implementation that *didn't* run on a VM.
21:32 geekosaur tk_, there is no VM specified, and two of the current implementations are on different VMs (Parrot and CLR)
21:33 tk_ so the perl virtual machine is made so that perl can run cross - compatible? what are the advantages and disadvantages?
21:33 geekosaur er?
21:33 masak [Coke]: main reason I'm still doing helping with Perl 6 is to see it ease into the world a little each day. so that I (and others) can use it practically for more things.
21:34 tk_ geekosaur: i realize that one advantage of a virtual machine is that programs can be run independently of the system they are running on. but what are the _real_ advantages?
21:34 PerlJam masak: watching it ease into Perl 5 is interesting too :)
21:34 masak indeed.
21:34 masak but they can't steal some of our best stuff because backwards compat.
21:35 PerlJam depends on how well obra's plan for the future is executed.  It may be that one day they break back-compat. because they can.
21:36 masak nod.
21:36 masak obra++
21:36 PerlJam and then we'll wake up one day and Perl 5 will have morphed into Perl 6 and there will only be Perl  :)
21:37 jnthn tk_: All we really mean by "virtual machine" here is "something that provides services that a language implementation needs at runtime". Part of that is access to the underlying OS, part of it is garbage collection (freeing memory that is no longer in use), part of it is actually executing code, and so on.
21:39 tk_ nqp is like rakudo in that it compiles code for parrot?
21:40 PerlJam tk_: you can think of nqp as a mini-perl6
21:41 [Coke] ISTR jnthn++ had a nice slide for that.
21:41 dalek nqp/bs: 52c1b2b | jnthn++ | src/NQP/ (3 files):
21:41 dalek nqp/bs: Big refactor of block and symbol handling in NQP. This more fully shuffles it into NQP::World, matching the factoring that's worked out so nicely in Rakudo. It'll also make the upcoming multi refactoring much easier.
21:41 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/52c1b2b3bd
21:42 jnthn [Coke]: You may be thinking of the Rakudo architecture diagram from get_legacy_block_list()
21:42 jnthn er
21:42 jnthn from http://jnthn.net/papers/2011-tcpw-optimization.pdf
21:45 [Coke] jnthn: that seems sufficiently recent and pretty, yes.
21:45 [Coke] tk_: try that URL, page through to "Rakudo Architecture".
21:48 tk_ ruby v python?
21:50 PerlJam ruby wins!
21:50 xinming joined #perl6
21:51 tk_ i havent used it, but i'm not sure if i can love anything as much as python
21:51 tk_ i also think that the industry needs to catch up with py3
21:52 masak good luck.
21:52 tk_ its unfortunate that i have to write code in py2
21:52 tk_ s/have/am forced
21:55 masak now you know how we feel, with Perl 5 and Perl 6 :)
21:56 tk_ "the perl 6 teleportation project"
21:56 rsimoes1 joined #perl6
21:57 tk_ in which caffeined perl 6 macho devs port every package to perl 6
21:57 tk_ [Coke]: 'we do a few fixups do world' ..??
21:58 tk_ is AST v World like .c v .h?
21:58 [Coke] tk_: context?
21:58 tk_ in the slide
21:59 tk_ 'how rakudo runs programs'
21:59 jnthn tk_: The AST captures the execution aspects of the program (like statements). The World captures the declarations (classes, routines, etc.)
22:00 dalek joined #perl6
22:01 jnthn tk_: There's a phase when we've compiled the AST when we need to tweak some things. In Perl 6 you can run code at compile time, so when we parse a routine, we install a "compile it on demand" stub thingy. But before we run the program we have to replace that "compile on demand" stub with the real compiled output.
22:01 jnthn That phase is called "fixup time" in Rakudo.
22:02 jnthn nom: sub foo() { say "I get run!" }; BEGIN { foo() }; omfg !!!!! a parse error!!
22:02 p6eval nom bd5adb: OUTPUT«I get run!␤===SORRY!===␤Confused␤at /tmp/ss0bh2qdR4:1␤»
22:03 tk_ jnthn: is that the basis of JIT? in order to run at compile time?
22:03 jnthn tk_: No, JIT would be at a rather lower level than this.
22:04 jnthn tk_: Though the "on demand" compilation is indeed what JIT compilers do.
22:04 tk_ jnthn: its a concept that needs a name
22:04 jnthn tk_: But this is something else.
22:04 jnthn tk_: In Perl 6 we talk about BEGIN time. This is the time during compilation.
22:04 jnthn So the code I wrote there gets run at BEGIN time.
22:05 jnthn (and no, it's not something you do very often :-))
22:05 jnthn (it's a power tool)
22:05 PerlJam parse-time thunking of compile-time information for proper run-time semantics
22:06 PerlJam (but run-time could happen at any time ;)
22:08 jnthn Perl 6 kinda blurs the lines for the user, but if you're implementing the stuff you'd better know which you're doing at a given point in time. :)
22:10 tk_ pypy is so cool
22:10 tk_ it translates python into c
22:12 tk_ so does rakudo compile perl 6 into a subset of perl 6 for efficient compilation?
22:12 tk_ i.e. nqp
22:13 jnthn tk_: No, both Rakudo and NQP genrate an AST, and that is in turn transformed into code for the Parrot VM.
22:13 jnthn tk_: NQP being simpler allows us to more easily optimize it, and means it can be bootstrapped too.
22:14 jnthn Well, we could technically bootstrap all of Rakudo, but...I'd not fancy that. :)
22:14 tk_ what is bootstrapped
22:14 jnthn tk_: NQP can compile itself.
22:14 jnthn tk_: That is, it's written in NQP.
22:14 tk_ it said it was written in parrot
22:15 jnthn At least, mostly; the few parts left that aren't soon will be.
22:15 PerlJam tk_: bootstrapping is building just enough of a compiler to write a complicated compiler.  Keep doing that until you have the compiler of appropriate complexity that you wan.t
22:15 PerlJam to write a more complicated compiler.
22:15 tk_ rakudo uses nqp?
22:15 PerlJam tk_: ye
22:15 jnthn tk_: Rakudo is mostly written in NQP
22:16 tk_ so you could eliminate rakudo and write in nqp?
22:16 jnthn tk_: Yes, NQP is a language in its own right.
22:16 tk_ why wouldnt you do that, jnthn
22:16 jnthn tk_: It's a subset of Perl 6, with just the right things for writing compilers.
22:16 tk_ thats what i said
22:16 PerlJam tk_: NQP doesn't have assignment for instance.  Only binding.
22:17 tk_ example? i dont
22:18 isBEKaml joined #perl6
22:19 masak binding is tying a value to a variable. assignment is placing a value in a container (which in turn may be tied to a variable).
22:19 masak nom: my $a; my $b := $a; $a = 42; say $b
22:19 p6eval nom bd5adb: OUTPUT«42␤»
22:19 masak (the ':=' is binding, and makes $b and $a point to the same container)
22:20 masak so, um, binding is tying *something* to a variable -- either a value or a container.
22:20 masak nom: my $a := 42; $a = 5
22:20 p6eval nom bd5adb: OUTPUT«Cannot assign to a non-container␤  in block <anon> at /tmp/p6UiRlEkLx:1␤␤»
22:21 masak when tying $a directly to a value like that, it loses its ability to be assigned to. because the container that assignment needs is out of the loop -- there's just the variable and the value.
22:21 tk_ so declare and define is equivalent to bind and assign?
22:21 masak I'm not sure that analogy holds, no.
22:25 tk_ what else is := used for?
22:26 masak signature binding.
22:26 masak nom: sub foo($a) { say $a }; my $b = 42; foo($b)
22:26 p6eval nom bd5adb: OUTPUT«42␤»
22:26 masak the $a and the $b are distinct variables, but they need to point to the same value/container.
22:27 masak binding to the rescue.
22:27 tk_ thank you, lover.
22:28 * masak has never been called "lover" on #perl6 before :)
22:29 tk_ normally i'd reserve that language for my usb port, but you're something special ;)
22:29 masak not gonna argue there. :)
22:29 pyrimidine it's getting hot in here :)
22:30 * masak should've said "...I see my reputation precedes me" :)
22:32 masak tk_: we do want to let newbies feel they are loved when they arrive. we love to heap attention on them.
22:33 tk_ i'm speechless
22:33 * tk_ has a sense of gratitude in his eyes
22:35 tk________ *ahem*
22:35 * tk________ crosses legs
22:38 masak now that's perhaps somewhat below the level of discourse we try to keep around here.
22:38 masak keep in mind this is a family channel.
22:39 tk________ im trying to keep it g
22:39 xinming joined #perl6
22:41 drbean joined #perl6
22:41 masak nom: .say for (1, 1, 2, * + * ... *)[^20]
22:41 p6eval nom bd5adb: OUTPUT«1␤1␤2␤3␤5␤8␤13␤21␤34␤55␤89␤144␤​233␤377␤610␤987␤1597␤2584␤4181␤6765␤»
22:42 lestrrat joined #perl6
22:44 isBEKaml joined #perl6
22:44 tk______ masak: in the signature binding example you never used :=
22:48 masak no, because the binding is done behind the scenes, through the function call.
22:48 masak but you asked about another example of binding, not of the actual ':=' syntax.
22:48 tk______ oh
22:49 tk______ OH
22:49 fridim_ joined #perl6
22:50 tk______ my comp sci teacher always used to say "java 5's new boxing feature hurr durr" which made primitive data types into objects
22:50 tk______ autoboxing
22:52 masak in Perl 6, Int is a full-featured object, and int is the native type.
22:53 masak generally, you'd use Int for full flexibility, and int for memory compactness/speed.
22:55 tk______ a:=42 is that an Int or int
22:56 masak std: a := 42
22:56 p6eval std 52f3895: OUTPUT«[31m===[0mSORRY![31m===[0m�Preceding context expects a term, but found infix := instead at /tmp/SaaPMU4bNU line 1:�------> [32ma [33m�[31m:= 42[0m�Parse failed�FAILED 00:01 109m�»
22:56 masak it's not syntactically correct Perl 6.
22:57 masak you need to declare variables, using 'my' or equivalent.
22:57 benabik nom: my \a := 42; say a
22:57 p6eval nom bd5adb: OUTPUT«===SORRY!===␤Malformed my at line 1, near " \\a := 42;"␤»
22:57 benabik NYI, I guess.
22:58 tk______ masak: so, using = on an int would be illegal?
22:58 tk______ because it doesnt have a container
22:58 tk______ in reference to your earlier example
22:58 jnthn tk______: If you want to work with native types, you have to explicitly declare variables as being natives
22:59 jnthn my int $a = 42; # $a stores 42 as a native integer
22:59 jnthn my $a = 42; # $a stores 42 as a boxed Int
22:59 tk______ std: my int $a = 42; $b = 43
22:59 p6eval std 52f3895: OUTPUT«[31m===[0mSORRY![31m===[0m�Variable $b is not predeclared at /tmp/3JLRbG4vmK line 1:�------> [32mmy int $a = 42; [33m�[31m$b = 43[0m�Check failed�FAILED 00:01 111m�»
22:59 tk______ std: my int $a = 42; my $b = 43
22:59 p6eval std 52f3895: OUTPUT«ok 00:01 110m␤»
23:00 tk______ std: my int $a = 42; my $b = $a
23:00 p6eval std 52f3895: OUTPUT«ok 00:01 110m␤»
23:00 tk______ std: my int $a := 42; my $b = $a
23:00 p6eval std 52f3895: OUTPUT«ok 00:01 110m␤»
23:00 masak tk______: your question about natives, assignment, and containers makes a lot of sense. I don't know the answer, though.
23:00 tk______ std: my $a := 42; my $b = $a
23:00 p6eval std 52f3895: OUTPUT«ok 00:01 110m␤»
23:00 masak keep in mind that STD only checks syntax, it doesn't run your code.
23:01 skids jnthn: that kinda confuses me given the "native types dispatch to their container's methods" thing, which makes me expect "my $i = int(42)" to be the way to do things.
23:02 tk______ nom: my $a := 42; my $a = 5
23:02 p6eval nom bd5adb: OUTPUT«===SORRY!===␤Redeclaration of symbol $a␤at /tmp/EMNdolqru0:1␤»
23:02 tk______ nom: my $a := 42; $a = 5
23:02 p6eval nom bd5adb: OUTPUT«Cannot assign to a non-container␤  in block <anon> at /tmp/cDYF5FsQjy:1␤␤»
23:02 tk______ nom: my int $a := 42; $a = 5
23:02 p6eval nom bd5adb: OUTPUT«===SORRY!===␤Cannot bind to a natively typed variable; use assignment instead␤at /tmp/onl5kHz6Ht:1␤»
23:02 tk______ nom: my int $a = 42; $a = 5
23:02 p6eval nom bd5adb:  ( no output )
23:02 masak seems it's binding that doesn't work for natives.
23:03 jnthn Correct.
23:03 jnthn Because there's no container.
23:03 tk______ so its Int by default
23:03 lestrrat joined #perl6
23:03 tk______ nom: my Int $a := 42; $a = 5
23:03 p6eval nom bd5adb: OUTPUT«Cannot assign to a non-container␤  in block <anon> at /tmp/HL7WKXUkdu:1␤␤»
23:04 jnthn skids: It's not quite like that - actually if you do a method call on a native type it has to box it first.
23:04 jnthn skids: When you declare "my int ..." you're saying "don't allocate a container, instead just make space in the lexpad for a native integer"
23:06 dalek nqp/bs: 0fad218 | jnthn++ | src/ops/nqp.ops:
23:06 dalek nqp/bs: Add an op for setting the signature as a single object.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/0fad218b9f
23:06 dalek nqp/bs: e7be6cc | jnthn++ | src/guts/multi_dispatch.h:
23:06 dalek nqp/bs: Fix typo.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/e7be6cc27c
23:06 dalek nqp/bs: 18f17e9 | jnthn++ | src/ops/nqp.ops:
23:06 dalek nqp/bs: Oops, can't remove this yet - gotta go round the bootstrap loop.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/18f17e95d6
23:06 dalek nqp/bs: 78fb2c3 | jnthn++ | src/guts/multi_dispatch.c:
23:06 dalek nqp/bs: Get multi dispatcher to recognize both new and old way of doing the signature for a moment.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/78fb2c37bd
23:06 dalek nqp/bs: bfadf52 | jnthn++ | src/NQP/ (2 files):
23:06 dalek nqp/bs: Switch to using the new signature objects.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/bfadf52a65
23:06 dalek nqp/bs: 1ac3f88 | jnthn++ | src/guts/multi_dispatch.c:
23:06 dalek nqp/bs: Quick tweak and...the new signature objects work.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/1ac3f88f04
23:06 dalek nqp/bs: 33fc4d2 | jnthn++ | src/stage0/ (6 files):
23:06 dalek nqp/bs: Update bootstrap.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/33fc4d2c5a
23:06 dalek nqp/bs: 7c8a11c | jnthn++ | / (4 files):
23:06 dalek nqp/bs: Rip out the NQPMultiSig PMC; we don't need it any more.
23:06 dalek nqp/bs: review: https://github.com/perl6/nqp/commit/7c8a11cc1f
23:06 tk______ so if youre binding an integer you could just use native types for memory efficiency
23:07 jnthn Yeah *but* Int also provides big integer semantics.
23:07 skids so "my int $i" declares a virtual container that autoboxes into ... ? ... and then methods called on its contents (an immutable int) dispatch to the result of the autobox.
23:07 jnthn nom: say [*] 1..100
23:07 p6eval nom bd5adb: OUTPUT«93326215443944152681699238856266700​490715968264381621468592963895217599993229​915608941463976156518286253697920827223758​251185210916864000000000000000000000000␤»
23:07 jnthn Much bigger than a native int can store.
23:08 jnthn skids: If you do $i.foo then it code-gens a boxing if $i into an Int.
23:08 jnthn And then what you said, yes.
23:08 jnthn s:2nd/if/of
23:09 shinobicl_ joined #perl6
23:09 tk______ so binding essentially erases the container of an Int?
23:10 tk______ nom: my $a = 5; $a := 42
23:10 pat_js joined #perl6
23:10 p6eval nom bd5adb:  ( no output )
23:10 tk______ nom: my $a = 5; $a := 42; $a := 5; $a = 5
23:10 p6eval nom bd5adb: OUTPUT«Cannot assign to a non-container␤  in block <anon> at /tmp/Ti0vvEUFZh:1␤␤»
23:10 tk______ nom: my $a = 5; $a := 42; $a := 5
23:10 p6eval nom bd5adb:  ( no output )
23:11 tk______ nom: my $a = 5; $a := 42; $a := [*] 1..100; say $a
23:11 p6eval nom bd5adb: OUTPUT«93326215443944152681699238856266700​490715968264381621468592963895217599993229​915608941463976156518286253697920827223758​251185210916864000000000000000000000000␤»
23:11 xinming joined #perl6
23:12 tk______ nom: my int $a = [*] 1..100; say $a
23:12 p6eval nom bd5adb: OUTPUT«0␤»
23:12 tk______ nom: my $a = [*] 1..100; say $a
23:12 p6eval nom bd5adb: OUTPUT«93326215443944152681699238856266700​490715968264381621468592963895217599993229​915608941463976156518286253697920827223758​251185210916864000000000000000000000000␤»
23:13 skids OK, so if "int $i" is contains the platform's MAXINT, and you call "$i++", then at some point after the boxing, the Int gets unboxed again, and that's when we'd get an error, or is Int supposed to have some wisdom about underlying REPRs?
23:14 tk______ is all this Int and boxing stuff defined in the spec?
23:15 jnthn skids: ++ is an operator. When we're done with natives, that'll just be a CPU-level increment. And it should check for overflow and throw also.
23:15 skids The binding stuff and such related material is kinda scattered around the specs, really needs a more congealed workup.
23:16 jnthn Note that the native types implementation is still quite new and experimental.
23:16 masak yes, the thing with native types and boxing is defined by the spec.
23:16 jnthn It works well in various places, and not so well in others just yet.
23:16 skids jnthn: that, I have definitely noticed :-)
23:17 jnthn skids: Yeah. Many improvements there are on my todo list.
23:19 skids WRT the ++ example, I was thinking more on a "theoretically if we didn't have an optimizer" specifications level.
23:21 isBEKaml joined #perl6
23:24 shinobicl_ left #perl6
23:24 Trashlord joined #perl6
23:29 masak 'night, #perl6
23:35 whiteknight joined #perl6
23:37 xinming joined #perl6
23:44 * jnthn figures he'd best get some rest also
23:44 jnthn 'night
23:44 xinming joined #perl6
23:48 tomaw joined #perl6
23:57 tokuhirom joined #perl6

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

Perl 6 | Reference Documentation | Rakudo