»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
00:01
Tenzen left,
supernovus joined
00:02
Tenzen joined,
bacek left
|
|||
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 | |
00:03
skids joined
|
|||
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:04 | |
00:09
benabik joined
00:10
tarch left
00:16
supernovus left
00:17
spine left
00:18
bacek joined
00:46
Trashlord joined
00:56
Trashlord left
|
|||
sorear | good * #perl6 | 01:36 | |
01:55
shinobicl___ joined
02:10
Bucciarati left
|
|||
skids | What are the current options for pod2* converters? | 02:15 | |
02:28
wolfman2000 joined
02:29
whiteknight left
02:36
zjmarlow joined
02:41
leprevost joined
02:48
shinobicl___ left
02:57
chee left,
chee joined,
chee left,
chee joined
|
|||
sorear | skids: not a p6 specific question, and I have no clue | 03:01 | |
skids: ask around on MAGnet... if Google won't help, I suggest maybe #toolchain | 03:02 | ||
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:04 | |
03:06
Exodist_ left
03:07
Exodist joined
03:16
orafu left,
orafu joined
|
|||
TimToady | you can test $/ instead | 03:17 | |
perl6: $_ = 'foo'; say so s/food/bar/; say so $/ | |||
p6eval | niecza v13-389-g852f0ff: OUTPUT«FalseFalse» | ||
..rakudo ce5cca: OUTPUT«TrueFalse» | |||
..pugs b927740: OUTPUT«*** No such subroutine: "&so" at /tmp/2zlZDpLXG1 line 1, column 17-31» | |||
TimToady | perl6: $_ = 'foo'; say so s/foo/bar/; say ?$/ | ||
p6eval | rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«TrueTrue» | 03:18 | |
..pugs b927740: OUTPUT«*** No such subroutine: "&so" at /tmp/NMB1ziZZHE line 1, column 17-30» | |||
TimToady | perl6: $_ = 'foo'; say ?s/foo/bar/; say ?$/ | ||
p6eval | rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«TrueTrue» | ||
..pugs b927740: OUTPUT«1» | |||
TimToady | perl6: $_ = 'foo'; say ?s/goo/bar/; say ?$/ | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«FalseFalse» | ||
..rakudo ce5cca: OUTPUT«TrueFalse» | |||
..pugs b927740: OUTPUT«1» | |||
sorear | rakudobug? nieczabug? | ||
TimToady | niecza looks correct | 03:19 | |
03:19
Chillance left
|
|||
TimToady | though I like pugs answer, which follows P5 | 03:20 | |
sorear | doesn't pugs have the same result as rakudo? | 03:21 | |
pugs: say True | |||
p6eval | pugs b927740: OUTPUT«1» | ||
sorear | pugs: say True.WHAT | ||
p6eval | pugs b927740: OUTPUT«Bool» | ||
TimToady | perl6: $_ = 'foo'; say s/o/x/.perl; say $/.perl | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«Bool::True#<match from(1) to(2) text(o) pos([].list) named({}.hash)>» | 03:22 | |
..pugs b927740: OUTPUT«{subst}\Match.new( ok => Bool::False,  from => 0,  to => 0,  str => "",  sub_pos => (),  sub_named => {})» | |||
..rakudo ce5cca: OUTPUT«"fxo"Match.new(orig => "foo", from => 1, to => 2, ast => Any, list => ().list, hash => EnumMap.new())» | |||
TimToady | perl6: $_ = 'foo'; say s:g/o/x/.perl; say $/.perl | ||
p6eval | pugs b927740: OUTPUT«{subst}\Match.new( ok => Bool::False,  from => 0,  to => 0,  str => "",  sub_pos => (),  sub_named => {})» | ||
..niecza v13-389-g852f0ff: OUTPUT«Bool::True#<match from(2) to(3) text(o) pos([].list) named({}.hash)>» | |||
..rakudo ce5cca: OUTPUT«"fxx"Match.new(orig => "foo", from => 2, to => 3, ast => Any, list => ().list, hash => EnumMap.new())» | |||
03:22
cognominal_ joined
|
|||
sorear | why does Match have 'ok'? | 03:22 | |
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… | ||
..niecza v13-389-g852f0ff: OUTPUT«1» | |||
..rakudo ce5cca: OUTPUT«0» | |||
TimToady | perl6: $_ = 'foo'; say +s:g/o/x/; .say | 03:24 | |
p6eval | rakudo ce5cca: OUTPUT«0fxx» | 03:25 | |
..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… | |||
..niecza v13-389-g852f0ff: OUTPUT«1fxx» | |||
TimToady | eval: $_ = 'foo'; print s/o/x/g, "\n"; | 03:26 | |
buubot_backup | TimToady: 2 1 | ||
03:26
cognominal left,
Exodist left
03:27
Exodist joined
|
|||
TimToady | is there any good reason not to return the number of substitutions like P5 does? | 03:27 | |
hmm, I guess smartmatching rears its head there... | 03:28 | ||
perl6: say True but 3 | |||
p6eval | pugs b927740: OUTPUT«*** Cannot cast from VInt 3 to VCode (VCode) at Prelude.pm line 541, column 5-16» | ||
..rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«True» | |||
TimToady | perl6: say +(True but 3) | ||
p6eval | pugs b927740: OUTPUT«*** Cannot cast from VInt 3 to VCode (VCode) at Prelude.pm line 541, column 5-16» | ||
..rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1» | |||
benabik | TimToady: True but 3 only overrides True.Bool | 03:29 | |
*.Int | |||
(I hit that earlier) | |||
TimToady | perl6: say +(True but 3e0) | ||
p6eval | rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1» | ||
..pugs b927740: OUTPUT«*** Cannot cast from VRat (3 % 1) to VCode (VCode) at Prelude.pm line 541, column 5-16» | |||
TimToady | perl6: say +(True but 3.0e0) | 03:30 | |
p6eval | rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«1» | ||
..pugs b927740: OUTPUT«*** Cannot cast from VRat (3 % 1) to VCode (VCode) at Prelude.pm line 541, column 5-16» | |||
TimToady | perl6: say 3e0.WHAT | ||
p6eval | rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«Num()» | ||
..pugs b927740: OUTPUT«Rat» | |||
03:31
lutok left
|
|||
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» | ||
..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» | |||
..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 … | |||
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:32 | ||
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:34 | |
skids | sorear: Thanks, but I meant the new P6 Pod. | 03:46 | |
TimToady | a good project for someone would be translate all the docs to P6 pod | 03:56 | |
skids | Well, not if they don't render like S26 doesn't :-) | 04:35 | |
TimToady | so fix it! :) | 04:43 | |
05:02
zjmarlow left
|
|||
tadzik | since when S26 doesn't? :) | 05:07 | |
haha, today _I'm_ awake before everybody :) | |||
05:12
birdwindupbird joined
05:16
Tenzen left
|
|||
sorear | "before"? | 05:16 | |
:) | |||
tadzik | oh, from Europeans at least :) | ||
05:20
zjmarlow joined
05:23
orafu left,
orafu joined
|
|||
dalek | ecs: 588f3ef | larry++ | S03-operators.pod: move smartmatch toward treating Match like Bool |
05:27 | |
ecs: e73bd99 | larry++ | S12-objects.pod: Merge branch 'master' of github.com:perl6/specs |
|||
moritz | good morning | 05:32 | |
tadzik | good morning moritz | ||
moritz | TimToady: so 'foo' ~~ m/bar/ doesn't return a Match object anymore? | 05:33 | |
why? | |||
TimToady | it does, but because it's a Match object it doesn't rematch it against 'foo' | 05:36 | |
the Match passes through as if it were Bool | |||
the table perhaps does not express this well | 05:37 | ||
match if ?X just means it's evaluating the boolean aspect of the match | |||
the result should still be X, the Match object | |||
moritz | then it would be clearer to mark it as X and not ?X | 05:39 | |
05:49
erc_man joined
05:57
am0c left
|
|||
dalek | ecs: c7c7def | larry++ | S03-operators.pod: ? already implied by 'if' in header, moritz++ |
05:58 | |
05:59
am0c joined
06:04
wolfman2000 left
06:07
erc_man left
|
|||
sorear | TimToady: Do we really need more than one False Match? In Niecza all Matches other than Match itself are considered true | 06:09 | |
06:09
DarthGandalf left
|
|||
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:11 | |
also, failure to match is still a defined concept, I think | 06:14 | ||
much like False is a defined concept | 06:15 | ||
06:24
kaleem joined,
birdwind1pbird joined
06:27
DarthGandalf joined
06:32
Guest23280 left
|
|||
TimToady | but maybe the most useful thing would be if a failed match would just .gist to Nil | 06:38 | |
moritz | erm | ||
it's not a Nil, so it shouldn't .gist to Nil | 06:39 | ||
that'd be just confusing for everybody | |||
nom: say 'a' ~~ /b/ | |||
p6eval | nom ce5cca: OUTPUT«#<failed match>» | ||
TimToady | I don't think so | ||
perhaps Match(Nil) | |||
Match() is just bad human engineering | 06:40 | ||
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:49 | ||
06:55
tarch joined
|
|||
TimToady | and if we do that, there's not much to stand in the way of actually returning Nil for a failed match | 07:05 | |
and like literal True or False, a literal ~~ Nil could elicit a warning | 07:11 | ||
well, best sleep on that one | 07:24 | ||
zzz & | |||
tarch | perl6: say "test"; | 07:26 | |
p6eval | pugs b927740, rakudo ce5cca, niecza v13-389-g852f0ff: OUTPUT«test» | ||
07:41
birdwind1pbird left
07:42
kaleem left
07:43
birdwind1pbird joined
|
|||
tarch | nom: say "test"; | 07:47 | |
p6eval | nom ce5cca: OUTPUT«test» | 07:48 | |
moritz | 'nom' and 'rakudo' are currently aliases on p6eval | ||
tarch | thanks...does the bot checks for too long running code? | 07:50 | |
moritz | yes | 07:51 | |
it has also memory and fork limits | |||
nom: loop { } | |||
p6eval | nom ce5cca: OUTPUT«(timeout)» | ||
tarch | nom: my @arr = <<a b c d e f>>; 0..^+@arr; | 07:52 | |
p6eval | nom ce5cca: ( no output ) | ||
tarch | nom: my @arr = <<a b c d e f>>; 0..^@arr; | 07:53 | |
p6eval | nom ce5cca: ( no output ) | ||
moritz | tarch: you need to print() or say() something | 07:54 | |
tarch: the bot only captures output, not return values | |||
(we had it capture return values back in the days, and it confused the heck out of everyone) | |||
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? | ||
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 | ||
tarch | I mean...I haven't tried | ||
moritz | nom: my @arr = <<a b c d e f>>; ~ 0..^@arr; | ||
p6eval | nom ce5cca: ( no output ) | ||
moritz | nom: my @arr = <<a b c d e f>>; say ~ 0..^@arr; | ||
p6eval | nom ce5cca: OUTPUT«"0"..^["a", "b", "c", "d", "e", "f"]» | ||
moritz | nom: my @arr = <<a b c d e f>>; say ~(0..^@arr); | ||
p6eval | nom ce5cca: OUTPUT«(timeout)» | ||
moritz | I guess we really need to special-case that one | 07:57 | |
07:58
kaleem joined
08:01
icwiener joined
08:05
birdwind1pbird left
08:19
dbr joined
|
|||
sorear | hello, tarch | 08:25 | |
tarch | hellp | ||
hello | |||
sorear | welcome | 08:26 | |
tarch | thank you very much! :) | ||
08:42
bkolera joined
08:46
mj41 joined
|
|||
mathw | lo | 08:49 | |
08:50
am0c left
09:32
Bucciarati joined
09:47
Psyche^ joined,
dakkar joined
09:51
Patterner left,
Psyche^ is now known as Patterner
09:56
grondilu joined
|
|||
moritz | www.fanfiction.net/s/5782108/77/ now has a status update at least | 09:56 | |
grondilu | perl6: say 6981106388 +> 2; | 09:57 | |
p6eval | niecza v13-389-g852f0ff: OUTPUT«-402207051» | ||
..pugs b927740, rakudo ce5cca: OUTPUT«1745276597» | |||
grondilu | perl6: say 6981106388 +> 2 :!signed; | ||
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 | |
..rakudo ce5cca: OUTPUT«===SORRY!===Confusedat /tmp/OstLyfc76Z:1» | |||
..pugs b927740: OUTPUT«pugs: Named argument found where no matched parameter expected: (signed,Val (VBool False))» | |||
grondilu | perl6: say 6981106388 +> 2 :unsigned; | ||
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 … | ||
..pugs b927740: OUTPUT«pugs: Named argument found where no matched parameter expected: (unsigned,Val (VBool True))» | |||
..rakudo ce5cca: OUTPUT«===SORRY!===Confusedat /tmp/1WDlJsXe9s:1» | |||
grondilu | How do I use the unsigned version of +> ? | ||
(if it has been implemented, that is) | 09:59 | ||
moritz | what does +> do again? | 10:00 | |
nom: say 5 +> 2 | 10:01 | ||
p6eval | nom ce5cca: OUTPUT«1» | ||
moritz | nom: say 5 +> 1 | ||
p6eval | nom ce5cca: OUTPUT«2» | ||
10:03
daxim joined
|
|||
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 | ||
can't you simply divide by 2**$n? | 10:05 | ||
grondilu | I tried. Doesn't work for obscure reasons. | ||
rakudo: say 6981106388 / 2 | |||
p6eval | rakudo ce5cca: OUTPUT«3490553194» | ||
grondilu | niecza: say 6981106388 / 2 | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«3490553194» | ||
grondilu | niecza: say 6981106388 +> 2 | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«-402207051» | ||
grondilu | niecza: say 6981106388 +> 1 | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«-804414102» | 10:06 | |
grondilu | rakudo: say :2(sprintf "%b", 6981106388) +> 1; | ||
p6eval | rakudo ce5cca: OUTPUT«3490553194» | ||
grondilu | rakudo: say 6981106388 +> 1; | 10:07 | |
p6eval | rakudo ce5cca: OUTPUT«3490553194» | ||
grondilu | hahh I don' get it | ||
tadzik | rakudo: say :2(sprintf "%b", 6981106388 +> 1) | ||
p6eval | rakudo ce5cca: OUTPUT«3490553194» | ||
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 | ||
that might add a bit of confusion | 10:09 | ||
grondilu | I guess | ||
rakudo: my $a = 6981106388; say :2(sprintf "%b", $a) +> 1; | |||
p6eval | rakudo ce5cca: OUTPUT«3490553194» | ||
grondilu | damn it | ||
Hang on, in javascript for instance, 6981106388 >>> 0 returns 2686139092 | 10:11 | ||
perl6: say 2686139092 +> 0; | |||
p6eval | niecza v13-389-g852f0ff: OUTPUT«-1608828204» | ||
..pugs b927740, rakudo ce5cca: OUTPUT«2686139092» | |||
grondilu | see ? | ||
moritz | why would a bit-shift by 0 do anything? | 10:12 | |
grondilu | because it turns a signed to an unsigned, I guess. | ||
rakudo: printf "%b", 2686139092; | 10:13 | ||
p6eval | rakudo ce5cca: OUTPUT«10100000000110110011101011010100» | ||
grondilu | rakudo: printf "%b", 2686139092 +> 0; | ||
p6eval | rakudo ce5cca: OUTPUT«10100000000110110011101011010100» | ||
grondilu | hahh | 10:14 | |
moritz | akudo: printf "%b", -2686139092 | ||
rakudo: printf "%b", -2686139092 | |||
p6eval | rakudo ce5cca: OUTPUT«1111111111111111111111111111111101011111111001001100010100101100» | ||
moritz | pugs: printf "%b", -2686139092 | ||
p6eval | pugs b927740: OUTPUT«1111111111111111111111111111111111111111111111111111111111111111111111111111111111111110» | ||
moritz | niecza: printf "%b", -2686139092 | 10:15 | |
p6eval | niecza v13-389-g852f0ff: OUTPUT«1» | ||
moritz | three compilers, three answers | ||
grondilu | For what it's worth, I was confronted to this while trying to translate crypto-js.googlecode.com/files/2.5....-sha256.js | 10:16 | |
10:27
avar left
10:28
avar joined,
avar left,
avar joined
10:34
bobot joined,
bobot left
10:48
grondilu left
10:49
lutok joined
11:01
icwiener left
11:03
icwiener joined
|
|||
dalek | ast: 2f7692d | moritz++ | S06-advanced/wrap.t: RT #69312, repeated &routine.wrap in a loop |
11:19 | |
11:23
leprevost left
11:29
daxim left
|
|||
moritz | std: if 0 { succeed } | 11:31 | |
p6eval | std 48335fc: OUTPUT«ok 00:01 108m» | ||
moritz | nom: if 0 { succeed } | ||
p6eval | nom ce5cca: ( no output ) | ||
moritz | is succeed dynamically scoped? | 11:32 | |
11:38
icwiener left
11:51
kaleem left
11:58
tokuhirom joined
11:59
passr joined
|
|||
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» | ||
..niecza v13-389-g852f0ff: OUTPUT«Potential difficulties: @c is declared but not used at /tmp/OfduZYzVI1 line 1:------> say my ⏏@c = grep { [<] .comb }, [X~] [^5] xx 4Unhandled exception: Excess arguments to ANON, used 2 of 4 positionals at /tmp/OfduZYzVI1 line 0… | |||
..rakudo ce5cca: OUTPUT«0123 0124 0134 0234 1234» | |||
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» | ||
..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… | |||
..rakudo ce5cca: OUTPUT«0123 0124 0134 0234 1234» | |||
passr | perl6: my @d = grep { [!=] .comb.sort }, [X~] [^5] xx 4;say @d | 12:02 | |
12:02
dbr left
|
|||
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 | |
..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 … | |||
..pugs b927740: OUTPUT«***  Unexpected "[" expecting bare or pointy block construct, ":", identifier, operator or "," at /tmp/NgIvVArLO8 line 1, column 35» | |||
passr | \o/ | 12:03 | |
12:03
dbr joined
|
|||
passr | hi perl6, a smallquestion, why perl6 so slow,what's the bottleneck? | 12:06 | |
gfldex | there is no single bottleneck | 12:07 | |
12:07
dbr left
|
|||
gfldex | in your example i would guess is the lack of inlining of operators | 12:09 | |
passr | gfldex: how to improve it ? | 12:11 | |
gfldex | i think it would help to clone jnthn a few times | ||
12:12
kaleem joined
|
|||
gfldex | having a jit for parrot would help too | 12:12 | |
passr | gfldex: but perl6 is slow now. | 12:13 | |
gfldex | indeed | ||
perl 6 is largely written in perl 6 what is not helping the cause | |||
passr | bottleneck? | ||
slow in parrot?or perl6 ? | 12:14 | ||
gfldex | both | ||
Timbus | what do you call a bottleneck if the entire bottle is the same size and shape as the neck | ||
passr | Timbus: any example ? | 12:15 | |
Timbus | what i mean is, its all slow. there is no neck | 12:16 | |
passr | that's too bad. | 12:17 | |
gfldex | it's gotten a lot faster the last 6 month | ||
passr | agree absolutily | 12:18 | |
12:19
benabik left
|
|||
passr | Timbus: is there any pernutation and combination method for perl6? | 12:19 | |
permutation! | 12:20 | ||
12:21
passr left
12:22
am0c joined
12:25
tokuhirom left
|
|||
moritz | Timbus: (bottle without neck) cylinder! | 12:28 | |
nom: use Test; eval_dies_ok 'succeed' | 12:32 | ||
p6eval | nom ce5cca: OUTPUT«ok 1 - » | ||
12:35
cognominal_ left,
cognominal_ joined
|
|||
moritz | niecza: use Test; eval_dies_ok 'succeed' | 12:36 | |
p6eval | niecza v13-389-g852f0ff: OUTPUT«not ok 1# /tmp/CW8HlZsIuM line 1» | ||
moritz | niecza: succeed | ||
p6eval | niecza v13-389-g852f0ff: ( no output ) | ||
moritz | niecza: succeed; say 'alive' | 12:37 | |
p6eval | niecza v13-389-g852f0ff: ( no output ) | ||
moritz | niecza: succeed; say 'alive'; END { say 'end' } | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«end» | ||
12:45
benabik joined
13:00
tokuhirom joined
13:08
daxim joined
13:33
skids left
|
|||
[Coke] | Would it be fair to have a "build time" chart? ;) | 13:48 | |
moritz | maybe :-) | 13:52 | |
if you include parrot and nqp build times in rakudo build, you also need to include mono build times in niecza build :-) | |||
13:54
kaleem left,
xinming left
|
|||
[Coke] | ah, well, uh, that's... too much work, then. ;) | 13:56 | |
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
|
|||
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 | ||
[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. | ||
mathw | moritz: awesome | 13:58 | |
moritz | niecza is about a factor 3 to 4 faster at run time | ||
[Coke] | moritz: mine failed to work on niecza, and I never came back to figure out why. :( | ||
[Coke] was sad. | |||
mathw | aaaw | ||
that is sad | |||
moritz | and seems that niecza is a bit slower to compile stuff | ||
mathw | maybe it does more work at compile time? | 13:59 | |
it fits the usual expectation really :) | 14:00 | ||
slower compile -> more optimising -> faster runtime | |||
but remember to be fair to Rakudo, Niecza has had speed as an explicit goal from the start | |||
moritz | otoh rakudo has had more time to speed things up :-) | 14:01 | |
[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»… | ||
mathw | moritz: true, but it's only recently got into a position to have speed work | 14:03 | |
[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)' ~~ /'(' ~ ')' .*?/ | ||
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» | ||
[Coke] | rakudo: class A { method Str() { for ^1 {} } }; say ~A.new #RT 71270 | ||
p6eval | rakudo ce5cca: OUTPUT«» | ||
moritz | niecza: say '(foo)' ~~ /'(' ~ ')' .*?/ | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«Unhandled exception: Unable to parse anonymous regexCouldn'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… | ||
[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"» | ||
[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» | ||
[Coke] | rakudo: my Any %.x=3,%.x; #RT #73232 | 14:09 | |
p6eval | rakudo ce5cca: OUTPUT«Useless declaration of a has-scoped method in mainlineNull PMC access in find_method('x') in block <anon> at /tmp/AGDZSzesDD:1 in <anon> at /tmp/AGDZSzesDD:1» | ||
moritz | the has-self branch tries to fix that (and other problems) | 14:10 | |
[Coke] | rakudo: subset Foo::Bar of Int where { $_ %% 2 }; my Foo::Bar $i #RT #80930 | ||
moritz | sadly I'm stuck | ||
p6eval | rakudo ce5cca: ( no output ) | ||
[Coke] | rakudo: subset Foo::Bar of Int where { $_ %% 2 }; my Foo::Bar $i # RT #80930 | 14:11 | |
p6eval | rakudo ce5cca: ( no output ) | ||
sjn | o/ | 14:14 | |
[Coke] | jnthn: here's an attribute segfault for you: rt.perl.org/rt3/Ticket/Display.html?id=77070 | 14:15 | |
jnthn: hio | |||
er, sjn: hio. | |||
tadzik | hello sjn | ||
[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 "» | ||
sjn | So, anyone here interested in coming to Oslo for a Perl 6 hackathon? :) gist.github.com/1711730 | 14:17 | |
[Coke] | rakudo: "foo" ~~ /(foo)/; say "$0a" #RT #74180 | ||
p6eval | rakudo ce5cca: OUTPUT«===SORRY!===Method 'ast' not found for invocant of class 'Undef'» | ||
[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… | ||
PerlJam | sjn: that looks like a hack-the-community hackathon. | ||
[Coke] | rakudo: class A { ... }; class B is A {}; class A {} #RT #81060 | ||
p6eval | rakudo ce5cca: ( no output ) | ||
[Coke] | rakudo: class A { ... }; say A.WHAT #RT 81060 | ||
p6eval | rakudo ce5cca: OUTPUT«===SORRY!===The following packages were stubbed but not defined: A» | ||
sjn | PerlJam: maybe a little | 14:19 | |
PerlJam: it's a hackathon though. if people just want to meet up and hack, that's fine | |||
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 | ||
p6eval | rakudo ce5cca: OUTPUT«a » | ||
sjn | moritz: even weekend trips, with some sponsoring? :) | ||
moritz | sjn: well, maybe :-) | 14:21 | |
sjn | moritz: well in that case, check your calendar | ||
moritz | sjn: I will, when I get home | ||
sjn | April 20-22 | 14:22 | |
[Coke] | rakudo: say "1ab2ab3c" ~~ /^ \d ** abc $/ ?? "OH NOES" !! "oh phew" #RT 72440 | 14:24 | |
p6eval | rakudo ce5cca: OUTPUT«OH NOES» | 14:25 | |
[Coke] | rakudo: say 6 >== 2 | ||
p6eval | rakudo ce5cca: OUTPUT«Cannot assign to a non-container in block <anon> at /tmp/Z1nrj9myoc:1 in <anon> at /tmp/Z1nrj9myoc:1» | ||
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:------> say "1ab2ab3c" ~~ /^ \d ** a⏏bc $/ ?? "OH NOES" !! "oh phew"oh phew» | ||
moritz | niecza: say "1ab2ab3c" ~~ /^ \d+ % abc $/ ?? "OH NOES" !! "oh phew" | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«oh phew» | ||
[Coke] | masak: can you provide a code snippet to make it easier to test rt.perl.org/rt3/Ticket/Display.html?id=78200 ? | ||
moritz | nom: say "1ab2ab3c" ~~ /^ \d+ % abc $/ ?? "OH NOES" !! "oh phew" | ||
p6eval | nom ce5cca: OUTPUT«OH NOES» | ||
[Coke] | rakudo: class Car { has @.wheels }; say Car.^attributes.perl #RT 78316 | 14:27 | |
p6eval | rakudo ce5cca: OUTPUT«(Attribute.new(),)» | ||
[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«2Any()» | ||
14:29
Yary joined
|
|||
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» | ||
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 | ||
[Coke] | rakudo: say 0 ~~ 0 ~~ 0 # RT 81336 | ||
p6eval | rakudo ce5cca: OUTPUT«False» | ||
[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"» | ||
[Coke] | std: [+]; say "I am ok!" #RT 80332 | ||
p6eval | std 48335fc: OUTPUT«ok 00:01 110m» | ||
[Coke] | rakudo: my $.foo; say "alive"; $.foo # RT 80008 | ||
p6eval | rakudo ce5cca: OUTPUT«Useless declaration of a has-scoped method in mainlinealiveNull PMC access in find_method('foo') in block <anon> at /tmp/SJaI203Lww:1 in <anon> at /tmp/SJaI203Lww:1» | 14:32 | |
Yary | How do I initialize a private array attribute in a "new" method? | 14:34 | |
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()» | ||
Yary | I was expecting to see "1" there | ||
pmichaud | good morning, #perl6 | 14:36 | |
moritz | \o pmichaud | ||
[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 | ||
p6eval | nom ce5cca: OUTPUT«Array.new(1, 2, 3)» | ||
[Coke] | b: say 19593-19489 ; # 02/01/2012 - niecza at 99.46% | ||
p6eval | b 1b7dd1: OUTPUT«104» | ||
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» | ||
moritz | nom: class A { has @.q; method new ($x) { self.bless(*,:q(1..$x)) }; method pq { say @!q[0] } };A.new(3).pq | ||
p6eval | nom ce5cca: OUTPUT«1» | ||
moritz | nom: class A { has @!q; method new ($x) { self.bless(*,:q(1..$x)) }; method pq { say @!q[0] } };A.new(3).pq | ||
p6eval | nom ce5cca: OUTPUT«Any()» | ||
moritz | Yary: ah, the problem is that .bless doesn't initialize private attributes | 14:39 | |
you can change that with a BUILD submethod | |||
Yary | moritz: thanks | ||
14:39
PacoAir joined
|
|||
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 | |
p6eval | nom ce5cca: OUTPUT«1» | ||
Yary | moritz: ahh... that's a bit of a pain but know that I know... | ||
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? | ||
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 | ||
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 | ||
(but i could be wrong) | |||
pmichaud | Note that the default C<BUILD> | ||
will only initialize public attributes; you must write your own C<BUILD> | |||
(as above) in order to present private attributes as part of your | |||
initialization API. | |||
S12:878 | 14:42 | ||
moritz | ah, and it's specced that .bless (indirectly) calls BUILD | ||
so rakudo is correct here | |||
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 | |
but... let me work up another example... | |||
pmichaud | Yary: it used to be the other way (private attributes were initialized by bless), but was changed to the current spec. | ||
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. | |||
b: say 649-92; #RT | |||
p6eval | b 1b7dd1: OUTPUT«557» | ||
pmichaud | moritz: oh, that's a reasonable point | ||
I suppose .bless could handle private attributes even if the default BUILD doesn't | |||
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. | ||
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» | ||
[Coke] | I think any RTs with [spec] should (first approximation) be on the spec github queue instead. | ||
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 | ||
Yary | in there, | ||
"bless" isn't touching the private attribute $!q | |||
moritz | Yary: your're calling it wrongly | ||
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 | ||
Yary | ugh | ||
and I have a comma instead of a semicolon | |||
let's try again | |||
14:47
estrabd left,
Gothmog_ left
|
|||
Yary | hmm I can't seem to get it "right"- | 14:47 | |
14:47
estrabd joined,
estrabd left
|
|||
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» | ||
Yary | still the type object | ||
14:48
moritz_ joined
|
|||
moritz_ | lag-- | 14:48 | |
14:48
skids joined,
_sri left
|
|||
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 | |
14:49
estrabd joined
14:50
_sri joined
|
|||
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 | ||
also, sometimes someone may post a rakudobug that needs to be treated as a specbug instead (not common, I admit) | |||
moritz: perhaps there should be an analog to BUILD that also handles private attributes | |||
or that only handles private attributes | |||
self.bless(*, :public(...)).PRIVATE( :priv1(...), :priv2(...) ) | |||
moritz | Yary: but after correcting that, your point is valid, IMHO | ||
14:50
moritz left
|
|||
tadzik | Yary: I agree with you | 14:50 | |
I'm just pointing that out :) | |||
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. | ||
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? | ||
[Coke] adds the LTA, regex, and rule tickets back into his "check if they're closable" bucket. | |||
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 | ||
[Coke] | pmichaud: yah, I think that's irc backscroll. | ||
Yary | moritz: Yes... and I am already using BUILD in another object to set private attributes | ||
pmichaud | class A { has $!q; method new { self.bless(*).PRIVATE( q=>7 ) } }; # example | 14:53 | |
(if some form of .PRIVATE were available) | |||
moritz_ | pmichaud: I don't like that API (more) | ||
Yary | moritz: and I just had a reaction that's hard to explain | ||
moritz_ | pmichaud: it requires 1) another method call and 2) modifying the object after it has been created | ||
Yary | moritz: it started with this example- | ||
moritz_ | (which isn't great for value types) | 14:54 | |
Yary | perlgeek.de/blog-en/perl-6/object-c....writeback | ||
pmichaud | well, even bless "modifies the object after it has been created", in a sense. | ||
moritz_ | I'd rather have a .bless-priv that treats all attributes equally | ||
pmichaud | that works for me also | ||
moritz_ | (name to be discussed :-) | ||
pmichaud | .blesspriv works :) | 14:55 | |
.blessall | |||
moritz_ | pmichaud: (re modifies after creation) yes, depends on where you mentally put the "object is now created" marker | ||
and for me that's as soon as .bless returns | |||
Yary | so I came away with "BUILD" needs named parameters, and "new" does not | ||
moritz_ | the default .new only takes named arguments, but you can write your own to do whatever you like | 14:56 | |
but if you write a BUILD submethod, you must stick to the internal API (which is named only) | |||
Yary | OK I think that is the crux | ||
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 | ||
(scrolling back to see your examples) | |||
moritz_ | submethod BUILD(:$y, :$z) { $!x = $y + $z } # for example | 14:58 | |
Yary | OK I understand moritz++ example now | 14:59 | |
just saw it in the scrollback | |||
you need a "new" that passes arguments to the submethod BUILD | |||
moritz_ | well, new calls bless, bless calls BUILDALL which calls BUILD | 15:00 | |
15:02
tokuhirom left
15:03
tokuhirom joined
|
|||
Yary | thanks | 15:04 | |
15:07
tokuhirom left
15:15
xinming left
15:17
birdwindupbird left
|
|||
Yary | aww darn. Now how does one set both a private and a public in "new"... | 15:19 | |
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) | |||
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… | ||
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 | ||
p6eval | nom ce5cca: ( no output ) | ||
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 | ||
p6eval | nom ce5cca: OUTPUT«Any()» | ||
15:22
kaleem joined,
xinming joined
|
|||
Yary | Why did BUILD complain about assigning a readonly variable in the first example? | 15:23 | |
Did | |||
"bless" already assign it? | |||
apparently not, because the 2nd example shows $.x is uninitialized | 15:24 | ||
sorry $.b is uninitialized | |||
moritz_ | Yary: you need to assign to $!b, not $.b | ||
Yary: $.b is just a short form for $( self.b ), and usually is read-only | 15:25 | ||
Yary | wow, that works | ||
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) | |||
p6eval | nom ce5cca: ( no output ) | ||
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) | ||
p6eval | nom ce5cca: OUTPUT«A.new(b => "b :-) 3")» | ||
15:25
Gothmog_ joined
|
|||
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 | ||
Yary | ah ok | ||
15:26
xinming left
|
|||
eviltwin_b | ^^ is how I understand it, the $!foo is the real thing, the $.foo form creates a public accessor | 15:26 | |
tadzik | ywis | 15:27 | |
15:30
xinming joined,
kaare_ joined
|
|||
moritz_ | that's correct | 15:31 | |
15:31
icwiener joined
15:47
bluescreen10 joined
15:55
fasad joined,
jaldhar left,
jaldhar joined
15:57
jaldhar left,
jaldhar joined
16:02
jaldhar left
16:03
spine_ joined
|
|||
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 | |
and bit shifts should never change the sign | |||
arguably, .fmt('%b') should print the sign if negative | 16:09 | ||
we can't show the leading ones without something to tell us how long it is supposed to be; pugs is just guessing | |||
moritz_ | as is rakudo | 16:10 | |
nom: say (-1).fmt('%b').chars | |||
p6eval | nom ce5cca: OUTPUT«64» | ||
TimToady | yes | ||
moritz_ | well, assuming, not guessing :-) | ||
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 | |
in the absense of instruction to truncate | |||
moritz_ | aye | ||
TimToady | unless we go back to a notion of printfs all coercing to a native type first | ||
which seems a bit too retro for Perl 6 | 16:12 | ||
moritz_ fears that in the end, we'll have to reimplement sprintf | |||
one reason is that our sprintf will need to know about our coercion rules | 16:13 | ||
hey, wouldn't that be a nice GSoC project? | |||
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 | ||
with limited scope, but big enough to keep the student busy | |||
TimToady | I don't fear that we'll re-implement sprintf, but that we won't | 16:16 | |
likewise I fear that we won't re-implement Unicode | |||
TimToady hates relying on things like ICU | |||
without implementing your own version of something, you can never be more portable than your dependencies | 16:17 | ||
moritz_ | TimToady: isn't sorear++ already reimplementing ICU-stuff for the regex engine in niecza? | 16:18 | |
TimToady | yes, a good start on it anyway | 16:19 | |
perl6: say (^2**256).pick.fmt('%256b') | 16:21 | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«(timeout)» | 16:22 | |
..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)» | |||
..rakudo ce5cca: OUTPUT« 0» | |||
TimToady | heh | ||
masak: ^^ here's a bug for you, or maybe two or three | 16:23 | ||
perl6: say (^2**32).pick.fmt('%32b') | 16:25 | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«(timeout)» | 16:26 | |
..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)» | |||
..rakudo ce5cca: OUTPUT«11110010000111100110011111110100» | |||
TimToady | nom: say (^2**64).pick.fmt('%64b') | ||
p6eval | nom ce5cca: OUTPUT«1010100001010011111100101101011101010001000000010000000000000000» | ||
TimToady | nom: say (^2**128).pick.fmt('%128b') | 16:27 | |
p6eval | nom ce5cca: OUTPUT« 0» | ||
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 | ||
colomon | oooo, right | 16:28 | |
moritz_ | aye | ||
good catch, TimToady++ | |||
nom: say (^2**64).pick.fmt('%64b') | 16:29 | ||
p6eval | nom ce5cca: OUTPUT«1000010110111011101000111001111101010001000000010000000000000000» | ||
moritz_ submits rakudobug | |||
tadzik | random not random enough | ||
TimToady | cat /dev/urandom :) | 16:30 | |
benabik | xkcd.com/221/ | ||
masak | oh hai, #perl6 | 16:32 | |
moritz_ | lol it's masak, 3 minutes after I've submitted a rakudobug :-) | ||
masak | :) | 16:33 | |
TimToady | well, %256b is another | ||
masak | I could smell it all the way across the Interwebs... | ||
16:33
kaleem left
|
|||
tadzik | oh hai masak | 16:33 | |
16:34
lrnperl6 joined
|
|||
TimToady | nom: say uint32(-1234) | 16:35 | |
p6eval | nom ce5cca: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&uint32' called (line 1)» | ||
TimToady | aww | ||
moritz_ | we don't have no unsigned or sized types yet | 16:36 | |
TimToady | how hard can it be? :) | 16:37 | |
moritz_ | O(ugly) | ||
TimToady | U(n log n) | ||
moritz_ | at least if you want to be able to stuff with it, and not just store it :-) | 16:38 | |
masak | moritz_: oh, you're back to having an underscore? :/ | 16:39 | |
16:39
moritz_ is now known as moritz
|
|||
moritz | me? | 16:39 | |
masak | :) | 16:40 | |
16:40
alester left
|
|||
TimToady | an implementation is allowed to use larger temporary values and just treat a sized native as a storage type | 16:40 | |
though obviously uint32() filters it through such a storage location notionally | |||
16:47
brian___ joined
|
|||
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:47 | |
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 | ||
16:49
kaleem joined,
kaleem left
|
|||
TimToady | niecza: "abc" ~~ /()/ | 16:57 | |
p6eval | niecza v13-389-g852f0ff: OUTPUT«===SORRY!===Null pattern not allowed at /tmp/RT0yNE_wqG line 1:------> "abc" ~~ /(⏏)/Parse failed» | ||
17:01
kmwallio joined
17:02
lrnperl6 left
17:03
bluescreen10 left
17:05
Yary left
17:06
bluescreen10 joined
|
|||
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:------> say "1ab2ab3c" ~~ /^ \d ** a⏏bc $/ ?? "OH NOES" !! "oh phew"oh phew» | ||
TimToady | oh, already in the backlog, sorry | 17:07 | |
17:09
slavik left
|
|||
TimToady | if we're going to compare timings, I'd rather have the startup costs separate from the timings after that | 17:10 | |
I'm more interested in how fast it runs once it gets going | |||
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
|
|||
TimToady | well, if it runs in -400 days, you have a winner :) | 17:12 | |
17:12
MayDaniel joined
|
|||
masak .oO( time-traveling runtime ) | 17:13 | ||
PerlJam starts building his computer based on time traveling neutrinos | |||
17:15
am0c left
|
|||
masak | PerlJam: answer shows up fraction of a second before you hit Enter. :) | 17:16 | |
tadzik | have you see TheDamian's talk about time-traveling programs? | 17:17 | |
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 :) | ||
brian___ | so amazing... can you help simply explain that/ | ||
tadzik | you mean, how's it possible than the Perl 6 compiler is written in Perl 6? | 17:19 | |
brian___ | yes | ||
tadzik | I'm not too good at explaining that, tbh :) | ||
en.wikipedia.org/wiki/Bootstrapping_(compilers) may help | 17:20 | ||
TimToady | well, you have to write it in *something*, and we like to write Perl 6 | ||
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. | ||
but there's really not much more to it than that. | |||
simple* | 17:22 | ||
PerlJam | brian___: or ... you can just continue to think of it as magic in order to maintain a sense of wonder :) | ||
masak | tadzik: I have seen it. it's breathtaking. | ||
TimToady | the other important bit is to design the language such that it will be efficient (enough, fsdo) to write a compiler in | ||
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 :) | ||
PerlJam | I see it!! It's right there at the end of your sentence | ||
brian___ | okay...thanks, sounds wonderful | ||
masak | PerlJam: :P | ||
TimToady | it *is* wonderful, except when it isn't :) | ||
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". | ||
PerlJam | tadzik: the trick for us mortals is recognizing when Damian is being a genius and when he's just being insane. | ||
TimToady | HTAAOF has a certain jauntiness to it | 17:25 | |
PerlJam | tadzik: that's especially hard when those two states overlap | ||
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 | ||
tadzik | :P | ||
masak | tadzik: "it's not a completely black-and-white thing, though" | ||
tadzik | jnthn at his best | ||
masak | dang, even when he's offline he's making awful puns! :P | ||
":D" | 17:26 | ||
TimToady | brian___: run away! you're in danger! | ||
masak | *lol* | ||
tadzik | masak: I'm now tempted to stick zebra images in my next talk, as subliminal messages or such | ||
PerlJam | masak: the talk might be more interesting with out the commas | 17:27 | |
masak | PerlJam: :D | ||
TimToady | perl6: say perl True; | ||
p6eval | niecza v13-389-g852f0ff: OUTPUT«===SORRY!===Undeclared routine: 'perl' used at line 1Unhandled 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… | ||
..pugs b927740: OUTPUT«Bool::True» | |||
..rakudo ce5cca: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&perl' called (line 1)» | |||
TimToady | aww | ||
pugs++ | |||
though perhaps it's just an old failover | 17:28 | ||
tadzik | pugs: say perl 6 | ||
p6eval | pugs b927740: OUTPUT«6» | ||
TimToady | pugs: say perl 6, <The Movie>; | 17:29 | |
p6eval | pugs b927740: OUTPUT«6TheMovie» | ||
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 nomZebra<2156237269854969130> chip chopZebra<2156237269865416254> om nomZebra<2156237269865430586> om nomZebra<2156237269865451573> chip chop» | ||
masak | :D | ||
17:30
tarch left
17:31
brian___ left
|
|||
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. | |||
cognominal_ | coke, you should figure that in constant time | 17:32 | |
17:32
zjmarlow left
|
|||
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» | ||
..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/… | |||
..pugs b927740: OUTPUT«*** No such method in class A: "&bless" at /tmp/lKqkdd8bc_ line 1, column 40-58» | |||
TimToady | that maybe oughta work | ||
a class is supposed to trust itself | |||
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 sideat /tmp/O52Jx80HaS:1» | ||
..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/… | |||
..pugs b927740: OUTPUT«*** No such method in class A: "&bless" at /tmp/bUqVPV4PNq line 1, column 37-58» | |||
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 sideat /tmp/tDCsYeQXIU:1» | ||
..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/… | |||
..pugs b927740: OUTPUT«***  Unexpected "$ is" expecting formal parameter or ")" at /tmp/evtmtApqAA line 1, column 31» | |||
17:37
fasad left
|
|||
TimToady | it would be interesting to allow new to turn itself into a method halfway through | 17:37 | |
17:38
dbr joined
|
|||
TimToady | *instance metohd | 17:39 | |
*ho | |||
in any case, private attrs can be initialized with a real method too | 17:41 | ||
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«42True» | ||
..pugs b927740: OUTPUT«*** No such method in class A: "&bless" at /tmp/A9BceJ3LJ5 line 1, column 40-58» | |||
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 | ||
p6eval | pugs b927740: OUTPUT«*** No such method in class A: "&bless" at /tmp/hf9sOvg374 line 1, column 40-58» | ||
..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» | |||
..niecza v13-389-g852f0ff: OUTPUT«42True» | |||
17:45
mj41 left
|
|||
TimToady | niecza++ # helps to return the new object from new... | 17:49 | |
17:52
spine_ left
|
|||
sorear | good * #perl6 | 17:54 | |
colomon | \o | 17:56 | |
17:58
blynch joined
|
|||
[Coke] | o/ | 17:59 | |
masak | sorear! \o/ | ||
18:03
dakkar left
|
|||
sorear | o/ masak | 18:06 | |
18:08
slavik joined
|
|||
tadzik | hm, niecza now fully supports MAIN? | 18:11 | |
sorear | No, but it's as good as nom at MAIN | 18:12 | |
tadzik | I see | ||
sorear | I ported the (incomplete) nom implementation | ||
there are a number of spectests that had to be fudged | |||
tadzik | I ask for the features matrix shows MAIN as better in niecza than in nom | ||
sorear | I think the features matrix is wrong for nom, | 18:13 | |
nom: multi MAIN("foo") { }; multi MAIN("bar", $quux) { }; @*ARGS = '--help' | |||
p6eval | nom ce5cca: OUTPUT«Usage: --setting=SAFE foo --setting=SAFE bar <quux>» | ||
tadzik | hmm, phasers in 15? | 18:14 | |
sorear | phasers in -45 | 18:15 | |
it's 1815 UTC now | |||
tadzik | so everyone forgot? | ||
duh | |||
PerlJam | apparently | ||
might be time to renegotiate the #phasers time | 18:16 | ||
tadzik | heh, just in time when wed started to suit me again :) | ||
colomon | whoops. | ||
complete fail to have #phasers, eh? | |||
masak | o.O | ||
PerlJam | too many time-traveling zebra neutrinos | 18:17 | |
masak .oO( everyone had an inappropriate amount of fun ) | 18:20 | ||
tadzik | heh, fsvo fun | ||
18:20
kaleem joined
18:33
kaleem left
18:48
spine joined
|
|||
pmichaud | current phasers time hasn't been convenient for me the past few weeks | 18:54 | |
sorear leaves | 18:55 | ||
[Coke] | ~~ | 18:56 | |
19:01
slavik left
19:08
slavik joined
19:10
birdwindupbird joined
19:25
am0c joined
19:26
am0c left
19:28
am0c joined
19:30
MayDaniel left
19:50
GlitchMr joined
19:53
daxim left
20:10
estrabd left,
ksi joined
20:15
birdwindupbird left
20:16
birdwindupbird joined
20:32
mj41 joined
20:36
MayDaniel joined
20:38
MayDaniel left
20:43
birdwindupbird left
20:45
kaare_ left,
kaare__ joined
|
|||
[Coke] | .u shark | 20:59 | |
phenny | [Coke]: Sorry, no results for 'shark'. | ||
[Coke] | .u jump | 21:00 | |
phenny | [Coke]: Sorry, no results for 'jump'. | ||
21:00
am0c left
|
|||
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:03
sboyette left
21:04
sboyette joined
|
|||
bbkr1 | is there a way to make variable static within method? | 21:08 | |
moritz | static? as in 'state'? | 21:10 | |
bbkr1 | rakudo: sub foo { state $x; say $x++; }; foo(); foo() | 21:11 | |
p6eval | rakudo ce5cca: OUTPUT«01» | ||
bbkr1 | exactly! | ||
thanks | |||
jnthn home :) | 21:12 | ||
21:13
icwiener left
|
|||
jnthn | ...and pretty tired. But tomorrow is pretty much free for Rakudo stuff :) | 21:13 | |
tadzik | \o/ | ||
jnthn | (5 hour trip to Stockholm, evening out, slide hacking, little sleep, giving three talks, five hour train journey home :)) | 21:14 | |
21:16
y3llow left
21:17
cooper left
21:19
y3llow joined,
pothos_ joined
21:20
pothos left
21:21
y3llow left
21:22
y3llow joined,
pothos_ left,
pothos joined,
cooper joined
21:24
y3llow left,
y3llow joined
21:25
pothos left,
dbr left,
pothos joined
21:26
y3llow left
|
|||
[Coke] | jnthn++ | 21:26 | |
anyone here going to YAPC::NA this year? | |||
21:26
y3llow joined
|
|||
[Coke] | be nice to have at least one sixperl talk. | 21:27 | |
21:28
y3llow left
21:29
y3llow joined
21:31
y3llow left,
y3llow joined
21:33
y3llow left
21:34
y3llow joined,
bluescreen10 left
21:36
y3llow left,
y3llow joined
21:38
y3llow left,
y3llow joined
21:39
bluescreen10 joined
21:41
kaare__ left
|
|||
Tene | [Coke]: I'd love to go; I've planned to go the past few years, but life gets in the way. | 21:46 | |
Hopeful to avoid that this year. | |||
colomon | I'm tentatively planning on going to YAPC::NA | ||
21:51
GlitchMr left
21:58
skids left
22:00
benabik left
22:25
tarch joined
22:26
bluescreen10 left
22:28
pyrimidine joined
22:30
dorlamm joined,
spine left
22:35
Chillance left
22:40
dukeleto left
22:44
ksi left
22:48
tarch left
22:49
lutok left
22:57
kmwallio left
22:59
Chillance joined
|
|||
[Coke] | I need to see if my boss will spring for it. | 23:07 | |
23:10
leprevost joined
23:23
mj41 left
23:33
literal joined,
dukeleto joined
23:37
Bucciarati left,
Bucciarati joined
23:41
dorlamm left
23:43
blynch left
23:50
PacoAir left
23:53
stepnem left
|