Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-02-01

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 supernovus joined #perl6
00:02 Tenzen joined #perl6
00:03 supernovus Not sure if there's any demand for it, but my latest project is a template engine for Perl 6, inspired by Template Toolkit. It should work well with WWW::App to enable building MVC-style web apps in Perl 6.
00:03 skids joined #perl6
00:04 supernovus No code link yet. I just finished abandoning my Garden template language, which was a monstrosity. So, I'm starting from scratch for this project (currently using the very unoriginal name of Template6)
00:09 benabik joined #perl6
00:18 bacek joined #perl6
00:46 Trashlord joined #perl6
01:36 sorear good * #perl6
01:55 shinobicl___ joined #perl6
02:15 skids What are the current options for pod2* converters?
02:28 wolfman2000 joined #perl6
02:36 zjmarlow joined #perl6
02:41 leprevost joined #perl6
02:57 chee joined #perl6
02:57 chee joined #perl6
03:01 sorear skids: not a p6 specific question, and I have no clue
03:02 sorear skids: ask around on MAGnet... if Google won't help, I suggest maybe #toolchain
03:04 abercrombie Hi guys, a quick question: how do I test if the replacement got executed successfully in s/// expression? if $str ~~ s/../../ {..} doesn't work in this case.
03:06 Exodist joined #perl6
03:16 orafu joined #perl6
03:17 TimToady you can test $/ instead
03:17 TimToady perl6: $_ = 'foo'; say so s/food/bar/; say so $/
03:17 p6eval niecza v13-389-g852f0ff: OUTPUT«False␤False␤»
03:17 p6eval ..rakudo ce5cca: OUTPUT«True␤False␤»
03:17 p6eval ..pugs b927740: OUTPUT«*** No such subroutine: "&so"␤    at /tmp/2zlZDpLXG1 line 1, column 17-31␤»
03:17 TimToady perl6: $_ = 'foo'; say so s/foo/bar/; say ?$/
03:18 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«True␤True␤»
03:18 p6eval ..pugs b927740: OUTPUT«*** No such subroutine: "&so"␤    at /tmp/NMB1ziZZHE line 1, column 17-30␤»
03:18 TimToady perl6: $_ = 'foo'; say ?s/foo/bar/; say ?$/
03:18 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«True␤True␤»
03:18 p6eval ..pugs b927740: OUTPUT«1␤␤»
03:18 TimToady perl6: $_ = 'foo'; say ?s/goo/bar/; say ?$/
03:18 p6eval niecza v13-389-g852f0ff: OUTPUT«False␤False␤»
03:18 p6eval ..rakudo ce5cca: OUTPUT«True␤False␤»
03:18 p6eval ..pugs b927740: OUTPUT«1␤␤»
03:18 sorear rakudobug? nieczabug?
03:19 TimToady niecza looks correct
03:20 TimToady though I like pugs answer, which follows P5
03:21 sorear doesn't pugs have the same result as rakudo?
03:21 sorear pugs: say True
03:21 p6eval pugs b927740: OUTPUT«1␤»
03:21 sorear pugs: say True.WHAT
03:21 p6eval pugs b927740: OUTPUT«Bool␤»
03:21 TimToady perl6: $_ = 'foo'; say s/o/x/.perl; say $/.perl
03:22 p6eval niecza v13-389-g852f0ff: OUTPUT«Bool::True␤#<match from(1) to(2) text(o) pos([].list) named({}.hash)>␤»
03:22 p6eval ..pugs b927740: OUTPUT«{subst}␤\Match.new(␤  ok => Bool::False, ␤  from => 0, ␤  to => 0, ␤  str => "", ␤  sub_pos => (), ␤  sub_named => {}␤)␤»
03:22 p6eval ..rakudo ce5cca: OUTPUT«"fxo"␤Match.new(orig => "foo", from => 1, to => 2, ast => Any, list => ().list, hash => EnumMap.new())␤»
03:22 TimToady perl6: $_ = 'foo'; say s:g/o/x/.perl; say $/.perl
03:22 p6eval pugs b927740: OUTPUT«{subst}␤\Match.new(␤  ok => Bool::False, ␤  from => 0, ␤  to => 0, ␤  str => "", ␤  sub_pos => (), ␤  sub_named => {}␤)␤»
03:22 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Bool::True␤#<match from(2) to(3) text(o) pos([].list) named({}.hash)>␤»
03:22 p6eval ..rakudo ce5cca: OUTPUT«"fxx"␤Match.new(orig => "foo", from => 2, to => 3, ast => Any, list => ().list, hash => EnumMap.new())␤»
03:22 cognominal_ joined #perl6
03:22 sorear why does Match have 'ok'?
03:23 TimToady perl6: $_ = 'foo'; say +s:g/o/x/;
03:23 p6eval pugs b927740: OUTPUT«*** Cannot cast from VSubst (MkSubst {substRegex = MkRulePGE {rxRule = "o", rxGlobal = True, rxStringify = False, rxAdverbs = VRef <Hash:0x7f58cdf77411>}, substExp = Ann (Cxt (CxtItem (mkType "Str"))) (Val (VStr "x"))}) to Double (VNum)␤    at /tmp/tlz2tpY9_T line 1…
03:23 p6eval ..niecza v13-389-g852f0ff: OUTPUT«1␤»
03:23 p6eval ..rakudo ce5cca: OUTPUT«0␤»
03:24 TimToady perl6: $_ = 'foo'; say +s:g/o/x/; .say
03:25 p6eval rakudo ce5cca: OUTPUT«0␤fxx␤»
03:25 p6eval ..pugs b927740: OUTPUT«*** Cannot cast from VSubst (MkSubst {substRegex = MkRulePGE {rxRule = "o", rxGlobal = True, rxStringify = False, rxAdverbs = VRef <Hash:0x7f0ac715e459>}, substExp = Ann (Cxt (CxtItem (mkType "Str"))) (Val (VStr "x"))}) to Double (VNum)␤    at /tmp/udse4zbKvK line 1…
03:25 p6eval ..niecza v13-389-g852f0ff: OUTPUT«1␤fxx␤»
03:26 TimToady eval: $_ = 'foo'; print s/o/x/g, "\n";
03:26 buubot_backup TimToady: 2 1
03:27 Exodist joined #perl6
03:27 TimToady is there any good reason not to return the number of substitutions like P5 does?
03:28 TimToady hmm, I guess smartmatching rears its head there...
03:28 TimToady perl6: say True but 3
03:28 p6eval pugs b927740: OUTPUT«*** Cannot cast from VInt 3 to VCode (VCode)␤    at Prelude.pm line 541, column 5-16␤»
03:28 p6eval ..rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«True␤»
03:28 TimToady perl6: say +(True but 3)
03:28 p6eval pugs b927740: OUTPUT«*** Cannot cast from VInt 3 to VCode (VCode)␤    at Prelude.pm line 541, column 5-16␤»
03:28 p6eval ..rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1␤»
03:29 benabik TimToady: True but 3 only overrides True.Bool
03:29 benabik *.Int
03:29 benabik (I hit that earlier)
03:29 TimToady perl6: say +(True but 3e0)
03:29 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1␤»
03:29 p6eval ..pugs b927740: OUTPUT«*** Cannot cast from VRat (3 % 1) to VCode (VCode)␤    at Prelude.pm line 541, column 5-16␤»
03:30 TimToady perl6: say +(True but 3.0e0)
03:30 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1␤»
03:30 p6eval ..pugs b927740: OUTPUT«*** Cannot cast from VRat (3 % 1) to VCode (VCode)␤    at Prelude.pm line 541, column 5-16␤»
03:30 TimToady perl6: say 3e0.WHAT
03:30 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«Num()␤»
03:30 p6eval ..pugs b927740: OUTPUT«Rat␤»
03:31 TimToady perl6: say +(True but Numeric(3))  # :)
03:31 p6eval pugs b927740: OUTPUT«*** No such subroutine: "&Numeric"␤    at /tmp/bLjyiwCgdm line 1, column 7-26␤»
03:31 p6eval ..rakudo ce5cca: OUTPUT«Can only supply an initialization value for a role if it has a single public attribute␤  in sub infix:<but> at src/gen/CORE.setting:8854␤  in block <anon> at /tmp/cXHTWfUW21:1␤  in <anon> at /tmp/cXHTWfUW21:1␤»
03:31 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Role(s) being mixed in do not define precisely one, public attribute␤  at /home/p6eval/niecza/lib/CORE.setting line 1301 (infix:<does> @ 10) ␤  at /home/p6eval/niecza/lib/CORE.setting line 1304 (infix:<but> @ 3) ␤  at /tmp/6qOKeBJ_dy …
03:31 benabik :(
03:32 benabik My suggestion was that "but" override all roles the new value has that the old doesn't.  But then someone said Bool was supposed to be Numeric anyway.  :-
03:34 TimToady I think we said once that smartmatching should treat a Match object the same as a Bool, and a Match can return both a boolean and a number
03:46 skids sorear: Thanks, but I meant the new P6 Pod.
03:56 TimToady a good project for someone would be translate all the docs to P6 pod
04:34 skids Well, not if they don't render like S26 doesn't :-)
04:43 TimToady so fix it! :)
05:07 tadzik since when S26 doesn't? :)
05:07 tadzik haha, today _I'm_ awake before everybody :)
05:12 birdwindupbird joined #perl6
05:16 sorear "before"?
05:16 sorear :)
05:16 tadzik oh, from Europeans at least :)
05:20 zjmarlow joined #perl6
05:23 orafu joined #perl6
05:27 dalek specs: 588f3ef | larry++ | S03-operators.pod:
05:27 dalek specs: move smartmatch toward treating Match like Bool
05:27 dalek specs: review: https://github.com/perl6/specs/commit/588f3ef196
05:27 dalek specs: e73bd99 | larry++ | S12-objects.pod:
05:27 dalek specs: Merge branch 'master' of github.com:perl6/specs
05:27 dalek specs: review: https://github.com/perl6/specs/commit/e73bd99f98
05:32 moritz good morning
05:32 tadzik good morning moritz
05:33 moritz TimToady: so  'foo' ~~ m/bar/ doesn't return a Match object anymore?
05:33 moritz why?
05:36 TimToady it does, but because it's a Match object it doesn't rematch it against 'foo'
05:36 TimToady the Match passes through as if it were Bool
05:37 TimToady the table perhaps does not express this well
05:37 TimToady match if ?X just means it's evaluating the boolean aspect of the match
05:37 TimToady the result should still be X, the Match object
05:39 moritz then it would be clearer to mark it as X and not ?X
05:49 erc_man joined #perl6
05:58 dalek specs: c7c7def | larry++ | S03-operators.pod:
05:58 dalek specs: ? already implied by 'if' in header, moritz++
05:58 dalek specs: review: https://github.com/perl6/specs/commit/c7c7def094
05:59 am0c joined #perl6
06:07 erc_man left #perl6
06:09 sorear TimToady: Do we really need more than one False Match?  In Niecza all Matches other than Match itself are considered true
06:11 TimToady well, sometimes I wish that Failure were the name of the false Match, just becuase Match() is a rotten name for something that didn't
06:14 TimToady also, failure to match is still a defined concept, I think
06:15 TimToady much like False is a defined concept
06:24 kaleem joined #perl6
06:24 birdwind1pbird joined #perl6
06:27 DarthGandalf joined #perl6
06:38 TimToady but maybe the most useful thing would be if a failed match would just .gist to Nil
06:38 moritz erm
06:39 moritz it's not a Nil, so it shouldn't .gist to Nil
06:39 moritz that'd be just confusing for everybody
06:39 moritz nom: say 'a' ~~ /b/
06:39 p6eval nom ce5cca: OUTPUT«#<failed match>␤»
06:39 TimToady I don't think so
06:39 TimToady perhaps Match(Nil)
06:40 TimToady Match() is just bad human engineering
06:49 TimToady and it's really quite likely that anything that returns Nil should fail smartmatch; the table entry for Nil is entirely redundant with $_ === Nil
06:55 tarch joined #perl6
07:05 TimToady and if we do that, there's not much to stand in the way of actually returning Nil for a failed match
07:11 TimToady and like literal True or False, a literal ~~ Nil could elicit a warning
07:24 TimToady well, best sleep on that one
07:24 TimToady zzz &
07:26 tarch perl6: say "test";
07:26 p6eval pugs b927740, rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«test␤»
07:43 birdwind1pbird joined #perl6
07:47 tarch nom: say "test";
07:48 p6eval nom ce5cca: OUTPUT«test␤»
07:48 moritz 'nom' and 'rakudo' are currently aliases on p6eval
07:50 tarch thanks...does the bot checks for too long running code?
07:51 moritz yes
07:51 moritz it has also memory and fork limits
07:51 moritz nom: loop { }
07:51 p6eval nom ce5cca: OUTPUT«(timeout)»
07:52 tarch nom: my @arr = <<a b c d e f>>; 0..^+@arr;
07:52 p6eval nom ce5cca:  ( no output )
07:53 tarch nom: my @arr = <<a b c d e f>>; 0..^@arr;
07:53 p6eval nom ce5cca:  ( no output )
07:54 moritz tarch: you need to print() or say() something
07:54 moritz tarch: the bot only captures output, not return values
07:54 moritz (we had it capture return values back in the days, and it confused the heck out of everyone)
07:55 tarch yes I know this....I was just testing out the fact that on my machine on nom the second example takes forever...
07:55 moritz in the interactive environment?
07:56 tarch no
07:56 moritz because there's really no reason why it would loop on constructing the range, if it didn't do anything with it
07:56 tarch I mean...I haven't tried
07:56 moritz nom: my @arr = <<a b c d e f>>; ~ 0..^@arr;
07:56 p6eval nom ce5cca:  ( no output )
07:56 moritz nom: my @arr = <<a b c d e f>>; say ~ 0..^@arr;
07:56 p6eval nom ce5cca: OUTPUT«"0"..^["a", "b", "c", "d", "e", "f"]␤»
07:56 moritz nom: my @arr = <<a b c d e f>>; say ~(0..^@arr);
07:56 p6eval nom ce5cca: OUTPUT«(timeout)»
07:57 moritz I guess we really need to special-case that one
07:58 kaleem joined #perl6
08:01 icwiener joined #perl6
08:19 dbr joined #perl6
08:25 sorear hello, tarch
08:25 tarch hellp
08:25 tarch hello
08:26 sorear welcome
08:26 tarch thank you very much! :)
08:42 bkolera joined #perl6
08:46 mj41 joined #perl6
08:49 mathw lo
09:32 Bucciarati joined #perl6
09:47 Psyche^ joined #perl6
09:47 dakkar joined #perl6
09:56 grondilu joined #perl6
09:56 moritz http://www.fanfiction.net/s/5782108/77/ now has a status update at least
09:57 grondilu perl6: say 6981106388 +> 2;
09:57 p6eval niecza v13-389-g852f0ff: OUTPUT«-402207051␤»
09:57 p6eval ..pugs b927740, rakudo ce5cca: OUTPUT«1745276597␤»
09:57 grondilu perl6: say 6981106388 +> 2 :!signed;
09:57 p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Excess arguments to infix:<+>>, unused named signed␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (infix:<+>> @ 1) ␤  at /tmp/4kMz6L2kgv line 1 (mainline @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at /h…
09:58 p6eval ..rakudo ce5cca: OUTPUT«===SORRY!===␤Confused␤at /tmp/OstLyfc76Z:1␤»
09:58 p6eval ..pugs b927740: OUTPUT«pugs: Named argument found where no matched parameter expected: (signed,Val (VBool False))␤»
09:58 grondilu perl6: say 6981106388 +> 2 :unsigned;
09:58 p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Excess arguments to infix:<+>>, unused named unsigned␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (infix:<+>> @ 1) ␤  at /tmp/BhLOU7zCw6 line 1 (mainline @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at …
09:58 p6eval ..pugs b927740: OUTPUT«pugs: Named argument found where no matched parameter expected: (unsigned,Val (VBool True))␤»
09:58 p6eval ..rakudo ce5cca: OUTPUT«===SORRY!===␤Confused␤at /tmp/1WDlJsXe9s:1␤»
09:58 grondilu How do I use the unsigned version of +> ?
09:59 grondilu (if it has been implemented, that is)
10:00 moritz what does +> do again?
10:01 moritz nom: say 5 +> 2
10:01 p6eval nom ce5cca: OUTPUT«1␤»
10:01 moritz nom: say 5 +> 1
10:01 p6eval nom ce5cca: OUTPUT«2␤»
10:03 daxim joined #perl6
10:04 grondilu numeric right shift.  In javascript there is >> and >>>, for signed and unsigned.  In perl6 we are supposed to depend on argument types or use the :signed adverb.  But there is no unsigned type implemented in rakudo, is ther?
10:04 moritz no, there isn't
10:05 moritz can't you simply divide by 2**$n?
10:05 grondilu I tried.  Doesn't work for obscure reasons.
10:05 grondilu rakudo:  say 6981106388 / 2
10:05 p6eval rakudo ce5cca: OUTPUT«3490553194␤»
10:05 grondilu niecza:  say 6981106388 / 2
10:05 p6eval niecza v13-389-g852f0ff: OUTPUT«3490553194␤»
10:05 grondilu niecza:  say 6981106388 +> 2
10:05 p6eval niecza v13-389-g852f0ff: OUTPUT«-402207051␤»
10:05 grondilu niecza:  say 6981106388 +> 1
10:06 p6eval niecza v13-389-g852f0ff: OUTPUT«-804414102␤»
10:06 grondilu rakudo: say :2(sprintf "%b", 6981106388) +> 1;
10:06 p6eval rakudo ce5cca: OUTPUT«3490553194␤»
10:07 grondilu rakudo: say 6981106388 +> 1;
10:07 p6eval rakudo ce5cca: OUTPUT«3490553194␤»
10:07 grondilu hahh I don' get it
10:07 tadzik rakudo: say :2(sprintf "%b", 6981106388 +> 1)
10:07 p6eval rakudo ce5cca: OUTPUT«3490553194␤»
10:08 grondilu I need to find a clearer example of why I can't use it
10:08 moritz grondilu: I know that rakudo implements some operations with system integers instead of bigints if you use literals
10:09 moritz that might add a bit of confusion
10:09 grondilu I guess
10:09 grondilu rakudo: my $a = 6981106388; say :2(sprintf "%b", $a) +> 1;
10:09 p6eval rakudo ce5cca: OUTPUT«3490553194␤»
10:09 grondilu damn it
10:11 grondilu Hang on, in javascript for instance, 6981106388 >>> 0 returns 2686139092
10:11 grondilu perl6: say 2686139092 +> 0;
10:11 p6eval niecza v13-389-g852f0ff: OUTPUT«-1608828204␤»
10:11 p6eval ..pugs b927740, rakudo ce5cca: OUTPUT«2686139092␤»
10:11 grondilu see ?
10:12 moritz why would a bit-shift by 0 do anything?
10:12 grondilu because it turns a signed to an unsigned, I guess.
10:13 grondilu rakudo: printf "%b", 2686139092;
10:13 p6eval rakudo ce5cca: OUTPUT«10100000000110110011101011010100»
10:13 grondilu rakudo: printf "%b", 2686139092 +> 0;
10:13 p6eval rakudo ce5cca: OUTPUT«10100000000110110011101011010100»
10:14 grondilu hahh
10:14 moritz akudo: printf "%b", -2686139092
10:14 moritz rakudo: printf "%b", -2686139092
10:14 p6eval rakudo ce5cca: OUTPUT«11111111111111111111111111111​11101011111111001001100010100101100»
10:14 moritz pugs: printf "%b", -2686139092
10:14 p6eval pugs b927740: OUTPUT«11111111111111111111111111111111111111111​11111111111111111111111111111111111111111111110»
10:15 moritz niecza: printf "%b", -2686139092
10:15 p6eval niecza v13-389-g852f0ff: OUTPUT«1»
10:15 moritz three compilers, three answers
10:16 grondilu For what it's worth, I was confronted to this while trying to translate http://crypto-js.googlecode.co​m/files/2.5.3-crypto-sha256.js
10:28 avar joined #perl6
10:28 avar joined #perl6
10:34 bobot joined #perl6
10:49 lutok joined #perl6
11:03 icwiener joined #perl6
11:19 dalek roast: 2f7692d | moritz++ | S06-advanced/wrap.t:
11:19 dalek roast: RT #69312, repeated &routine.wrap in a loop
11:19 dalek roast: review: https://github.com/perl6/roast/commit/2f7692d1e3
11:31 moritz std: if 0 { succeed }
11:31 p6eval std 48335fc: OUTPUT«ok 00:01 108m␤»
11:31 moritz nom: if 0 { succeed }
11:31 p6eval nom ce5cca:  ( no output )
11:32 moritz is succeed dynamically scoped?
11:58 tokuhirom joined #perl6
11:59 passr joined #perl6
12:00 passr perl6: say my @c = grep { [<] .comb }, [X~] [^5] xx 4
12:00 p6eval pugs b927740: OUTPUT«*** ␤    Unexpected "["␤    expecting bare or pointy block construct, ":", identifier, operator or ","␤    at /tmp/01srY6lGQE line 1, column 33␤»
12:00 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Potential difficulties:â�¤  @c is declared but not used at /tmp/OfduZYzVI1 line 1:â�¤------> [32msay my [33mâ��[31m@c = grep { [<] .comb }, [X~] [^5] xx 4[0mâ�¤â�¤Unhandled exception: Excess arguments to ANON, used 2 of 4 positionalsâ�¤  at /tmp/OfduZYzVI1 line 0…
12:00 p6eval ..rakudo ce5cca: OUTPUT«0123 0124 0134 0234 1234␤»
12:01 passr perl6: my @c = grep { [<] .comb }, [X~] [^5] xx 4;say @c
12:01 p6eval pugs b927740: OUTPUT«*** ␤    Unexpected "["␤    expecting bare or pointy block construct, ":", identifier, operator or ","␤    at /tmp/CFcl07jyvs line 1, column 29␤»
12:01 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Excess arguments to ANON, used 2 of 4 positionals␤  at /tmp/aCL00_tWft line 0 (ANON @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2268 (reduceop @ 9) ␤  at /tmp/aCL00_tWft line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/COR…
12:01 p6eval ..rakudo ce5cca: OUTPUT«0123 0124 0134 0234 1234␤»
12:02 passr perl6: my @d = grep { [!=] .comb.sort }, [X~] [^5] xx 4;say @d
12:02 p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Excess arguments to ANON, used 2 of 4 positionals␤  at /tmp/sfMc6ArS5y line 0 (ANON @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2268 (reduceop @ 9) ␤  at /tmp/sfMc6ArS5y line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/COR…
12:02 p6eval ..rakudo ce5cca: OUTPUT«0123 0124 0132 0134 0142 0143 0213 0214 0231 0234 0241 0243 0312 0314 0321 0324 0341 0342 0412 0413 0421 0423 0431 0432 1023 1024 1032 1034 1042 1043 1203 1204 1230 1234 1240 1243 1302 1304 1320 1324 1340 1342 1402 1403 1420 1423 1430 1432 2013 2014 2031 2034 2041 …
12:02 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected "["␤    expecting bare or pointy block construct, ":", identifier, operator or ","␤    at /tmp/NgIvVArLO8 line 1, column 35␤»
12:03 passr \o/
12:03 dbr joined #perl6
12:06 passr hi perl6, a smallquestion, why perl6 so slow,what's the bottleneck?
12:07 gfldex there is no single bottleneck
12:09 gfldex in your example i would guess is the lack of inlining of operators
12:10 passr gfldex: how to improve it ?
12:11 gfldex i think it would help to clone jnthn a few times
12:12 kaleem joined #perl6
12:12 gfldex having a jit for parrot would help too
12:13 passr gfldex: but perl6 is slow now.
12:13 gfldex indeed
12:13 gfldex perl 6 is largely written in perl 6 what is not helping the cause
12:13 passr bottleneck?
12:14 passr slow in parrot?or perl6 ?
12:14 gfldex both
12:14 Timbus what do you call a bottleneck if the entire bottle is the same size and shape as the neck
12:15 passr Timbus: any example ?
12:16 Timbus what i mean is, its all slow. there is no neck
12:17 passr that's too bad.
12:17 gfldex it's gotten a lot faster the last 6 month
12:18 passr agree absolutily
12:19 passr Timbus: is there any pernutation and combination method for perl6?
12:20 passr permutation!
12:22 am0c joined #perl6
12:28 moritz Timbus: (bottle without neck) cylinder!
12:32 moritz nom: use Test; eval_dies_ok 'succeed'
12:32 p6eval nom ce5cca: OUTPUT«ok 1 - ␤»
12:35 cognominal_ joined #perl6
12:36 moritz niecza: use Test; eval_dies_ok 'succeed'
12:36 p6eval niecza v13-389-g852f0ff: OUTPUT«not ok 1␤# /tmp/CW8HlZsIuM line 1␤»
12:36 moritz niecza: succeed
12:36 p6eval niecza v13-389-g852f0ff:  ( no output )
12:36 moritz niecza: succeed; say 'alive'
12:37 p6eval niecza v13-389-g852f0ff:  ( no output )
12:37 moritz niecza: succeed; say 'alive'; END { say 'end' }
12:37 p6eval niecza v13-389-g852f0ff: OUTPUT«end␤»
12:45 benabik joined #perl6
12:59 tokuhirom joined #perl6
13:08 daxim joined #perl6
13:48 [Coke] Would it be fair to have a "build time" chart? ;)
13:52 moritz maybe :-)
13:52 moritz if you include parrot and nqp build times in rakudo build, you also need to include mono build times in niecza build :-)
13:56 [Coke] ah, well, uh, that's... too much work, then. ;)
13:57 mathw I don't think it's a particularly useful thing to track
13:57 moritz fwiw I did some (very non-scientific) speed comparisons on the p6cc solutions for t1 and t2
13:57 xinming joined #perl6
13:57 moritz some of them work on both rakudo and niecza
13:57 mathw if people say it compiles too slowly just tell them the wait is worth it for the awesome Perl 6 they'll be able to write afterwards
13:57 [Coke] mathw: no, me neither. Just very striking when I kick off the spec test comparisons, especiallywhen rakudo has a new nqp which has a new parrot.
13:58 mathw moritz: awesome
13:58 moritz niecza is about a factor 3 to 4 faster at run time
13:58 [Coke] moritz: mine failed to work on niecza, and I never came back to figure out why. :(
13:58 * [Coke] was sad.
13:58 mathw aaaw
13:58 mathw that is sad
13:58 moritz and seems that niecza is a bit slower to compile stuff
13:59 mathw maybe it does more work at compile time?
14:00 mathw it fits the usual expectation really :)
14:00 mathw slower compile -> more optimising -> faster runtime
14:00 mathw but remember to be fair to Rakudo, Niecza has had speed as an explicit goal from the start
14:01 moritz otoh rakudo has had more time to speed things up :-)
14:02 [Coke] rakudo: say '(foo)' ~~ /'(' ~ ')' .*?/ #RT 68854
14:02 p6eval rakudo ce5cca: OUTPUT«Unable to parse _block1011, couldn't find final ')'␤  in FAILGOAL at src/stage2/QRegex.nqp:1202␤  in regex <anon> at /tmp/Zi9Bf0825Y:1␤  in method ACCEPTS at src/gen/CORE.setting:7655␤  in block <anon> at /tmp/Zi9Bf0825Y:1␤  in <anon> at /tmp/Zi9Bf0825Y:1␤»…
14:03 mathw moritz: true, but it's only recently got into a position to have speed work
14:04 [Coke] that ticket (RT 68854) was last touched by pmichaud who said it was probably working right, but the spec might need tweaking (in 2009). Can someone put it out of its misery?
14:04 moritz nom: say '(foo)' ~~ /'(' ~ ')' .*?/
14:04 p6eval nom ce5cca: OUTPUT«Unable to parse _block1011, couldn't find final ')'␤  in FAILGOAL at src/stage2/QRegex.nqp:1202␤  in regex <anon> at /tmp/_4LyVWzhD1:1␤  in method ACCEPTS at src/gen/CORE.setting:7655␤  in block <anon> at /tmp/_4LyVWzhD1:1␤  in <anon> at /tmp/_4LyVWzhD1:1␤»
14:04 [Coke] rakudo: class A { method Str() { for ^1 {} } }; say ~A.new #RT 71270
14:04 p6eval rakudo ce5cca: OUTPUT«␤»
14:04 moritz niecza: say '(foo)' ~~ /'(' ~ ')' .*?/
14:04 p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to parse anonymous regex␤Couldn't find final ')'; gave up␤  at /home/p6eval/niecza/lib/CORE.setting line 1344 (die @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2464 (Cursor.FAILGOAL @ 5) ␤  at /tmp/ddp7b7Okcp line 1 (AN…
14:06 [Coke] rakudo: "abc" ~~ /()/ # RT 73940
14:06 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter (must be quoted to match literally) at line 1, near "/ # RT 739"␤»
14:07 [Coke] rakudo: multi foo(Int $x is rw) { say "writable" }; multi foo(Int $x) { "readonly" }; foo(42) #RT #74414
14:07 p6eval rakudo ce5cca: OUTPUT«Ambiguous dispatch to multi 'foo'. Ambiguous candidates had signatures:␤:(Int $x is rw)␤:(Int $x)␤␤  in block <anon> at /tmp/6PdwoSOPyM:1␤  in <anon> at /tmp/6PdwoSOPyM:1␤»
14:09 [Coke] rakudo: my Any %.x=3,%.x; #RT #73232
14:09 p6eval rakudo ce5cca: OUTPUT«Useless declaration of a has-scoped method in mainline␤Null PMC access in find_method('x')␤  in block <anon> at /tmp/AGDZSzesDD:1␤  in <anon> at /tmp/AGDZSzesDD:1␤»
14:10 moritz the has-self branch tries to fix that (and other problems)
14:10 moritz sadly I'm stuck
14:10 [Coke] rakudo: subset Foo::Bar of Int where { $_ %% 2 }; my Foo::Bar $i #RT #80930
14:10 p6eval rakudo ce5cca:  ( no output )
14:11 [Coke] rakudo: subset Foo::Bar of Int where { $_ %% 2 }; my Foo::Bar $i # RT #80930
14:11 p6eval rakudo ce5cca:  ( no output )
14:14 sjn o/
14:15 [Coke] jnthn: here's an attribute segfault for you: https://rt.perl.org/rt3/Ti​cket/Display.html?id=77070
14:15 [Coke] jnthn: hio
14:15 [Coke] er, sjn: hio.
14:15 tadzik hello sjn
14:16 [Coke] rakudo: $_ = "0"; s/-/1/; # RT #77110
14:16 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter (must be quoted to match literally) at line 1, near "/1/; # RT "␤»
14:17 sjn So, anyone here interested in coming to Oslo for a Perl 6 hackathon? :) https://gist.github.com/1711730
14:17 [Coke] rakudo: "foo" ~~ /(foo)/; say "$0a" #RT #74180
14:17 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Method 'ast' not found for invocant of class 'Undef'␤»
14:18 [Coke] rakudo: class A is A {}; say A.new; #RT #81058
14:18 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Attribute:D $attr, Any :rw(:$rw)!)␤:(Attribute:D $attr, Any :readonly(:$readonly)!)␤:(Attribute:D $attr, Any :box_target(:$box_target)!)␤:(Routine:D $r, Any…
14:18 PerlJam sjn: that looks like a hack-the-community hackathon.
14:18 [Coke] rakudo: class A { ... }; class B is A {}; class A {} #RT #81060
14:18 p6eval rakudo ce5cca:  ( no output )
14:18 [Coke] rakudo: class A { ... }; say A.WHAT #RT 81060
14:18 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤The following packages were stubbed but not defined:␤    A␤␤»
14:19 sjn PerlJam: maybe a little
14:19 sjn PerlJam: it's a hackathon though. if people just want to meet up and hack, that's fine
14:20 moritz sjn: sounds awesome, and I'd really love to go, but it's unlikely that I'll be able to do much perl-related travelling this year
14:20 [Coke] rakudo: my ($foo, $bar = "baz") = <a>; say "$foo $bar" #RT #74664
14:20 p6eval rakudo ce5cca: OUTPUT«a ␤»
14:20 sjn moritz: even weekend trips, with some sponsoring? :)
14:21 moritz sjn: well, maybe :-)
14:21 sjn moritz: well in that case, check your calendar
14:21 moritz sjn: I will, when I get home
14:22 sjn April 20-22
14:24 [Coke] rakudo: say "1ab2ab3c" ~~ /^ \d ** abc $/ ?? "OH NOES" !! "oh phew" #RT 72440
14:25 p6eval rakudo ce5cca: OUTPUT«OH NOES␤»
14:25 [Coke] rakudo: say 6 >== 2
14:25 p6eval rakudo ce5cca: OUTPUT«Cannot assign to a non-container␤  in block <anon> at /tmp/Z1nrj9myoc:1␤  in <anon> at /tmp/Z1nrj9myoc:1␤»
14:26 moritz niecza: say "1ab2ab3c" ~~ /^ \d ** abc $/ ?? "OH NOES" !! "oh phew"
14:26 p6eval niecza v13-389-g852f0ff: OUTPUT«Potential difficulties:â�¤  Unsupported use of atom ** a as separator; nowadays please use atom+ % a at /tmp/PNZdbiBWqB line 1:â�¤------> [32msay "1ab2ab3c" ~~ /^ \d ** a[33mâ��[31mbc $/ ?? "OH NOES" !! "oh phew"[0mâ�¤â�¤oh phewâ�¤Â»
14:26 moritz niecza: say "1ab2ab3c" ~~ /^ \d+ % abc $/ ?? "OH NOES" !! "oh phew"
14:26 p6eval niecza v13-389-g852f0ff: OUTPUT«oh phew␤»
14:26 [Coke] masak: can you provide a code snippet to make it easier to test https://rt.perl.org/rt3/Ti​cket/Display.html?id=78200  ?
14:26 moritz nom: say "1ab2ab3c" ~~ /^ \d+ % abc $/ ?? "OH NOES" !! "oh phew"
14:26 p6eval nom ce5cca: OUTPUT«OH NOES␤»
14:27 [Coke] rakudo: class Car { has @.wheels }; say Car.^attributes.perl #RT 78316
14:27 p6eval rakudo ce5cca: OUTPUT«(Attribute.new(),)␤»
14:28 [Coke] rakudo: my @a = 1, 2, 3; my @b; my $c = @b[0] = @a[1]; say $c; say @b[0]; # RT 80614
14:29 p6eval rakudo ce5cca: OUTPUT«2␤Any()␤»
14:29 Yary joined #perl6
14:29 moritz nom: say 107 / 18 # speed ration between rakudo and niecza on [Coke]'s t1 solution, once fixed to run on niecza
14:29 p6eval nom ce5cca: OUTPUT«5.94444444444444␤»
14:30 moritz erm, time ratio :-)
14:30 Yary .msg p6eval perl6:class A{has @!q;method new($x){self.bless(*,:q(1..$x))}; method qp{say @!q[0]}};A.new(3).qp
14:30 [Coke] rakudo: say 0 ~~ 0 ~~ 0 # RT 81336
14:30 p6eval rakudo ce5cca: OUTPUT«False␤»
14:31 [Coke] rakudo: [+]; say "I am ok!" #RT 80332
14:31 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix [+] instead at line 1, near "; say \"I a"␤»
14:31 [Coke] std: [+]; say "I am ok!" #RT 80332
14:31 p6eval std 48335fc: OUTPUT«ok 00:01 110m␤»
14:31 [Coke] rakudo: my $.foo; say "alive"; $.foo # RT 80008
14:32 p6eval rakudo ce5cca: OUTPUT«Useless declaration of a has-scoped method in mainline␤alive␤Null PMC access in find_method('foo')␤  in block <anon> at /tmp/SJaI203Lww:1␤  in <anon> at /tmp/SJaI203Lww:1␤»
14:34 Yary How do I initialize a private array attribute in a "new" method?
14:35 Yary nom: class A{has @!q;method new($x){self.bless(*,:q(1..$x))}; method qp{say @!q[0]}};A.new(3).qp
14:35 p6eval nom ce5cca: OUTPUT«Any()␤»
14:35 Yary I was expecting to see "1" there
14:36 pmichaud good morning, #perl6
14:36 moritz \o pmichaud
14:37 [Coke] hey, pmi.
14:37 moritz nom: class A { has @.q; method new ($x) { self.bless(*,:q(1..$x)) } }; say A.new(3).q.perl
14:37 p6eval nom ce5cca: OUTPUT«Array.new(1, 2, 3)␤»
14:37 [Coke] b: say 19593-19489 ; # 02/01/2012 - niecza at 99.46%
14:37 p6eval b 1b7dd1: OUTPUT«104␤»
14:38 moritz nom: class A { has @.q; method new ($x) { self.bless(*,:q(1..$x)); method pq { say @!q[0] } }; say A.new(3).pq
14:38 p6eval nom ce5cca: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤»
14:38 moritz nom: class A { has @.q; method new ($x) { self.bless(*,:q(1..$x)) }; method pq { say @!q[0] } };A.new(3).pq
14:38 p6eval nom ce5cca: OUTPUT«1␤»
14:38 moritz nom: class A { has @!q; method new ($x) { self.bless(*,:q(1..$x)) }; method pq { say @!q[0] } };A.new(3).pq
14:38 p6eval nom ce5cca: OUTPUT«Any()␤»
14:39 moritz Yary: ah, the problem is that .bless doesn't initialize private attributes
14:39 moritz you can change that with a BUILD submethod
14:39 Yary moritz: thanks
14:39 PacoAir joined #perl6
14:39 moritz nom: class A { has @!q; method new ($x) { self.bless(*,:q(1..$x)) }; submethod BUILD(:@!q) { }; method pq { say @!q[0] } };A.new(3).pq
14:39 Yary moritz: ahh... that's a bit of a pain but know that I know...
14:39 p6eval nom ce5cca: OUTPUT«1␤»
14:40 moritz Yary: it seems to surprise a lot of people, and it surprised me too
14:40 Yary is that part of the design or how the implementation is?
14:40 moritz Yary: the step of filtering out private attributes need to happen somewhere, I assumed it's in the default .new, but rakudo implements in in .bless or BUILDALL
14:41 pmichaud I'm pretty sure it's spec.
14:41 moritz Yary: I think the spec just says that .new() now doesn't initialize private attributes, but I don't think it it says *where* that filtering step happens
14:41 moritz (but i could be wrong)
14:41 pmichaud Note that the default C<BUILD>
14:41 pmichaud will only initialize public attributes; you must write your own C<BUILD>
14:41 pmichaud (as above) in order to present private attributes as part of your
14:41 pmichaud initialization API.
14:42 pmichaud S12:878
14:42 moritz ah, and it's specced that .bless (indirectly) calls BUILD
14:42 moritz so rakudo is correct here
14:43 Yary I understand the rationale of not letting private attributes leak out, but there still strikes me as something a bit wrong about it. Disallowing "bless" to know about private attriubutes is ok....
14:43 Yary but... let me work up another example...
14:43 pmichaud Yary: it used to be the other way (private attributes were initialized by bless), but was changed to the current spec.
14:44 moritz pmichaud: but the discussion that led to it only discussed it on the .new level, not on the .bless level
14:44 * [Coke] gets us back up to 92 tickets needing tests.
14:44 [Coke] b: say 649-92; #RT
14:44 p6eval b 1b7dd1: OUTPUT«557␤»
14:44 pmichaud moritz: oh, that's a reasonable point
14:44 pmichaud I suppose .bless could handle private attributes even if the default BUILD doesn't
14:45 Yary nom: class A{has $!q;method new($x){self.bless(*),$!q=>$x}};A.new(3)
14:45 pmichaud seems weird that we'd need an extra level of filtering in that case, though.
14:45 p6eval nom ce5cca: OUTPUT«Cannot look up attributes in a type object␤  in method new at /tmp/PDSckbEOAA:1␤  in block <anon> at /tmp/PDSckbEOAA:1␤  in <anon> at /tmp/PDSckbEOAA:1␤»
14:45 [Coke] I think any RTs with [spec] should (first approximation) be on the spec github queue instead.
14:45 moritz pmichaud: when writing custom .new methods, one wants a primitive that easily handles private attributes; it's fine if the default .new doesn't take that way
14:45 Yary in there,
14:45 Yary "bless" isn't touching the private attribute $!q
14:45 moritz Yary: your're calling it wrongly
14:46 pmichaud Yary: that's because you're referring to the $!q of the A type object
14:46 moritz self.bless(*) # no named arguments to bless
14:46 Yary ugh
14:46 Yary and I have a comma instead of a semicolon
14:46 Yary let's try again
14:47 Yary hmm I can't seem to get it "right"-
14:47 estrabd joined #perl6
14:47 Yary nom: class A{has $q;method new($x){self.bless(*);$q=>$x}};A.new(3)
14:47 p6eval nom ce5cca: OUTPUT«Cannot look up attributes in a type object␤  in method new at /tmp/UGQK07f4Kc:1␤  in block <anon> at /tmp/UGQK07f4Kc:1␤  in <anon> at /tmp/UGQK07f4Kc:1␤»
14:47 Yary still the type object
14:48 moritz_ joined #perl6
14:48 moritz_ lag--
14:48 skids joined #perl6
14:48 tadzik nom: class A { has $!q; method new { self.bless(*, q=>7) }; method foo { say $!q } }; A.new.foo
14:48 p6eval nom ce5cca: OUTPUT«Any()␤»
14:49 estrabd joined #perl6
14:50 _sri joined #perl6
14:50 Yary tadzik: I think that's the spec saying we can't touch private attributes in "bless"
14:50 pmichaud [Coke]: ([spec])  makes sense; some of the [spec] tickets pre-date when the specs were in github
14:50 pmichaud also, sometimes someone may post a rakudobug that needs to be treated as a specbug instead (not common, I admit)
14:50 pmichaud moritz: perhaps there should be an analog to BUILD that also handles private attributes
14:50 pmichaud or that only handles private attributes
14:50 pmichaud self.bless(*, :public(...)).PRIVATE( :priv1(...), :priv2(...) )
14:50 moritz Yary: but after correcting that, your point is valid, IMHO
14:50 tadzik Yary: I agree with you
14:50 tadzik I'm just pointing that out :)
14:51 pmichaud so the above could be
14:51 [Coke] pmichaud: yah, I don't really want to do another ticket migration, even if it's a small one. ;) perhaps we can pester @Larry with one a week until they're gone.
14:51 Yary OK so here's the thing... can one set (or read) a private attribute of an object in a "new" method, after calling bless?
14:51 * [Coke] adds the LTA, regex, and rule tickets back into his "check if they're closable" bucket.
14:52 moritz_ Yary: did you see my example with BUILD for setting the private attribute directly in bless?
14:52 pmichaud [Coke]: I agree, no point in migrating, unless the github queue is where @Larry typically looks for spec issues
14:52 [Coke] pmichaud: yah, I think that's irc backscroll.
14:52 Yary moritz: Yes... and I am already using BUILD in another object to set private attributes
14:53 pmichaud class A { has $!q; method new { self.bless(*).PRIVATE( q=>7 ) } };    # example
14:53 pmichaud (if some form of .PRIVATE were available)
14:53 moritz_ pmichaud: I don't like that API (more)
14:53 Yary moritz: and I just had a reaction that's hard to explain
14:53 moritz_ pmichaud: it requires 1) another method call and 2) modifying the object after it has been created
14:53 Yary moritz: it started with this example-
14:54 moritz_ (which isn't great for value types)
14:54 Yary http://perlgeek.de/blog-en/perl-6/object-​construction-and-initialization.writeback
14:54 pmichaud well, even bless "modifies the object after it has been created", in a sense.
14:54 moritz_ I'd rather have a .bless-priv that treats all attributes equally
14:54 pmichaud that works for me also
14:54 moritz_ (name to be discussed :-)
14:55 pmichaud .blesspriv  works :)
14:55 pmichaud .blessall
14:55 moritz_ pmichaud: (re modifies after creation) yes, depends on where you mentally put the "object is now created" marker
14:55 moritz_ and for me that's as soon as .bless returns
14:55 Yary so I came away with "BUILD" needs named parameters, and "new" does not
14:56 moritz_ the default .new only takes named arguments, but you can write your own to do whatever you like
14:56 moritz_ but if you write a BUILD submethod, you must stick to the internal API (which is named only)
14:56 Yary OK I think that is the crux
14:57 Yary If I want to initialize a private attribute, but don't want to use named attributes in the public "new" method, what does one do?
14:57 Yary (scrolling back to see your examples)
14:58 moritz_ submethod BUILD(:$y, :$z) { $!x = $y + $z  } # for example
14:59 Yary OK I understand moritz++ example now
14:59 Yary just saw it in the scrollback
14:59 Yary you need a "new" that passes arguments to the submethod BUILD
15:00 moritz_ well, new calls bless, bless calls BUILDALL which calls BUILD
15:03 tokuhirom joined #perl6
15:04 Yary thanks
15:19 Yary aww darn. Now how does one set both a private and a public in "new"...
15:19 Yary nom: class A{has $.b;has $!x;submethod BUILD(:$.b,:$!x){ };method new($a){self.bless(*,b=>"b :-) $a",x=>"x (-: $a")}};A.new(3)
15:19 p6eval nom ce5cca: OUTPUT«Cannot assign to a readonly variable or a value␤  in submethod BUILD at /tmp/SW9DNyjea9:1␤  in method BUILDALL at src/gen/CORE.setting:583␤  in method bless at src/gen/CORE.setting:573␤  in method new at /tmp/SW9DNyjea9:1␤  in block <anon> at /tmp/SW9DNyjea9:1␤  in <a…
15:19 Yary nom: class A{has $.b;has $!x;submethod BUILD(:$!x){ };method new($a){self.bless(*,b=>"b :-) $a",x=>"x (-: $a")}};A.new(3).b
15:19 p6eval nom ce5cca:  ( no output )
15:19 Yary nom: class A{has $.b;has $!x;submethod BUILD(:$!x){ };method new($a){self.bless(*,b=>"b :-) $a",x=>"x (-: $a")}};say A.new(3).b
15:19 p6eval nom ce5cca: OUTPUT«Any()␤»
15:22 kaleem joined #perl6
15:22 xinming joined #perl6
15:23 Yary Why did BUILD complain about assigning a readonly variable in the first example?
15:23 Yary Did
15:23 Yary "bless" already assign it?
15:24 Yary apparently not, because the 2nd example shows $.x is uninitialized
15:24 Yary sorry $.b is uninitialized
15:24 moritz_ Yary: you need to assign to $!b, not $.b
15:25 moritz_ Yary: $.b is just a short form for $( self.b ), and usually is read-only
15:25 Yary wow, that works
15:25 Yary nom: class A{has $.b;has $!x;submethod BUILD(:$!b,:$!x){ };method new($a){self.bless(*,b=>"b :-) $a",x=>"x (-: $a")}};A.new(3)
15:25 p6eval nom ce5cca:  ( no output )
15:25 Yary nom: class A{has $.b;has $!x;submethod BUILD(:$!b,:$!x){ };method new($a){self.bless(*,b=>"b :-) $a",x=>"x (-: $a")}};say A.new(3)
15:25 p6eval nom ce5cca: OUTPUT«A.new(b => "b :-) 3")␤»
15:25 Gothmog_ joined #perl6
15:25 Yary I thought the "!" was only for private attributes
15:26 tadzik every attribute is private, I think. It may have a public accessor though
15:26 Yary ah ok
15:26 eviltwin_b ^^ is how I understand it, the $!foo is the real thing, the $.foo form creates a public accessor
15:27 tadzik ywis
15:30 xinming joined #perl6
15:30 kaare_ joined #perl6
15:31 moritz_ that's correct
15:31 icwiener joined #perl6
15:47 bluescreen10 joined #perl6
15:54 fasad joined #perl6
15:55 jaldhar joined #perl6
15:57 jaldhar joined #perl6
16:03 spine_ joined #perl6
16:08 TimToady in a system with arbitrary precision integers, negative 2's complement is represented by an infinite number of 1's on the left, so since we can't represent that, we always store positive plus the sign
16:08 TimToady and bit shifts should never change the sign
16:09 TimToady arguably, .fmt('%b') should print the sign if negative
16:09 TimToady we can't show the leading ones without something to tell us how long it is supposed to be; pugs is just guessing
16:10 moritz_ as is rakudo
16:10 moritz_ nom: say (-1).fmt('%b').chars
16:10 p6eval nom ce5cca: OUTPUT«64␤»
16:10 TimToady yes
16:10 moritz_ well, assuming, not guessing :-)
16:11 TimToady well, guessing 64-bit integers is likely to match native int for some time in the future on many machines, but it's still kinda wrongish to assume that
16:11 TimToady in the absense of instruction to truncate
16:11 moritz_ aye
16:11 TimToady unless we go back to a notion of printfs all coercing to a native type first
16:12 TimToady which seems a bit too retro for Perl 6
16:12 * moritz_ fears that in the end, we'll have to reimplement sprintf
16:13 moritz_ one reason is that our sprintf will need to know about our coercion rules
16:13 moritz_ hey, wouldn't that be a nice GSoC project?
16:14 moritz_ can be done in pure Perl 6, portable between rakudo and niecza, lots of tests to be stolen from C and perl 5
16:14 moritz_ with limited scope, but big enough to keep the student busy
16:15 TimToady I don't fear that we'll re-implement sprintf, but that we won't
16:16 TimToady likewise I fear that we won't re-implement Unicode
16:16 * TimToady hates relying on things like ICU
16:17 TimToady without implementing your own version of something, you can never be more portable than your dependencies
16:18 moritz_ TimToady: isn't sorear++ already reimplementing ICU-stuff for the regex engine in niecza?
16:19 TimToady yes, a good start on it anyway
16:21 TimToady perl6: say (^2**256).pick.fmt('%256b')
16:22 p6eval niecza v13-389-g852f0ff: OUTPUT«(timeout)»
16:22 p6eval ..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)␤»
16:22 p6eval ..rakudo ce5cca: OUTPUT«                                                                                                                                                                                                                                                               0␤»
16:22 TimToady heh
16:23 TimToady masak: ^^ here's a bug for you, or maybe two or three
16:25 TimToady perl6: say (^2**32).pick.fmt('%32b')
16:26 p6eval niecza v13-389-g852f0ff: OUTPUT«(timeout)»
16:26 p6eval ..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)␤»
16:26 p6eval ..rakudo ce5cca: OUTPUT«11110010000111100110011111110100␤»
16:26 TimToady nom: say (^2**64).pick.fmt('%64b')
16:26 p6eval nom ce5cca: OUTPUT«101010000101001111110010110101​1101010001000000010000000000000000␤»
16:26 TimToady nom: say (^2**128).pick.fmt('%128b')
16:27 p6eval nom ce5cca: OUTPUT«                                                                                                                               0␤»
16:27 TimToady pick from a large range might need to generate more entropy than a single standard rand call provides; note the trailing 0's above
16:28 colomon oooo, right
16:28 moritz_ aye
16:28 moritz_ good catch, TimToady++
16:29 moritz_ nom: say (^2**64).pick.fmt('%64b')
16:29 p6eval nom ce5cca: OUTPUT«100001011011101110100011100111​1101010001000000010000000000000000␤»
16:29 * moritz_ submits rakudobug
16:29 tadzik random not random enough
16:30 TimToady cat /dev/urandom   :)
16:30 benabik http://xkcd.com/221/
16:32 masak oh hai, #perl6
16:32 moritz_ lol it's masak, 3 minutes after I've submitted a rakudobug :-)
16:33 masak :)
16:33 TimToady well, %256b is another
16:33 masak I could smell it all the way across the Interwebs...
16:33 tadzik oh hai masak
16:34 lrnperl6 joined #perl6
16:35 TimToady nom: say uint32(-1234)
16:35 p6eval nom ce5cca: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&uint32' called (line 1)␤»
16:35 TimToady aww
16:36 moritz_ we don't have no unsigned or sized types yet
16:36 TimToady how hard can it be?  :)
16:37 moritz_ O(ugly)
16:37 TimToady U(n log n)
16:38 moritz_ at least if you want to be able to stuff with it, and not just store it :-)
16:39 masak moritz_: oh, you're back to having an underscore? :/
16:39 moritz me?
16:40 masak :)
16:40 TimToady an implementation is allowed to use larger temporary values and just treat a sized native as a storage type
16:40 TimToady though obviously uint32() filters it through such a storage location notionally
16:47 brian___ joined #perl6
16:47 TimToady and we probably need pragmatic controls of temporary values to get C-like speeds, since converting to and from Int is likely to be slowish
16:48 TimToady we also have to think about how much leeway we give the default behavior, since it can lead to non-portability if some implementations store temps in natives and some don't
16:48 kaleem joined #perl6
16:57 TimToady niecza: "abc" ~~ /()/
16:57 p6eval niecza v13-389-g852f0ff: OUTPUT«[31m===[0mSORRY![31m===[0m��Null pattern not allowed at /tmp/RT0yNE_wqG line 1:�------> [32m"abc" ~~ /([33m�[31m)/[0m��Parse failed��»
17:01 kmwallio joined #perl6
17:06 bluescreen10 joined #perl6
17:06 TimToady niecza: say "1ab2ab3c" ~~ /^ \d ** abc $/ ?? "OH NOES" !! "oh phew"
17:06 p6eval niecza v13-389-g852f0ff: OUTPUT«Potential difficulties:â�¤  Unsupported use of atom ** a as separator; nowadays please use atom+ % a at /tmp/fafMgnVUwW line 1:â�¤------> [32msay "1ab2ab3c" ~~ /^ \d ** a[33mâ��[31mbc $/ ?? "OH NOES" !! "oh phew"[0mâ�¤â�¤oh phewâ�¤Â»
17:07 TimToady oh, already in the backlog, sorry
17:10 TimToady if we're going to compare timings, I'd rather have the startup costs separate from the timings after that
17:10 TimToady I'm more interested in how fast it runs once it gets going
17:11 masak +1
17:11 PerlJam .oO( It may take a year to get going, but once it's running, it's blazing fast )
17:11 Chillance joined #perl6
17:12 TimToady well, if it runs in -400 days, you have a winner :)
17:12 MayDaniel joined #perl6
17:13 * masak .oO( time-traveling runtime )
17:13 * PerlJam starts building his computer based on time traveling neutrinos
17:16 masak PerlJam: answer shows up fraction of a second before you hit Enter. :)
17:17 tadzik have you see TheDamian's talk about time-traveling programs?
17:18 brian___ hi, may I ask why most of the source files under  rakudo-star-2012.01/rakudo-2012.01 are just Perl6 pm files?
17:18 tadzik because Rakudo is mostly written in Perl 6 :)
17:18 brian___ so amazing... can you help simply explain that/
17:19 tadzik you mean, how's it possible than the Perl 6 compiler is written in Perl 6?
17:19 brian___ yes
17:19 tadzik I'm not too good at explaining that, tbh :)
17:20 tadzik http://en.wikipedia.org/wik​i/Bootstrapping_(compilers) may help
17:20 TimToady well, you have to write it in *something*, and we like to write Perl 6
17:21 TimToady as for bootstrapping, it just means that the first time, we couldn't write it in Perl 6, till we could
17:21 masak brian___: maybe the tricky bit to understand about it is that you have to build things up in a certain order, from simply to complex, to get a system to bootstrap.
17:21 masak but there's really not much more to it than that.
17:22 masak simple*
17:22 PerlJam brian___: or ... you can just continue to think of it as magic in order to maintain a sense of wonder  :)
17:22 masak tadzik: I have seen it. it's breathtaking.
17:22 TimToady the other important bit is to design the language such that it will be efficient (enough, fsdo) to write a compiler in
17:23 masak PerlJam: sir, I have confiscated your geek card until you see sense.
17:23 tadzik I have a feeling that Damian could've been talking about zebras, chopping wood and eating oranges and it'd still be interesting as hell, if you know what I mean :)
17:23 PerlJam I see it!! It's right there at the end of your sentence
17:23 brian___ okay...thanks, sounds wonderful
17:23 masak PerlJam: :P
17:23 TimToady it *is* wonderful, except when it isn't :)
17:24 TimToady we say "Have the appropriate amount of fun!" because sometimes the appropriate amount is negative :)
17:24 masak tadzik: now there's my next talk request for TheDamian: "Zebras, chopping wood, and eating oranges".
17:24 PerlJam tadzik: the trick for us mortals is recognizing when Damian is being a genius and when he's just being insane.
17:25 TimToady HTAAOF has a certain jauntiness to it
17:25 PerlJam tadzik: that's especially hard when those two states overlap
17:25 masak tadzik: jnthn's sitting next to me. he says "it sounds more like a tadzik talk, since it's got zebry in it" :P
17:25 tadzik :P
17:25 masak tadzik: "it's not a completely black-and-white thing, though"
17:25 tadzik jnthn at his best
17:25 masak dang, even when he's offline he's making awful puns! :P
17:26 masak ":D"
17:26 TimToady brian___: run away! you're in danger!
17:26 masak *lol*
17:26 tadzik masak: I'm now tempted to stick zebra images in my next talk, as subliminal messages or such
17:27 PerlJam masak:  the talk might be more interesting with out the commas
17:27 masak PerlJam: :D
17:27 TimToady perl6: say perl True;
17:27 p6eval niecza v13-389-g852f0ff: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤    'perl' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1347 (die @ 3) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 33) â�¤  at /ho…
17:27 p6eval ..pugs b927740: OUTPUT«Bool::True␤»
17:27 p6eval ..rakudo ce5cca: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&perl' called (line 1)␤»
17:27 TimToady aww
17:27 TimToady pugs++
17:28 TimToady though perhaps it's just an old failover
17:28 tadzik pugs: say perl 6
17:28 p6eval pugs b927740: OUTPUT«6␤»
17:29 TimToady pugs: say perl 6, <The Movie>;
17:29 p6eval pugs b927740: OUTPUT«6TheMovie␤»
17:30 masak nom: class Zebra { method chop-wood { say "{self} chip chop" }; method eat-oranges { say "{self} om nom" } }; for map { Zebra.new }, ^5 { Bool.roll ?? .chop-wood !! .eat-oranges }
17:30 p6eval nom ce5cca: OUTPUT«Zebra<2156237269854934840> om nom␤Zebra<2156237269854969130> chip chop␤Zebra<2156237269865416254> om nom␤Zebra<2156237269865430586> om nom␤Zebra<2156237269865451573> chip chop␤»
17:30 masak :D
17:31 tadzik lovely :)
17:31 * [Coke] needs to figure out a way how it makes sense for Damian to give a presentation to the bunch of accountants and lawyers (and IT people who don't use perl) that I work with.
17:32 cognominal_ coke, you should figure that in constant time
17:34 TimToady perl6: class A { has $!x; method new($x) { my $s = self.bless(*); $s!x = $x; }; method emit { say $!x } }; say A.new(42).emit
17:34 p6eval rakudo ce5cca: OUTPUT«Private method 'x' not found on type A␤  in method dispatch:<!> at src/gen/CORE.setting:783␤  in method new at /tmp/vZaSEx0rTL:1␤  in block <anon> at /tmp/vZaSEx0rTL:1␤  in <anon> at /tmp/vZaSEx0rTL:1␤»
17:34 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to resolve method emit in class Int␤  at /tmp/N_zbHgx3bm line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3607 (module-CORE @ 62) ␤  at /home/…
17:34 p6eval ..pugs b927740: OUTPUT«*** No such method in class A: "&bless"␤    at /tmp/lKqkdd8bc_ line 1, column 40-58␤»
17:34 TimToady that maybe oughta work
17:34 TimToady a class is supposed to trust itself
17:36 TimToady perl6: class A { has $!x; method new($x) { self := self.bless(*); $!x = $x; }; method emit { say $!x } }; say A.new(42).emit
17:36 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/O52Jx80HaS:1␤»
17:36 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to resolve method emit in class Int␤  at /tmp/9fZJmJZirV line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3607 (module-CORE @ 62) ␤  at /home/…
17:36 p6eval ..pugs b927740: OUTPUT«*** No such method in class A: "&bless"␤    at /tmp/bUqVPV4PNq line 1, column 37-58␤»
17:36 TimToady perl6: class A { has $!x; method new($ is copy: $x) { self := self.bless(*); $!x = $x; }; method emit { say $!x } }; say A.new(42).emit
17:37 p6eval rakudo ce5cca: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/tDCsYeQXIU:1␤»
17:37 p6eval ..niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to resolve method emit in class Int␤  at /tmp/YcAYnAhuld line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3607 (module-CORE @ 62) ␤  at /home/…
17:37 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected "$ is"␤    expecting formal parameter or ")"␤    at /tmp/evtmtApqAA line 1, column 31␤»
17:37 TimToady it would be interesting to allow new to turn itself into a method halfway through
17:38 dbr joined #perl6
17:39 TimToady *instance metohd
17:39 TimToady *ho
17:41 TimToady in any case, private attrs can be initialized with a real method too
17:43 TimToady perl6: class A { has $!x; method new($x) { my $s = self.bless(*); $s.init($x); $s; }; method init($x) { $!x = $x }; method emit { say $!x } }; say A.new(42).emit
17:43 p6eval rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«42␤True␤»
17:43 p6eval ..pugs b927740: OUTPUT«*** No such method in class A: "&bless"␤    at /tmp/A9BceJ3LJ5 line 1, column 40-58␤»
17:43 TimToady perl6: class A { has $!x; method new($x) { my $s = self.bless(*); $s!x = $x; $s; }; method emit { say $!x } }; say A.new(42).emit
17:43 p6eval pugs b927740: OUTPUT«*** No such method in class A: "&bless"␤    at /tmp/hf9sOvg374 line 1, column 40-58␤»
17:43 p6eval ..rakudo ce5cca: OUTPUT«Private method 'x' not found on type A␤  in method dispatch:<!> at src/gen/CORE.setting:783␤  in method new at /tmp/ZmgID2PgKO:1␤  in block <anon> at /tmp/ZmgID2PgKO:1␤  in <anon> at /tmp/ZmgID2PgKO:1␤»
17:43 p6eval ..niecza v13-389-g852f0ff: OUTPUT«42␤True␤»
17:49 TimToady niecza++  # helps to return the new object from new...
17:54 sorear good * #perl6
17:56 colomon \o
17:58 blynch joined #perl6
17:59 [Coke] o/
17:59 masak sorear! \o/
18:06 sorear o/ masak
18:08 slavik joined #perl6
18:11 tadzik hm, niecza now fully supports MAIN?
18:12 sorear No, but it's as good as nom at MAIN
18:12 tadzik I see
18:12 sorear I ported the (incomplete) nom implementation
18:12 sorear there are a number of spectests that had to be fudged
18:12 tadzik I ask for the features matrix shows MAIN as better in niecza than in nom
18:13 sorear I think the features matrix is wrong for nom,
18:13 sorear nom: multi MAIN("foo") { }; multi MAIN("bar", $quux) { }; @*ARGS = '--help'
18:13 p6eval nom ce5cca: OUTPUT«Usage:␤  --setting=SAFE foo␤  --setting=SAFE bar <quux>␤»
18:14 tadzik hmm, phasers in 15?
18:15 sorear phasers in -45
18:15 sorear it's 1815 UTC now
18:15 tadzik so everyone forgot?
18:15 tadzik duh
18:15 PerlJam apparently
18:16 PerlJam might be time to renegotiate the #phasers time
18:16 tadzik heh, just in time when wed started to suit me again :)
18:16 colomon whoops.
18:16 colomon complete fail to have #phasers, eh?
18:16 masak o.O
18:17 PerlJam too many time-traveling zebra neutrinos
18:20 * masak .oO( everyone had an inappropriate amount of fun )
18:20 tadzik heh, fsvo fun
18:20 kaleem joined #perl6
18:48 spine joined #perl6
18:54 pmichaud current phasers time hasn't been convenient for me the past few weeks
18:55 * sorear leaves
18:56 [Coke] ~~
19:08 slavik joined #perl6
19:10 birdwindupbird joined #perl6
19:25 am0c joined #perl6
19:28 am0c joined #perl6
19:50 GlitchMr joined #perl6
20:10 ksi joined #perl6
20:15 birdwindupbird joined #perl6
20:32 mj41 joined #perl6
20:36 MayDaniel joined #perl6
20:45 kaare__ joined #perl6
20:59 [Coke] .u shark
20:59 phenny [Coke]: Sorry, no results for 'shark'.
21:00 [Coke] .u jump
21:00 phenny [Coke]: Sorry, no results for 'jump'.
21:02 moritz niecza: .say for dir
21:02 p6eval niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: dir may not be used in safe mode␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (dir @ 0) ␤  at /tmp/pseTHfvDz8 line 1 (mainline @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3606 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE…
21:04 sboyette joined #perl6
21:08 bbkr1 is there a way to make variable static within method?
21:10 moritz static? as in 'state'?
21:11 bbkr1 rakudo: sub foo { state $x; say $x++; }; foo(); foo()
21:11 p6eval rakudo ce5cca: OUTPUT«0␤1␤»
21:11 bbkr1 exactly!
21:11 bbkr1 thanks
21:12 * jnthn home :)
21:13 jnthn ...and pretty tired. But tomorrow is pretty much free for Rakudo stuff :)
21:13 tadzik \o/
21:14 jnthn (5 hour trip to Stockholm, evening out, slide hacking, little sleep, giving three talks, five hour train journey home :))
21:19 y3llow joined #perl6
21:19 pothos_ joined #perl6
21:22 y3llow joined #perl6
21:22 pothos joined #perl6
21:22 cooper joined #perl6
21:24 y3llow joined #perl6
21:25 pothos joined #perl6
21:26 [Coke] jnthn++
21:26 [Coke] anyone here going to YAPC::NA this year?
21:26 y3llow joined #perl6
21:27 [Coke] be nice to have at least one sixperl talk.
21:28 y3llow joined #perl6
21:31 y3llow joined #perl6
21:34 y3llow joined #perl6
21:36 y3llow joined #perl6
21:38 y3llow joined #perl6
21:39 bluescreen10 joined #perl6
21:45 Tene [Coke]: I'd love to go; I've planned to go the past few years, but life gets in the way.
21:46 Tene Hopeful to avoid that this year.
21:46 colomon I'm tentatively planning on going to YAPC::NA
22:25 tarch joined #perl6
22:28 pyrimidine joined #perl6
22:30 dorlamm joined #perl6
22:59 Chillance joined #perl6
23:07 [Coke] I need to see if my boss will spring for it.
23:10 leprevost joined #perl6
23:33 literal joined #perl6
23:33 dukeleto joined #perl6
23:37 Bucciarati joined #perl6

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

Perl 6 | Reference Documentation | Rakudo