»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! 🦋 Set by Zoffix on 25 May 2018. |
|||
Zoffix | This is the bench I used that showed normal lookup 5x faster: gist.github.com/zoffixznet/c46533e...b12c72f713 | 00:00 | |
And this is the diff of the changes: gist.github.com/zoffixznet/7e45adc...711b509abf | 00:01 | ||
00:02
MasterDuke left
|
|||
timotimo | did you happen to look at how often DYNAMIC gets invoked with and without your change? | 00:02 | |
jnthn | nqp::ctx forces the frame to the heap so we can reference it (those these days MoarVM also keeps stats on which frames nearly always end up getting promoted there, and then just allocates them there in the first place to save the copy). | 00:03 | |
nqp::ctx also is not possible to inline | |||
(Because there's no frame for it to refer to if the frame is inlined) | |||
Zoffix | ahh | ||
timotimo | should we introduce a variant of getlexdyn that starts in the current frame rather than the caller's? | 00:04 | |
jnthn | Hm, I'd forgotten that even did start at the caller :) | ||
Zoffix tries with nqp::getlexdyn to see if that boosts the `print` stuff | |||
timotimo | wait, what about getlexreldyn? | ||
oh, that's what you had | 00:05 | ||
jnthn | I figured if you're in the current scope, though, then you can just emit a lexical lookup | ||
timotimo | is that proper? doesn't that perhaps give outers too high a priority, so to speak? | ||
jnthn | I meant strictly declared the current scope :) | 00:06 | |
That is, it's in the .symbol hash of $*W.cur_lexpad | |||
timotimo | ah, that'd be a compile-time decision, even | ||
jnthn | *decalred in | ||
Yes, exactly | 00:07 | ||
timotimo | which would make dynamic variables inside the scope they're declared in cheaper | ||
well, it wouldn't have to look far in the dynamic lookup either, but still | |||
jnthn | Right, which is useful because one usually touches them at least once there to initialize them. | ||
timotimo | aye | ||
jnthn | Sure, but it still has to do that lookup by name | ||
timotimo | oh, true | ||
jnthn | Whereas a lexical compiles into an array indexing operation | ||
And so can JIT into just an instruction or two | 00:08 | ||
Zoffix | well, even with getlexdyn it's slower. By less, but slower. 0m3.301s on HEAD vs 0m3.547s with my changes | 00:09 | |
Damn, I made ZofBot get ready the medal for nothing :) | |||
At least I learned a bunch of stuff from this. | 00:10 | ||
timotimo | will you try the lexical lookup thing before you scrap the idea? | 00:11 | |
Zoffix | timotimo: what do you mean? | ||
what lexical lookup thing? | |||
timotimo | when compiling the DYNAMIC call, first check if the current $!symbols has the $*FOO as a lexical | 00:12 | |
and if it does, just use QAST::Var.new with '$*FOO' | |||
otherwise emit the same code you have now | |||
00:12
lizmat joined
|
|||
timotimo | that way you don't need to do the nqp::ctx | 00:12 | |
because now you don't have to do dynamic lookup in the current frame, the caller's is an acceptable starting point | |||
Kaiepi | m: role Foo { proto method gist(| --> Str) { "SB {*} SE" }; multi method gist(--> Str) { callwith("NAWS") } }; Foo.new.gist | 00:13 | |
camelia | ( no output ) | ||
Kaiepi | m: role Foo { proto method gist(| --> Str) { "SB {*} SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | SB * SE | ||
Zoffix | timotimo: so the QAST::Var would be just the only thing there for $*OUT? | ||
Kaiepi | is there a way to get it to output "SB NAWS SE"? | ||
Zoffix | like when would it be lexical? | ||
timotimo | that's right | ||
Kaiepi: {{*}} probably | 00:14 | ||
maybe { {*} } | |||
Zoffix | m: role Foo { proto method gist(| --> Str) { "SB { {*} } SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | 00:15 | |
camelia | Use of Nil in string context SB SE in method gist at <tmp> line 1 |
||
timotimo | aaw | ||
Zoffix | m: role Foo { proto method gist(| --> Str) { "SB $({*}) SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | Use of Nil in string context SB SE in method gist at <tmp> line 1 |
||
timotimo | m: role Foo { proto method gist(| --> Str) { "SB " ~ {*} ~ SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3thod gist(| --> Str) { "SB " ~ {*} ~ SE7⏏5" }; multi method gist(--> Str) { callwi expecting any of: infix infix stopper … |
||
timotimo | m: role Foo { proto method gist(| --> Str) { "SB " ~ {*} ~ " SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | Use of Nil in string context SB SE in method gist at <tmp> line 1 |
||
timotimo | oh | 00:16 | |
i don't think you can callwith the "original" gist like that, as you've actually overridden the proto | |||
Kaiepi | m: role Foo { proto method gist(|$ --> Str) { "SB " ~ {$} ~ " SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Obsolete use of | or \ with sigil on param $ at <tmp>:1 ------> 3role Foo { proto method gist(|$7⏏5 --> Str) { "SB " ~ {$} ~ " SE" }; multi expecting any of: formal parameter… |
||
timotimo | the candidate from Any isn't available to that particular dispatcher any more | ||
m: role Foo { proto method gist(| --> Str) { "SB " ~ {*} ~ " SE" }; multi method gist(--> Str) { self::Any.gist("NAWS") } }; say Foo.new.gist | |||
camelia | Could not find symbol '&Any' in method gist at <tmp> line 1 in method gist at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Kaiepi | m: role Foo { proto method gist(|$a --> Str) { "SB " ~ {$a} ~ " SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | 00:17 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Obsolete use of | or \ with sigil on param $a at <tmp>:1 ------> 3role Foo { proto method gist(|$a7⏏5 --> Str) { "SB " ~ {$a} ~ " SE" }; mult expecting any of: shape declaratio… |
||
Zoffix | It's in Mu, but it don't take any args | ||
timotimo | oh | ||
jnthn | Zoffix: Dynamic variables are stored in the lexpad of the block that declares them. | ||
Kaiepi | m: role Foo { proto method gist(|a --> Str) { "SB " ~ {a} ~ " SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | Block object coerced to string (please use .gist or .perl to do that) SB SE in method gist at <tmp> line 1 |
||
Kaiepi | m: role Foo { proto method gist($a --> Str) { "SB " ~ {$a} ~ " SE" }; multi method gist(--> Str) { callwith("NAWS") } }; say Foo.new.gist | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in method gist at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Kaiepi | m: role Foo { proto method gist($a --> Str) { "SB " ~ {$a} ~ " SE" }; multi method gist(--> Str) { callwith(self, "NAWS") } }; say Foo.new.gist | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in method gist at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
jnthn | Zoffix: So if you're in the declaring scope then a lexical lookup and a dynamic lookup are equivalent, since there's no searching to do. | ||
Zoffix | OK, I'll give that a go. Thanks. | 00:18 | |
Kaiepi | m: role Foo { proto method gist(*@a --> Str) { "SB " ~ {@a[1]} ~ " SE" }; multi method gist(--> Str) { callwith(self, "NAWS") } }; say Foo.new.gist | ||
camelia | Block object coerced to string (please use .gist or .perl to do that) SB SE in method gist at <tmp> line 1 |
||
jnthn | Kaiepi: callwith has no candidates to call, because you only declared one (and the proto hides all inherited ones) | ||
Kaiepi | oh | ||
m: role Foo { proto method gist(--> Str) {*}; multi method gist(--> Str) { "SE {nextsame} SE" }; multi method gist(--> Str) { "NAWS" } }; say Foo.new.gist | 00:19 | ||
camelia | Nil | ||
Kaiepi | m: role Foo { proto method gist(--> Str) {*}; multi method gist(--> Str) { "SE {callsame} SE" }; multi method gist(--> Str) { "NAWS" } }; say Foo.new.gist | ||
camelia | Use of Nil in string context SE SE in method gist at <tmp> line 1 |
||
jnthn | nextsame is walking the exact same dispatch list | ||
Zoffix | m: role Foo { proto method gist(| --> Str) { "SB " ~ {*} ~ " SE" }; multi method gist(\s) { s }; multi method gist(--> Str) { samewith "NAWS" } }; say Foo.new.gist | ||
camelia | SB SB NAWS SE SE | ||
timotimo | why did my self::Any.gist not work? | ||
i thought that's how you call a method from a parent class on yourself | 00:20 | ||
jnthn | timotimo: Because the syntax is self.Any::gist :) | ||
Zoffix | timotimo: it's in Mu | ||
oh | |||
timotimo | ah! | ||
Zoffix | m: 42.Any::gist | ||
camelia | ( no output ) | ||
Zoffix | TIL | ||
timotimo | a haven't had a use for this yet i believe? | ||
jnthn | And Any is just the starting point of the lookup | ||
So it'll find the Mu one also :) | |||
Zoffix | Cool | ||
I thought it had to be exact | |||
timotimo | no, Any. | ||
:P | 00:21 | ||
Zoffix | m: class Foo {}; class Bar is Foo {}; dd Bar.Foo::gist | ||
camelia | "(Bar)" | ||
Zoffix | awesome | ||
jnthn | Also, this form of call got about 12x faster recently. :-) | ||
Zoffix | m: role Foo { proto method gist(|c --> Str) { c ?? "SB " ~ {*} ~ " SE" !! {*} }; multi method gist(\s) { s }; multi method gist(--> Str) { samewith "NAWS" } }; say Foo.new.gist | ||
camelia | SB NAWS SE | ||
Zoffix | \o/ | ||
jnthn++ | |||
00:22
markoong left
|
|||
Zoffix | hm, I think lexical thing for dynvars won't work, would it | 00:23 | |
m: my $*FOO = 42; sub bar { say $*FOO }; { my $*FOO = 100; bar } | |||
camelia | 100 | ||
Zoffix | like, wouldn't this start giving 42? | ||
timotimo | we have to be careful to only look in the exact lexpad of the current sub | 00:24 | |
not in any of the outers | |||
jnthn | Zoffix: Yes, this only works in the case where the symbol is declared precisely in this scope | ||
Zoffix | aw :( that would help only a tiny amount of cases then | ||
jnthn | Zoffix: I think if you can check by something like $*W.cur_lexpad.symbol('$*FOO') truthy | ||
Yes, but every little helps :) | 00:25 | ||
Zoffix | Yeah, I s'pose | ||
timotimo | it helps exactly in those cases where getlexdyn would miss it because it starts at the caller rather than the current frame | ||
jnthn | Right, which I thought was the aim :) | ||
Zoffix | timotimo: no, but the caller is the caller of &DYNAMIC | ||
timotimo | that's my idea of it anyway | ||
Zoffix | which is the current scope of where $*FOO is defined | ||
timotimo | yeah, but don't you generate the lookup op directly in the caller of DYNAMIC now? | 00:26 | |
Zoffix | Right | ||
japhb | As timotimo says, isn't the point that checking for this one case and separating it out allows you to use a better opt for many other cases? | ||
Zoffix | But getlexdyn wouldn't miss it | ||
timotimo | sorry, getdynlex | ||
the one that doesn't have nqp::ctx in it | |||
because nqp::ctx is the one that kills your performance | 00:27 | ||
jnthn | m: use nqp; sub foo() { my $*foo = 42; say nqp::getdynlex('$*foo') }; foo | ||
camelia | ===SORRY!=== No registered operation handler for 'getdynlex' |
||
Zoffix | timotimo: no, but I already tried the one without nqp::ctx in it, it's still slow | ||
it's getlexdyn | |||
jnthn | m: use nqp; sub foo() { my $*foo = 42; say nqp::getlexdyn('$*foo') }; foo | ||
camelia | (Mu) | ||
jnthn | Notice how it fails to find $*foo due to what timotimo said | ||
Hm, I'm surprised it's as slow as taking the nqp::ctx | 00:28 | ||
ooc, how were you deciding whether to fall back to calling DYNAMIC? | |||
timotimo | i expect with ifnull | ||
jnthn | Yeah, that'd be the best way, I think. Was checking in case it was another way :) | ||
Zoffix | It's not as slow, the diff with getlexreldyn(ctx) was ~.8s and with getlexreldyn was ~.4s | ||
slower | |||
00:29
gabiruh left
|
|||
jnthn | That surprises me | 00:29 | |
Zoffix | jnthn: this is what I'm genning: gist.github.com/zoffixznet/7e45adc...ff-L18-L21 and I tried changing that getlexreldyn(ctx) to just getlexdyn and (it failed to install modules, since it can't find current-scoped vars anymore), that was still slow | 00:30 | |
jnthn | Not saying you're measuring wrong, just that it doesn't mesh with what I know about how those two work. | ||
Zoffix | I hope I'm measuring wrong or doign something wrong :D | ||
was measuring with time perl6 -e '(print ".") xx 1_000_000' > /dev/null | 00:31 | ||
timotimo | hopefully there's some hidden factor we can smoke out | ||
Zoffix | jnthn: what timotimo proposed is that getting nqp::ifnull(getlexdyn,callstatic &DYNAMIC) instead of just callstatic &DYNAMIC was making something else important to get too large to get inlined | 00:32 | |
s:1st/getting/genning/; | |||
00:33
zachk left
|
|||
timotimo | jnthn is also about to do another round of tuning for "what should the inline limit be" | 00:33 | |
jnthn | One possible hypothesis: we can't JIT one of these ops yet, and so including it prevents us from JITting the enclosing code, which also blocks JIT of anything it's inlined in to | 00:35 | |
Another one: we can't JIT something that's in DYNAMIC, but we brought it below the inlining limit, so now it's inlined and also blocks JIT of whatever it's inlined in to | 00:36 | ||
MVM_JIT_LOG=jit_log perl6 -e '...' | |||
grep BAIL jit_log | |||
Will potentially be informative | |||
timotimo | my cmdline is usually grep "Constructing\|BAIL\|Entering" | 00:37 | |
so you'll see what exact frame is getting the bail | |||
Zoffix | BAIL: op <atkey_u> | ||
jnthn | ah, cute :) | ||
Zoffix | BAIL: op <getlexreldyn> | ||
jnthn | aha...that second one would be the guilty party :) | ||
Zoffix | Don't think it's my getlexreldyn, 'cause my code's using getlexdyn | 00:38 | |
jnthn | It's used in DYNAMIC though, I think | ||
00:38
MasterDuke joined
|
|||
Zoffix | $ ./perl6 -e 'my $*x; say $*x' | 00:38 | |
00:38
raschipi left
|
|||
timotimo | getlexdyn isn't actually an op that exists in moar | 00:38 | |
Zoffix | Dynamic variable $*x not found | ||
timotimo | there's a naming confusion somewhere in there | ||
in the mapping between ops and nqp::ops | |||
Zoffix | but I don't think we're calling &DYNAMIC now, like with my code now | ||
jnthn | timotimo: Yeah, there is. D'oh | 00:39 | |
lookatme | what's the difference between `my $x is dynamic` and twigil `my $*x` ? | ||
Zoffix | with these changes that don't quite compile right: gist.github.com/zoffixznet/725ea62...e0364d5deb | ||
(modules fail to install) | |||
timotimo | getlexdyn in nqp:: is getdynlex in moar | ||
or the other way around | |||
but getlexreldyn corresponds to the same name | |||
jnthn | lookatme: You can only access the former via CALLERS::<$x> or similar | ||
lookatme | oh | ||
Zoffix | ../nqp/gen/moar/stage1/QAST.nqp:4325:QAST::MASTOperations.add_core_moarop_mapping('getlexdyn', 'getdynlex'); | 00:40 | |
jnthn | .oO( dynlexic ) |
||
timotimo | oh, what does a Var with scope :contextual compile to? | ||
jnthn | timotimo: Not sure, but perhaps the "is it in this scope" and "if not use getlexdyn" | 00:41 | |
In which case it's perfect :) | |||
Though I'd check it doesn't do some odd NQP-ism | |||
Zoffix | |45d see if &DYNAMIC stuff can be made better: colabti.org/irclogger/irclogger_log...8-06-21#l2 | 00:42 | |
ZofBot | Zoffix, Will remind you on 2018-08-04T20:42:12.623304-04:00 about see if &DYNAMIC stuff can be made better: colabti.org/irclogger/irclogger_log...8-06-21#l2 | ||
Zoffix calls it a day | |||
00:42
Zoffix left
|
|||
timotimo | that compiles to getdynlex | 00:42 | |
but yeah, if it's in the same frame already, it does do a regular lexical lookup | |||
jnthn | Sleep time for me also, I think :) | 00:44 | |
'night o/ | |||
timotimo | i think i'll go to sleep as well | 00:45 | |
00:45
lizmat left
00:46
perlpilot joined
|
|||
timotimo | gnite | 00:51 | |
ryn1x | . | 00:52 | |
00:56
sacomo joined
01:01
Kaiepi left,
Kaiepi joined
|
|||
Kaiepi | m: constant IAC = 0xFF.chr; grammar A { token TOP { <a> <.b {~$<a>}> }; proto token a {*}; token a:sym(IAC) { <sym> }; method b($a) { if $a eq IAC { 0xFB.chr } } }; say A.parse("{IAC}\xFB") | 01:04 | |
camelia | P6opaque: no such attribute '$!pos' on type Match in a Slip when trying to get a value in regex TOP at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Kaiepi | how do i pass the match of a token to another token/method? | 01:05 | |
would i need to use a global variable or something? | |||
actually i think i should ask this on stackoverflow | 01:12 | ||
i can't be the only one that needs to be able to do this | |||
01:20
molaf left
|
|||
Kaiepi | never mind, all i needed to do was move a token from one token to another to do what i want | 01:21 | |
01:29
gabiruh joined
01:33
molaf joined
01:37
ChoHag left
01:38
ChoHag joined
|
|||
Kaiepi | m: grammar Foo { token TOP { <a> <b <{$<a>}> }; token a { foo }; token b($a) { <{~$a}> } }; say Foo.parse('foofoo') | 01:48 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in metachar:sym<assert>; couldn't find final '>' (corresponding starter was at line 1) at <tmp>:1 ------> 3ammar Foo { token TOP { <a> <b <{$<a>}> 7⏏5}; token a { foo… |
||
Kaiepi | m: grammar Foo { token TOP { <a> <b <{$<a>}>> }; token a { foo }; token b($a) { <{~$a}> } }; say Foo.parse('foofoo') | 01:49 | |
camelia | No such method 'anon' for invocant of type 'Foo'. Did you mean any of these? acos any asin atan in regex at EVAL_0 line 1 in regex b at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line… |
||
Kaiepi | m: grammar Foo { token TOP { <a> <b $<a>> }; token a { foo }; token b($a) { <{~$a}> } }; say Foo.parse('foofoo') | ||
camelia | No such method 'anon' for invocant of type 'Foo'. Did you mean any of these? acos any asin atan in regex at EVAL_0 line 1 in regex b at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line… |
||
Kaiepi | m: grammar Foo { token TOP { <a> <b $<a>> }; token a { foo }; token b($a) { {~$a} } }; say Foo.parse('foofoo') | ||
camelia | Nil | ||
Kaiepi | m: grammar Foo { token TOP { <a> <b $<a>> }; token a { foo }; token b($a) { <{{$a}}> } }; say Foo.parse('foofoo') | 01:50 | |
camelia | No such method 'anon' for invocant of type 'Foo'. Did you mean any of these? acos any asin atan in regex at EVAL_0 line 1 in regex b at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line… |
||
01:51
perlpilot left
|
|||
tony-o_ | what are you trying to do with the match value Kaiepi ? | 01:53 | |
Kaiepi | tony-o_, i'm writing a grammar to parse telnet's protocol | 02:02 | |
for IAC DO/DONT/WILL/WONT <option>, i'm required to keep the state for both sides of the connection for each type of telnet option | 02:03 | ||
tony-o_ | ah | ||
Kaiepi | the token looks like <{IAC}> <type=sym> <negotiation>, but i need to be able to pass type to negotiation | 02:04 | |
02:04
kjk joined
|
|||
Kaiepi | and set state accordingly depending on the value of <type> | 02:04 | |
kjk | p6: for CORE::.kv -> $k, $v { put $k } | ||
camelia | &ord Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 &infix:<⊈> &infix:«(<)» &samemark &prefix:<?> &infix:<%%> &sprintf SocketType &infix:<⊖> &METAOP_TEST_ASSIGN:<andthen> &… |
||
kjk | I wonder why I can't iterate what's in CORE directly like that | 02:05 | |
tony-o_ | should that not be happening in the actions? | ||
kjk | p6: for CORE::.keys -> $k { put $k } | 02:07 | |
camelia | e &tan &infix:<⊃> &infix:«+<» &infix:<×> NQPMatchRole StrPosRef Range Collation &substr-rw &infix:«=>» SIGTERM &infix:<before> &infix:<∉> &duckmap &infix:«<=» PositionalBindFailover ThreadPoolScheduler Na… |
||
tony-o_ | m: my $*ACTION; grammar F { token TOP { <a> <b> }; regex a { \w { $*ACTION=$/; } }; regex b { { $*ACTION.say; } \w+ }; }; F.parse("helloh"); | ||
camelia | 「h」 | ||
kjk | p6: for CORE::.values -> $v { put $v } | ||
camelia | Sub object coerced to string (please use .gist or .perl to do that) uniprops trait_mod:<returns> 0 flat infix:<…^> set infix:<∌> cotan leave prefix:<!> prepend split prefix:<^> spurt in block at <tmp> line… |
||
tony-o_ | m: my $*ACTION; grammar F { token TOP { <a> <b> }; regex a { \w { $*ACTION=$/; } }; regex b { { $*ACTION.say; } \w+ }; }; F.parse("helloh"); # Kaiepi | ||
camelia | 「h」 | ||
kjk | p6: for CORE::.values -> $v { put $v .^name } | 02:08 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed postfix call (only alphabetic methods may be detached) at <tmp>:1 ------> 3for CORE::.values -> $v { put $v .7⏏5^name } |
||
tony-o_ | there are other ways to abuse the matching too | ||
kjk | p6: for CORE::.values -> $v { put $v.^name } | ||
camelia | Signal Sub+{is-pure} Signature Sub+{Precedence} Sub+{Precedence} Sub Sub Sub NFKC Sub Sub Sub Sub+{is-pure} Sub+{is-pure}+{Precedence} Sub Sub+{is-nodal}+{Precedence}+{is-nodal} Sub Systemic Sub+{is-pure} Sub+{is-… |
||
kjk | so iterating through CORE::.keys and CORE::.values work, but not CORE::.kv, something the CORE module is triping up the for loop? | 02:09 | |
geekosaur | m: dd CORE::.kv | 02:12 | |
camelia | No such method 'perl' for invocant of type 'NQPMatchRole' in block <unit> at <tmp> line 1 |
||
geekosaur | guess there's your answer: it's not a perl 6 thing, it's more primitive | ||
which might be an oversight, and might be worth a rakudobug | 02:13 | ||
m: say CORE::.kv.^name | |||
camelia | Seq | ||
geekosaur | huh | ||
m: say CORE::.kv[0].^name | |||
camelia | Str | ||
kjk | but I was only printing the key | ||
geekosaur | m: say CORE::.kv[1].^name | ||
camelia | Sub | ||
geekosaur | ok, think it's handling that. it's .kv itself that may be strange. | 02:14 | |
m: say CORE::.kv.WHAT | |||
camelia | (Seq) | ||
kjk | if you assign the .kv result to an array and then iterate through that, it works | ||
geekosaur | oh, hm, that earlier error may have been something in it | ||
yes, I'm saying it's not quite a perl 6 value, it's somethoing else that only behaves as you expect part of the time | 02:15 | ||
underneath perl 6 is nqp, and sometimes nqp values leak through and do unexpected things | |||
kjk | should I open a bug report? | 02:16 | |
geekosaur | I think .kv should work for it like it works for anything else. although CORE:: is a PseudoStash, maybe it's known to do something different | ||
iirc | |||
m: say CORE::.^name | 02:17 | ||
camelia | PseudoStash | ||
geekosaur | might see if other PseudoStash-es (UNIT::, GLOBAL::, etc.) do the same thing, and include that in bug report | 02:18 | |
it looks like it should work | |||
02:25
lizmat joined
|
|||
kjk | does'nt seem to be because it's a PseudoStash. I suspect it might be some value in CORE:: that caused the problem. | 02:26 | |
02:27
lizmat left
|
|||
kjk | p6: say PROCESS::.^name; for PROCESS::.kv -> $k, $v { put $k } | 02:28 | |
camelia | Stash $AWAITER $IN $SPEC $ERR &chdir $PID $OUT $SCHEDULER %ENV |
||
geekosaur | actually, I bet it;s the same thing that tripped my earlier check, then | 02:29 | |
where dd tripped over an NQPMatchRole | |||
kjk | but isn't that because dd calls .perl on NQPMatchRole? my for loop didn't call .perl on the values at all | 02:30 | |
geekosaur | but it's missing more things than just .perl | 02:31 | |
nqp values are missing most things you expect | |||
02:33
lizmat joined
|
|||
Kaiepi | can i subclass a grammar with a class and use it both to parse data and handle socket connections? | 02:37 | |
there's a lot of state that both the grammar and the client class need to know | |||
geekosaur | I'm wondering if you should be looking at action classes at this point | 02:39 | |
02:40
xinming joined
|
|||
Kaiepi | i've been trying to avoid action classes because i honestly have no clue how to write them even after looking at the documentation | 02:40 | |
02:40
xinming left
02:41
xinming joined
|
|||
kjk | I wonder if it has something to do with IterationEnd in CORE | 02:41 | |
Kaiepi | i'll post the code i have so far in a sec and see if i can figure out how to use action classes for what i'm doing | 02:42 | |
kjk | p6: my %h = CORE::.kv | ||
camelia | Odd number of elements found where hash initializer expected: Found 189 (implicit) elements: Last element seen: "IterationEnd" in block <unit> at <tmp> line 1 |
||
MasterDuke | i think Slip might also be causing problems | 02:44 | |
kjk | p6: my %h = CORE::.kv | ||
camelia | Odd number of elements found where hash initializer expected: Found 119 (implicit) elements: Last element seen: "IterationEnd" in block <unit> at <tmp> line 1 |
||
kjk | p6: my %h = CORE::.kv | ||
camelia | Odd number of elements found where hash initializer expected: Found 1339 (implicit) elements: Last element seen: "IterationEnd" in block <unit> at <tmp> line 1 |
||
MasterDuke | m: my @a; for CORE::.kv -> $k, $v { @a.push: $v } | ||
camelia | Invocant of method 'iterator' must be an object instance of type 'List', not a type object of type 'Slip'. Did you forget a '.new'? in block <unit> at <tmp> line 1 |
||
geekosaur | o.O | 02:45 | |
Util | timotimo: timotimo: "The enemy is a Nazi ghost tank?" is one of three "Easter Eggs", | 02:48 | |
kjk | p6: my @a = CORE::.kv; for @a -> $k, $v { put $k } | ||
camelia | buf32 num64 Dateish &METAOP_CROSS &univals MultiDispatcher &undefine SIGSTKFLT NFD &log &minmax uint32 &combinations &infix:<⊍> &atomic-assign &infix:<×> &awaiterator SIGUSR1 SIGINFO &infix:<//> &item &infi… |
||
Util | to tempt people into Googling the phrases, which lead to online stories they might enjoy. | ||
tony-o_ | it definitely sounds like you need to be using actions Kaiepi | 02:50 | |
docs.perl6.org/language/grammars#Action_Objects | |||
are you going to run the grammar against every response from the server? | 02:51 | ||
Kaiepi | yes | 02:56 | |
the grammar's a bit tricky since there can be multiple actions in one message received from the server, and the actions can be either raw text or commands with subnegotiations that are unique to each command | 02:57 | ||
this is the code i have so far pastebin.com/9Yc8m1e2 | 02:58 | ||
i need to move $*SUPPRESS-GO-AHEAD and $*ACTION to the actions class since rfc1143 forces me to deal with DO/DONT/WILL/WONT in a certain way | 03:00 | ||
buggable | New CPAN upload: IP-Random-0.0.3.tar.gz by JMASLAK modules.perl6.org/dist/IP::Random:cpan:JMASLAK | 03:05 | |
Kaiepi | what confuses me about actions is what make/made/ast are doing | ||
and when methods are called | 03:06 | ||
03:17
Actualeyes left
|
|||
[Coke] | zoffix++ # mtime docs | 03:20 | |
03:36
Kaiepi left,
Kaiepi joined
03:59
Schepeers left
04:10
Schepeers joined
04:23
Kaiepi left,
Kaiepi joined
|
|||
Geth | doc/pod-cache: e9a057962d | (Will "Coke" Coleda)++ | 6 files Add Pod::Cache Instead of generating pod files each time for each test that needs it, generate a cache as we go, that uses the timestamp to insure we don't regen them if not needed. This temporarily removes the concurrency from some files. Related to #1952 |
04:29 | |
lizmat | [Coke]: wouldn't a sha1 be handier ? | 04:31 | |
[Coke] | handier in what way? | 04:32 | |
(i'd have to store the sha1 somewhere at that point as well) | 04:33 | ||
lizmat | sometimes people touch files inadvertently without changes | ||
[Coke] | but I'm definitely open to a better algorithm. | ||
lizmat | well, you're storing the mtime somewhere ? | ||
[Coke] | it's in the cached copy of the pod. | ||
if someone touches the file, regen'ing the pod isn't that slow. | |||
it's just that we were regening it 5 times. | |||
(and tossing it every single time) | 04:34 | ||
lizmat | oki... I guess I was just thinking about the precomp logic | ||
[Coke] | so, this is better, but not perfect. | ||
buggable | New CPAN upload: Acme-Dont-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz | 04:45 | |
lizmat | yeah, couldn't resist :-) | 04:46 | |
04:47
dabella12 joined,
curan joined
04:51
lizmat left
05:02
lizmat joined
05:06
Actualeyes joined
05:07
xinming left
|
|||
Kaiepi | i think i'm starting to work out how to use action classees | 05:17 | |
is there a difference between .ast and .made? | |||
05:20
sauvin joined,
sauvin left
05:24
xtreak joined
|
|||
geekosaur | nope, they're aliases | 05:25 | |
docs.perl6.org/routine/ast | |||
05:27
kjk left
|
|||
masak enjoyed arp242.net/weblog/yaml_probably_no...r_all.html | 05:46 | ||
I mean, I like YAML. but it _is_ a very complicated format. | 05:47 | ||
the article goes into some of the WATs | |||
also, TIL about StrictYAML | 05:50 | ||
05:51
HaraldJoerg joined
|
|||
moritz | yaml also has this mis-feature where 15:30 can be parsed either as a string or into the integer 15*60 + 30 | 05:52 | |
masak | the article points to the practice of explicitly quoting strings everywhere to avoid a lot of unexpected behavior | 05:53 | |
(which throws into stark relief the JSON practice of requiring this for object keys) | |||
05:56
sno left
05:57
sauvin joined
06:05
domidumont joined
|
|||
masak | I find that, in general, people don't appreciate the distinction between "parameters" and "arguments" | 06:05 | |
even accounting for different terms being used in different cultures, it seems to me that most of the time, people just conflate the two | |||
unless they're language designers :) | 06:06 | ||
06:07
damnlie left
06:08
damnlie joined
06:09
dabella12 left
06:11
domidumont left
06:12
domidumont joined
06:13
benji__ joined
06:15
ufobat_ joined
06:17
benjikun2 left
|
|||
tadzik | hm, I'm quite surprise at the first point of that article; is that a python-specific thing though, or does every yaml parser actually do this? | 06:20 | |
06:21
darutoko joined
|
|||
geekosaur | didn;t it address that? they pointed to load vs. load_safe. and that you need to change php's ini file to get safe loading | 06:21 | |
tadzik | it seems like YAML.pm has this as an opt-in | ||
right, but I expected a criticism of YAML, not its stupid default library in that language or the other | 06:22 | ||
geekosaur | it addressed that one too | ||
tadzik | "yaml is bad becuase its default python library is awful" is a weak point imho | ||
geekosaur | yaml is bad because its API encourages that bad defauklt | ||
and worse defaults like php's | |||
Kaiepi | is there a token like <:ascii> that exists for <[ 0x[00] .. 0x[FF] ]>? | 06:23 | |
i tried <:latin> but apparently it's not latin-1 | |||
masak | I think most language have both a load and a loadSafe method -- the load method is probably the first one and the loadSafe method was added after the security implications became clearer | ||
06:23
domidumont left
|
|||
masak | Kaiepi: I got a mental image of you trying <:latin> and the error message being "HAEC FORMA NON VALET" | 06:24 | |
Kaiepi | lol | 06:25 | |
tadzik | I still feel a bit like it's saying "memory is OSes is bad because we have strcpy() and not everyone uses strncpy()" :) But eh | 06:26 | |
geekosaur | API design's a valid complaint. and I would --- and many security types have --- made exactly that argument re libc | 06:27 | |
06:28
metracom joined
|
|||
masak | tadzik: I disagree. I think if you have a library that loads a data file, and that library has a default Load method which can have arbitrary side effects decided by the one who authored the data file, then that's a problem and a security risk and bad design. | 06:28 | |
tadzik | oh, I fully agree with that! But I think it's a failure of that library, not the data format | 06:29 | |
masak | it's something about expectations. loading a data format counts as "pure" in people's minds, so it doesn't register as a security risk. | ||
geekosaur | YAML is more than just a data format; it is an API for processing that data format | ||
masak | tadzik: to a large extent it falls on the libraries, yes. but the spec is what suggests having the side effects in the first place. | ||
tadzik | just like the strcpy argumemt is against libc :) | ||
06:30
benji__ left
|
|||
metracom | Slurp mode | 06:30 | |
tadzik | right. I guess it could be a failure of the spec that it doesn't make it clear enough that YAML does a lot of things | 06:31 | |
or it failed in its marketing, and we all know how hard it is to fix that :P | |||
masak | I think the spec is culpable to the extent that things should be secure by default. just having loadSafe on the side doesn't feel like enough -- somewhat backed up by the usage statistics. | 06:32 | |
tadzik | . o O ( mysql_real_escape_string ) | ||
masak | I mean, I'd much rather see a safe-by-default load method, along with a side-effecty loadDangerously | ||
tadzik | absolutely | ||
06:32
HaraldJoerg1 joined
|
|||
tadzik | or don't call it load, but rather something more obvious: eval? :) | 06:33 | |
metracom | loadandpray | ||
masak | I recall we had similar-ish discussions about Pod back in 2006 or something | ||
tadzik | you could even make it uppercase EVAL for it to stand out more... | ||
masak | don't really know how those resolved themselves | ||
tadzik: heh | 06:34 | ||
tadzik | "The reason for this is because you can’t use a list as a dict key in Python" -- ...so use a tuple? %) | ||
not sure if you can have such a workaround in ruby or php though | 06:35 | ||
masak | the point about portability still stands, though | ||
the same input data works in some languages but not in others | |||
tadzik | I guess YAML's strongest point, ultimately, is "it's less PITA to write by hand than other things" | ||
yep, agreed | |||
masak | I think the stated goal of YAML is noble | 06:36 | |
06:36
HaraldJoerg left
|
|||
masak | it's also worth remembering (as HN points out) that YAML got started about the same time as JSON | 06:36 | |
tadzik | all in all, it's was a good read and a pretty convincing one too :) | 06:40 | |
and TOML certainly looks sensible | 06:41 | ||
masak | news.ycombinator.com/item?id=17362178 -- this reminded me of Perl 6 on a good day | 06:45 | |
06:49
skids left
06:54
stmuk_ joined
|
|||
tadzik | indeed :) I did chime in | 07:00 | |
masak | tadzik++ | 07:01 | |
m: constant foo = [ sub { say "OH HAI" } ]; foo[0]() | 07:09 | ||
camelia | OH HAI | ||
masak | ...I'm new here. is there a tool to check how long ago something started working in Rakudo? | 07:10 | |
bisectable6: help | |||
bisectable6 | masak, Like this: bisectable6: old=2015.12 new=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # See wiki for more examples: github.com/perl6/whateverable/wiki/Bisectable | ||
07:10
robertle joined
|
|||
masak | bisectable6: old=2017.01 new=HEAD constant foo = [ sub { say "OH HAI" } ]; foo[0]() | 07:11 | |
bisectable6 | masak, On both starting points (old=2017.01 new=a167e6c) the exit code is 0 and the output is identical as well | ||
masak, Output on both points: «OH HAI» | |||
masak | hm. | ||
there was something with bounded serialization and subs in constants that didn't work a while ago | |||
07:12
sno joined
|
|||
moritz | try going back further? | 07:13 | |
or maybe the problem is only in precompiled code? | |||
07:14
wamba joined
|
|||
masak | yes, I suspect so. | 07:15 | |
rt.perl.org/Public/Bug/Display.html?id=131840 seems related | 07:16 | ||
07:18
lizmat left
07:21
timotimo left
|
|||
masak | m: my %h1; %h1<foo> = 1; my %h2 := %h1.clone; %h2<bar> = 2; say %h1 | 07:24 | |
camelia | {foo => 1} | ||
masak | I see RT #127704 has been resolved too long ago. nice. | ||
synopsebot_ | RT#127704 [resolved]: rt.perl.org/Ticket/Display.html?id=127704 [BUG] Hash.clone differs from hash assignment; the hash and its clone are spookily entangled | ||
07:25
kurahaupo left,
kurahaupo joined
07:27
HaraldJoerg1 is now known as HaraldJoerg
07:28
dakkar joined
07:43
zakharyas joined
08:00
lizmat joined
08:03
xtreak left
08:07
zakharyas left
08:08
zakharyas joined
08:11
jmerelo joined
|
|||
jmerelo | Hi | 08:11 | |
masak | aloha, jmerelo | 08:12 | |
08:15
domidumont joined
|
|||
jmerelo | masak: :-) So everyone is sleeping and getting ready for the next TPC session in SLC, I guess... | 08:16 | |
Somehow, I expected to see, if not a wave, at least a trickle of new Perl6 users. Maybe it's not so immediate... | 08:17 | ||
08:29
xtreak joined
08:37
[Sno] joined
08:38
sno left
|
|||
Kaiepi | why do the actions for <action> return Nil, while the ones for <data> work fine? hastebin.com/razayevezu.xml | 08:38 | |
Geth | doc/pod-cache: 56086e010a | (JJ Merelo)++ | 2 files Expands filehandle explanation closes #2111 |
08:44 | |
jmerelo | Hum, wrong branch... | 08:47 | |
Geth | doc: 5db6e0e006 | (JJ Merelo)++ | doc/Type/IO.pod6 Improves run docs by adding filehandle argument, closes #2111 |
08:49 | |
synopsebot_ | Link: doc.perl6.org/type/IO | ||
masak | Kaiepi: because the methods in the action class need to be named action:sym etc, not action | ||
masak finds that one of the big problems with the grammar/actions boundary is that it's far too loosely typed | 08:50 | ||
the other day I got an error message to the effect of "Got 2 arguments but expected 1", but the underlying problem was "You forgot to give your action method a $/ parameter!" | 08:51 | ||
Kaiepi | ohhh | 08:52 | |
masak | if you want a single method in the actions class, then consider not using a proto token in the first place :) | 08:54 | |
protoregexes in the end are a convenient form of "implicit alternatives", with the dispatch happening somewhere inside the regex engine | 08:55 | ||
moritz | you can always have a single action method upstream | 08:56 | |
though the separate action methods are what makes proto regexes so composable | 08:57 | ||
masak | I had a situation yesterday where I was doing `[<foo> | <bar> | <baz>]` in the token, and then `$<foo>.ast || $<bar>.ast || $<baz>.ast` in the action method (except I forgot the final $<baz>.ast in the heat of battle). and I was thinking "there's gotta be a better way" | 08:59 | |
and that better way was protoregexes :) | |||
moritz | you can also do $/.hash.values[0].ast | 09:00 | |
09:05
zakharyas left
09:10
gregf_ joined
|
|||
masak | I'm simultaneously informed by this, and disgusted :) | 09:12 | |
hm, there's a place in 007 where I might have use of this trick | |||
moritz++ | 09:13 | ||
moritz | you can reduce the scope of this madness by putting the alternative into a capture | 09:16 | |
so if you have token flurb { <foo> (<bar>|<baz>|<quox>) } | 09:17 | ||
you can say $0.hash.values[0].ast | |||
09:21
wamba left
|
|||
masak | ooh | 09:22 | |
09:22
wamba joined
|
|||
masak | sir, I will credit you in the commit message | 09:22 | |
09:26
zakharyas joined
09:27
ChoHag left
09:40
[Sno] left
09:47
[Sno] joined
09:57
pmurias joined
|
|||
pmurias | tadzik: YAML being vastly more complex then people using it casually expect is something you could consider a failure of the design | 09:58 | |
09:58
kurahaupo is now known as opuaharuk,
pmurias left
10:04
zakharyas left
10:05
[Sno] left
10:06
scimon joined
10:07
zakharyas joined
|
|||
masak | interestingly, that complexity seems to stem from (a) wanting to be a readable format, and (b) targeting many dynamic languages | 10:11 | |
10:31
sno joined
10:40
Actualeyes left
|
|||
moritz | and (c) too much creativity :) | 10:46 | |
masak | at first I thought you were doing an ASCII copyright symbol ;) | 10:48 | |
jnthn | "too much creativity" would be a cute company name :) | 10:53 | |
Though I'm not sure what for :P | 10:54 | ||
jmerelo | jnthn: A cupcake company | ||
jnthn | ooh, yes, that'd work :) | ||
Until you end up eating the brussel sprout puree with shrimp paste cupcake, anyway... | 10:55 | ||
masak | Cannot invoke this object (REPR: Null; VMNull) | 10:57 | |
awwww | |||
seems I can't stick the 007 builtins in a BEGIN block just yet | |||
I looked around in RT for this ticket, but didn't find it on a first attempt | 10:58 | ||
I might have to log in so I can do an Advanced Search | |||
11:03
zakharyas left
11:05
telex left
11:07
timo joined,
zakharyas joined,
telex joined
11:08
rindolf joined
|
|||
masak | ah! found the ticket about anonymous subs being broken across module/precomp lines: rt.perl.org/Public/Bug/Display.html?id=127089 | 11:09 | |
(maybe there are more tickets in RT about it, though) | 11:10 | ||
11:12
sno left
11:13
sno joined
|
|||
tinita | tadzik: the "YAML is insecure by default" is nonsense | 11:13 | |
YAML does not do anything, it's just a serialization language | 11:14 | ||
there's just the fact that some of the processors load generic objects by default | |||
this will be fixed in the next version of PyYAML | |||
and now that YAML::{Syck,XS,.pm} all have $LoadBlessed, I would like to change the default to 0 at some point | 11:15 | ||
there's a pyyaml release planned | |||
11:16
zakharyas left
|
|||
tinita | YAML::PP is safe by default anyway | 11:16 | |
(if you don't count cyclic references as unsafe, they can be turned off optionally) | 11:17 | ||
masak | tinita: I take your meaning, but somewhere (I think you'll admit) a lot of implementations ended up implementing the spec in such a way that (by default) generic objects could be loaded. the fact that they're correcting this *now* is... good, but detracting from the main point that the insecure way was put in there in the first place. | 11:18 | |
tinita | about the "The reason for this is because you can’t use a list as a dict key in Python:" I made a pull request to fix that actally | 11:19 | |
masak | \o/ | ||
tinita | masak: yeah, agreed that the current state is bad | ||
masak | I think "YAML does not do anything, it's just a serialization language" loses sight of the fact that several implementations ended up doing the insecure thing by default | 11:20 | |
it's kind of like saying "the law does not do anything, it's just a book" | |||
11:20
n1ge left
|
|||
tinita | still, I think writing that in an article is misleading | 11:21 | |
11:21
n1ge joined,
zak-l joined
|
|||
tinita | moritz: the 15:30 thing is not read as a number in YAML 1.2 anymore | 11:21 | |
masak | aye, getting the spec/implementation distinction across is hard, as we in the Rakudo Perl 6 world know ;) | ||
tinita | just that not too many libraries picked up 1.2 :-/ | ||
11:21
HaraldJoerg1 joined,
HaraldJoerg left
|
|||
tinita | YAML::PP will be able to do both soon | 11:22 | |
11:25
zak-l left,
n1ge left
|
|||
tinita | the thing about large YAML files and losing track of indendation: I'm using vim folding if necessary =) | 11:25 | |
11:25
n1ge joined
|
|||
timo | "if a yaml structure gets too big, it gets unwieldy. if code gets too big i split it into different functions" - so why not split the yaml structure up with references? | 11:27 | |
11:27
timo is now known as timotimo
|
|||
timotimo | that should work fine, right? | 11:27 | |
yoleaux | 02:40Z <MasterDuke> timotimo: can you think of a reason a profile just wouldn't get written? i'm attempting to --profile-compile the rakudo build and it takes a long time (~16m) and finishes without any sort of error, but it never even starts the 'Writing profiler output...' stage | ||
tinita | timotimo: I'm planning to implement an !include thing, but there's no such thing in the specification | 11:28 | |
so yes, splitting the file up is often better | |||
timotimo | in the example they give, the "post:" part could have been replaced with a reference and then the post: subtree could have lived at 0 indentation? | 11:29 | |
tinita | hm, maybe I read the wrong article | 11:30 | |
timotimo | the "Can be hard to edit, especially for large files" section | ||
11:31
raynold left
|
|||
tinita | I see. I think that depends on which framework you use. in openapi you can use something like $ref, and maybe in rails, too, but I don't know it. so that's not a "builtin" YAML thing | 11:31 | |
11:32
sena_kun joined
|
|||
timotimo | i thought about using & and * | 11:32 | |
tinita | I see | ||
timotimo | but now i realize that would mean the node would also have to show up in some other place; anchors and aliases are probably not able to go between documents in the same file? | ||
tinita | exactly | 11:33 | |
it would work if your structure allows something like: x-definitions: # define some &anchors here | 11:34 | ||
11:34
sno left
11:37
pmurias joined
|
|||
timotimo | also, i just realized that something like json pointers would be difficult in yaml, since json doesn't have to handle complex keys at all | 11:38 | |
so while json pointers can be a simple format of their own, yaml pointers would have to include at least one way of writing yaml objects, most probably the one that doesn't need any newlines | 11:39 | ||
tinita | with json pointers you mean /foo/bar? | 11:41 | |
timotimo | yes | ||
tinita | I think a couple of people started ypath, but it never was completed :-/ | ||
github.com/peterkmurphy/YPath-Specification | 11:42 | ||
Kaiepi | why does parsing "{IAC}{SB}{NAWS}0x[00]0x[80]0x[00]0x[80]{IAC}{SE}" work ok with the grammar itself, but parsing it with these actions gives me Nil instead? hastebin.com/uyumetilab.sm | 11:43 | |
11:46
pmurias left
|
|||
timotimo | hm, regexes are allowed in ypath? that could allow user-provided ypaths to DOS using catastrophic backtracking, couldn't it? | 11:52 | |
11:53
rindolf left
11:54
pmurias joined
11:56
rindolf joined
|
|||
tinita | timotimo: probably, I never looked at ypath closely =) | 11:56 | |
timotimo | [Coke]: i think on the Proc::Async slide you're potentially resizing the %output hash when output comes from one of the processes, which can lead to a crash if two processes make their first output sufficiently close together | ||
even in a later version of moarvm that can do concurrent hash resizes without crashing, i think that'll still give data loss | 11:57 | ||
masak | timotimo: is there a pattern for how to handle that? | 11:58 | |
timotimo | concurrent resizes you mean? | ||
masak | I mean, what if a hash is what I actually want here? | ||
timotimo | have it in a supply or react block, where execution is guaranteed to only be active in one thread at a time | ||
masak | should I have an array and make a hash later? | ||
oh, supply or react. that makes sense. | 11:59 | ||
timotimo | if you know the keys up front, just initialize all of them up front, that works too | ||
masak | right | ||
right, 'cus it's the resizing that's the problem | |||
timotimo | yeah | ||
masak | initializing keys up front sounds like a generally good idea, concurrency or no | ||
timotimo | assigning to the same scalar from two threads at the same time just races and whoever wins gets to install their value | ||
though of course you can use CAS if you want for that purpose | 12:00 | ||
y'all remember the "soft" cat? she woke up my computer from suspend last night by putting her foot down somewhere on my keyboard | 12:04 | ||
12:05
telex left
12:10
committable6 left,
committable6 joined
12:12
Pheix joined
12:15
raschipi joined
|
|||
jmerelo | timotimo: she learns pretty fast. You'll have her getting out of vim pretty soon. | 12:24 | |
You probably know, but another batch of TPC talks has been accepted. | 12:25 | ||
timotimo | i wish this wouldn't lead to all the loose cat hair accumulating all over the keyboard, because that makes it hard to take pretty pictures | ||
also, it's a little icky just in general | |||
jmerelo | timotimo: get an old computer and put some herrings in the screen _and_ over the keyboard. That will keep her busy for a while. | 12:26 | |
timotimo | red herrings? | ||
jmerelo | timotimo: that would be doubly effective. Even more so if she's investigating some crime in the feline world. | 12:27 | |
jmerelo: also, LOL :-) | |||
pmurias | jmerelo: TPC::EU? | 12:36 | |
stmuk_ | timotimo: a trained cat on the keyboard is good for crypto entropy | 12:37 | |
timotimo | she's far too lazy for that :) | ||
masak .oO( lovingly paw-crafted entropy ) | 12:48 | ||
timotimo | well, for now the *other* cat is relaxing between my keyboard and monitor | 12:52 | |
12:53
telex joined
12:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
12:58
xtreak left,
telex left
13:02
jmerelo left
13:03
zakharyas joined
13:09
Khisanth left
13:22
Khisanth joined
13:23
sno joined
13:25
AlexDani` joined
13:27
AlexDaniel left
13:36
scimon left,
scimon joined
13:38
AlexDani` is now known as AlexDaniel
13:39
raschipi left
13:41
aborazmeh left
|
|||
tbrowder_ | jmerelo: not a cat comment, but how are non-breaking spaces working now? any problems noticed? | 13:47 | |
ingy | if I enter `sub x {}; x < 1` in the p6 repl and hit enter it goes it a mode I don't understand | 13:54 | |
and can't seem to get out of | |||
13:54
sno left
|
|||
ingy | can someone explain that? | 13:55 | |
e: sub x {}; x < 1 | |||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/YBnZ35wPEx Unable … |
||
ingy, Sorry kid, that's not my department. | |||
13:55
evalable6 left,
evalable6 joined
|
|||
AlexDaniel | e: sub x {}; x < 1 | 13:55 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/k6ZUj7oWwJ Unable … |
||
AlexDaniel, Full output: gist.github.com/54f38a3a9446b9dec3...ce91e88a77 | |||
moritz | m: sub x {}; x < 1 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in quote words; couldn't find final '>' (corresponding starter was at line 1) at <tmp>:1 ------> 3sub x {}; x < 17⏏5<EOL> expecting any of: argument … |
||
moritz | ingy: it's a quote-word expression <...> | ||
that you didn't finish | |||
need x() < 1 | 13:56 | ||
ingy | I was playing with qw vs lt | ||
actually | |||
moritz | the repl somehow recognizes that there's an unfinished quote, and asks you for more input | 13:57 | |
ingy | moritz: but how do I tell the repl to give up but not exit? | ||
ctl-c kills the repl | |||
moritz | besides closing the quote? no idea :( | ||
ingy | as does ctl-d | ||
BAD REPL! BAD REPL! | 13:58 | ||
:) | |||
moritz | patches welcome :) | ||
ingy | ctl-c should probably kill the context, not the repl (unless top context (and only after prompt)) | 13:59 | |
14:00
sno joined
|
|||
ingy | $ coffee | 14:00 | |
coffee> | |||
(To exit, press ^C again or type .exit) | |||
good example | |||
moritz | +1 | ||
ingy | e: sub x {}; sub y { x < 0 } | 14:05 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/OZEjh76AEZ Unable … |
||
ingy, Full output: gist.github.com/d1cdd30d2a2a790a86...e5b3e37980 | |||
ingy | moritz: doesn't that seem like an ambiguity? | 14:06 | |
Kaiepi | i worked out what i was doing wrong with my grammar | ||
now i have a basic telnet parser! \o/ | |||
14:06
raschipi joined
|
|||
ingy | Kaiepi++ | 14:07 | |
robertle | isn't telnet a surprisingly complicated protocol? I remember looking at the spec once and benig shocked by the sheer size of it... | ||
moritz | ingy: no, the parser always knows whether it expects a term or an operator | ||
ingy | moritz: in that case y should have returned a Bool | 14:08 | |
Kaiepi | it's a simple protocol but really annoying to parse, if it makes sense | ||
moritz | ingy: x is a listop, so it expects a term after that | 14:09 | |
robertle | hmm, i remember the autonegotiation on connection establishment as rather long-winded... | ||
14:09
Luneburg joined
|
|||
moritz | x < 0 is the same as x( < 0 ) | 14:09 | |
Luneburg | m: False and $number > 0; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$number' is not declared at <tmp>:1 ------> 3False and 7⏏5$number > 0; |
||
ingy | e: sub x {}; sub y { x } | 14:11 | |
evalable6 | |||
ingy | e: sub x {}; sub y { x() < 0 } | ||
evalable6 | |||
14:11
HaraldJoerg1 left
|
|||
Luneburg | Interesting, in the ThinkPerl6 book it says that "False and $number > 0;"expression should short-circuit after the first Boolean is read, and it shouldn't check whether $number has even been declared? | 14:11 | |
ingy | just seems a little fragile to me | ||
14:12
HaraldJoerg joined
|
|||
moritz | Luneburg: the declaration check happens at compile time | 14:12 | |
Luneburg: before the short-circuiting at run time | |||
Luneburg | moritz: Got it, thanks :D | ||
ingy | bbl | ||
14:19
sno left,
Luneburg left
14:20
raschipi left
14:21
sno joined
14:27
curan left,
diakopter joined,
MasterDuke left
14:29
molaf left,
molaf joined
14:34
markoong joined
14:37
ChoHag joined
14:43
xtreak joined
14:45
domidumont left
14:48
Luneburg joined
|
|||
Luneburg | I have a value from 0 to 100(decimals included). Every time the value passes a whole integer (1,2,3,4,5), I want to concatenate a dot to an array. How can I do this without using given statements? | 14:50 | |
timotimo | an important question is: does the number hit a whole integer exactly? or are you using floating point? | 14:51 | |
or are you just looking for "was the value before a given integer before and is now after that given integer?" | 14:52 | ||
Luneburg | timotimo: The number will hit all the whole integers | ||
timotimo | OK | ||
m: for 0, 0.1 ... 10 { if $_ %% 1 { print "." } } | |||
camelia | ........... | ||
timotimo | m: for 0, 0.1 ... 10 { if $_ %% 1 { print "." } else { print " " } } | ||
camelia | . . . . . . . . . . . | ||
Luneburg | timotimo: Doesn't that just print a "." if the number $_ is divisible by 1? | 14:55 | |
timotimo | yes | ||
i might be misunderstanding your question | |||
Luneburg | timotimo: Ah, for one of the project euler problems I decided to make a progress bar thing. Currently, I have it display a percentage towards completion (i.e. "search 0.125% complete) | 14:57 | |
But every time it passes a 1, I want it to add a "." to a progress bar, if that makes sense? | |||
And display the progress bar instead | |||
timotimo | OK, i don't quite understand why just checking for percentages that are divisible by 1 isn't good enough | 14:58 | |
ilmari | github.com/sergot/Term--ProgressBar? | ||
AlexDaniel | timotimo: because it can jump over some numbers? | ||
timotimo | that's why i asked if it hits integers exactly | 14:59 | |
and Luneburg said "will hit all the whole integers" | |||
Luneburg | timotimo: Yup | ||
timotimo: I'm just thinking, aren't all the percentages... divisible by 1 though? | |||
timotimo | 100 of the ones between 0 and 100 are | 15:00 | |
Luneburg | *facepalm* I forgot that "divisible" means without decimal points | 15:01 | |
timotimo: Thanks :D | |||
timotimo | hah | ||
it'd be kind of useless otherwise :D | |||
AlexDaniel | m: my $progress = 2.3; my $last = 0; sub dots() { put ‘.’ x ($progress.floor - $last.floor); $last = $progress; }; dots; $progress = 5.2; dots | ||
camelia | .. ... |
||
AlexDaniel | something like this maybe? | ||
I'm not sure if it is correct | |||
timotimo | AlexDaniel: i'm sure something with a supply could be pretty | ||
AlexDaniel | m: my $progress = 2.3; my $last = 0; my &dots = { put ‘.’ x ($progress.floor - $last.floor); $last = $progress; }; dots; $progress = 5.2; dots | 15:02 | |
camelia | .. ... |
||
timotimo | m: my $numbers = Supply.from-list(0.1, 1.1 ... 20.1); $numbers.rotor(2 => 1).tap({ .say if .[0].ceil == .[1].floor }); | 15:03 | |
camelia | ( no output ) | ||
timotimo | m: my $numbers = Supply.from-list(0.1, 1.1 ... 20.1); $numbers.rotor(2 => 1).tap({ say .[0].ceil, .[1].floor }); | ||
camelia | ( no output ) | ||
AlexDaniel | maybe modules.perl6.org/search/?q=ncurses ? | ||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.rotor(2 => 1).tap({ say .[0].ceil, .[1].floor }); $numbers.emit($_) for 1.1, 2.1 ... 10.1; | 15:04 | |
camelia | No such method 'tap' for invocant of type 'Seq'. Did you mean any of these? Map map tan in block <unit> at <tmp> line 1 |
||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => 1).tap({ say .[0].ceil, .[1].floor }); $numbers.emit($_) for 1.1, 2.1 ... 10.1; | ||
camelia | No such method 'ceil' for invocant of type 'Rat'. Did you mean any of these? Real cis perl tail in block <unit> at <tmp> line 1 |
||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => 1).tap({ say .[0].ceiling, .[1].floor }); $numbers.emit($_) for 1.1, 2.1 ... 10.1; | ||
camelia | 22 55 88 |
||
15:04
zakharyas left
|
|||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => 1).tap({ .say if .[0].ceiling == .[1].floor }); $numbers.emit($_) for 1.1, 2.1 ... 10.1; | 15:05 | |
camelia | [1.1 2.1] [4.1 5.1] [7.1 8.1] |
||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => -1).tap({ .say if .[0].ceiling == .[1].floor }); $numbers.emit($_) for 1.1, 2.1 ... 10.1; | ||
camelia | [1.1 2.1] [2.1 3.1] [3.1 4.1] [4.1 5.1] [5.1 6.1] [6.1 7.1] [7.1 8.1] [8.1 9.1] [9.1 10.1] |
||
timotimo | m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => -1).tap({ .say if .[0].ceiling == .[1].floor }); $numbers.emit($_) for 1.1, 1.2 ... 10.1; | ||
camelia | [1.9 2] [2 2.1] [2.9 3] [3 3.1] [3.9 4] [4 4.1] [4.9 5] [5 5.1] [5.9 6] [6 6.1] [6.9 7] [7 7.1] [7.9 8] [8 8.1] [8.9 9] [9 9.1] [9.9 10] [10 10.1] |
||
timotimo | damn, that fires just a bit too often | ||
ah | |||
m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => -1).tap({ .say if .[0].truncate != .[1].truncate }); $numbers.emit($_) for 1.1, 1.2 ... 10.1; | 15:06 | ||
camelia | [1.9 2] [2.9 3] [3.9 4] [4.9 5] [5.9 6] [6.9 7] [7.9 8] [8.9 9] [9.9 10] |
||
timotimo | perfect | ||
this can handle the case when integers aren't hit exactly, too | |||
m: my $numbers = Supplier::Preserving.new; $numbers.Supply.rotor(2 => -1).tap({ .say if .[0].truncate != .[1].truncate }); $numbers.emit($_) for 1.1, 1.3 ... 10.1; | |||
camelia | [1.9 2.1] [2.9 3.1] [3.9 4.1] [4.9 5.1] [5.9 6.1] [6.9 7.1] [7.9 8.1] [8.9 9.1] [9.9 10.1] |
||
15:08
zakharyas joined
15:10
robertle left
15:15
sena_kun left
15:18
diakopter left
15:34
xtreak left
15:35
lizmat left
15:40
Pheix left
15:41
Pheix joined,
Luneburg left
15:42
Pheix left,
sno left
15:46
robertle joined
15:54
lichtkind joined,
wamba left
16:02
lichtkind left
16:04
zakharyas left
16:14
lizmat joined
16:15
lizmat_ joined
16:19
lizmat left
16:21
zakharyas joined
16:28
wamba joined,
dakkar left,
scimon left
16:34
lizmat_ is now known as lizmat
|
|||
buggable | New CPAN upload: Acme-Dont-0.0.2.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.2.tar.gz | 16:35 | |
16:39
perlpilot joined
|
|||
[Coke] | timotimo: (hash resize) oops! | 16:40 | |
timotimo | [Coke]: i like your talks, your presentation style is pleasant | ||
[Coke] | Recipe: Stress out for weeks, do all the work the night before! | 16:43 | |
. o O (Don't actualy do that) | |||
timotimo | i tend to do it in an even worse way, but then i'm also rather nervous and don't speak very clearly and all that | 16:45 | |
16:45
zakharyas left
16:46
fou joined
|
|||
perlpilot | timotimo, there are several people who have pleasant presentation styles. I wish I could relax in front of people like that. (or at least look like it! :-) | 16:46 | |
fou | hey, I'm porting Peter Norvig's lis.py tutorial to perl6, but it crashes - could I get some help here? I'm desperated :( | ||
timotimo | fou: i'd say you've come to the right place | 16:47 | |
fou | timotimo: what a relief | ||
timotimo | what's the nature of the crash? just exceptions, or an actual segfault? | 16:48 | |
fou | timotimo: seems like a logic bug. which is weird, because my code is 1:1 translation | ||
can I post a gist here? | |||
timotimo | yes, you can. if you put a m: in front it'll even run the code and put the output on irc, too | 16:49 | |
fou | one second | ||
timotimo: gist.github.com/fou/a70ecd989c47c7...15d5d5ee0e | 16:50 | ||
read-from-tokens always dies with 'unexpected EOF' | |||
norvig.com/lispy.html <- python version | 16:51 | ||
timotimo | do you have example input? does it get deep into recursion at all? | ||
oh, heh. | |||
you're using ~ in the if/elsif in read-from-tokens | |||
you'll want "eq" there instead | |||
and i'd probably replace the !~~ with ne as well | 16:52 | ||
fou | oh ^^ thank you! | ||
I have to go now, will join later though. thanks for help :) | |||
timotimo | you're welcome | ||
16:52
fou left
16:55
mahafyi joined
16:59
grumble joined
17:17
|oLa| left
|
|||
Geth | doc: e9a057962d | (Will "Coke" Coleda)++ | 6 files Add Pod::Cache Instead of generating pod files each time for each test that needs it, generate a cache as we go, that uses the timestamp to insure we don't regen them if not needed. This temporarily removes the concurrency from some files. Related to #1952 |
17:27 | |
doc: 56086e010a | (JJ Merelo)++ | 2 files Expands filehandle explanation closes #2111 |
|||
doc: 6e4c16e3a1 | (Will "Coke" Coleda)++ | 8 files Merge branch 'pod-cache' |
|||
17:38
dha joined
17:58
dha left
18:00
dha joined
18:07
Grauwolf left
18:15
Grauwolf joined,
Grauwolf left,
Grauwolf joined
18:25
zachk joined,
Xliff_ left,
Xliff joined
18:26
zachk left,
zachk joined,
sauvin left
18:28
fou joined
|
|||
fou | timotimo: it works! but the array is flattened for some reason | 18:28 | |
18:30
espadrine joined,
lembark joined
|
|||
perlpilot | fou: flattened? you mean @l in your program? If so, perhaps you wanted @l.push instead of @l.append | 18:31 | |
fou | perlpilot: ah, right :) I've changed it to .append and wanted to switch back but I forgot | ||
lembark | Q: If I want to get the same effect as P5's "use lib...", how would I manage $*REPOS in order to add new lib's? | ||
Liz doesn't know where this is documented -- her one attempt left her emotionally scarred enought that she has attempted to blot it from her memory :-) | 18:32 | ||
moritz | lembark: why not just "use lib 'path';"? | ||
works in Perl 6, afaict :-) | 18:33 | ||
lembark | If that works, fine. | ||
moritz | worked last I tried it :-) | ||
lembark | i.e., "use lib @prefix_these_libs;" works in Perl6 as it does in Perl5? | ||
perlpilot | It's that "manage $*REPOS" part you should probably stay away from :) | ||
lembark | Fine with me. | ||
I've got a working version of FindBin (much simpler in P6), wanted to implement FindBin::libs. | 18:34 | ||
18:36
fou left
|
|||
lembark | Q: Given a list of paths in @pathz what is the correct syntax for calling P6 "lib" at runtime to make use of the values in @pathz? | 18:37 | |
Thanks. | |||
moritz | m: my $r = CompUnit::RepositoryRegistry; $r.use-repository($r.repository-for-spec("some/path")); | 18:46 | |
camelia | ( no output ) | ||
18:46
Xliff left
|
|||
moritz | lembark: ^^ should work something like that (which you have to repeate for every element in @pathz | 18:47 | |
18:53
Xliff joined
|
|||
tbrowder_ | .ask jmerelo how are pod non-breaking spaces working now? any problems noticed? | 19:00 | |
yoleaux | tbrowder_: I'll pass your message to jmerelo. | ||
19:08
dha left
19:10
jmerelo joined
|
|||
jmerelo | So very soon there will be a Perl 6 .gitignore in GitHub github.com/github/gitignore/pull/2...1693842140 thanks to bdfoy | 19:12 | |
yoleaux | 19:00Z <tbrowder_> jmerelo: how are pod non-breaking spaces working now? any problems noticed? | ||
jmerelo | tbrowder_: Has it been included in the new release? I'll check. Thanks! | 19:13 | |
Is there a new release? | |||
releasable6: status | |||
releasable6 | jmerelo, Next release will happen when it's ready. 0 blockers. 88 out of 123 commits logged | ||
jmerelo, Details: gist.github.com/ec61a4a60c235504fa...d492fd6dcc | |||
jmerelo | Not yet, I guess... | ||
tbrowder_ | oh, you’re right, i can’t keep up with the release process :( | 19:14 | |
19:15
opuaharuk is now known as kurahaupo
|
|||
AlexDaniel | release will happen in a few hours | 19:16 | |
nothing is blocking, I just need to get my hands on it | |||
jmerelo | tbrowder_: thanks for warning, anyway. I'm still travelling but will try to do something as soon as it's availab.e | 19:17 | |
AlexDaniel++ | |||
El_Che | release depends on Argentina playing better | ||
:) | |||
jmerelo | El_Che: Well, that goal was terrible... | ||
I mean, really. | 19:18 | ||
Kick it into the hands of the Croatian forward. | |||
El_Che | It's on onto the hand of god, that's sure | ||
not | |||
geekosaur | another team that barely qualified on the way out :p | 19:19 | |
jmerelo | Or boots, rather | ||
Also, 4 days without Perl6 questions in StackOverflow. We're missing Brian D. Foy there... | |||
El_Che | jmerelo: it's because your new doc is too clear | 19:21 | |
jmerelo | El_Che: :-) 155 issues say otherwise... | 19:23 | |
AlexDaniel | o-o-o my PR to FastCGI was merged | ||
jmerelo | AlexDaniel: congrats! | 19:24 | |
El_Che | AlexDaniel: you da man | ||
lucs | jmerelo: bdf's book is now in t | ||
meh | |||
jmerelo | Beer|Soft drink|water for everyone. Next round is on AlexDaniel. | ||
lucs | jmerelo: bdf's book is now in the hands of his editors, so that probably explains his absence. | ||
AlexDaniel | .oO(beer water for everyone!) |
19:25 | |
jmerelo | lucs: that's probably the case. But there's no one else taking up the slack... | ||
lucs | jmerelo: Write a book! ;) | ||
El_Che | is the code on the draft ideomatic? | 19:26 | |
there was some critique on the blog posts | |||
jmerelo | lucs: Hey, I _did_ write a book! amzn.to/2JVX2MF | ||
lucs | Could be tricky -- one person's idiom is another one's golf example. | 19:27 | |
Geth | doc: ronaldxs++ created pull request #2112: Update regexes.pod6 fix reversed suppress capture operators ".&" |
||
lucs | jmerelo: Oh, cool :) | ||
jmerelo | El_Che: there's no such thing as "idiomatic" perl6 | ||
AlexDaniel | why not | 19:28 | |
El_Che | there pis perl6 with a stong perl 5 accent | ||
jmerelo | We barely have a word for it: p6y... | ||
AlexDaniel: Well, there's maybe such a thing "in the abstract". But it's a matter of opinions. | |||
Not that, actually. Rather of what you want to optimize. Speed, "functional", thread-safe... | 19:29 | ||
El_Che | I prefer slow, non-functioning and locking code, myself | 19:30 | |
19:34
n1ge left
|
|||
jmerelo | El_Che: If it non-works optimally, great :-) | 19:34 | |
Geth | doc: 33a4b40ddb | (Jan-Olof Hendig)++ | xt/examples-compilation.t Added a couple of missing close statements Could cause problems on systems where the number of open fh's per process was set too low, e.g. 1024 |
19:35 | |
El_Che | jmerelo: it looks like the Argentinian selection will have some time soon to ask question on SO | 19:39 | |
19:39
n1ge joined
|
|||
jmerelo | El_Che: :-) a lot of time indeed. | 19:41 | |
Geth | doc: 81f5da0ccf | (JJ Merelo)++ | doc/Type/IO.pod6 Minor reflow |
19:45 | |
doc: c678f271bd | (JJ Merelo)++ | 9 files Fixes conflict |
|||
synopsebot_ | Link: doc.perl6.org/type/IO | ||
doc: 23578bb4e0 | (Ronald Schmidt)++ | doc/Language/regexes.pod6 Update regexes.pod6 fix reversed suppress capture operators ".&" |
19:46 | ||
synopsebot_ | Link: doc.perl6.org/language/regexes | ||
doc: a3753c01a3 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6 Merge pull request #2112 from ronaldxs/reverse-suppress-capture Update regexes.pod6 fix reversed suppress capture operators ".&" Thanks a lot! |
|||
19:47
darutoko left
|
|||
El_Che | jmerelo: heh, indeed :) | 19:49 | |
19:49
Kaiepi left,
Kaiepi joined
|
|||
geekosaur | one could argue they have time right now | 19:49 | |
not sure what they're doing out there, ight as well be on SO | 19:50 | ||
jmerelo | geekosaur: yep, they are not doing much... | ||
I'm pretty sure that if they ask "How to win a match with a second-tier European team having the (arguably) best player in the world" will be voted down as "too broad" | 19:51 | ||
El_Che | opiniated | ||
jmerelo | Finished | ||
El_Che | The Promise was broken | 19:53 | |
20:20
gabiruh left
20:21
drforr joined
20:23
perlpilot left
|
|||
drforr | You'd think there was a convention going on or something. | 20:23 | |
yoleaux | 16 Apr 2018 13:31Z <Zoffix> drforr: you done a bunch of Perl 6 workshops. Do you got any advice to offer for what should be included in our Perl 6 Starter Kit? github.com/perl6/marketing/issues/14 | ||
16 Jun 2018 18:38Z <Zoffix> drforr: a long shot, but is there a version of your ML talk with working sound by any chance? www.youtube.com/watch?v=GI9DmIbNXrM | |||
20:23
raschipi joined
20:24
MasterDuke joined,
ChoHag left
|
|||
drforr | .tell Zoffix I'll give it some thought tonight. | 20:25 | |
yoleaux | drforr: I'll pass your message to Zoffix. | ||
20:26
gabiruh joined
20:27
ChoHag joined
|
|||
drforr | .tell Zoffix I know of no other version of | 20:28 | |
yoleaux | drforr: I'll pass your message to Zoffix. | ||
drforr | .tell Zoffix ... of the talk. | 20:29 | |
yoleaux | drforr: I'll pass your message to Zoffix. | ||
20:30
ryn1x left
|
|||
jmerelo | drforr: you've done a talk on machine learning? | 20:31 | |
20:32
rindolf left
20:36
rindolf joined
20:38
drforr left
20:41
ufobat_ left
20:42
jmerelo left
20:43
pmurias left
20:54
pmurias joined
20:56
perlpilot joined
21:08
ryn1x joined,
raschipi left
|
|||
masak | why is EXPR upper-cased in the Perl 6 grammar? | 21:17 | |
21:18
jast joined
21:20
sno joined
|
|||
Geth | perl6-most-wanted: c9b3fbbb5b | (Will Coleda)++ (committed using GitHub Web editor) | most-wanted/modules.md Update modules.md |
21:27 | |
perl6-most-wanted: c08f7c4cf9 | (Will Coleda)++ (committed using GitHub Web editor) | most-wanted/modules.md Update modules.md App::Uni was done ages ago: github.com/coke/p6-uni |
21:28 | ||
21:28
pmurias left
21:29
pmurias joined
|
|||
Xliff | m: my $a = 1; my $b := $a; say $b.^name; | 21:30 | |
camelia | Int | ||
[Coke] | is docs.perl6.org/language/modules#Up...le_to_CPAN up to date? | ||
Xliff | m: my $a = 1; my $b := $a; say $b.VAR.^name; | ||
camelia | Scalar | ||
Xliff | m: my $a = 1; my $b := $a; say $b.VAR.gist.say; | 21:32 | |
camelia | 1 True |
||
Xliff | How can you get the name assigned to a variable? | 21:36 | |
And is there a way to determine if that variable has been bound to another? | |||
timotimo | you can compare with :=: | ||
Xliff | (The second one isn't as important) | ||
timotimo | er | ||
=:= | |||
Xliff | m: my $a = 1; my $b := $a; say ($b =:= $a) | 21:37 | |
camelia | True | ||
Xliff | m: my $a = 1; my $b := $a; my $c = 2; say ($b =:= $c) | ||
camelia | False | ||
MasterDuke | m: my $a = 1; my $b := $a; say $b.VAR.name; | ||
camelia | $a | ||
masak | I'd say this, if you need to check whether a variable has been bound to another, you might want to step back and re-examine the premises of your program design :P | 21:38 | |
[Coke] | lizmat: you've probably uploaded more cpan modules than anyone, let me borrow you for 30s when you get a chance. | ||
21:43
telex joined
|
|||
Xliff | m: my $a = 1; my $b := $a; say $b.VAR.name; | 21:44 | |
camelia | $a | ||
Xliff | ^^ Is there a way to get that to say "b"? | ||
m: my $a = 1; my $b := $a; my $c = 2; say $c.VAR.name | 21:45 | ||
camelia | $c | ||
timotimo | you're overwriting the very existence of $b, at that point, no b exists any more | ||
Xliff | That's what I was afraid of. | ||
OK, thanks! | |||
timotimo | it could potentially be possible, if perl6 didn't decont when assigning | ||
ingy | why is modules.perl6.org/t/SLANG so empty? | 21:50 | |
I am thinking to make a Slang::Destructure to implement coffeescript.org/#destructuring in p6 | 21:51 | ||
I thought there would be more slang modules | |||
hmm there are actually 9 slang modules. people just suck at tagging | 21:52 | ||
21:53
raynold joined
|
|||
Kaiepi | there's no destructuring for stuff like hashes? | 21:54 | |
m: my %a = a => 1, b => 2; my ($a, $b) = %a; say $a, $b | 21:55 | ||
camelia | a => 1b => 2 | ||
Kaiepi | m: my %a = a => 1, b => 2; my ($a, $b) = %a; say $a | ||
camelia | a => 1 | ||
timotimo | m: my %a = :1a, :2b; my (:$a, :$b) = %a; dd $a, $b; | 21:57 | |
camelia | Pair $a = :b(2) Pair $b = :a(1) |
||
timotimo | m: my %a = :1a, :2b; my (:$a, :$b) = %a; say $a.perl; say $b.perl | ||
camelia | :b(2) :a(1) |
||
timotimo | huh | ||
m: my %a = :1a, :2b; my \(:$a, :$b) := %a; say $a.perl; say $b.perl | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed my at <tmp>:1 ------> 3my %a = :1a, :2b; my7⏏5 \(:$a, :$b) := %a; say $a.perl; say $b. |
||
timotimo | m: my %a = :1a, :2b; my (:$a, :$b) := %a; say $a.perl; say $b.perl | ||
camelia | 1 2 |
||
timotimo | that's how | ||
Kaiepi | what would be cool is an equivalent to something like "let foo = {a: 1}; let bar = {b: 2, ...a}" like in javascript | 21:58 | |
timotimo | m: my %foo = :1a; my %bar = :2b, %foo; say %bar.perl | 21:59 | |
Kaiepi | wait | ||
camelia | {:a(1), :b(2)} | ||
Kaiepi | m: my %a = a => 1; my %b = b => 2, |%a; dd %b | ||
camelia | Hash %b = {:a(1), :b(2)} | ||
timotimo | no need for the | actually | 22:00 | |
Kaiepi | oh nice | ||
22:04
rindolf left
22:05
diakopter joined
22:06
perlpilot left
22:07
sno left,
sno joined
22:11
pmurias left
22:14
sno left
22:15
sno joined
22:31
labster joined
22:35
Kaiepi left
22:42
HaraldJoerg left
22:53
Kaiepi joined
22:57
robertle left
23:03
cpage joined
|
|||
buggable | New CPAN upload: IP-Random-0.0.4.tar.gz by JMASLAK modules.perl6.org/dist/IP::Random:cpan:JMASLAK | 23:05 | |
23:06
kurahaupo_ joined
23:08
kurahaupo left
23:10
perlpilot joined
23:32
espadrine left
23:33
greppable6 left
23:34
greppable6 joined,
ChanServ sets mode: +v greppable6,
kurahaupo_ is now known as kurahaupo
23:35
molaf left
23:36
lembark left
23:43
Kaiepi left
23:46
raschipi joined
23:48
Kaiepi joined
|
|||
Xliff | Can someone point me to docs for caller()? | 23:48 | |
I need to get the call chain from within a method or sub. | |||
geekosaur | if it's implemented yet, it's a wrapper for docs.perl6.org/routine/callframe | 23:50 | |
perlpilot | Xliff, there's docs.perl6.org/routine/callframe | ||
I think there might be a module (from lizmat?) that does caller() | |||
23:52
molaf joined
|
|||
perlpilot | oh, I'm thinking of modules.perl6.org/dist/P5caller:cpan:ELIZABETH | 23:53 | |
23:57
lizmat left
|
|||
jnthn | Xliff: Depending why you want it, the Backtrace class may also be sueful | 23:57 | |
*useful | |||
23:58
Kaypie joined,
quotable6 left,
Kaiepi left,
quotable6 joined
23:59
lizmat joined
|