»ö« 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 moritz on 22 December 2015.
00:10 Lac left 00:12 zakharyas joined 00:28 Cabanossi left, cdg joined 00:30 Cabanossi joined 00:31 wamba left 00:33 skids joined, cdg left 00:34 dogbert2 left 00:45 margeas left 00:48 zakharyas left 00:50 nattefrost left
samcv sub thing { return $foo, @array;}; my ($foo, @array) = thing 00:51
this makes @array an array of an array. how do i prevent this
it becomes [[0 => 16, 2 => 5, 3 => 1, 1 => 9],]
instead of what it used to be
00:52 astj joined
samcv return $foo, |@array seems to work at least 00:53
wouldn't that possibly mess up things if i did: `return $foo, |@array, $thing`? 00:54
00:54 raschipi left, nadim left 00:56 astj left 00:59 Cabanossi left 01:00 Cabanossi joined 01:01 Lac joined 01:08 nightfrog joined 01:15 Lac left
ugexe m: proto sub foo { {*}>>.Slip }; multi sub foo { return 1, (2,3) }; my ($foo, @array) = foo; say @array.perl 01:18
camelia [slip(2, 3),]
ugexe i like to use protos to do return value formatting for some reason 01:19
01:21 jeromelanteri joined 01:24 mr-foobar left 01:25 mr-foobar joined 01:43 Cabanossi left 01:45 Cabanossi joined, cdg joined 01:46 ilbot3 left 01:50 cdg left, ChoHag left 01:54 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:03 R0b0t1_ left, piojo2 joined 02:12 audiatorix left 02:16 noganex joined 02:18 noganex_ left 02:21 R0b0t1_ joined 02:32 audiatorix joined
audiatorix is there any more direct way to get a list of captures from a Match than $/.caps>>.value>>.Str 02:33
02:34 dj_goku_ joined
audiatorix ie, without needing the hyperoperator 02:34
02:36 dj_goku left 02:41 pyrimidine left, pyrimidi_ joined 02:52 audiatorix left 02:59 raschipi joined 03:04 raschipi left 03:05 raschipi joined
raschipi m: 'ab' ~~ /(.)(.)/; $/.^methods 03:05
camelia ( no output )
raschipi m: 'ab' ~~ /(.)(.)/; $/.^methods.say
camelia (ast made STR MATCH CURSOR_NEXT CURSOR_OVERLAP CURSOR_MORE INTERPOLATE CALL_SUBRULE DYNQUANT_LIMITS OTHERGRAMMAR INDMETHOD INDRULE RECURSE BUILD clone Bool prematch postmatch caps chunks punct lower !LITERAL set_package CAPHASH !alt_nfa !reduce_with_matc…
03:19 raschipi left 03:33 dogbert2 joined 03:43 Cabanossi left 03:44 Cabanossi joined
Geth doc: lefth++ created pull request #1543:
Describe the Backtrace class in the debugging section.
03:48
03:50 kaare__ joined 03:52 kaare_ left 04:07 geekosaur left
Geth doc: 7f104fe03f | (Dan Zwell)++ | doc/Programs/01-debugging.pod6
Describe the Backtrace class in the debugging section.
04:12
doc: c89adc019a | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Programs/01-debugging.pod6
Update 01-debugging.pod6
doc: c8c56df47e | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Programs/01-debugging.pod6
Merge pull request #1543 from lefth/master

Describe the Backtrace class in the debugging section.
04:13 raschipi joined 04:29 geekosaur joined, geekosaur left, ShalokShalom joined 04:34 raschipi left 04:40 geekosaur joined 04:55 khw left 04:57 Cabanossi left 04:58 Sgeo left 04:59 Cabanossi joined 05:01 Sgeo joined 05:02 lucs left 05:03 Sgeo_ joined 05:05 piojo2 left 05:06 piojo2 joined, Sgeo left 05:18 pyrimidine joined, pyrimidi_ left 05:25 skids left 05:26 wamba joined, andrzejku joined 05:36 dogbert2 left 05:42 Cabanossi left 05:44 Cabanossi joined 05:46 espadrine joined 05:58 pyrimidine left 05:59 pyrimidine joined 06:00 wamba left 06:01 cdg joined 06:03 pyrimidine left 06:06 cdg left, pyrimidine joined 06:10 pyrimidine left, pyrimidine joined 06:14 piojo2 left 06:16 pyrimidine left 06:20 pyrimidine joined 06:25 pyrimidine left 06:27 pyrimidine joined 06:32 todd joined
todd Hi All! I am trying to convert some Perl 5 code to 65. What do I use in place of `use Term::ReadKey qw ( ReadKey ReadMode );` 06:32
06:32 nadim joined
todd Full code can be seen here: vpaste.net/UGpel 06:32
06:33 pyrimidine left, pyrimidine joined 06:38 pyrimidine left 06:39 pyrimidine joined 06:42 Cabanossi left 06:43 pyrimidine left, pyrimidi_ joined 06:44 Cabanossi joined
todd I will post over on [email@hidden.address] bye bye 06:45
06:45 todd left 06:47 pyrimidine joined 06:48 pyrimidi_ left, kaare__ left, kaare__ joined 06:53 pyrimidine left 06:57 pyrimidine joined 07:02 pyrimidine left 07:04 pyrimidine joined 07:09 pyrimidine left 07:13 pyrimidine joined 07:14 okl joined 07:16 setty1 joined 07:19 pyrimidine left, robertle joined, pyrimidine joined 07:24 pyrimidine left 07:26 andrzejku left 07:27 BenGoldberg left 07:28 pyrimidine joined 07:31 setty1 left, domidumont joined 07:33 pyrimidi_ joined, pecastro left 07:34 pyrimidine left 07:35 pecastro joined 07:37 pyrimidi_ left, pyrimidine joined, domidumont left 07:38 domidumont joined 07:41 pyrimidine left, pyrimidine joined 07:42 pecastro left 07:45 pyrimidine left 07:46 pyrimidine joined 07:47 robertle left 07:48 jeromelanteri left 07:49 domidumont left 07:50 pyrimidine left, pyrimidi_ joined 07:54 darutoko joined 07:56 pyrimidi_ left, pyrimidine joined 07:57 okl left 07:58 pecastro joined 08:01 pyrimidine left 08:02 pecastro left, raschipi joined 08:03 raschipi left, pyrimidine joined 08:07 pyrimidine left 08:08 pyrimidine joined 08:14 konsolebox left 08:19 pecastro joined, TEttinger left 08:22 konsolebox joined 08:32 pyrimidine left, pyrimidi_ joined 08:57 Cabanossi left 08:58 Cabanossi joined 09:03 ChoHag joined 09:08 ufobat joined 09:10 robertle joined 09:36 margeas joined 09:41 piojo joined, Cabanossi left
piojo Regarding p6doc, can we index the MOP page as "Introspection"? 09:43
nobody newbie searches for MOP
09:44 Cabanossi joined
piojo I can figure out how and make a PR if y'all would be amenable to that change, but it's possible the best way is to accomplish it is to rename the page. 09:45
and then we'd need to add a redirect from "mop" to "introspection" 09:46
moritz I hope you can add an index item for "introspection" but still keep the page as "mop"?
the MOP can do much more than just introspection, so I'm against a rename 09:47
piojo moritz: I haven't tried, but I have the doc server on my laptop so can figure it out
moritz: you're right. I was looking at the top half of the page... I'll figure out if it can be indexed.
I'm really glad you guys made the doc server easy to run. My internet connection is spotty, and I don't know what I'd do without local documentation. It's too bad the p6doc CLI isn't as powerful (either for searching or showing methods of parent classes) 09:51
I guess nobody wants to improve the CLI for core classes/modules because the web UI is so beautiful. (Myself included) 09:52
moritz also it's a pain to make the CLI performant without having some kind of index in a DB 09:53
piojo oh, that reminds me I found I can't build HTML on windows. I've gotta remember to try fixing that...
(bug already filed) 09:54
a sqlite db could be generated during the build process, and modules could optionally provide a db with their .pod 09:56
But that's a complicated change.
(probably over-engineered to use more than one DB, but it depends how big a non-core class hierarchy gets) 09:57
moritz: oh, something unrelated--I was reading your book blog entry on regex errors (than you, by the way), and noticed sometimes ".pos" isn't defined for Match objects
Do you know what determines when .pos exists?
The post on generating good errors for users, I mean. It described using "self.pos" to create the error message. When I converted it to a "log" helper, self.pos wasn't defined in that usage. 09:59
stmuk_ the CLI is more performant than it was but really needs a sqlite db with FTS
10:00 mr-fooba_ joined
moritz piojo: .pos is a method on the grammar, not on Match 10:01
piojo: .pos on the grammar roughly corresponds to .to on Match 10:02
10:02 mr-foobar left
piojo moritz: is it right that the invocant is sometimes the grammar and sometimes the match? 10:02
for grammar methods/rules
moritz piojo: the invocant is always the grammar 10:03
piojo and that always corresponds to "self"?
moritz yes
piojo is it a 'but' construct? because "dd self" shows match, but self.WHAT shows a grammar 10:04
10:10 wtw left 10:11 Cabanossi left 10:13 rindolf joined 10:14 Cabanossi joined 10:25 ShalokShalom_ joined 10:26 espadrine left 10:29 ShalokShalom left 10:30 ShalokShalom_ is now known as ShalokShalom 10:39 Skarsnik joined
nadim ab5tract: did you see my earlier message? 10:44
Geth doc: lefth++ created pull request #1544:
Make the meta-object protocol also searchable as "Introspection".
10:47
10:50 Ptolemarch left, Ptolemarch joined 10:51 Skarsnik_ joined 10:54 Skarsnik left
piojo It looks like in some circumstances, <match-rule($i++)> is not post-incrementing $i when it's called in a grammar 10:56
has anyone seen that bug, or is it new?
the bug goes away if I refer to $i again in the same scope, like: {say $i} 10:57
and it goes away if I replace the original assertion to force incrementing the variable: <match-rule($i)> { ++$i }
the layout is basically: 10:58
:my $i = 0; [ <rule-1($i, $arg1, $arg2)> <rule-2($i++, $arg2)> ]+ 10:59
Ignore me! Sorry, something else is wrong, though it seems related 11:01
11:01 llfourn joined 11:02 Skarsnik_ is now known as Skarsnik
piojo I'm having a really hard time making this bug into a good test case, since adding blocks something in the way the grammar executes 11:03
*adding blocks changes the way the grammar is parsed
11:11 dogbert2 joined 11:17 leont joined
jnthn piojo: Blocks are procedural, so adding a block into a token may change its longest prefix, and thus change the way it's LTM matched. 11:19
piojo jnthn: I know, that may be what's making the test case hard. But I really think there's a rakudo bug here. 11:20
I can make the grammar work by changing little details. That's easy. But proving there's a bug is what's hard. 11:21
Geth doc: 4a6382c607 | (Dan Zwell)++ (committed by Moritz Lenz) | doc/Language/mop.pod6
Make the meta-object protocol also searchable as "Introspection".
11:24
11:27 Cabanossi left 11:29 Cabanossi joined
leont Meh, it seems a callframe doesn't allow looking up dynamic variables easily 11:37
moritz you might have to go through CALLERS:: or so for that 11:39
leont Well, I'd want that relative to that callframe, which is where it gets complicated 11:40
I think it's easier to solve my problem in another way
moritz what problem are you trying to solve? 11:41
leont I'm writing a Test::Builder, I'm experimenting with $*TODO semantics 11:51
11:53 zakame joined 11:59 mr-foobar joined 12:00 mr-fooba_ left 12:04 espadrine joined 12:17 rindolf left 12:30 kaare__ left
piojo I just posted my troubling grammar to stackoverflow--this may be a bug in the grammar engine 12:30
but I'm always happy to hear how I'm wrong ;)
stackoverflow.com/questions/461307...sing-a-bug
12:30 kaare__ joined
timotimo piojo: did you get latest rakudo where Nil is no longer wrongly set in $/.made? 12:33
12:34 rindolf joined, Ven`` joined
timotimo putting a { } in your code causes the match object to be populated, including $0, $1, $2, ... and the named captures 12:34
piojo timotimo: I compiled last night, and I'm not using actions or .made
timotimo OK, was just a hunch because it said Nil there 12:35
piojo timotimo: that explains it! but why is that?
I do need $<array-name> to be populated for this code to work
timotimo right, then you need to put a {} in there
this may need better docs or something
piojo why is that? seems like a nasty workaround
timotimo because otherwise performance would be ridiculously bad 12:36
we could probably figure out you're refering to a part of the match object there, not sure
piojo I see. And otherwise the variables are populated when each matcher starts?
timotimo i think they will be when a match succeeds 12:37
12:37 domidumont joined
piojo that should have already happened in this example 12:37
timotimo no, i mean the full match 12:38
piojo you mean per scope?
timotimo the full regex { ... }
well, token in this case
piojo "full" is relative when things are nested, but I think I know what you mean. 12:39
timotimo tbh, i'd factor this differently, with a keyed-array and keyed-array-tail token where keyed-array calls keyed-array-tail with the information it got
that saves you from having to re-populate the match object for every single line
every regex
every regex { } gets its own $/
that's the part that matters here 12:40
piojo that change sounds reasonable. But I was more interested in figuring out the problem than refactoring it, so I stopped trying to make it nicer after I encountered the error
since I might accidentally make the error go away. We programmers are a perverse bunch :)
12:42 leont left
piojo timotimo: oh, that makes so much sense. then $/ will never invisibly "update" in the middle of a matcher 12:42
timotimo the regexes page in the docs doesn't seem to cover using $0 and friends inside the same regex you're matching them at all
let's see if there's a ticket for it
piojo I could take a stab at adding that info-- 12:43
although nervous about writing docs for things I just learned 5 minutes ago.
timotimo opens an issue
piojo thanks! 12:44
timotimo the spec test suite should have some good bits to learn from, let me have a look-see 12:46
piojo timotimo: that sounds helpful. All the examples I could find online were too simple to be good guidance for yaml parsing, except a very few 12:48
timotimo tbh, yaml is a scary, scary thing 12:50
i have a single mention in S05-match/capturing-contexts.t 12:51
m: say "heyhey" ~~ / (.+) $0 /; 12:52
camelia 「heyhey」
0 => 「hey」
timotimo hm.
that just works™, probably because we're not using $/ in any kind of calling or code context
since you can have whatever code you want inside <foo(here)>
12:53 domidumont left
timotimo a whole lot more regex tests are in nqp's test suite 12:53
12:53 lucs joined
timotimo so maybe we'll have to look there 12:53
really. there's two lines with a "backreference" description in the qregex tests 12:55
and another two for the perl5 compatible regex
piojo I don't need to parse all of YAML, just what Unity3D uses. And it's mostly done
and I can't use a library since it doesn't seem to be valid YAML1.1. Also because I want to save extra info to output it in exactly the same format (i.e., an inline array is never transformed into another type of array) 12:56
timotimo right 13:00
tinita piojo: do you have an example yaml that Unity3D uses that you think is not valid? would be interesting for the yaml-test-suite 13:01
timotimo heyo tinita
tinita hi timotimo 13:02
timotimo i used your yaml grant application document as inspiration for my upcoming application
tinita cool =)
what do you wanna do?
timotimo tools for users of rakudo-moar that help figure out performance issues
piojo ‎tinita‎: every parse library I tried fails. The python crowd complains of the same problem, based on internet search results. Someone said the files are actually yaml 1.0, but I'm not sure 13:03
timotimo docs.google.com/document/d/102h_Nl...sp=sharing - has the details
tinita timotimo: i hope it works, good luck =)
piojo so I don't think it could be incorporated in the test suite, since it actually should fail.
timotimo thanks! 13:04
tinita piojo: would still be interesting to see
timotimo i have the hardest part ahead of me: figuring out a preliminary schedule and what amount of money i'd ask for
piojo tinita: just a minute while I find one that isn't from work... 13:05
tinita timotimo: yeah, the amount of money gave me a headache too 13:10
13:11 Cabanossi left, piojo left 13:12 piojo joined
tinita i estimated the hours and thought of an amount. the resulting hourly rate is about 1.5 times of the minimum wage 13:12
(and i know already that the hour estimation is too low ;-)
13:13 Rawriful joined 13:14 Cabanossi joined
moritz it always is :-) 13:18
13:20 ufobat left
piojo tinita: here's a yaml doc that doesn't work: pastebin.com/K2DWwntw 13:21
I think it's either because it has multiple streams per file, or because the alias defined at the top is used multiple times. But I'm just parroting what I read. I don't actually know YAML very well 13:22
13:27 leont joined
tinita piojo: i think the %TAG directive must be added for all documents 13:28
a tag directive is only applied to the next document
so yes, it's invalid unfortunately 13:29
piojo tinita: I don't mind. Just one more problem for which no tools exist. So it's time to make tools. 13:30
tinita i think they should fix their YAML 13:31
piojo Haha, just like they should allow nested assets (each saved as a file on disk)
tinita i could imagine writing a loader/parser that allows fiddling with it 13:32
inserting a tag directive during parsing 13:33
piojo that seems a little too special-cased, though
and we also don't know whether unity3d can *read* all the valid YAML syntax 13:34
tinita well, at least i aim for an API that allows such kind of things in general
timotimo tinita: i'd rather estimate too many hours and if i'm finished before the hours run out i just add "stretch goals"
tinita in yamlpp p5 at least for now
piojo so using a parser to read/write wouldn't necessarly produce the desired result
tinita needs food & 13:35
piojo: java snakeyaml and yaml-cpp can handle it 13:38
so far the only two of 16 frameworks i tested
piojo holy cow, you're serious about yaml!
tinita =) 13:39
i'm contributing to github.com/yaml/yaml-editor, github.com/yaml/yaml-test-suite and i wrote the text matrix:
piojo I'd still like to make something that can handle it in perl (preferably perl6), so people can write tools to batch-modify game projects
tinita piojo: matrix.yaml.io/
timotimo piojo: i never gave you the link to the issue: github.com/perl6/doc/issues/1545 13:40
tinita piojo: so your test case is definitely worth adding to the test suite as an invalid test, thanks
piojo tinita: wow, that is pretty!
tinita thanks
leont's yamlish is to be added soon 13:41
leont :-) 13:42
I'm planning to add en event-stream output for those tests 13:43
13:44 mr-fooba_ joined
piojo timotimo: thanks, I adde a comment 13:44
leont: I just downloaded yamlish--I think I'll learn a lot from reading that 13:45
13:46 pecastro left, mr-foobar left
leont Recent rakudo broke its tests, fix will be released soon but I was in the middle of a major refactor (that was needed to be able to add for example event-streams) 13:46
13:46 mr-foobar joined
piojo leont: I watched a video of your talk, and you really convinced me I should only parse the subset of YAML that's necessary, since it's a beast 13:48
(but it looks so simple to a casual observer!)
tinita exactly 13:49
we hope that we can release a 1.3 spec that makes some things easier
13:49 mr-fooba_ left
timotimo leont: that was already fixed if you mean the Nil/Any thing 13:50
leont :-)
Then I need to build a new rakudo 13:51
timotimo m: "hellohello" ~~ / $<first>=.+ $<first> / 13:56
camelia ( no output )
timotimo m: say "hellohello" ~~ / $<first>=.+ $<first> /
camelia 「hellohello」
first => 「hello」
piojo m: my regex word { \w+ }; say 'hellohello' ~~ /<word> $<word>/ 13:59
camelia 「hellohello」
word => 「hello」
piojo so it works except when I want it to work! 14:00
timotimo: that is really what my test case was doing, except it's fine in this context, for some reason. 14:01
timotimo m: "hellohello" ~~ / (.+) { say $/ } o /
camelia 「hellohello」
0 => 「hellohello」
「hellohell」
0 => 「hellohell」
timotimo m: "hellohello" ~~ / (.+?) { say $/ } o /
camelia 「h」
0 => 「h」
「he」
0 => 「he」
「hel」
0 => 「hel」
「hell」
0 => 「hell」
timotimo m: "hellohello" ~~ / (.+?) <&say($/)> o /
camelia 「h」Nil
P6opaque: no such attribute '$!pos' in type Match when trying to get a value
in block <unit> at <tmp> line 1
timotimo oops 14:02
of course
m: my regex sayit($foo) { <?> { say $foo } }; "hellohello" ~~ / (.+?) <&sayit($/)> o /
camelia Nil
Too few positionals passed; expected 2 arguments but got 1
in regex sayit at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: my regex sayit($foo) { <?> { say $foo } }; "hellohello" ~~ / (.+?) <sayit($/)> o /
camelia Nil
Too few positionals passed; expected 2 arguments but got 1
in regex sayit at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo huh. 14:03
piojo It seems like parameters aren't fully implemented
timotimo m: sub sayit($/, $foo) { <?> { say $foo }; $/ }; "hellohello" ~~ / (.+?) <&sayit($/)> o /
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3sub sayit($/, $foo) { <?>7⏏5 { say $foo }; $/ }; "hellohello" ~~ / (
expecting…
timotimo m: sub sayit($/, $foo) { say $foo; $/ }; "hellohello" ~~ / (.+?) <&sayit($/)> o /
camelia Nil
P6opaque: no such attribute '$!pos' in type Match when trying to get a value
in block <unit> at <tmp> line 1
timotimo no, i'm just doing it wrong 14:04
i haven't used this in a long time and i didn't look at the docs :P
piojo oh. I can't see the error in the "huh" one
oh, I forgot named regexes aren't the same as match rules 14:05
I also don't know the right syntax. I don't use them that way.
14:05 robertle left
piojo timotimo: I don't think the syntax is wrong. The unset variable isn't being counted as a parameter 14:10
m: my regex repeated($x) { [$x]+ }; say 'ooxoo' ~~ / ^ <repeated('o')> . <repeated($<repeated>)> $ / 14:11
camelia Too few positionals passed; expected 2 arguments but got 1
in regex repeated at <tmp> line 1
in block <unit> at <tmp> line 1
piojo m: my regex repeated($x) { [$x]+ }; say 'ooxoo' ~~ / ^ <repeated('o')> . {} <repeated($<repeated>)> $ /
camelia 「ooxoo」
repeated => 「oo」
repeated => 「oo」
piojo so named matches are only not being set when they have a parameter.
since this works:
m: my regex word { \w+ }; say 'hellohello' ~~ /<word> $<word>/ 14:12
camelia 「hellohello」
word => 「hello」
14:13 pecastro joined
piojo m: my regex repeated($x) { [$x]+ }; say 'ooxoo' ~~ / ^ <repeated=repeated('o')> . <repeated($<repeated>)> $ / 14:15
camelia Too few positionals passed; expected 2 arguments but got 1
in regex repeated at <tmp> line 1
in block <unit> at <tmp> line 1
14:16 yht joined
piojo m: my regex repeated($x) { [$x]+ }; say 'ooxoo' ~~ / ^ $<repeated>=repeated('o')> . <repeated($<repeated>)> $ / 14:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<( )>; couldn't find final ')'
at <tmp>:1
------> 3peated('o')> . <repeated($<repeated>)> $7⏏5 /
expecting any of:
infix stopper
piojo m: my regex repeated($x) { [$x]+ }; say 'ooxoo' ~~ / ^ $<repeated>=<repeated('o')> . <repeated($<repeated>)> $ / 14:17
camelia Too few positionals passed; expected 2 arguments but got 1
in regex repeated at <tmp> line 1
in block <unit> at <tmp> line 1
14:21 skids joined
timotimo it'd be unusual if a function call without a | would have a different number of arguments than what you wrote 14:25
14:27 Cabanossi left
piojo timotimo: I verified what you wrote in the bug report--it's not about parameters, it's about being used in a code context 14:29
14:29 Cabanossi joined
piojo (maybe it's about being used *as* a parameter, but not about the first match having parameters) 14:29
14:34 mr-fooba_ joined 14:35 mr-foobar left
piojo Time for food. Lovely and educational talking to you all! 14:37
14:42 piojo left 14:53 khw joined
leont Imagine I have a module Foo with a class Bar, and a module Foo::Baz, in separate compilation units. Is there a way to enable me to refer to Foo::Bar as Bar in Foo::Baz? 14:56
s/module Foo::Baz/class Foo::Baz/
14:58 TreyHarris left 15:06 DerAlex joined 15:12 TreyHarris joined 15:16 lancew joined 15:21 lancew left 15:31 setty1 joined, mr-foobar joined, mr-fooba_ left
tinita hm, too bad 15:38
15:38 ChoHag left
tinita i found a simple way to make YAML::PP accept the YAML provided by piojo 15:39
perlpunks.de/paste/show/59b40ae8.532.1e9
15:47 robertle joined 15:50 ChoHag joined 15:55 zakharyas joined 15:56 kaare__ left 15:58 Cabanossi left 15:59 Cabanossi joined, kaare__ joined 16:02 zakame left 16:03 kaare__ left 16:04 kaare__ joined 16:06 zakame joined 16:10 xinming joined
ugexe you could probably do something like 16:11
m: constant Foo := ::("IO::Path"); say Foo.^name; say Foo.new($*CWD)
camelia IO::Path
IO::Path is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
16:11 Khisanth left 16:12 pilne joined 16:13 xinming_ left 16:14 skids left 16:17 galx joined
galx i have an array with length 2100 16:18
when i run for @my_array_name -> $iter { ... }
for loop works, but in ~20 times it stops!
what's it? 16:19
ugexe whatever ... is
16:19 ShalokShalom left
galx $iter = $iter.trim; my $parsed = lozv_segment.parse($iter); say $parsed; 16:20
three lines
16:21 ShalokShalom joined
AlexDaniel what is lozv_segment ? 16:22
galx a grammar
pastebin.com/p0bJ65pL 16:23
ugexe does it freeze on the .parse() or the say?
16:24 Khisanth joined
galx on the say 16:24
AlexDaniel so without “say $parsed” it works fine? :o 16:25
galx no
but the last command it executes in the last loop "time" is `say` 16:26
it also does freeze without `say` 16:27
ugexe hmm let me see if i can repro 16:28
[Coke] news.perlfoundation.org/2017/09/cal...pte-1.html 16:29
galx the whole code pastebin.com/Mv9qZyxK
ugexe thanks 16:30
ah i need the data too
galx yes, i'm uploading it already
16:31 wamba joined
galx here it is pastebin.com/R8egnwLf 16:31
the log file is empty
16:32 pecastro left 16:34 mr-foobar left 16:35 mr-foobar joined
ugexe ok, i see similar behavior at first try 16:38
always 7 for me though 16:39
galx for me too
i was wrong, not 20, but 7
ugexe seems to be certain lines 16:40
if i skip lines 5-10 it does a few additionals ones until getting stuck again 16:41
lets see what Grammar::Tracer shows...
galx there are lots of fails 16:44
16:45 wamba left
ugexe it looks like it might be getting stuck in an infinite parse cycle 16:45
galx ok, so the grammar should be fixed?
ugexe i think so. you could probably isolate the first line that causes it to freeze, and then just try to parse that line with Grammar::Tracer 16:47
probably a * that needs to be a + or something
galx ok, i'll try. thank you! 16:48
ugexe galx: actually s/regex/token/ 16:49
i dunno if that breaks your results, but it gets around the infinite backtracking
16:54 wamba joined 16:56 Cabanossi left 16:59 Cabanossi joined, setty1 left 17:04 mr-foobar left 17:05 mr-foobar joined 17:06 domidumont joined 17:10 sftp left 17:11 sftp joined, pecastro joined 17:18 zakharyas left 17:19 scovit joined
Geth doc: 1a74aea21f | (Will "Coke" Coleda)++ | t/pod-valid.t
Die on pod warnings also.

Helps catch errors like C<asdf
Fix comment;
17:19
scovit m: my $addr = uint8; my $addre = uint16; my $addo = uint8; say ($addr.WHERE, $addre.WHERE, $addo.WHERE); # is this a reasonable way to store a type in a number?
camelia (44904872 44904728 44904872)
scovit is there another way to get unique id to variables? 17:20
can those things move due to GC? 17:21
17:22 eliasr joined
Skarsnik hm interesting 17:24
17:24 zakame left 17:26 Cabanossi left
timotimo there's the nqp::objectid or what it's called 17:27
when you call that you'll get an id that won't change
it's what we use to make object hashes work properly
with mutable objects as keys i mean
17:29 Cabanossi joined 17:35 mr-foobar left 17:36 mr-foobar joined
scovit timotimo thanks 17:37
timotimo piojo_: regarding your stackoverflow question: it'd probably be better for later viewers if the text in the answer and its "update" would be merged into one text describing what's known
17:53 Skarsnik_ joined 17:56 Skarsnik left 18:03 mr-foobar left
scovit timotimo: is there a nqp op to get back from the objectid to the actual object? 18:04
18:05 telex left 18:06 telex joined
timotimo i don't think so 18:06
18:07 mr-foobar joined 18:10 andrzejku joined 18:12 dogbert2 left
scovit Ok, I am a bit struggling trying to do things which are not very useful and should probably be done at another level. So far has been fun but Im afraid I got to a dead end 18:14
was trying to add attributes to an is repr('CPointer'), storing them around the pointer. But I stumble on wanting to store a type object 18:17
18:21 Skarsnik_ is now known as Skarsnik
Skarsnik hm 18:21
[Coke] m: $*ERR = class :: { method print(*@a) {}}; { my $a; my $a; note "eek"} 18:25
camelia Potential difficulties:
Redeclaration of symbol '$a'
at <tmp>:1
------> 3 { method print(*@a) {}}; { my $a; my $a7⏏5; note "eek"}
[Coke] ^^ if we can make that not emit anything, it would be more correct, yes?
18:26 Cabanossi left
leont That reminds me, is there an easy way to get an IO::Handle that's actually backed by a Buf? 18:27
(or a Str, but Buf feels more appropriate) 18:28
[Coke] eco: string
(*&^#$ bots.
IO::String, IO::Blob 18:29
18:29 Cabanossi joined
geekosaur buggable: eco stromh 18:29
buggable geekosaur, Nothing found
geekosaur bleh
typing what is it
[Coke] :)
geekosaur buggable: eco string
buggable geekosaur, Found 22 results: String::CRC32, MIME::Base64, Text::Levenshtein, IO::String, Form. See modules.perl6.org/s/string
geekosaur buggable: eco blob 18:30
buggable geekosaur, Found 3 results: IO::Blob, NativeHelpers::Blob, MessagePack::Class. See modules.perl6.org/s/blob
18:30 ggoebel left 18:31 pecastro left 18:34 mr-foobar left 18:37 pecastro joined 18:42 mr-foobar joined 18:43 ggoebel joined 18:44 pilne left
galx how to catch infinity grammar parsing loops? 18:47
if there some exceptions
*there are
(the previous problem was solved) 18:48
moritz galx: typically an infinite loop in a grammar comes from quantifying something that can match zero chars 18:55
18:56 domidumont left
moritz something like token identifier { \w* }; regex other { <identifier> 18:56
erm
something like token identifier { \w* }; regex other { <identifier>+ }
identifier here can parse the empty string, and if there is no more identifier to match, it'll do so inifinitely
Grammar::Tracer (zef install Grammar::Debugger) can help you find the spot 18:57
galx and if it is an exception that isn't worth added to the rules? 19:00
*worth add
moritz if it's not worth dealing, then don't deal with it
and accept that it might loop infinitely
but since you are asking right now, it seems to bother you, so maybe you should investigate handling it 19:01
galx but if 99% of cases work correctly, and 1% exceptions stop the loop, then can I recognize them and ignore them 19:03
>
?
moritz I'm nost qite sure what you're asking
19:03 yht left
moritz if it's a bug worth fixing, fix it 19:03
if not, don't fix it
19:04 mr-foobar left
galx e.g.: I have a standard string like "A: 1, B: 2". And suddenly I get "*&$^%#*$#JH@#%U&" 19:04
And all exceptions are various 19:05
ok, it's not a bug. but how to avoid `for` loop stopping when a garbage string makes parsing infinite? 19:06
moritz structure your for-loop to not go infinite
or validate your input string with a regex before entering the loop
timotimo scovit: i'm surprised it would even let you have attributes inside an "is repr('CPointer')" because a CPointer repr'd thing doesn't have any body to put attributes into 19:07
19:07 lichtkind joined
galx >structure your for-loop to not go infinite 19:07
how to do it?
timeout is a bad idea IMHO
scovit timotimo exactly it doesn't 19:08
timotimo right
because how would that be possible
moritz galx: this is all pretty hard to describe because your question is so abstract 19:09
19:09 andrzejku left
moritz galx: I can answer in equally abstract terms, but I don't know if you will gain anything from it 19:09
scovit timotimo but this make composibility impossile
timotimo how so?
scovit a role have attributes
timotimo yeah
moritz galx: if well-formed inputs cause your loop to terminate, that means you have some assumptions in your code about how the data looks 19:10
scovit it would be nice to have a repr with a CPointer and also some space for attributes
of course only accessible from Perl6 and not C
moritz galx: so as soon as you see those assumptions violated, react appropriately (discard the input, jump out of the loop, throw an exception, whatever)
timotimo it'll be pretty hard to have that same object come back from a C function
moritz galx: but that means you have to explore what those assumptions are, because quite often they are implicit 19:11
timotimo what you probably really want is for NativeCall to be able to grab a CPointer field from an object when passing to a native function
scovit timotimo true, it would be partially accessible from C
timotimo sure
but that way is like not using composition
timotimo but you can just do that in your own library and expose the "nicer" api to your users
moritz like if you regular input is "A: 1, B: 2", and implicit assumption might be "when I split by a comma, each element contains exactly one colon". You can detect if that's not the case, and jump out of the loop 19:12
19:12 Cabanossi left
scovit timotimo I told you it was not so useful.. 19:12
just I was trying to implement it with hacks
(saturday) 19:13
19:14 Cabanossi joined 19:18 llfourn left 19:19 llfourn joined 19:20 mr-foobar joined 19:32 DerAlex left 19:34 mr-foobar left 19:36 mr-foobar joined 19:37 darutoko left
moritz galx: still around? Was any of what I said above useful to you? 19:39
19:48 TEttinger joined 19:58 Cabanossi left 19:59 Cabanossi joined 20:04 mr-foobar left
moritz it appears not :( 20:09
20:12 troys joined 20:15 Exodist left 20:17 Exodist joined 20:18 mr-foobar joined 20:20 Kyo91_ joined 20:22 audiatorix joined
audiatorix Is there any way to make the second part of a substitution regex ignore leading/trailing whitespace? 20:23
20:28 Cabanossi left 20:29 Cabanossi joined
timotimo ignore in what way? 20:31
you mean to have whitespace in the second half without it ending up in the result?
sounds like the substitution-assignment-syntax would be nicer in your case
m: $_ = "hello how are you"; s[ \w(\w+)\w ] = "($0)"; .say 20:32
camelia (ell) how are you
timotimo m: $_ = "hello how are you"; s:g[ \w(\w+)\w ] = "($0)"; .say
camelia (ell) (o) (r) (o)
timotimo audiatorix: ^ how does that look? 20:33
audiatorix ahh I didn't know about that 20:34
thanks
timotimo you're welcome :)
20:34 mr-foobar left 20:43 wamba left 20:48 mr-foobar joined
moritz tomasp.net/blog/2017/design-side-of-pl/ 20:53
21:04 troys is now known as troys_ 21:05 mr-foobar left 21:12 Cabanossi left
timotimo uh oh, the call for grant applications has been published 21:13
21:14 Cabanossi joined 21:19 mr-foobar joined 21:20 mscha joined
mscha m: 'my $n = 1000000; my int @a; for 1..$n { @a[$_] = 1 }; say now - BEGIN now; 21:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'"
at <tmp>:1
------> 3.$n { @a[$_] = 1 }; say now - BEGIN now;7⏏5<EOL>
expecting any of:
single quotes
mscha m: 'my $n = 1000000; my int @a[$n+1]; for 1..$n { @a[$_] = 1 }; say now - BEGIN now;
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'"
at <tmp>:1
------> 3.$n { @a[$_] = 1 }; say now - BEGIN now;7⏏5<EOL>
expecting any of:
single quotes
mscha m: my $n = 1000000; my int @a; for 1..$n { @a[$_] = 1 }; say now - BEGIN now;
camelia 0.6761706
mscha m: my $n = 1000000; my int @a[$n+1]; for 1..$n { @a[$_] = 1 }; say now - BEGIN now;
camelia 7.5491492
mscha How come shaped arrays are so much slower than dynamic ones?
The other way around seems more logical. 21:22
Skarsnik benchable6, my $n = 1000000; my int @a[$n+1]; for 1..$n { @a[$_] = 1 }; 21:23
AlexDaniel Skarsnik: 7 seconds per run is too much (as it does several runs on each revision) 21:25
Skarsnik I forget to add what release anyways
AlexDaniel oh 21:26
benchable6 Skarsnik, ¦my: «Cannot find this revision (did you mean “all”?)»
AlexDaniel bench: 2015.12,HEAD my $n = 50000; my int @a[$n+1]; for 1..$n { @a[$_] = 1 }; say now - BEGIN now; 21:27
benchable6 AlexDaniel, starting to benchmark the 2 given commits
21:27 khw left
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences 21:27
AlexDaniel, ¦2015.12: «1.6192» ¦HEAD: «0.5518»
AlexDaniel bench: releases my $n = 50000; my int @a[$n+1]; for 1..$n { @a[$_] = 1 }; say now - BEGIN now;
benchable6 AlexDaniel, starting to benchmark the 22 given commits
AlexDaniel I don't think that shaped arrays became faster, what we're seeing there ↑ is that rakudo got faster in general 21:28
well, that's my best guess, I can be wrong
Skarsnik still it's too much 21:29
21:29 BenGoldberg joined
Skarsnik 10 ten time slower with something supposed to be faster x) 21:29
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences 21:30
AlexDaniel, gist.github.com/121a42d5979b040240...c8f3502806
AlexDaniel that's a very positive graph nonetheless 21:31
it seems that a native unshaped array is faster than any other option in this case 21:33
Skarsnik bench: releases my $n = 50000; my int @a; for 1..$n { @a[$_] = 1 }; say now - BEGIN now; 21:34
benchable6 Skarsnik, starting to benchmark the 22 given commits
Skarsnik, benchmarked the given commits, now zooming in on performance differences 21:35
21:35 mr-foobar left
benchable6 Skarsnik, gist.github.com/2f57cb9204a4e62406...82b0e62749 21:36
Skarsnik duh
that was always faster 21:37
21:39 |oLa| left
timotimo shaped arrays with multiple dimensions are rather slow still, yeah :( 21:43
21:47 mr-foobar joined 21:48 |oLa| joined
Skarsnik there is only one here 21:52
timotimo hmm 22:02
22:03 dogbert2 joined 22:04 zakharyas joined
mscha On my PC: my int @a[$n+1]: 7.7s; my int @a: 1.2s; my Int @a[$n+1]: 1.3s; my Int @a: 1.7s. Weird: shaped is faster with Int, but much slower with int. 22:10
22:13 zakharyas left 22:17 zakharyas joined 22:24 Kyo91_ left, rindolf left 22:27 Cabanossi left, galx left 22:29 Cabanossi joined, |oLa|1 joined 22:30 Cabanossi left 22:31 Cabanossi joined 22:32 |oLa| left 22:36 mr-foobar left 22:39 zakharyas left 22:47 Kyo91_ joined 22:49 mr-foobar joined
scovit timotimo: I made it gist.github.com/scovit/a061415aa84...c6c6901490 22:50
.type and .size are like attribute
22:56 zakame joined 23:01 geekosaur left 23:07 mr-foobar left 23:08 Skarsnik left 23:10 geekosaur joined 23:11 lichtkind left 23:12 Cabanossi left 23:14 Cabanossi joined 23:17 mr-foobar joined 23:24 nadim left 23:32 ShalokShalom is now known as haywire, haywire is now known as heywire 23:36 mr-foobar left 23:47 mr-foobar joined 23:51 heywire is now known as ShalokShalom