Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-20

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 AlexDaniel here's the ticket: https://github.com/rakudo/rakudo/issues/1259
00:00 jnthn That's the flags. 4 is MVM_FRAME, 16 is MVM_CF_SECOND_GEN, 128 is MVM_CF_GEN2_LIVE
00:01 jnthn Nothing looks out of order there, MVM_gc_debug_find_region agrees the memroy address is in thread 1's gen2, and owner is gen2
00:04 gfldex joined #perl6
00:05 mr-foobar joined #perl6
00:05 jnthn Not immediately sure what's up, will need to poke further when it's not 1am. :) The object doesn't seem corrupt in general, but the SC indexes are indeed pretty bonkers
00:06 timotimo is it at all possible to record this run with rr?
00:06 timotimo i believe rr is installed on that server
00:06 AlexDaniel it is instaled, and I can install more stuff if needed
00:06 timotimo then you could set a watchpoint on the sc idx
00:07 timotimo and reverse-cont to the place it gets changed at
00:08 * AlexDaniel has no idea how to do that
00:10 khw joined #perl6
00:10 jnthn It's a good idea, and I can probably figure it out when better rested. :)
00:10 timotimo put "rr record -n" in front of the /foo/bar/moar ... perl6.moar ... commandline
00:12 timotimo then later you can "rr replay" and it'll be just like a gdb session
00:23 jnthn Will try and give that a go tomorrow
00:23 jnthn For now, 'night all o/
00:24 ZzZombo What does it mean "Cannot resolve caller AUTOGEN(<...>), none of these signatures match: <...>"?
00:24 timotimo calling a multi with arguments that don't match
00:24 timotimo i'm not sure why it sometimes gives that kind of error
00:31 ZzZombo um... out of all of the candidates, one is supposed to handle the base class of my argument, but it fails?
00:33 ZzZombo `multi method unset(::?CLASS:D: Grammar::VDF::Node:D $kv --> ::?CLASS:D)`
00:33 ZzZombo `if $el ~~ Grammar::VDF::Section|Grammar::VDF::Key-Value` # the calling code checks for stricter type
00:33 ZzZombo What gives?
00:34 itaipu joined #perl6
00:38 astronavt joined #perl6
00:39 timotimo not sure, what does it claim to have in the caller portion of the error?
00:40 ZzZombo `Grammar::VDF::Section.new(<...>)`...
00:41 timotimo so a section or key-value, those are both nodes?
00:42 ZzZombo yes, they inherit from it.
00:42 timotimo ISTR a bug with :D types that could cause things to be confused about things coming in from modules
00:42 ZzZombo but they are declared in the same module.
00:42 ZzZombo That still counts?
00:43 timotimo oh, hmm
00:43 timotimo does anything change when you drop the :D?
00:44 astronavt joined #perl6
00:44 cdg joined #perl6
00:45 aborazmeh joined #perl6
00:45 aborazmeh joined #perl6
00:45 char_var[buffer] joined #perl6
00:46 astronavt joined #perl6
00:49 ZzZombo Same thing.
00:49 timotimo ok, so it's not that
00:50 timotimo i'll go to bed now, so can't help much more :(
00:51 ZzZombo gn
00:51 timotimo seeya
00:52 ZzZombo something actually changed
00:52 ZzZombo the new stack trace points to a different calling site. I'm investigating it.
00:56 bisectable6 joined #perl6
00:56 committable6 joined #perl6
00:56 evalable6 joined #perl6
00:57 unicodable6 joined #perl6
00:57 releasable6 joined #perl6
01:03 ZzZombo You were right, timotimo, I overlooked it first because the error message was exactly the same, but the code did get further a step.
01:07 ryn1x_ joined #perl6
01:19 Xliff joined #perl6
01:23 lookatme joined #perl6
01:26 Xliff m: class A { has $.a = 'AA' }; A.a.say;
01:26 camelia rakudo-moar 85105077a: OUTPUT: «Cannot look up attributes in a A type object␤  in method a at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:26 Xliff m: class A { has $.a = 'AA' }; A.new.a.say;
01:26 camelia rakudo-moar 85105077a: OUTPUT: «AA␤»
01:27 Xliff m: class A { has $.a = 'AA' }; A.instance.a.say;
01:27 camelia rakudo-moar 85105077a: OUTPUT: «No such method 'instance' for invocant of type 'A'␤  in block <unit> at <tmp> line 1␤␤»
01:31 comborico1611 joined #perl6
01:32 comborico1611 Good morning, Vietnam!
01:33 tejr left #perl6
01:35 comborico1611 Lieutenant Dan!
01:50 Aaronepower joined #perl6
01:51 ZzZombo This bug is nasty, it completely gobbles multiple dispatch in methods!
02:01 ilbot3 joined #perl6
02:01 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:06 lookatme :) o/
02:07 comborico1611 Ah, you're back!
02:07 comborico1611 Good morning, Vietnam!
02:08 llfourn joined #perl6
02:08 lookatme Vietnam ?
02:12 geekosaur movie quote
02:12 geekosaur (also the title of that movie iirc)
02:13 Cabanossi joined #perl6
02:29 cdg joined #perl6
02:32 Xliff Is GTK::Simple still the best way to build GUI Apps with Perl6?
02:53 Cabanossi joined #perl6
02:55 ilbot3 joined #perl6
02:55 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:07 noganex joined #perl6
03:15 ufobat_ joined #perl6
03:34 ZzZombo Why does multiple dispatch not redispatch to the other candidate here:
03:34 ZzZombo `nextwith (*.name eq $name),$default;`?
03:48 samcv joined #perl6
04:02 raiph joined #perl6
04:05 astronavt joined #perl6
04:07 astronav_ joined #perl6
04:10 mson joined #perl6
04:15 piojo1 ZzZombo: do you have an example with subs and args?
04:16 ZzZombo ah, I have rewritten the code by directly calling methods.
04:17 piojo1 nextwith worked in a little test I made, but there was probably a detail in your parameters that made it fail. Perhaps the parameters didn't actually agree with the other candidate?
04:18 ZzZombo but it's just two multis, one with a string parameter that turns that into a Block that returns whether $_.name matches the string, and the second takes a Callable matcher and returns first element from an internal array that the matcher matches.
04:21 astronav_ joined #perl6
04:22 piojo1 ZzZombo: sounds like it didn't work because the two multis weren't both candidates
04:23 piojo1 nextwith calls the next candidate, for example if you have a multi that takes a scalar, a multi that takes a scalar where ~~ Int, and a multi that takes an Int
04:23 piojo1 That would be 3 candidates, and the most specific is called
04:23 ZzZombo but in my REPL test, doing `$instance.can('method').candidates` showed just them.
04:26 ZzZombo if I were to guess, it's because of that `AUTOGEN` thing that somehow gets called instead of my methods, as was shown above.
04:27 Cabanoss- joined #perl6
04:28 ZzZombo What in hell?..
04:29 ZzZombo `say "\n$kv.WHAT()\n$kv";`
04:29 ZzZombo returns
04:29 ZzZombo 'Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
04:29 ZzZombo in block  at tooltip-enhance.p6 line 318
04:29 ZzZombo "AbilityUnitDamageType"                 "DAMAGE_TYPE_MAGICAL"'
04:30 teatime oh man, are you theorycrafting?
04:31 piojo1 teatime: making shit up to try explaining an error?
04:32 ZzZombo so what's wrong with this is, $kv somehow is a Seq, even tho it's result of a `first` call that returns an object, then, the supposed object did correctly get stringified below the warning, but then calling a method on it finally dies because it thinks it's a Seq.
04:32 ZzZombo how am I making shit up??
04:32 piojo1 No, I'm making shit up
04:33 teatime piojo1: hehe, no, it's a gamer term, for figuring out the math behind the game, and optimizing builds etc.
04:33 * geekosaur assumed that wwas a reference to what appears to be a dungeon crawler or sth?
04:34 piojo1 m: class C { multi method f($) { dd; }; multi method f(Int $) { dd; nextwith 5; }; }; C.new.f(4);
04:34 camelia rakudo-moar 85105077a: OUTPUT: «method f(C $: Int, *%_)␤method f(C $: $, *%_)␤»
04:34 piojo1 m: class C { multi method f(Str $) { dd; }; multi method f(Int $) { dd; nextwith '5'; }; }; C.new.f(4);
04:34 camelia rakudo-moar 85105077a: OUTPUT: «method f(C $: Int, *%_)␤»
04:34 ZzZombo I omitted "Use of uninitialized value of type Seq in string context." at the start accidentally. Seriously, how can `$kv` be both a Seq and my object at the same time?
04:35 ZzZombo Again, it did get stringified correctly.
04:35 piojo1 ZzZombo:  the results above agree with my explanation
04:35 piojo1 It seems the `candidates` method isn't the same as the actual candidates when you have parameters. (And this is what I'd expect, but it does seem a weird naming contradiction)
04:36 piojo1 teatime: oh, haha. Thanks
04:37 ZzZombo piojo1: okay, seems so.
05:09 abhi12ravi joined #perl6
05:09 abhi12ravi .hug
05:09 * huggable hugs everyone
05:12 Cabanossi joined #perl6
05:13 xtreak joined #perl6
05:18 ZzZombo huh, I figured the last one out, one my method calls another as an one liner, implicitly returning the latter's value. Somehow, it ends up in another layer of `Seq` when in the first method, so I get a Seq in another Seq.
05:18 ZzZombo how can I fix that?
05:20 ZzZombo Marked the methods as raw, let's see if it fixes anything.
05:23 ZzZombo Nope.
05:28 hello joined #perl6
05:39 lookatme :)
05:42 Cabanossi joined #perl6
06:01 ZzZombo So apparently there is subtle (or huge???) difference between doing `$.method-call` and `self.method-call` inside a method.
06:01 ZzZombo I can't explain it, but it's what caused the double-wrapping issue.
06:02 ZzZombo Converting the former to the latter solved it.
06:04 ZzZombo timotimo, samcv, piojo1, geekosaur, can you explain it?
06:04 ZzZombo and everybody else as well, if you please.
06:06 teatime I didn't think $ was an alias for self
06:07 teatime isn't it just the automatic state variable?
06:07 ZzZombo yea, but that's not that
06:07 teatime https://docs.perl6.org/language/variables#The_$_Variable
06:07 ZzZombo in there, it's at least `$.`, a twigil
06:09 geekosaur this should be listed as a trap, I think?
06:09 geekosaur (sorry, helping someone elsechannel)
06:09 ZzZombo heh, that was relevant.
06:10 piojo1 I also wasn't aware you could use $. to refer to a method (except the autogenerated methods)
06:11 itaipu joined #perl6
06:11 piojo1 ZzZombo: where the methods autogenerated (has $.foo) or written by hand?
06:11 piojo1 *were
06:11 teatime right, you'd have to declare it like a scalar instance variable and assign to it
06:11 ZzZombo by hand
06:11 piojo1 teatime: I tested, and you can write it by hand and still call it as $.method-name
06:11 ZzZombo method foo {}
06:11 teatime piojo1: I see
06:12 piojo1 Where are methods stored, anyway?
06:12 ZzZombo in the class? where else?
06:13 teatime yeah, your test seems to answer that
06:13 teatime well, not that I actually know
06:14 teatime https://docs.perl6.org/language/variables#The_._Twigil
06:14 teatime also documented here
06:14 geekosaur feh. I recall there being noted a difference there but can;t recall what it is and don't see it in the traps doc
06:14 geekosaur if you do track one down, please file a doc bug to have it listed in the traps doc
06:15 geekosaur oh, looks like you might have sorted it
06:15 * geekosaur was back elsechannel. why everyoen gotta ask for help at once? :p
06:16 ilbot3 joined #perl6
06:16 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
06:19 xtreak joined #perl6
06:19 s0me0n3-unkn0wn joined #perl6
06:22 ugexe joined #perl6
06:22 lookatme I think you should use samewith instead of nextwith
06:24 lookatme m: class C { multi method f(Str $) { dd; }; multi method f(Int $) { dd; nextwith("5"); }; }; C.new.f(5); say C.new.^find_method("f").candidates.>>.signature;
06:24 camelia rakudo-moar 85105077a: OUTPUT: «method f(C $: Int, *%_)␤((C $: Str, *%_) (C $: Int, *%_))␤»
06:25 lookatme The document said nextwith will call the next routine. So what is the `next` mean ?
06:25 teatime in the inheritence hierarchy
06:25 teatime so yeah, need samewith
06:26 lookatme yeah, that's easily misunderstand
06:31 raiph m: { Failure.new for 1 } # does what I'd expect
06:31 camelia rakudo-moar 85105077a: OUTPUT: «Failed␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:31 ugexe joined #perl6
06:31 raiph m: { Failure.new for 1 }() # doesn't .oO ( why not? )
06:31 camelia rakudo-moar 85105077a: ( no output )
06:33 raiph m: { Failure.new given 1 }() # does what I'd expect
06:33 camelia rakudo-moar 85105077a: OUTPUT: «Failed␤  in block <unit> at <tmp> line 1␤␤»
06:33 darutoko joined #perl6
06:36 piojo1 raiph: I'm getting different results than camelia
06:36 piojo1 p6: { Failure.new for 1 }
06:36 camelia rakudo-moar 85105077a: OUTPUT: «Failed␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:36 piojo1 oh, same bot
06:37 piojo1 oh, it's the REPL that's giving different output. The actual perl6 agrees with camelia.
06:37 lookatme perl6
06:38 lookatme The REPL did not throw exception for  { Failure.new for 1 }()  and  { Failure.new for 1 }
06:40 wamba joined #perl6
06:46 ZzZombo how thread-safe is accessing/modifying DIFFERENT hash keys, without deleting or creating them?
06:47 lookatme It's not thread-safe
06:48 ZzZombo got a source?
06:49 lookatme The document not said it's thread-safe, so it is not thread-safe
06:49 ZzZombo what document?
06:50 lookatme docs.perl6.org
06:51 ZzZombo that's as unhelpful as it can be
06:51 ZzZombo now I just gotta grep it all to find your source
06:51 lookatme :)
06:51 lookatme You should use Lock protect your Hash
06:51 lookatme https://docs.perl6.org/type/Hash
06:52 ZzZombo Sorry, but I'll wait for someone I know to be more knowledgeable in P6 stuff.
06:53 lookatme :) Okay
06:54 raiph maybe jnthn's SO answer about thread safety of using *arrays* is of interest: https://stackoverflow.com/a/43792718/1077672
06:55 HoboWithAShotgun joined #perl6
06:59 ZzZombo Yea, it was. Thanks.
07:01 lowbro joined #perl6
07:01 lowbro joined #perl6
07:05 domidumont joined #perl6
07:10 domidumont joined #perl6
07:50 Ven joined #perl6
08:07 xtreak joined #perl6
08:08 Ven joined #perl6
08:10 xtreak_ joined #perl6
08:13 Ven joined #perl6
08:17 zakharyas joined #perl6
08:23 tyil how can I depend on a minimum version of a dependency in my META6?
08:28 Cabanossi joined #perl6
08:28 tyil also, is their an idiomatic way to see if a directory is empty in perl 6?
08:29 moritz !dir($path)
08:30 abraxxa joined #perl6
08:30 tyil neat, thanks
08:33 lookatme joined #perl6
08:40 tyil is there also an idiomatic way to check if a certain file exists in a given path, so i can check whether I can use it in a `run`
08:40 tyil if it exists in PATH*
08:41 tyil I `run « git init »` in my code, but I want to do it only if git is available
08:42 moritz tyil: https://github.com/azawawi/perl6-file-which
08:42 lookatme PATH or  path ?
08:42 tyil PATH
08:42 lookatme ^^ above is the answer
08:42 tyil moritz: awesome
08:42 tyil how do you know everything
08:43 lookatme Just write read and talk
08:43 moritz sadly I don't know next week's lottery numbers :-)
08:44 lookatme :)
08:44 tyil yet!
08:45 cdg joined #perl6
08:49 scimon joined #perl6
08:50 moritz when I know them next week, it'll be too late :(
08:53 lookatme Create a time machine use Perl6, return to the past, buy that number :)
08:58 Cabanossi joined #perl6
09:18 dakkar joined #perl6
09:30 ZzZombo what `?|` is?
09:31 ZzZombo is incorrectly described at https://docs.perl6.org/routine/?|
09:32 ZzZombo m: my $a=True;$a ?|= False;$a.say
09:32 camelia rakudo-moar 85105077a: OUTPUT: «True␤»
09:32 ZzZombo got it
09:33 ZzZombo still, how do one fix the docs?
09:33 ZzZombo does*
09:33 robertle joined #perl6
09:36 timotimo ZzZombo: the difference between self.foo and $.foo is that the latter contextualizes it like a scalar would
09:36 timotimo let me cook up an example
09:37 timotimo m: class test { method bloop { (1, 2, 3) }; method one { .say for $.bloop }; method two { .say for self.bloop } }; test.one; test.two
09:37 camelia rakudo-moar 85105077a: OUTPUT: «(1 2 3)␤1␤2␤3␤»
09:37 timotimo see how the first one iterates only once and the second one iterates three times?
09:37 xtreak joined #perl6
09:38 timotimo this should really be in the docs for the "The . Twigil" section of "variables", because it might not be clear that "things starting in $ behave like items" in this case, too
09:39 timotimo the reason why your "$kv.WHAT()" thing gives a warning about stringifying a type object is because .WHAT gives you the type object, and trying to stringify that is usually a sign of doing something wrong
09:40 ZzZombo yea, but why did it in my case wrap return values in an additional layer of... uh, containers? If I returned a Seq at the innermost routine, the second innermost wrapped it again in a Seq, if I returned an Array, the second returned an Array of Arrays, and if I returned a List...
09:40 ZzZombo you get the picture.
09:40 timotimo so instead you want $kv.^name() or $kv.WHAT.gist
09:40 timotimo do you have some code for me?
09:41 Ven joined #perl6
09:41 ZzZombo multi method values(*@names,Bool:D :$keys=Bool::False --> Seq:D) { self.values({!@names || .name eq @names.any},:$keys) }
09:41 ZzZombo multi method values(&matcher,Bool:D :$keys=Bool::False --> Seq:D) { @!children.map( { if .isa(Grammar::VDF::Key-Value) && matcher($_) { $keys ?? $_ !! .value; } }); }
09:42 ZzZombo replace `self.values` with `$.values`
09:42 ZzZombo `@!children` is just an array of items.
09:43 Cabanossi joined #perl6
09:43 sena_kun joined #perl6
09:46 timotimo i'll use
09:46 timotimo er
09:46 rindolf joined #perl6
09:46 timotimo i'll use Pair instead of the Key-Value class
09:47 ZzZombo yea, shouldn't matter.
09:48 timotimo yeah, what you're seeing is that it puts the result of the values call into a scalar container
09:48 timotimo just like with method bloop in my example
09:48 Brumbazz nine: Do you have a moment sometime to help me debugging a perl5-perl6 problem ? If not, should I fill in a ticket somewhere? Thanks in advance :>
09:49 timotimo same if you use "my $ = self.values(...)"
09:49 nine Brumbazz: I can have a look.
09:50 ZzZombo timotimo: uh, can you tell me step-by-step how it does all go? The very moment when the wrapping occurs slips from me.
09:52 timotimo aye, grokking scalar containers can be difficult, but it's much easier since the Great List Refactor happened
09:53 timotimo almost every operation looks right through any container you might have, but a few operations will introspect if there's a container around the value or not. iteration is a big one
09:53 timotimo m: my $foo = (1, 2, 3); say $foo.VAR.^name; my @foo = (1, 2, 3); say @foo.VAR.^name
09:53 camelia rakudo-moar 85105077a: OUTPUT: «Scalar␤Array␤»
09:55 timotimo also, putting $( ) around something is the same as calling .item on it
09:55 timotimo as things contained in a scalar will behave "like an item"
09:55 Brumbazz nine:  Ah thanks :) This is my code: https://pastebin.com/tk3FD2Hx. When I run it with perl6 it throws: [1]    10664 segmentation fault  perl6 xmpp_who_am_i.pl. A gdb full backtrace says: https://pastebin.com/pZZ2dUcp. I'm using rakuku version 2017.10 and perl-inline v.0.29
09:56 El_Che releasable6: status
09:56 releasable6 El_Che, Next release will happen when it's ready. No blockers. 213 out of 215 commits logged
09:56 releasable6 El_Che, Details: https://gist.github.com/061aeda0c5294271168e5d3d2e2e9f92
09:56 timotimo for iteration, having a Slip will overrule scalarness
09:57 Ven joined #perl6
09:58 Ven joined #perl6
09:59 timotimo ZzZombo: i'll need more questions form you to continue explaining i think
10:00 ZzZombo so to clarify, at what place the return value from the last routine gets wrapped?
10:00 timotimo which one is the last routine?
10:01 ZzZombo placed last in the code I gave you
10:01 ZzZombo m: sub x(Str:D() $x){ $x.say };x(1)
10:01 ZzZombo m: sub x(Str() $x){ $x.say };x(1)
10:01 camelia rakudo-moar 85105077a: OUTPUT: «Type check failed in binding to parameter '$x'; expected Str but got Int (1)␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
10:01 camelia rakudo-moar 85105077a: OUTPUT: «1␤»
10:01 ZzZombo m: sub x(Str:D() $x){ $x.say };x('1')
10:01 camelia rakudo-moar 85105077a: OUTPUT: «1␤»
10:01 ZzZombo m: sub x(Str:D() $x){ $x.say };x(Str)
10:01 camelia rakudo-moar 85105077a: OUTPUT: «Parameter '$x' of routine 'x' must be an object instance of type 'Str', not a type object of type 'Str'.  Did you forget a '.new'?␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
10:02 ZzZombo intended?
10:02 timotimo it's not generally possible to convert a type object into a defined object
10:03 timotimo the return value of the last routine gets wrapped in a scalar container because you're calling it as $.values(blah)
10:03 ZzZombo but the first example fails to do anything but die with the argument I gave
10:04 timotimo and $.values(blah) is equivalent to (my $ = self.values(blah)) or self.values(blah).item
10:05 ZzZombo it either shouldn't compile, or should just behave as without the smiley
10:05 timotimo yeah, looks like NYI
10:05 gfldex_ joined #perl6
10:05 ZzZombo m: sub x(Str() $x){ $x.say };x(Str)
10:06 camelia rakudo-moar 85105077a: OUTPUT: «(Str)␤»
10:06 ZzZombo m: sub x(Str() $x){ $x.say };x(Int)
10:06 camelia rakudo-moar 85105077a: OUTPUT: «Use of uninitialized value of type Int in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤␤  in sub x at <tmp> line 1␤»
10:06 gfldex_ joined #perl6
10:06 gfldex joined #perl6
10:08 nine Brumbazz: can reproduce the segfault here
10:09 Brumbazz Ah ok :>
10:14 nine Brumbazz: pushed a fix to Inline::Perl5 git
10:14 llfourn joined #perl6
10:14 Geth_ joined #perl6
10:14 Brumbazz woaw that was fast :O so can I use zef to install that or should I clone it from github and compile it ?
10:15 nine Brumbazz: the latter. I still need to make a release
10:15 Brumbazz ah alright :) I'll try, thanks a lot !
10:15 nine you're welcome!
10:20 scimon Are there known issues with Regexs in threads? Before I dive into trying and replicating an error.
10:20 tyil I have a Path::IO, and I want to see what the first directory of this path is called, but I cant seem to find a method that allows me to split it up into a list of "parts" of the path
10:21 tyil the .parts method that does exist is just a shorthand for getting 3 different parts of the path, not splitting up each dir/filename into its own element
10:21 tyil i could just take .path and split it on /, but that won't do well on windows I guess
10:22 Aaronepo_ joined #perl6
10:24 Brumbazz nine: After I've removed my existing version with zef uninstall .... and compile your version from github, I'm getting: This type cannot unbox to a native string: P6opaque, Failure
10:29 nine Brumbazz: you did perl6 configure.pl6 && make install?
10:29 Brumbazz yes
10:30 Brumbazz ahh, I ran "make install" as root, I just ran it again but without sudo and now that error dissapered !
10:31 Brumbazz This type cannot unbox to a native string: P6opaque, Failure
10:31 Brumbazz woops
10:31 Brumbazz disappeared*
10:31 comborico1611 joined #perl6
10:31 Brumbazz yiiiiir my xmpp script now runs ! :D You are a life safer nine, thanks :>
10:33 sacomo hi all
10:34 ZzZombo timotimo: let me remind I still want to hear your opinion on https://gist.github.com/ZzZombo/e78cad56722eda7f9fe8f40b33ad6bb5.
10:38 sacomo is there a way to redirect a local ./lib/.precomp to another directory?
10:43 gregf_ joined #perl6
10:43 Cabanossi joined #perl6
10:44 timotimo ZzZombo: you want general feedback on the implementation or help to make the whole thing work?
10:45 ZzZombo "did I get everything right", more of
10:46 timotimo don't see an obvious problem
10:46 ZzZombo what is the difference between "eat all characters" and "eat available ones"?
10:50 xtreak joined #perl6
10:55 Ven joined #perl6
10:56 eliasr joined #perl6
10:57 ZzZombo maybe I am missing something very obvious, but I don't see how can I in binary mode, remove a chunk, shifting the rest of content, or overwrite it, or write over and have bytes not fitting in the overwritten chunk shift the rest of the file.
10:58 Ven_ joined #perl6
11:02 timotimo sorry, i don't quite understand what you want to do there?
11:05 ZzZombo say, I wanna write 10 bytes in the middle of a file, 1) by inserting them, 2) by overwriting the same amount of byte, 3) by overwriting less amount of bytes, inserting excessive, 4) by overwriting more, shifting the rest of file.
11:08 jnthn 2 is just .seek($the-position); .write($the-stuff-to-overwrite)
11:08 jnthn 1 would be seek to the position, read everything from there up to the end of the file, write the stuff you want to insert, then write the stuff you read
11:13 rgrau joined #perl6
11:18 timotimo yeah, files don't have an api that would let you insert stuff, you can only overwrite or append to the end (which is just overwriting with smarter positioning)
11:28 Cabanossi joined #perl6
11:28 Geth ¦ doc: c07264f5d1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/glossary.pod6
11:28 Geth ¦ doc: tweak definition
11:28 synopsebot Link: https://doc.perl6.org/language/glossary
11:28 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c07264f5d1
11:29 rindolf joined #perl6
11:56 Ven joined #perl6
11:59 Ulti Xliff: re best way to do GUI apps, is there a reason you wouldn't just write everything as a webapp now?
12:00 Ulti neat there are Electron bindings in the ecosystem too https://github.com/azawawi/perl6-electron
12:03 Xliff Ulti: Good point, and one I thought about, however web-apps imply a number of moving parts, and I'd rather just have one.
12:03 Xliff m: 0.001.^name.say
12:03 camelia rakudo-moar 85105077a: OUTPUT: «Rat␤»
12:03 Xliff m: +0.001.^name.say
12:03 camelia rakudo-moar 85105077a: OUTPUT: «WARNINGS for <tmp>:␤Rat␤Useless use of "+" in expression "+0.001.^name.say" in sink context (line 1)␤»
12:03 Xliff m: (+0.001).^name.say
12:03 camelia rakudo-moar 85105077a: OUTPUT: «Rat␤»
12:03 Xliff m: 0.001.Num.^name.say
12:03 camelia rakudo-moar 85105077a: OUTPUT: «Num␤»
12:04 geospeck joined #perl6
12:05 Xliff Hrm.
12:06 wamba joined #perl6
12:06 timotimo m: say 0.001.Numeric.^name
12:06 camelia rakudo-moar 85105077a: OUTPUT: «Rat␤»
12:06 araujo joined #perl6
12:07 Xliff Yeah. I guess thing thing to do here would be to use RatNum
12:08 Ulti dunno Im more averse to native deps as a horrible moving part I guess, Windows for example no one is going to have that laying around unless they installed GIMP
12:09 ZzZombo m: class A{multi sub trait_mod:<is>(Attribute:D $s, :$foo){};has $.a is foo<bar>};class B is A { has $!b is foo} # any easy way to have the trait available ONLY to A and its subclasses?
12:09 camelia rakudo-moar 85105077a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is foo' in an attribute declaration.␤at <tmp>:1␤    expecting any of:␤        rw␤        readonly␤        box_target␤        leading_docs␤        trailing_docs␤»
12:11 jast hmm, I've built rakudo star 2017.10 on an armv7l system and now trying to run 'perl6' yields a bus error...
12:13 jast specifically, BUS_ADRALN
12:18 jast I haven't asked a question, have I? so, what would be a good way to track down the issue? given someone with pretty much no experience with moar/nqp
12:34 aborazmeh joined #perl6
12:34 aborazmeh joined #perl6
12:43 Cabanossi joined #perl6
12:44 xtreak joined #perl6
12:45 ZzZombo is there any actual difference between `does <role>` and `is <role>`
12:45 ZzZombo ?
12:45 cdg joined #perl6
12:47 AlexDaniel jast: that's interesting
12:48 jast I've rebuilt with debug info and found the source line from moar that triggers it
12:48 AlexDaniel jast: a bug report would be nice to have
12:49 jast just dump gdb output in there, or should I add anything else?
12:49 jast also what's the preferred place to report bugs, RT?
12:49 AlexDaniel huggable: rakudobug
12:49 huggable AlexDaniel, Report bugs on https://github.com/rakudo/rakudo/issues/new    If you don't have access to GitHub, you can email your report to rakudobug@perl.org . See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
12:51 Aaronepower joined #perl6
12:57 tyil I cant find anything useful on the %?RESOURCES var in the docs, does anyone know where it's sourcefile is so I can look into making docs for it?
13:17 comborico1611 joined #perl6
13:18 perlpilot ZzZombo: yes.  The latter adds an extra layer in the inheritance hierarchy for the implied class created while the former composes all of the role's methods and attributes into the class upon which it has been "does"-ed.
13:44 wamba joined #perl6
13:46 zakharyas joined #perl6
13:49 mcmillhj joined #perl6
13:58 sjn joined #perl6
14:00 HoboWithAShotgun joined #perl6
14:12 s0me0n3-unkn0wn Need some help with NativeCalls
14:13 s0me0n3-unkn0wn I created a test library containing function int *test_ppint(int **a, int **b)
14:13 s0me0n3-unkn0wn Declared it in p6 as sub test_ppint(Pointer[int32] is rw, Pointer[int32] is rw) returns Pointer[int32] is native('test') {*}
14:14 s0me0n3-unkn0wn Given I have variables my int32 $a and my int32 $b, how cat I pass pointers to pointers to them as function parameters?
14:15 s0me0n3-unkn0wn I tried something like my Pointer[int32] $pa = Pointer[int32].new($a);
14:15 s0me0n3-unkn0wn But that did not work out :(
14:17 pmurias joined #perl6
14:22 itaipu joined #perl6
14:23 geospeck joined #perl6
14:25 ZzZombo wow, nice, effortless auto-ID increment in class instances:
14:25 ZzZombo m: class A {has $.a=$++};say do for 1..3 { A.new }
14:25 camelia rakudo-moar 85105077a: OUTPUT: «(A.new(a => 0) A.new(a => 1) A.new(a => 2))␤»
14:26 * masak wonders idly how thread-safe that is
14:27 timotimo it's a flat-out race :)
14:27 mson joined #perl6
14:27 moritz it should be safe, as long as you don't do it in multiple threads at the same time
14:28 masak haha :P
14:28 masak moritz, I like your attitude :)
14:28 moritz :-)
14:28 * masak .oO( this tiger will not harm you, as long as you do not enter is cage and poke it with a stick )
14:29 ilmari m: class A {has $.a = state atomicint $⚛++ }; await start { say A.new } xx 5;
14:29 camelia rakudo-moar 85105077a: OUTPUT: «===SORRY!===␤Natively typed state variables not yet implemented␤»
14:29 ilmari :(
14:29 timotimo it should work to have it in a lexically scoped variable inside the class body
14:30 ilmari m: class A { my atomicint $c = 0; has $.a = ++⚛$c }; await start { say A.new } xx 5;
14:30 camelia rakudo-moar 85105077a: OUTPUT: «A.new(a => 1)␤A.new(a => 2)␤A.new(a => 3)␤A.new(a => 4)␤A.new(a => 5)␤»
14:30 ilmari m: class A { my int $c = 0; has $.a = ++$c }; await start { say A.new } xx 5;
14:30 camelia rakudo-moar 85105077a: OUTPUT: «A.new(a => 1)␤A.new(a => 2)␤A.new(a => 3)␤A.new(a => 4)␤A.new(a => 5)␤»
14:30 pmurias hmm, I'm looking at the collation tests and it seems we don't set a language there?
14:31 ilmari I guess 5 .new calls isn't enough to make it actuall spawn multiple threads
14:31 wamba joined #perl6
14:33 timotimo not enough contention to actually hit a conflict
14:34 timotimo m: class A { my int $c = 0; has $.a = ++$c }; await start { A.new } xx 5000; say A.new
14:34 camelia rakudo-moar 85105077a: OUTPUT: «A.new(a => 5001)␤»
14:34 timotimo m: class A { my int $c = 0; has $.a = ++$c }; await start { A.new } xx 50000; say A.new
14:34 camelia rakudo-moar 85105077a: OUTPUT: «A.new(a => 50001)␤»
14:34 timotimo could very well be it's running on just one thread, let me "time" it
14:35 timotimo i get 150% cpu usage
14:35 ZzZombo heh, this actually breaks it:
14:35 ZzZombo m: class A {my $lock=Lock.new;has $.a=$lock.protect: {$++}};say do for 1..3 { A.new }
14:35 camelia rakudo-moar 85105077a: OUTPUT: «(A.new(a => 0) A.new(a => 0) A.new(a => 0))␤»
14:36 timotimo it works much better when you xx inside the start block
14:36 timotimo class A { my int $c = 0; has $.a = ++$c }; await start { A.new xx 10_000 } xx 500; say A.new
14:36 timotimo m: class A { my int $c = 0; has $.a = ++$c }; await start { A.new xx 10_000 } xx 500; say A.new
14:36 camelia rakudo-moar 85105077a: OUTPUT: «A.new(a => 4609695)␤»
14:37 Xliff s0me0n3-unkn0wn: It would be better to use the following signature: sub test_ppint(CArray[int32] is rw, CArray[int32] is rw) returns CArray[int32]
14:37 Xliff If the pointers are being allocated by the test lib, then the following might work better, as well:
14:38 Xliff (OpaquePointer is rw, OpaquePointer is rw) returns OpaquePointer
14:38 Xliff You will then have to nativecast() them all back to whatever you would prefer to use.
14:38 timotimo if you have so many start blocks that only do a few microseconds of work each, they'll be done before the next worker gets to pull a task out of the queue i suppose
14:39 comborico1611 joined #perl6
14:39 ZzZombo but why the lock doesn't fly?
14:39 s0me0n3-unkn0wn Xliff: Probabply, but it's not an array pointer, it's just a pointer to pointer to single int. Indeed, I need to pass pointers to pointers to structures, I just want to understand a principle with those ints
14:40 ZzZombo m: my $lock=Lock.new;class A {has $.a=$lock.protect: {$++}};say do for 1..3 { A.new }
14:40 camelia rakudo-moar 85105077a: OUTPUT: «(A.new(a => 0) A.new(a => 0) A.new(a => 0))␤»
14:40 cdg joined #perl6
14:40 kerframil joined #perl6
14:40 timotimo the block that has the $++ inside it gets closure-cloned each time the lock.protect runs it i expect
14:40 timotimo m: my $lock=Lock.new;class A {has $.a=$lock.protect: $++ };say do for 1..3 { A.new }
14:40 camelia rakudo-moar 85105077a: OUTPUT: «Attempt to unlock mutex by thread not holding it␤  in method  at <tmp> line 1␤  in submethod BUILDALL at <tmp> line 1␤  in code  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:40 timotimo that's weird
14:40 Xliff s0me0n3-unkn0wn: It's weird, I've always had problems with the Pointer[<type>] spec. So have others. That's why CArray and OpaquePointer generally get used, even though each has its own drawback.
14:41 Xliff s0me0n3-unkn0wn: Just try them and see if they work better.
14:41 timotimo anyway, you're getting a fresh state var each time that runs
14:41 timotimo so use a lexical variable there, as well
14:41 ZzZombo ye, I see, but can't explain
14:42 s0me0n3-unkn0wn Xliff: Okay, thanks, I'll try to proceed with opaque ones (docs says OpaquePointer is deprecated in favor of just Pointer, btw)
14:42 Xliff Yes, the docs say one thing, experience says something else.
14:42 timotimo m: for ^5 { for ^2 { say $++ } }
14:42 camelia rakudo-moar 85105077a: OUTPUT: «0␤1␤0␤1␤0␤1␤0␤1␤0␤1␤»
14:42 Xliff It could be that things are shifting back to Pointer, now.
14:42 ZzZombo m: my $lock=Lock.new;class A {my $id;has $.a=$lock.protect: {$id++}};say do for 1..3 { A.new }
14:42 camelia rakudo-moar 85105077a: OUTPUT: «(A.new(a => 0) A.new(a => 1) A.new(a => 2))␤»
14:43 moritz masak: regarding the thread saftey comment earlier, that was only half tongue in cheek. In Perl 5 there are many things (like DB handles) that you can't use from another thread than the one they were created in, even if the access is serialized
14:43 timotimo i'd suggest putting the lexical inside the class so nothing can get to it
14:43 Xliff s0me0n3-unkn0wn: If that is the case, then just use "Pointer". Don't specify a type.
14:43 ZzZombo m: class A {my $lock=Lock.new;my $id;has $.a=$lock.protect: {$id++}};say do for 1..3 { A.new }
14:43 camelia rakudo-moar 85105077a: OUTPUT: «(A.new(a => 0) A.new(a => 1) A.new(a => 2))␤»
14:43 ZzZombo hey, before I forget again
14:44 ZzZombo what is the difference between "eat all characters" and "eat available ones"?
14:44 ZzZombo for the decoder stuff
14:53 jnthn ZzZombo: "eat all characters" means it can assume that it's not going to be getting any further bytes; "eat available characters" means it should only hand back things that more bytes arriving couldn't change
14:53 jnthn That includes incomplete multi-byte sequences and potentially incomplete grapheme sequences
14:55 ZzZombo so in the first case, I should error out in case of broken byte sequence, whereas in the second I should wait for more?
14:58 Cabanossi joined #perl6
14:59 itaipu joined #perl6
15:06 holyghost joined #perl6
15:06 jnthn Yes
15:07 ZzZombo thanks!
15:07 jnthn And also, to support NFG, if the next thing might combine with the previous
15:07 jnthn Whether that's an issue depends on whether the encoding you're writing includes combining chars etc.
15:08 ZzZombo if you don't mind, can you also take a look at my decoder implementation? I had to figure it out from https://github.com/rakudo/rakudo/blob/master/src/core/Encoding/Decoder/Builtin.pm, and I'm not sure I translated the code right.
15:08 ZzZombo https://gist.github.com/ZzZombo/e78cad56722eda7f9fe8f40b33ad6bb5
15:11 geospeck joined #perl6
15:11 jnthn Looks OK having had a quick glance over it, though I think UCS2 does include combining chars
15:12 ZzZombo yea, but I think UTF-16 should handle t, once I rewrite the code to handle the distinction you've made.
15:13 geospeck joined #perl6
15:14 pmurias is there a channel for asking unicode questions?
15:16 moritz pmurias: you mean except here? :-)
15:20 ZzZombo jnthn: oh and also, what does `$eof` in arguments mean?
15:20 jnthn "end of file", as in "you can assume nothing more is coming"
15:21 jnthn For lines handling, it means we can return an incomplete final line
15:23 pmurias samcv: the unicmp_s op is passed a 0 0 country/region codes by the high level unicmp op, what high level locale can I use for that
15:23 pmurias ?
15:23 ZzZombo jnthn: For lines handling, it means we can return an incomplete final line
15:24 ZzZombo as in?
15:24 jnthn Well, imagine a file containing "foo\nbar\nbaz"
15:24 ZzZombo yes
15:24 jnthn The $eof being true is what lets us know that we can hand back baz, rather than refuse 'cus we might get more bytes
15:24 jnthn If it's False, we should not do that
15:25 jnthn So, $eof in consume-line-chars really means "hand back everything if we didn't fine the line separator"
15:25 zakharyas joined #perl6
15:25 ZzZombo ah, now makes sense
15:25 jnthn Which could be done by, after failing to find the sep, just calling the "eat all chars" thingy
15:25 pmurias samcv: I want to use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator for the collation, so I need something that can select a most defaulitsh locale
15:26 jnthn (Pretty sure that's how the built-in impls do it)
15:38 bdmatatu joined #perl6
15:41 cdg joined #perl6
15:43 cdg joined #perl6
15:48 troys joined #perl6
15:56 khw joined #perl6
15:58 Cabanossi joined #perl6
16:00 markong joined #perl6
16:01 Geth joined #perl6
16:28 Cabanossi joined #perl6
16:50 mson joined #perl6
16:52 jaush joined #perl6
16:55 Ven`` joined #perl6
16:56 mcmillhj joined #perl6
16:58 jaush hello!  windows question:  is there a recommended way to get sensible unicode support with command-line perl6 usage under windows (windows 10 or server 2012 or newer, if that matters)?
16:59 zakharyas joined #perl6
16:59 jaush playing last night i saw that both cmd.exe and powershell.exe using Consolas weren't displaying the fancy quotes that are printed for matches
16:59 jaush is that just a font issue, or a deeper problem?
17:02 moritz jaush: if it's only the corner brackets that are missing, it's likely a font issue
17:02 moritz those characters are present in surprisingly few fonts, and in nearly no monospace fonts at all
17:02 jaush what font would you recommend?
17:02 moritz the only monospace font I found that contains them is https://github.com/be5invis/Iosevka
17:03 moritz (though my terminal (not windows) typically does character substitution, and simply displays non-monospace versions)
17:03 jaush okay; another question - how do i configure what quotes the interpreter prints?
17:03 moritz you don't
17:03 jaush really?
17:04 timotimo well, you could override the method that pretty-prints the thing you're interested in
17:04 moritz or apply a .subst or .trans to its return value
17:04 jaush this needs to be something the REPL picks up
17:05 AlexDaniel relevant tickets: RT#132441 RT#132452
17:05 synopsebot RT#132441 [open]: https://rt.perl.org/Ticket/Display.html?id=132441 [SEVERE] Windows REPL cannot handle «, » characters
17:05 synopsebot RT#132452 [open]: https://rt.perl.org/Ticket/Display.html?id=132452 Unicode: Windows shells print garbage instead of "「」"
17:09 jaush proposed solution: the world standardizes on ascii english ^_^
17:09 moritz how about UTF-8 instead? :-)
17:10 jaush so i am reminded of something that postgresql's command-line interface does
17:10 jaush when there is a code page mismatch it tells you on startup
17:11 El_Che someone with a bad character (pun!) would start with s/shells print//
17:11 jaush it would be Super Neet (TM) if perl6 did the same
17:15 jaush i'm not convinced this is a font issue?  is 'HALFWIDTH LEFT CORNER BRACKET' (U+FF62) the actual open-quote character that is supposed to be printed?
17:16 timotimo m: "hi" ~~ /./; say $/.gist.uninames
17:16 camelia rakudo-moar 8ccb60e39: OUTPUT: «(HALFWIDTH LEFT CORNER BRACKET LATIN SMALL LETTER H HALFWIDTH RIGHT CORNER BRACKET)␤»
17:16 timotimo yes, indeed
17:16 jaush and the "chcp 65001" remedy mentioned in the quoted bug reports did something, but not the correct something
17:18 mst Ulti: looks like one of the ones we uploaded, I wasn't directly involved but if you need anything try '/msg tbsliver' and tell him I sent you
17:19 timotimo mst: can i have a /developer/ cloak? :)
17:20 mst you're a committer, right?
17:20 timotimo i am
17:21 jaush alternatively, 1) bundle a font with the rakudo star distribution that actually includes glyphs for all the characters that the interpreter emits under normal operation; 2) modify the perl6 startup script to perform whatever code page or other magic required to get it to work?
17:22 timotimo https://github.com/orgs/rakudo/teams?query=%40timo - mst, can you see this?
17:22 jaush "can't even read the interpreter's output on my common OS on earth" isn't really ... yay-ful (not windows apologia)
17:22 jaush *on most common OS
17:23 AlexDaniel timotimo: I don't think he can
17:23 AlexDaniel but yes, timo is a dev :)
17:25 mst I'm happy to take people's word on the assumption somebody would correct it
17:27 timotimo and even if you give it to me wrongly, you can just take it away again, can't you?
17:27 mst precisely
17:28 Cabanossi joined #perl6
17:28 mst I just wanted to hear you say 'yes' first (I've now put the request in)
17:28 timotimo oh, me? yes yes :)
17:28 mst :D
17:29 timotimo joined #perl6
17:30 timotimo i see my cloak! yay
17:32 Geth ¦ mu: 27a965b182 | (Zoffix Znet)++ | misc/perl6advent-2017/schedule
17:32 Geth ¦ mu: Revert "Remove post"
17:32 Geth ¦ mu:
17:32 Geth ¦ mu: This reverts commit f595b21d00a9185c726e4008bb8e481e54b56476.
17:32 Geth ¦ mu: review: https://github.com/perl6/mu/commit/27a965b182
17:33 mst \o/
17:33 timotimo now who do i ask to get some daggers
17:35 ilmari mst: hey, can I get a /perl/developer/ (not perl6) cloak?
17:35 setty1 joined #perl6
17:36 dogbert17 joined #perl6
17:40 pmurias joined #perl6
17:42 ilmari joined #perl6
17:42 ilmari[m] joined #perl6
17:44 [Coke] joined #perl6
17:45 Geth ¦ doc: d209e6e6c8 | (Jan-Olof Hendig)++ | doc/Type/IO/CatHandle.pod6
17:45 synopsebot Link: https://doc.perl6.org/type/IO/CatHandle
17:45 Geth ¦ doc: Fix two broken links
17:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d209e6e6c8
17:45 * AlexDaniel wonders what difference it makes
17:45 AlexDaniel having a cloak that is
17:45 Ulti mst: cool, its just I processed the audio which is probably better than what's currently on the vid
17:46 Ulti audacity++
17:46 mst I know very little about AV but tbsliver actually has a clue so please do talk to him :)
17:47 domidumont joined #perl6
17:52 Ulti re bundling a font try https://nerdfonts.com/ with FIRA ligatures
17:57 samcv .tell pmurias you want "ducet" for co
17:57 yoleaux samcv: I'll pass your message to pmurias.
17:58 samcv not sure about the rest yet. gonna have some eggs then will get let you know
18:00 nhywyll joined #perl6
18:16 Geth ¦ doc: bd1feb09a7 | (Jan-Olof Hendig)++ | 2 files
18:16 Geth ¦ doc: Fix a few incorrect links
18:16 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bd1feb09a7
18:19 * s0me0n3-unkn0wn is beating his head against the wall
18:20 s0me0n3-unkn0wn I have a Buf[uint8] slurped from a file
18:20 s0me0n3-unkn0wn I put the bytes to CArray[uint8]
18:21 s0me0n3-unkn0wn Now I need to pass a POINTER to that CArray[uint8] to native function which accepts `const unsigned char **` argument
18:21 s0me0n3-unkn0wn HOW? How the hell do I create that pointer?
18:21 robertle joined #perl6
18:22 s0me0n3-unkn0wn How do I even declare the function?
18:23 s0me0n3-unkn0wn Right now playing with `sub d2i_PKCS12(Pointer, Pointer[CArray[uint8]], long) returns Pointer is native('test2') {*}`
18:23 s0me0n3-unkn0wn I have an array `my $ca = CArray[uint8].new($p12);`
18:23 Xliff You are thinking too literally. I did the same thing when I started with NativeCall.
18:23 s0me0n3-unkn0wn I create the pointer `my $pca = Pointer[CArray[int8]].new;`
18:24 s0me0n3-unkn0wn How do I tell the pointer to point to array?
18:25 Xliff Instead, try: sub d2i_PKCS12(Pointer, CArray[Pointer] long) returns Pointer...
18:25 Xliff Oops: sub d2i_PKCS12(Pointer, CArray[Pointer], long) returns Pointer...
18:26 s0me0n3-unkn0wn Okaaay, and how do I pass the buffer then?
18:27 Xliff nativecast() the CArray created from the Buf to a Pointer.
18:27 s0me0n3-unkn0wn Mother of god
18:28 Cabanossi joined #perl6
18:28 Xliff There are a lot of indirect ways to work around things.
18:28 s0me0n3-unkn0wn That doesn't sound intuitive :))
18:28 Xliff *shrug*
18:29 wamba joined #perl6
18:30 Xliff Of course, it's been a while since I've done NativeCall stuff at that detail. Things could have changed since then, and there might be another, more intuitive method.
18:33 Geth ¦ doc: 9782bf86e4 | (Jan-Olof Hendig)++ | doc/Language/nativecall.pod6
18:33 synopsebot Link: https://doc.perl6.org/language/nativecall
18:33 Geth ¦ doc: Indentation fixes
18:33 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9782bf86e4
18:34 s0me0n3-unkn0wn Xliff: Didn't work exactly like you suggested, but you gave me an idea an it finally worked out, THANK YOU SO MUCH
18:35 s0me0n3-unkn0wn Declared `unsigned char **` argument as `CArray[CArray[uint8]]`
18:35 s0me0n3-unkn0wn Then called like `CArray[CArray[uint8]].new([CArray[uint8].new($p12)])`
18:35 Xliff \o/
18:35 s0me0n3-unkn0wn Still looks terribly wrong but works
18:39 ___luke___ joined #perl6
18:39 ___luke___ Hello to all
18:40 Xliff s0me0n3-unkn0wn: Yeah. If you are working on an API, you should abstract that all out so a user on the P6 side never sees the nasty. =-)
18:40 moritz hello ___luke___, maybe the Perl 6 be with you!
18:40 Xliff We have an image to maintain, here. ;)
18:41 ___luke___ Thanks moritz
18:42 ___luke___ Funny you bring Perl 6 up, because I've been working on a program for the last few minutes, and you'll never believe what language it uses.
18:42 ___luke___ Perl 6
18:42 s0me0n3-unkn0wn Xliff: Ok, I'll try to bury it as deep as possible :)
18:43 ___luke___ More seriously: apparently unnamed lambda function arguments (like $^a, $^b and the like) are read-only
18:43 ___luke___ Or am I doing something wrong?
18:43 mst s0me0n3-unkn0wn: sufficiently encapsulated insanity is indistinguishable from technology
18:43 Xliff mst: Black boxing FTW!
18:44 ___luke___ m: my &z={$^a++}; z(4);
18:44 camelia rakudo-moar 8ccb60e39: OUTPUT: «Cannot resolve caller postfix:<++>(Int); the following candidates␤match the type but require mutable arguments:␤    (Mu:D $a is rw)␤    (Int:D $a is rw)␤␤The following do not match for other reasons:␤    (Bool:D $a is rw)␤    (Bool:U $a …»
18:44 mst Xliff: I see a red box and I want to paint it black
18:45 Xliff mst: If the paint is good enough, they will never know the difference.
18:46 Xliff m: my &z = -> $ is rw { $^a++ }; z(4);
18:46 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Placeholder variable '$^a' cannot override existing signature␤at <tmp>:1␤------> 3my &z = 7⏏5-> $ is rw { $^a++ }; z(4);␤»
18:46 Xliff m: my &z = -> $a is rw { $a++.say }; z(4);
18:46 camelia rakudo-moar 8ccb60e39: OUTPUT: «Parameter '$a' expected a writable container, but got Int value␤  in block <unit> at <tmp> line 1␤␤»
18:46 mcmillhj joined #perl6
18:47 Xliff m: my &z = -> is rw { $^a++ }; z(4);
18:47 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'is' in parameter declaration.␤at <tmp>:1␤------> 3my &z = -> is7⏏5 rw { $^a++ }; z(4);␤»
18:48 Xliff Hrm...
18:48 ShalokShalom joined #perl6
18:58 asdsdfgh joined #perl6
18:58 asdsdfgh m: my $l := List.new: <foo bar>; $l.^name.say; $l[0] := 100; say $l;
18:58 camelia rakudo-moar 8ccb60e39: OUTPUT: «List␤(100)␤»
18:58 asdsdfgh m: my $l := <foo bar>; $l.^name.say; $l[0] := 100; say $l;
18:58 camelia rakudo-moar 8ccb60e39: OUTPUT: «List␤Cannot use bind operator with this left-hand side␤  in block <unit> at <tmp> line 1␤␤»
18:58 asdsdfgh Why's one allowed buit not the other?
18:59 ufobat joined #perl6
19:00 moritz m: my $l := List.new: <foo bar>; say $l.perl;
19:00 camelia rakudo-moar 8ccb60e39: OUTPUT: «($("foo", "bar"),)␤»
19:01 moritz this is actually a list inside a one-element list
19:01 moritz and the $(...) in there means the inner list is inside a scalar container
19:01 moritz which enables the binding operation
19:01 moritz m: my $l := List.new: |<foo bar>; say $l.perl;
19:01 camelia rakudo-moar 8ccb60e39: OUTPUT: «("foo", "bar")␤»
19:01 moritz m: my $l := List.new: |<foo bar>; $l[0] := 'x'; say $l.perl
19:01 camelia rakudo-moar 8ccb60e39: OUTPUT: «("x", "bar")␤»
19:02 moritz now *that* surprises me
19:02 mcmillhj joined #perl6
19:03 ufobat what did you expect?
19:03 asdsdfgh m: my $l := List.new: <foo bar>; say $l[0] = 42;
19:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «42␤»
19:03 asdsdfgh Why does it get a scalar container though?
19:04 asdsdfgh m: my $l := List.new: 42; say $l[0] = 42;
19:04 camelia rakudo-moar 8ccb60e39: OUTPUT: «42␤»
19:04 asdsdfgh It's meant to be immutable
19:04 El_Che releasable6: status
19:04 releasable6 El_Che, Next release will happen when it's ready. No blockers. 213 out of 216 commits logged
19:04 releasable6 El_Che, Details: https://gist.github.com/f85bd7bc3bd4adaf4bb6362072aef9ce
19:06 asdsdfgh moritz: it's not surprising. The "foo" and "bar" are each in their own container.,
19:07 asdsdfgh That answers my question. Thanks, moritz++
19:07 moritz I didn't expect the elements to be in containers, because it's a List, not an Array
19:07 moritz and I didn't do anything to create a container, afaict
19:09 asdsdfgh Yeah. The signature in `List.new` has `**@items`. Containers comes from there.
19:10 moritz using an array to construct a list: what could possibly go wrong :-)
19:10 asdsdfgh :)
19:11 lizmat joined #perl6
19:14 asdsdfgh R#1260
19:14 synopsebot R#1260 [open]: https://github.com/rakudo/rakudo/issues/1260 List.new creates unwanted containers
19:18 Geth ¦ doc: a37ea721e9 | (Jan-Olof Hendig)++ | 5 files
19:18 Geth ¦ doc: More formatting fixes
19:18 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a37ea721e9
19:22 mr-foobar joined #perl6
19:25 dhsfgjgfk joined #perl6
19:25 dhsfgjgfk moritz: how come you can bind to just `$x`? Is there a Scalar container involved? I thought it existed only when assigning
19:26 moritz dhsfgjgfk: the binding replaces the the scalar container, and is special-cased for variables in the compiler
19:26 dhsfgjgfk Ah. Thanks.
19:37 levex joined #perl6
19:38 mcmillhj joined #perl6
19:41 ryn1x_ joined #perl6
19:44 ryn1x_ Regex question. How can I match ": 7312500" but only return the numbers? I can match with /^ ': '\d+ $/ but I don't know how to return only the digits..
19:46 timotimo you can put a <( in front of \d+
19:48 moritz m: say 'abc: 1234' ~~ /':' \s+ <( \d+ /
19:48 camelia rakudo-moar 8ccb60e39: OUTPUT: «「1234」␤»
19:48 perlpilot Also, I wonder if it matters that that's a Match object and not just a number
19:51 ryn1x_ timotimo: thanks that is working!
19:51 ryn1x_ perlpilot: I was going to return $/.Str
19:52 perlpilot ryn1x_: well, you could have also captured the digits and returned $0.Str
19:54 ryn1x_ Can you give an example?
19:54 comborico1611 joined #perl6
19:54 perlpilot m: 'abc: 1234' ~~ /':' \s+ (\d+) /; say $0.Str;
19:54 camelia rakudo-moar 8ccb60e39: OUTPUT: «1234␤»
19:54 mr_ron joined #perl6
19:55 perlpilot m: 'abc: 1234' ~~ / <after ':' \s+ > \d+ /; say $/.Str;   # another way
19:55 camelia rakudo-moar 8ccb60e39: OUTPUT: «1234␤»
19:55 perlpilot but, of course, timotimo's way is nice and succinct.
19:55 comborico1611 Greetings, everyone.
19:55 timotimo it also creates fewer objects :P
19:56 perlpilot timotimo: sure ... timtowtdi too   :-)
19:57 timotimo though as an internals hacker i know how cheap very short-lived objects are
19:59 ryn1x_ Thank you. /':' \s+ (\d+) /; say $0.Str looks nice and readable to me... as someone who is still new to regexs
20:00 ryn1x_ I am guessing the parens make groups and you refer to each with $x instead of $/ ?
20:01 comborico1611 Parens are captured grouping.  (Versus brackets, which are just grouping.)
20:02 comborico1611 But I'm a newbie, so.  I just wanted to add that.
20:02 moritz ryn1x_: correct. You can also use $/ as a list, so $/[0]
20:03 ryn1x_ Ah ok. Thanks moritz. I have your regex book on pre-order. Can't wait for that!
20:06 moritz ryn1x_: I hope to get a final review of the manuscript tomorrow or Wednesday; then it can go into print soon
20:09 rindolf joined #perl6
20:10 raiph joined #perl6
20:11 perlpilot moritz: Can you write a book on NativeCall or async/concurrency next?  ;-)
20:12 moritz perlpilot: no. I'll leave async/conc/parallel to jnthn++ :-)
20:12 moritz and nativecall to nine++, maybe? :-)
20:12 perlpilot that's a good plan ... what about NativeCall ?
20:13 raiph m: { Failure.new for 1 }() # I haven't found doc or RT covering why this doesn't report the Failure; any thoughts/pointers?
20:13 camelia rakudo-moar 8ccb60e39: ( no output )
20:13 moritz seriously, I think I'm done with writing Perl 6 books for a while
20:14 perlpilot I wonder if there's a place for a book entitled "Perl 6's killer features and how to use them"  :)
20:14 moritz if I continue in that area, I might consider a grant proposal to add more structured introductory material to the docs
20:14 moritz perlpilot: now *that* is for you to write :-)
20:15 perlpilot moritz: I'll add it to The List.  :-)
20:33 HoboWithAShotgun perlpilot: Part 2: "Perl 6's killer features and how to shoot yourself in the foot with them"
20:33 moritz HoboWithAShotgun: you can write that :-)
20:34 perlpilot HoboWithAShotgun: as long as Part 3 ends up being something like "How to rewind time and otherwise defy the laws of physics with Perl 6"
20:34 HoboWithAShotgun was soll das denn bitte heissen?
20:34 perlpilot But that sounds like something for Damian to write
20:34 HoboWithAShotgun ;-)
20:35 HoboWithAShotgun It's german. I don't know how to express the fake "outrage" in english
20:36 perlpilot well, you're the only one with a gun in his nick, so naturally you'd be the expert on shooting things  :)
20:36 moritz HoboWithAShotgun: pretty much the same, "what's *that* supposed to mean?"
20:36 HoboWithAShotgun perlpilot: How to solve the halting problem with Perl 6 :)
20:37 perlpilot whoa whoa whoa!  Let's not get crazy!
20:37 teatime Perl = NP, discuss
20:38 moritz isn't there a quote like "It's easy to solve the halting problem with a shotgun" by our very own TimToady++ in some fortune files?
20:38 teatime lol
20:39 perlpilot That's how you know TimToady is american ... the causal use of guns to solve a problem   ;->
20:40 moritz speaking of P and NP, http://blog.computationalcomplexity.org/2014/03/why-do-we-think-p-ne-np-inspired-by.html
20:40 moritz that wasn't the post I wanted to link to, let me search the other one...
20:41 AndChat|688961 joined #perl6
20:42 moritz can't find it now :(
20:42 mcmillhj joined #perl6
20:42 HoboWithAShotgun you guys all have  a compsi degree? i'm not, just application and web programming
20:42 Cabanossi joined #perl6
20:43 TEttinger that's computers and psionics, right?
20:43 HoboWithAShotgun i'm terrible at math
20:43 lizmat HoboWithAShotgun: when I went to Uni, there was no CompSci there  :-(
20:43 HoboWithAShotgun *compsci
20:43 lizmat which may have been a good thing, actually :-)
20:43 TEttinger :)
20:44 moritz my degree is actually physics
20:44 HoboWithAShotgun oh cool.
20:44 teatime HoboWithAShotgun: I don't.
20:45 teatime I originally started in CS, dropped out pretty quick.  Went back later for a liberal arts degree, and took several CS classes, also stuff like logic.
20:45 perlpilot HoboWithAShotgun: Yeah, I have a BS and MS in computer science (because I was too lazy to do a degree in math or physics)
20:45 teatime You can go far in programming w/o the advanced math and CS, but I have gotten to the point where I really wish I had it.
20:46 moritz teatime: the nice thing is that, typically, you don't need *all* the CS stuff
20:46 perlpilot teatime: do you know of an understand big-O notation?
20:46 perlpilot s/an/and/
20:46 moritz need a bit of graph theory? read a bit about, learn some, you're good
20:46 teatime perlpilot: yeah, to a degree.
20:46 HoboWithAShotgun yeah me too. the document just linked to, for me it could as well contain lore ipsum
20:46 perlpilot teatime: you're doing better than most :)
20:46 teatime perlpilot: I don't really get how to look at an algorithm and determine it's O() though
20:46 moritz need a bit of compiler knowledge? it's not actually rocket science
20:47 teatime moritz: def. true, but it can be frustrating to find good resources when you don't know e.g. what stuff is called
20:47 HoboWithAShotgun moritz: the problem often isnt the learning of x but knowing that you need to learn x
20:47 teatime there are unknown unknowns.  but then I just ask you fine folks, which tends to work out great.
20:47 teatime HoboWithAShotgun: exactly
20:48 moritz that's when it's great to have friends or mentors who have a greater breadth of knowledge
20:48 perlpilot Actually ... trying to write a compiler will teach you all the things you need to learn in computer science I think.
20:48 HoboWithAShotgun do you want to be my friend?
20:48 HoboWithAShotgun :-)
20:49 moritz "speak friend and enter!" :-)
20:50 moritz though seriously, I don't have a problem with nudging people towards fields of CS or programming or so that I read about
20:51 perlpilot Lots of people that I've encountered over the years who are top-notch Perl programmers have come from non-computer science backgrounds.
20:54 HoboWithAShotgun speaking of top notch programmers: blob:https://imgur.com/b8b267eb-e218-44e9-a5ba-56d93eb36424
20:54 HoboWithAShotgun meh, https://imgur.com/a/N1m2t
20:55 HoboWithAShotgun youtube can't even do markup right
20:56 HoboWithAShotgun i mean what the...
20:58 moritz pro tip: your life will be better when you ignore the fact that youtube comments exist
20:59 HoboWithAShotgun nah, i have way too much fun exchanging insults with flat earthers and creationists
21:00 HoboWithAShotgun and it's the perfect place to live out my trolling lust. if the fbi ever checks my YT profile, i've been everything
21:01 HoboWithAShotgun from dentists wife to judge
21:06 HoboWithAShotgun *** crickets chirping ***
21:07 AndChat|688961 I believe YouTube intentionally makes their comment system atrocious.
21:07 HoboWithAShotgun for what reason?
21:08 AndChat|688961 Go get your tinfoil hat.
21:08 HoboWithAShotgun go get? i'm wearing it
21:08 AndChat|688961 Haha! Very funny.
21:10 AndChat|688961 I think from the very beginning after Google purchased YouTube and before, they knew it was going to be the main source of traffic on the internet. And they knew a comment system what generates valuable information. So they made it difficult for others, other than themselves, to navigate through the data.
21:10 AndChat|688961 Common system would* generate
21:11 HoboWithAShotgun i see. that's why they wrote an api (https://developers.google.com/youtube/v3/docs/comments/list) for it
21:11 s0me0n3-unkn0wn sergot: ping
21:12 s0me0n3-unkn0wn ugexe: ping
21:12 s0me0n3-unkn0wn Guys I'm sure I'm not the only one who's not happy with that `gen-lib` hack in OpenSSL
21:12 s0me0n3-unkn0wn But I need to add an another one :)
21:12 s0me0n3-unkn0wn I need to import functions from libcrypto.so to implement PKCS12 parsing in IO::Socket::Async:SSL
21:12 s0me0n3-unkn0wn Are there any better suggestions besides just copy-pasting `sub gen-lib` to `sub crypto-lib` ?
21:12 HoboWithAShotgun no, the yt comment is just another flat thread system, it's just buggy as hell
21:12 AndChat|688961 Where are the programs that use that api?
21:12 HoboWithAShotgun and that inconsistently.
21:13 ugexe s0me0n3-unkn0wn: depends, you might not have to use that. the reason it exists is because the openssl DLLs cannot be renamed (on windows), but all files get renamed upon installation
21:14 AndChat|688961 Why didn't YouTube implement a forum-type comment system? One that could be searched?
21:15 ugexe the deeper problem regarding file renaming will be fixed in the core eventually, but until then it sucks
21:15 HoboWithAShotgun because there are probably 100 Million new comments A DAY and having them all searchable is just not feasible?
21:17 AndChat|688961 YouTube can host thousands, millions of live streams at once, but they can't archive comments in a searchable form?
21:19 s0me0n3-unkn0wn ugexe: The problem is I need OPENSSL_add_all_algorithms_noconf() which resides in libcrypto.so on Linux and in libeay32.dll on Win. So my only option is to copy-paste the whole `sub gen-lib` and create something like `sub gen-crypto-lib` specifically for libcrypto.so. And considering the OpenSSL module is a duct tape warehouse already, I don't see a better place to implement it. Tell me if you have better solution, otherwise I'll
21:19 s0me0n3-unkn0wn submit pull request with that `sub gen-crypto-lib`. Hope that ends up soon :)
21:27 ugexe yeah just try and follow the hack that is implemented, since I do actually know how to turn it into something proper once its possible
21:27 mcmillhj joined #perl6
21:27 HoboWithAShotgun possible? sure. but also costly for little benefit.
21:28 * HoboWithAShotgun is off to attempt a 42cm pizza.
21:28 HoboWithAShotgun i'll be back if i survive that
21:28 HoboWithAShotgun :)
21:29 kitsunenokenja joined #perl6
21:40 geospeck joined #perl6
21:50 zacts joined #perl6
22:01 cdg joined #perl6
22:04 AndChat|688961 Enjoy. Pizza is heavenly.
22:05 AndChat|688961 Anyone want to answer a question I have on C?
22:10 dzove855 joined #perl6
22:14 s0me0n3-unkn0wn joined #perl6
22:28 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/11/20/2017-47-more-tpcia-videos/
22:30 Geth ¦ doc: e9b668c223 | (Will "Coke" Coleda)++ | xt/examples-compilation.t
22:30 Geth ¦ doc: Add an examples check for use of 'dd'
22:30 Geth ¦ doc:
22:30 Geth ¦ doc: For #1680
22:30 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e9b668c223
22:32 tokik joined #perl6
22:37 mcmillhj joined #perl6
22:37 comborico1611 joined #perl6
22:37 comborico1611 Gj, lizmat.
22:43 flatwhite joined #perl6
22:45 Geth ¦ doc: 20ae84b4fb | (Will "Coke" Coleda)++ | 2 files
22:45 Geth ¦ doc: learn new words
22:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/20ae84b4fb
22:53 mcmillhj joined #perl6
22:58 Geth ¦ doc: 738b5c8212 | (Will "Coke" Coleda)++ | EXAMPLES.md
22:58 Geth ¦ doc: Add refrence to new ok-test value: dd
22:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/738b5c8212
22:58 Geth ¦ doc: c6b5104830 | (Will "Coke" Coleda)++ | doc/Language/faq.pod6
22:58 Geth ¦ doc: This snippet is explicitly about dd, ok it
22:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c6b5104830
22:58 synopsebot Link: https://doc.perl6.org/language/faq
22:59 itaipu joined #perl6
23:09 mcmillhj joined #perl6
23:11 pilne joined #perl6
23:13 Cabanossi joined #perl6
23:22 kyan joined #perl6
23:25 mcmillhj joined #perl6
23:32 Altreus Is there a mode for exemel where it removes whitespace text nodes?
23:32 Altreus cos I'm finding it hard to reliably parse an XML file that may or may not have been reformatted
23:33 mcmillhj joined #perl6
23:33 Altreus cos if I pretty-print it, the zeroth node becomes an empty text node instead of another element, meaning all my things have to be greps, which gets cumbersome
23:34 Sgeo joined #perl6
23:38 regreg joined #perl6
23:42 lizmat joined #perl6
23:49 mcmillhj joined #perl6
23:55 comborico1611 joined #perl6

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

Perl 6 | Reference Documentation | Rakudo