»ö« 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:01 TreyHarr1 left
gfldex also we don't want the job of syntaxhighlighters to be too easy, do we? 00:01
timotimo stevieb: are you still there? 00:04
stevieb: you can just check if $<object> is defined, for example
then you can just make $<object>.made
00:05 M-Illandan left 00:14 zacts left 00:17 Xliff_ left 00:21 kid51 joined 00:24 TreyHarr1 joined 00:36 Xliff joined 00:37 TreyHarr1 left 00:39 tadzik joined 00:45 perigrin left
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ "C::foo"} }; my $R = R; my $c = C.new but $R; $c.foo; 00:48
camelia rakudo-moar 242baf: OUTPUT«R::foo␤»
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ "C::foo"} }; my $debug = True; my $R = $debug ?? R !! Mu; my $c = C.new but $R; $c.foo; 00:49
camelia rakudo-moar 242baf: OUTPUT«R::foo␤»
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ "C::foo"} }; my $debug = False; my $R = $debug ?? R !! Mu; my $c = C.new but $R; $c.foo;
camelia rakudo-moar 242baf: OUTPUT«Cannot mix in non-composable type Mu into object of type C␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ "C::foo"} }; my $debug = False; my $R = $debug ?? R !! role :: {}; my $c = C.new but $R; $c.foo;
camelia ( no output )
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ "C::foo"} }; my $debug = False; my $R = $debug ?? R !! role :: {}; my $c = C.new; $c.foo; 00:50
camelia ( no output )
gfldex m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ say "C::foo"} }; my $debug = False; my $R = $debug ?? R !! role :: {}; my $c = C.new but $R; $c.foo;
camelia rakudo-moar 242baf: OUTPUT«C::foo␤»
gfldex :)
m: role R { method foo(){ say "R::foo" } }; class C { method foo(){ say "C::foo"} }; my $debug = False; my $R = $debug ?? R !! role :: {}; my $c = C.new but $R; $c.foo; say $c.WHAT; 00:51
camelia rakudo-moar 242baf: OUTPUT«C::foo␤(C+{<anon|67671632>})␤»
01:02 M-matthew joined, M-Illandan joined
ovibos is there any way to define pseudo-attributes for perl6 classes, like c# properties? 01:12
timotimo yeah, you want Proxy
ovibos ah, thanks 01:13
gfldex m: class C {}; sub postfix:<.lie>(C:D){ say 'kekeke' }; my C $c.=new; $c.lie; 01:14
camelia rakudo-moar 242baf: OUTPUT«kekeke␤»
gfldex m: class C {}; sub postfix:<.lie>(C:D){ say 'kekeke' }; my C $c.=new; $c.lie();
camelia rakudo-moar 242baf: OUTPUT«kekeke␤No such method 'CALL-ME' for invocant of type 'Bool'␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: class C {}; sub postfix:<.lie()>(C:D){ say 'kekeke' }; my C $c.=new; $c.lie(); 01:15
camelia rakudo-moar 242baf: OUTPUT«kekeke␤»
gfldex ovibos: ^^^ you can do really odd things with user defined operators
mst ovibos: 'has' is perl6's equivalent of C# properties 01:17
ovibos mst: i mean, properties in the sense of making a function call look like assignment
so $x.y = z would be another way of writing $x.y(z) 01:18
gfldex ovibos: you may be talking about return-rw
mst yeah, that's how you get lvalue methods IIRC
C# properties are just a degenerate special case of lvalue methods :) 01:19
01:19 TreyHarr1 joined
ovibos oh, that's neat 01:19
thanks
01:25 dvinciguerra_ left, neuron left 01:34 djbkd joined 01:47 ilbot3 joined 01:50 TreyHarr1 left 01:52 kalkin-_ joined, kalkin-_ is now known as kalkin-
llfourn m: my $foo = "foo"; say "$foo("; # bug? 02:05
camelia rakudo-moar 242baf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 3my $foo = "foo"; say "$foo("; # bug?7⏏5<EOL>␤ expecting any of:␤ argument list␤ doub…»
gfldex llfourn: nobug
llfourn LTA error?
gfldex it should say finale ')', so I would vote for LTA 02:06
llfourn it leads to very strange side effects in large examples 02:07
gfldex i tend to use Q:c[] these days to avoid odd stuff
llfourn what's that?
gfldex it will only interpolate stuff inside {} 02:08
:c as in :code
llfourn oh right yeah
02:08 TreyHarr1 joined
llfourn m: class A { method foo { "$name(" } }; role C { method foo { } }; class B { method foo { } }; # this took me ages to figure out o.o 02:11
camelia rakudo-moar 242baf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Package 'A' already has a method 'foo' (did you mean to declare a multi-method?)␤at <tmp>:1␤»
02:14 TreyHarr1 left, AlexDaniel left
gfldex llfourn: did you meant to write $name or $name()? 02:14
llfourn "{$name}(" is what I meant
gfldex a good syntax highlighter would have helped. Sadly there are no good highlighters yet. 02:15
llfourn yeah :| 02:16
but if you don't finish the postcircumfix in the quote I think it might make sense to disregard it
gfldex m: my $a = -> |c {}; my $b = "$a("")"; 02:17
camelia rakudo-moar 242baf: OUTPUT«Use of Nil in string context in block <unit> at <tmp> line 1␤»
gfldex m: my $a = -> |c {1}; my $b = "$a("")";
camelia ( no output )
gfldex llfourn: do you see the problem?
as soon as the grammar spots the ( it will switch from Q parsing to Perl 6 parsing. 02:18
llfourn ah that's a good point 02:19
gfldex it's one of those spots where Perl 6 is to flexible for its own good.
llfourn I never knew that you could continue the quote in another ""
gfldex it's grammars all the way down :) 02:20
llfourn m: my $a = -> { say "foo" }; "$a("")";
camelia rakudo-moar 242baf: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in block <unit> at <tmp> line 1␤␤»
llfourn oh right I see what you mean
02:22 canopus joined 02:23 kid51 left, kid51 joined
gfldex i just glanced over the quoting section in the docs and already spotted 3 holes :-/ 02:23
llfourn gfldex++ # working on docs 02:24
02:31 Zoffix joined
Zoffix m: use MONKEY-TYPING; augment class IO::Path { multi method new (IO::Path: $, $, *@) { } }; IO::Path.new: 1, 2; 02:32
camelia rakudo-moar 242baf: OUTPUT«Ambiguous call to 'new'; these signatures all match:␤:(Mu $: $, *@, *%_)␤:(IO::Path $: $, $, *@, *%_)␤ in block <unit> at <tmp> line 1␤␤»
Zoffix Why is this ambiguous?
02:34 ponbiki joined, kid51 left, ponbiki is now known as Guest18609
Zoffix m: class Foo { multi method new (Foo: $, $, *@) {} }; Foo.new: 1, 2 02:35
camelia rakudo-moar 242baf: OUTPUT«Ambiguous call to 'new'; these signatures all match:␤:(Mu $: $, *@, *%_)␤:(Foo $: $, $, *@, *%_)␤ in block <unit> at <tmp> line 1␤␤»
Zoffix m: class Foo { proto method new(|) {*}; multi method new (Foo: $, $, *@) {} }; Foo.new: 1, 2 02:36
camelia ( no output )
llfourn I didn't know Mu had a new like :(Mu $: $, *@, *%_) 02:38
ah it's so it can throw a specific error 02:39
X::Constructor::Positional.new(:type( self )).throw();
Zoffix still doesn't get the proto stuff even after reading docs.perl6.org/syntax/proto
If | is an unnamed Capture parameter, what exactly is the proto (|) above do? 02:40
How come it stops matching the Mu?
llfourn because proto is only so it overrides Mu's multi rather than adding to it 02:41
I agree wrt to making proto clearer
I think I wrote some or most of it but I think i could make a simpler intro to it know that I understand it better 02:42
02:42 noganex_ joined 02:44 dvinciguerra_ joined
gfldex Zoffix: did you try (IO::Path:D:) ? 02:45
llfourn but you don't call .new on a defined IO::Path... 02:46
Zoffix gfldex, it's a .new method, it would not be :D at that point
gfldex m: say IO::Path ~~ Mu;
camelia rakudo-moar 242baf: OUTPUT«True␤»
gfldex it would solve the problem tho :) 02:47
Zoffix m: use MONKEY-TYPING; augment class IO::Path { multi method new (IO::Path:D: $, $, *@) { } }; IO::Path.new: 1, 2;
camelia rakudo-moar 242baf: OUTPUT«Default constructor for 'IO::Path' only takes named arguments␤ in block <unit> at <tmp> line 1␤␤»
Zoffix Nope, it just calls Mu :)
gfldex Zoffix: why do you want to overload new anyway, when you can use the one that is already there with a different BUILD
llfourn Zoffix: have you tried "is default" 02:48
gfldex if you need a different set of positionals, you have to overload new
llfourn m: class Foo { multi method new is default (Foo: $, $, *@) {} }; Foo.new: 1, 2
camelia rakudo-moar 242baf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class Foo { multi method new is default7⏏5 (Foo: $, $, *@) {} }; Foo.new: 1, 2␤»
gfldex or better provide another multi candidate 02:49
llfourn m: class Foo { multi method new (Foo: $, $, *@) is default {} }; Foo.new: 1, 2
camelia ( no output )
Zoffix Just adding `proto method new(|) {*}` did the trick.
gfldex, because the message lies. IO::Path's new can take positionals.
gfldex two of them anyway. 02:51
02:52 TreyHarr1 joined
konobi anyone around that's familiar with NQP and NQP bootstrapping who could help me with rubber ducking an conjecture? 02:53
02:57 kurahaupo joined 02:58 rgrinberg joined 03:05 TreyHarr1 left 03:06 TreyHarr1 joined 03:10 rgrinberg left
Zoffix
.oO( seems everyone is currently asquare... )
03:14
03:23 TreyHarr1 left, dvinciguerra_ left 03:29 mic_ joined 03:30 mic_ left 03:39 AlexDaniel joined 03:45 kaare_ joined 03:50 Senj joined, Senj is now known as Senji 03:54 TreyHarr1 joined 04:01 TreyHarr1 left 04:05 jack_rabbit joined 04:06 djbkd left 04:29 jack_rabbit left 04:34 zakharyas joined 04:35 BenGoldberg left 04:37 Cabanossi joined 04:42 TreyHarr1 joined 04:53 holyghost joined
holyghost Good morning 04:55
04:58 adu joined, TreyHarr1 left 05:01 TreyHarr1 joined 05:08 bob777 joined 05:09 adu left 05:12 mohae joined 05:13 TreyHarr1 left 05:23 kurahaupo left 05:42 xiaomiao joined 05:51 TreyHarr1 joined 05:54 RabidGravy joined 05:56 darutoko joined 06:02 TreyHarr1 left 06:07 AlexDaniel left 06:09 CIAvash joined 06:13 holyghost left 06:18 zakharyas left 06:25 ribasushi joined 06:27 TreyHarr1 joined, firstdayonthejob joined 06:30 ugexe joined 06:32 TreyHarr1 left 06:35 TreyHarr1 joined 06:36 firstdayonthejob left 06:43 user9 joined 06:44 domidumont joined 06:48 domidumont left, domidumont joined 06:50 trnh joined, TreyHarr1 left 06:51 mohae left 07:00 jonas2 joined 07:05 domidumont left 07:10 domidumont joined 07:12 kst` joined 07:13 wamba joined 07:14 kst left 07:32 abraxxa joined 07:33 pdcawley joined 07:34 telex joined 07:39 abraxxa left 07:40 abraxxa joined 07:41 TreyHarr1 joined 07:45 Actualeyes left, marcel_ joined 07:46 Actualeyes joined 07:50 TreyHarr1 left 07:56 TreyHarr1 joined 08:01 TreyHarr1 left 08:11 zakharyas joined 08:14 dwarring left 08:17 TreyHarr1 joined 08:22 TreyHarr1 left 08:31 marcel_ is now known as marcel__, marcel__ is now known as marcel_ 08:34 TreyHarr1 joined 08:39 TreyHarr1 left 08:41 gregf_ joined 08:45 sno joined 08:48 pmurias joined
pmurias konobi: what's your conjecture? 08:48
yoleaux 17 Jul 2016 22:25Z <konobi> pmurias: were you able to get the flamegraph representations from the chrome devtools?
08:50 TreyHarr1 joined
pmurias konobi: I have the Chart/Heavy/Tree options for viewing the profile. Maybe I need to update by Chrome? 08:51
08:57 TreyHarr1 left 09:00 TreyHarr1 joined 09:05 TreyHarr1 left 09:25 TreyHarr1 joined 09:31 huggable joined 09:41 TreyHarr1 left 09:50 marcel_ left 09:53 TreyHarr1 joined
CIAvash developers.slashdot.org/story/16/0...larry-wall 09:57
DrForr Slashdot? "And so it begins." 09:58
timotimo oh, that's already a few days old
www.p6c.org doesn't seem to have felt it at all 09:59
DrForr It's on slashdot. They've already decided that perl6 sucks. 10:00
timotimo ah, you're right, of course 10:01
DrForr Well, remember when the questions were being asked 90% of the questions were "have you stopped beating your wife?" 10:02
timotimo right. 10:03
did that question literally show up, though? or just questions of that type?
psch ...i wouldn't be surprised if someone on /. thought they were funny by asking exactly that question 10:04
timotimo well, it'd be funny in an ironic way i suppose? or maybe haha-only-serious?
stmuk oddly the /. interview answers are a lot better than the questions! :) 10:05
DrForr "Why does perl suck?" or variants. I read through those and lost the desire to come up with actually interesting questions.
stmuk I doubt most of the people asking questions even understand /. itself is perl
timotimo um ... /. being perl isn't a testament to perl's quality 10:06
psch it's really not an argument for either side
10:07 TreyHarr1 left
psch it's like with guitars - 80+% of the sound comes from the fingers, not the wood in the body vOv 10:07
timotimo how about the wood in the fingers? 10:08
psch that probably isn't a good idea, it's likely to hurt a lot :P
timotimo :)
psch splinters under the fingernail >_>
timotimo ugh 10:09
timotimo shudders
stmuk was more pondering the irony of the perl haters using perl unaware than claiming slashcode to be wonderful 10:11
although github.com/SoylentNews/rehash/ might fix some breakage 10:12
DrForr People only tend to care what a website "runs on" when it breaks, and someone tweets that a program in one or another language broke. 10:13
stmuk people in general yes but people expressing views about progamming might be more expected to know about website tech detailsa 10:17
-a 10:18
DrForr Naah, someone writes a snarky post and others just pile on in, joining in because they think it's funny. Easier to do that than take the time to Google what language the site uses.
xiaomiao I'm surprised that people still use slashdot ... after the "upgrade" last year it was TOFU and I gave up scraping text from the raw HTML 10:22
10:22 rindolf joined
timotimo what meaning does TOFU have outside german netizens? 10:22
in german it means "Text Oben, Fullquote Unten" 10:23
moritz timotimo: it's some kind of food :-)
psch ...i do that
timotimo as in, "text at the top, a full quote of the thread so far on the bottom"
psch because gmail does it
timotimo it can be useful
stmuk its a veggie food?
moritz yes 10:24
stmuk top posting?
timotimo yeah
psch i've read that usenet etiquette says it's bad, but i've used usenet so i don't really care about that
err, *never* used usenet
stmuk I think the bottom posting battle was lost years ago 10:25
DrForr O god, top vs. bottom.
timotimo why say "lost" and not just "decided"? :) 10:26
anyway, dinner time 10:27
xiaomiao timotimo: TOtally F'ed Up
timotimo o/
ah!
of course
xiaomiao like FUBAR, only more so
10:27 weeirc8081 joined 10:28 weeirc8081 left 10:33 labster left
raydiak \o 10:55
10:56 araujo joined
timotimo hey raydiak! 10:56
long time no see :)
raydiak hiya timo :) 10:57
yeah busy busy busy these days.../me haz $dayjob now
timotimo oh yay
raydiak mostly writing php :P
timotimo ... oh
hahainternet also secured a new job 10:58
10:58 TreyHarr1 joined
raydiak it's okay, I'm in a good position to drag our company into the light of perl 6 when the time is right :) 10:58
hahainternet hopefully with Perl, but won't be new Perl :(
raydiak congrats hahainternet :)
moritz hahainternet: use Inline::Perl6
hahainternet merci, same to you raydiak
DrForr We've already talked about P6 on one of my current projects :)
hahainternet moritz: i mean "no writing of new perl"
most likely rewriting in Go 10:59
moritz oh
raydiak thank you also hahainternet
moritz ah well, new experiences etc.
hahainternet honestly i'm not sure I could deal with writing Perl 5 too much these days 11:00
6 is so much more convincing
raydiak timotimo: what kinda awesome stuff are you up to these days? 11:01
timotimo eh
nothing very awesome in the last moths i'm afraid
but others are doing very good work in perl6-land
have you seen the rakudo changelog? lizmat has been improving the performance of core-setting builtins drastically 11:02
raydiak that's approximately what you said last time iirc...and now I ask what I asked last time...so what less-than-very-awesome stuff have you been up to? :)
nope haven't been keeping up...I'll go peruse it
timotimo hmm. i tend to just contribute some odds and ends; for example, we now have a little line-based coverage reporting mechanism in moarvm. though it tends to sometimes give surprising/wrong-seeming results 11:03
raydiak coverage reporting? what is it? 11:04
hahainternet for test i assume
raydiak oh of course
hahainternet it will tell you if your tests do not cover portions of code
timotimo you run a bunch of files - for example the spec tests - and then you can let it report on what lines in a code file -for example the core setting- were ever executed
hahainternet probably my favourite feature in Go too 11:05
raydiak nice
timotimo and i convinced someone to re-write the html profile thing in angular 2; we're hoping it could perform a bit better
11:05 TreyHarr1 left
raydiak glad you did...too bad I never got to it 11:05
timotimo no worries :) 11:06
raydiak I saw the big splash of bisectbot a while ago...that's pretty awesome
11:06 rindolf left
timotimo yup. we're even going to have a "benchable" on top of that 11:06
raydiak oh sweet
how is the performance overall these days? are we competitive with...anything yet? 11:07
timotimo it still strongly depends, sadly 11:08
we've recently got a little nice re-write in that'll allow moarvm to better parallelize when many invocations happen 11:09
but at the moment creating new stack frames goes through two allocations that both have to acquire a lock on our shared fixed-size allocator
i've run fuzzing against moarvm twice already this year, and there's a few things it found that were already fixed 11:10
raydiak as usual, your knowledge of the guts impresses and exceeds me :)
timotimo the particular approach i took just means we'll be a bit more robust against forged or b0rked .moarvm files, which isn't worth that much, sadly
well, if you bathe in guts all day for a couple of months, you have to have something to show for it, don't you ;)
raydiak heh I...yeah, that better be worth it...sure doesn't sound pleasant... 11:11
timotimo haha
it's pleasant enough when you have lovely people like the perl6 dev team to guide you
raydiak never hard to find help around here no matter what layer you're working on, that's for sure 11:12
timotimo brrt is still on the way toward thesis finishization, so even-moar-jit is only progressing slowly. but the design work and implementation done so far is promising 11:14
arnsholt timotimo: Also helps that large parts of the guts are less gory than you might expect
jnthn's made som good C APIs for us
timotimo yeah, from what i can tell he's got a good sense for API design
raydiak if you ever wanted to fix a broken cool thing with all that low-level knowledge...jnthn's unmaintained Grammar::Generative sure was a cool concept...but hasn't worked since I learned of it 11:15
timotimo what, me? :P 11:17
is it really low-level?
raydiak idk. lower than my understanding. last I knew, it was segafaulting and I posted a stack trace in an issue but he was busy with more central rakudo things 11:19
timotimo ouch
a segfault is surely not a good thing to have
raydiak the project is mostly nqp iirc. I only have a very vague understanding of nqp 11:20
DrForr I've been dealing with nqp over the last few days/week, and segfaulting is unavoidable.
raydiak or at least the failure point was nqp. that was when I realized I'd have to spend more time learning to fix it than I could, even though I really wanted to use it at that time for a larger related idea I had
psch github.com/jnthn/grammar-generativ...rative.pm6 has no occurence of "nqp"?
ah
DrForr (not after release, but development has a side effect of throwing segfaults) 11:21
raydiak here's the issue, which is apparently no longer a segfault: github.com/jnthn/grammar-generative/issues/1 11:23
I guess I was remmebering wrong about the nqp, I guess it's just all the $* vars and ast and such in there I'm not familiar with
psch yeah, it is rather gutsy, but more src/Perl6/ level gutsy, not nqp gutsy :) 11:24
raydiak all I remember for certain was that I really wanted to use it, tried to fix it myself but quickly discovered I was in over my head unless I was ready to spend some more serious study time :) 11:25
11:28 TreyHarr1 joined 11:30 _28_ria joined, zakharyas left
arnsholt Yeah, it's low-level at the NQP and grammar internals/MOP level, not C internals low-level 11:40
I attended jnthn's talk about it at YAPC::NA in Austin, but I've since forgotten the details of how it works
I remember that it was quite clever though (and the talk may have included things like co-parsing, although that may have been a different jnthn-talk from the same conference) 11:41
Roamer` mmmyeah, so Perl 6 has spoiled me already... writing some Perl 5 code, really missing the ability to do a map within a map and have access to the outer iterator
raydiak think I watched the talk at some point. I actually started writing my own crude version of the idea before I learned of grammar::generative, which looked like a much cleaner and better integrated solution than my silly user-level P6 'reimplement everything about pattern matching at the same time' attempt 11:45
11:47 f3ew_ is now known as f3ew
raydiak I was ending up with some barely-a-shadow-of-a-real-regex pattern implementation...more like lua patterns...just so it was all on a level I understood how to work with so I could implement the generative part. then realized how silly it is to write a pattern matching engine in a language which has an incredibly powerful pattern matching engine built in. that's where that project stopped, heh 11:52
11:53 rgrinberg joined 11:54 pmurias_ joined 11:58 pmurias left 11:59 Actualeyes left 12:01 pmurias_ left 12:06 kid51 joined, zakharyas joined 12:07 _28_ria left 12:11 pmurias joined
gregf_ I could be wrong. I've been wrong before, but I've also been right before.;-) <== thats a great way to end :) 12:12
12:15 sufrostico joined 12:16 perlpilot joined 12:27 shillo joined 12:28 cdg joined
shillo perl6 -e 'class A { method m() {} }; say &A.m;' 12:34
p6: class A { method m() {} }; say &A.m;
camelia rakudo-moar 21cfe2: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Illegally post-declared type:␤ A used at line 1␤␤»
shillo So, a quick question: How to I actually get a reference to a method as a Routine? Do I have to call A.^find_method?
timotimo find_method, or can
12:35 ribasushi left
psch or lookup 12:35
timotimo lookup?
psch m: Int.^lookup("Str").perl.say
camelia rakudo-moar 21cfe2: OUTPUT«method Str (Mu $: | is raw) { #`(Method|59787816) ... }␤»
timotimo neat
psch there is a difference between can and lookup, but i don't remember what it was :|
shillo Huh, I thought can returned Bool 12:36
psch m: Int.^can("Str").perl.say
camelia rakudo-moar 21cfe2: OUTPUT«(method Str (Mu $: | is raw) { #`(Method|53565960) ... }, method Str (Mu $: | is raw) { #`(Method|53019624) ... })␤»
psch ah, so lookup gets the proto and can the candidates..?
shillo lookup seems to return not-a-list 12:37
yah
12:37 molaf joined
psch m: Int.^lookup("Str").onlystar.say 12:37
camelia rakudo-moar 21cfe2: OUTPUT«True␤»
shillo and is find_method useful for normal work, or is that a low-level thing?
psch m: Int.^find_method("Str").onlystar.say
camelia rakudo-moar 21cfe2: OUTPUT«True␤»
jnthn Depends what your normal work is ;)
moritz shillo: both
m: Int.^lookup("Str").^name
camelia ( no output )
moritz m: say Int.^lookup("Str").^name 12:38
camelia rakudo-moar 21cfe2: OUTPUT«Method␤»
shillo jnthn: :)
jnthn find_method gives you back something you can invoke
It may not be the actual declared Method object in the class/role
shillo You mean, it'll convert what it finds into something invokable if it weren't already?
jnthn No
In a bog standard class you're not likely to see a difference 12:39
shillo yeah, I am interested in the other case specifically.
jnthn But if you were using something like OO::Monitors, which enforces mutual exclusion on the methods, then find_method will return something that does the lock acquire/release and calls the method.
Whereas lookup always gives you the method object that was declared in the class
12:40 ribasushi joined
jnthn So, find_method if you just want to delay or otherwise mess with invocation, lookup if you're introspecting, is a decent rule 12:40
shillo Thanks! Yeah, that helps. (and I want lookup, in that case
(or possibly can, not sure if I want to actually introspect the prototype)
12:41 pmurias_ joined 12:42 colomon left
shillo Just for the reference, this is what I'm doing: sub sample(Foo $x, Bar $t, Foo :$y, Bar :$z) { ... } <-- client method 12:43
class Config does Inject { multi method ASK(Foo) { FooImpl.new } multi method ASK(Bar) { BarImpl.new } } <--- provide implementations for the roles
my $c = Config.new; $c.call(&sample); <-- autofills everything magically 12:44
Works great, but $c.call(Klass.^lookup('sample')) is kind of ugly
12:44 pmurias left
moritz $c.call(Klass, 'sample') 12:45
less ugly 12:46
jnthn Why not just thunkit? $c.call({ Klass.sample })
*thunk it
shillo Because .call introspects its first argument, thunk loses everything
huf Klass always makes me think of the Klan...
moritz it's the python way of working around reservered words 12:47
shillo And Scheme way :)
huf and java
shillo And C++ way
huf it's the universal way to work around the reserved word "class" :)
in a sense, it's the only class us plebs can acquire :D
shillo Well, schemers tend to use cls instead
psch i've seen clazz more often in java actually
huf psch: that seems somewhat speakeasy-ish :) 12:48
jazz on clarinet or something
psch heh
shillo I wish for infix macros. So I can say Klass->sample($c, args...) 12:49
(on a second thought, it won't be -> ... )
12:50 dvinciguerra_ joined
shillo ... I'll probably end up with $c.call_method(Klass, 'method', ...), BTW 12:52
12:52 mcmillhj joined 12:53 zakharyas left
psch m: sub infix:['>~>'] { $^a.^find_method($^b) }; class A { method foo { "foo" } }; class B { method invoke($a, $b) { $a.$b() } }; say invoke B: A, (A >~> "foo") 12:53
camelia rakudo-moar c07b2d: OUTPUT«foo␤»
shillo Nice :) I'll think about it :) 12:55
psch well, if you can you probably want to avoid declaring infixes
they're somewhat slow during parse
12:56 cdg left
psch also, i personally don't actually see any improvement in readibility with that explicit example :| 12:56
mst shillo: note that masak was poking towards macros
psch probably due to badly chosen operator
shillo psch :) Hence 'I'll think about it' :) 12:58
... and I think I really want find_method for my usecase. I want to both introspect the arguments and to invoke. 12:59
timotimo yeah, sounds like the right tool for the job
though, do you really need to pass the class along, too?
in what case is the class different to the wrapped things' .WHAT?
shillo Just for convenience, it's easier to do $c.run(Cls, 'method') than $c.call(Cls.^find_method('method')) 13:00
... I plan to have both options in the API, anyway.
... and also $c.make(Cls, constructor args)
timotimo oh, $c doesn't have Cls somewhere in its belly, eh? 13:01
shillo ... with $c filling the unspecified args.
No, it's just a configuration object.
timotimo if you don't mind my sillyness, how about methodname => ClassObject? :)
shillo It gets ASKed for impls
I don't actually need the class at all.
timotimo because => will auto-quote the thing on its LHS :3 13:02
shillo Just a pointer to the callable to introspect and invoke. See above, passing the class is just for conventience, so you don't have to write 'find_method' on each callsite.
timotimo i understand that; what i was missing was that there's no $c.set_class_to_use(Cls) or anything
shillo Hmm, methodname => class... er, it's just the opposite order from the normal usage, though 13:03
there shouldn't be.
$c should be able to call stuff itself, as it fills the ASKs
timotimo right
what's an ASK again?
shillo Converts a role into its implementation. 13:04
13:04 melezhik joined
shillo This is basically Inversiof of Control pattern in a way that's not a giant blobby framework. 13:04
timotimo oh, ok
shillo So you'd write class Config does Inject { multi method ASK(FooRole) { $.make(FooImpl, size => 500) } multi method ASK(Bla) { ... } } 13:06
... and class FooImpl { method new(Bla $b, :size){} }
... with Bla being autofilled by ASKing the config 13:07
timotimo mhm
shillo ... not sure I can overload the new() like this, but I'll come ask when I have to :)
timotimo i'd probably have to see it to understand it :)
new is a 100% ordinary method
nothing special about it whatsoever
shillo pastee.org/u7a66
Here's the current paste 13:08
Outputs args: FooImpl<80076656> BarImpl<80076688> FooImpl<80076720> BarImpl<80076752> args: FooImplX<80076784> BarImpl<80076816> FooImpl<80076848> BarImpl<80076880>
13:08 colomon joined
shillo Ignore the proto method GET, I renamed into ASK at some point, but didn't see the proto 13:09
dalek c: c2f49be | (Wenzel P. P. Peppmeyer)++ | doc/Language/traps.pod6:
add quoting to traps
13:10
13:11 Actualeyes joined 13:14 ribasushi left 13:16 MasterDukeMobile joined
MasterDukeMobile timotimo: benchable should be running now 13:17
timotimo ooooh?
how does it make sure the results aren't noisy up the wazzoo? 13:18
MasterDukeMobile there are still some features to refine, and some to add (e.g., automatic graphing)
[Coke] waves, full of the Mondays.
MasterDukeMobile ha, that's one of the things that needs refining
timotimo sure :) 13:19
benchable: help
benchable timotimo: Like this: benchable: f583f22,110704d my $a = "a" x 2**16;for ^1000 {my $b = $a.chop($_)}
13:19 skids joined
MasterDukeMobile like committable, it also does ranges 13:20
timotimo could it bench all releases since 2015.12 and a current HEAD when no revisions are supplied?
MasterDukeMobile we've talked about what would make a good default behavior
that's a good idea 13:21
timotimo what were the other suggestions? 13:22
MasterDukeMobile do a sampling, kind of like you suggested, and then find inflection points and "zoom in" on them 13:23
timotimo that'd be fantastic
MasterDukeMobile I.e., when two commits have a large difference, do more sampling in-between them 13:24
I have very limited internet access right now, but if you have any ideas please tell AlexDaniel or myself, or file github issues/PRs 13:27
timotimo cool! 13:28
MasterDukeMobile bench: source
benchable MasterDukeMobile: github.com/perl6/bisectbot
13:28 ribasushi joined, cdg joined 13:31 huggable left 13:32 MasterDukeMobile left
shillo Hmm, let me test it with something (hopefully) light 13:33
bench: 1+1
benchable shillo: Like this: benchable: f583f22,110704d my $a = "a" x 2**16;for ^1000 {my $b = $a.chop($_)}
shillo benchable: f583f22,110704d 1+1 13:34
benchable shillo: |«f583f22»:0.0894␤|«110704d»:0.0894
Frameless benchable: 2016.04,2016.07 my $x = "foo".chop(10) 13:35
benchable Frameless: |«2016.04»:0.0946␤|«2016.07»:0.0941
Frameless That was surprisingly fast. Does it do just one iteration? 13:36
skids "Software interprets lawyers as damage, and routes around them." Haha, classic Larry.
timotimo yeah, you have to do the iteratings yourself
like in the example benchable gave you
Frameless benchable: 2016.04,2016.07 my $x = "foo".chop(10) for ^100
benchable Frameless: |«2016.04»:0.0980␤|«2016.07»:0.0970
Frameless Oh, right :)
benchable: 2016.04,2016.07 my $x = "foo".chop(10) for ^100000
benchable Frameless: |«2016.04»:0.1991␤|«2016.07»:0.1932
shillo benchable: 2016.01,2016.07 for ^1000 {"/a/b/c/foo.c".IO.basename} 13:37
benchable shillo: |«2016.01»:No build for this commit␤|«2016.07»:0.5594
shillo benchable: 2016.04,2016.07 for ^1000 {"/a/b/c/foo.c".IO.basename}
benchable shillo: |«2016.04»:0.8168␤|«2016.07»:0.5587
13:37 AlexDaniel joined
shillo I recall .basename being aggravatingly slow for traversing filesystems. 2x is an improvement. 13:37
Frameless benchable: 2016.04,2016.07 my $x = "foo".samemark("z") for ^100000 13:38
oops
shillo (as in, dominating traversal)
timotimo well, if you use /a/b/c/foo.c, you're not going to be traversing the filesystem :)
AlexDaniel timotimo: it does 5 iterations. Right now it kinda expects that you will be doing it across many-many commits, so
timotimo: at this point benchable is not very mature :)
shillo timotimo: Heh :) I just used that for the purpose of the benchmark 13:39
timotimo OK :)
AlexDaniel also, it is not async, so I guess that it will ping out soon
timotimo oh, that's a good point ...
AlexDaniel bisectable is doing great though. This bisect log is just awesome 13:40
bisectable AlexDaniel: On both starting points the exit code is 1 and the output is identical as well
AlexDaniel: gist.github.com/3bd7874edf0c8852be...1ad16f9d01
AlexDaniel I should've done it earlier
haha, it thought that I was talking to it
timotimo hahaha 13:41
shillo :)
timotimo adorable
shillo bisectable is adorable
bisectable shillo: On both starting points the exit code is 1 and the output is identical as well
shillo: Output on both points: ===SORRY!=== Error while compiling /tmp/VG87aUth1q␤Undeclared routines:␤ adorable used at line 1␤ is used at line 1␤
AlexDaniel ah right, the only thing that is missing is colors
moritz kinda proofs the point :-)
13:42 rindolf joined
Frameless AlexDaniel: you can turn that stuff off with RAKUDO_ERROR_COLOR env var 13:42
bisectable: BEGIN { RAKUDO_ERROR_COLOR = 0 }; is adorable 13:43
bisectable Frameless: On both starting points the exit code is 1 and the output is identical as well
Frameless: Output on both points: ===SORRY!=== Error while compiling /tmp/T4XNi9YAnc␤Preceding context expects a term, but found infix = instead␤at /tmp/T4XNi9YAnc:1␤------> BEGIN { RAKUDO_ERROR_COLOR =⏏ 0 }; is adorable
Frameless bisectable: BEGIN { %*ENV<RAKUDO_ERROR_COLOR> = 0 }; is adorable
bisectable Frameless: On both starting points the exit code is 1 and the output is identical as well
Frameless: Output on both points: ===SORRY!=== Error while compiling /tmp/P346kCguBa␤Undeclared routines:␤ adorable used at line 1␤ is used at line 1␤
13:48 ambs joined 13:49 benchable joined
benchable Frameless: |«2016.04»:127.8726␤|«2016.07»:0.6181 13:50
Frameless Talk about getting the job done no matter what :P
I actually have a thingie to make things non-blocking: metacpan.org/release/POE-Component...apper-Base 13:52
13:53 user9 left, user9 joined
AlexDaniel Frameless: you'd better have a thing for Perl 6 irc bots :) 13:55
Frameless Yeah, "soon" :)
AlexDaniel Frameless: by the way, do you know if any of huggable problems became less prevalent after several rakudo releases? 13:56
Frameless Well, there's really just one problem. She doesn't parse IRC messages correctly when they're spread across two sends. So when that happens, she craps out basically. 13:58
13:58 shillo left, ilbot3 left, ilbot3 joined
Frameless And the leak stuff. I've not checked that (nor do I have 100% guarantee she was leaking in the first place; it was just a quick observation based on `top`) 13:58
(FWIW, the message parsing is already fixed in the IRC::Client rewrite) 14:03
[Coke] oh, crap, I had time this weekend to work on the new profiler, and completely flaked! aigh. 14:07
14:08 TreyHarr1 left
timotimo oh well :) 14:11
14:19 canopus left, cdg left, cdg joined 14:20 ptolemarch joined, cdg left 14:24 canopus joined 14:30 TreyHarr1 joined 14:33 RabidGravy left 14:36 perigrin joined, melezhik_ joined
melezhik_ Hi! Does anybody know a perl6 module for easy and fast development of command line utilities? 14:38
like handling command line parameters, etc ...
14:38 Tonik joined
timotimo no module needed; read up on "multi sub MAIN" 14:38
14:39 TreyHarr1 left
Frameless docs.perl6.org/language/functions#...entry-MAIN 14:39
melezhik_ yeah, I just wanted to say that sub MAIN is cool, but seems not enough for me ...
Frameless melezhik_: there seem to be a couple of related modules in the Ecosystem: modules.perl6.org/#q=GetOpt 14:40
melezhik_ or I have not read a docs on it, too much (:
Frameless melezhik_: and if you find MAIN lacking in what you think should be part of its features, it may be worth reporting it as a feature request.
14:41 huggable joined
Frameless huggable: rakudobug 14:41
melezhik_ Frameless, will look at GetOpt pack ...
huggable Frameless, To report a bug, email detailed description and any test cases to [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs
melezhik_ thanks
ugexe you can mutate @*ARGS before MAIN if you want to use most of MAIN features but only tweak a few things
14:42 jonas2 left
melezhik_ ugexe, "you can mutate @*ARGS before MAIN" this is what I am looking for ... 14:42
ugexe can you give an example of something you are trying to do? 14:43
melezhik_ ugexe, sure. This is the boilerplate of my future module, API might change, but this is the draft of what I am looking for - github.com/melezhik/whatsup#wu-api 14:45
14:46 Guest18609 is now known as ponbiki
ugexe looks pretty basic, MAIN should be able to handle all of that as-is 14:46
timotimo ugexe: no. MAIN expects all named arguments before the first positional argument 14:49
14:51 perigrin left
dalek c: 9188d22 | (Wenzel P. P. Peppmeyer)++ | doc/Language/functions.pod6:
tell that @ARGS can be mutated
14:51
hoelzro o/ #perl6 14:54
melezhik_ anybody knows who to mutate @ARGS before gets parsed by MAIN?
s{who}{how} 14:55
14:55 perigrin joined, perigrin left, TreyHarr1 joined 14:56 holyghost joined
Frameless m: BEGIN { @*ARGS = "meow" }; sub MAIN($x) { say $x } 14:56
camelia rakudo-moar 664af9: OUTPUT«meow␤»
hoelzro melezhik_: you should be able to do it in the part of your script not contained in any function 14:57
Frameless m: @*ARGS = "meow";sub MAIN($x) { say $x }
camelia rakudo-moar 664af9: OUTPUT«meow␤»
hoelzro m: @*ARGS = <foo bar>; sub MAIN(*@args) { .say for @args }
camelia rakudo-moar 664af9: OUTPUT«foo␤bar␤»
timotimo Frameless: no need for BEGIN. in fact, i'd say it's wrong.
perlpilot timotimo: wrong? 14:58
timotimo yeah. if your code gets precompiled, for example.
perlpilot timotimo: I'd say that depends on what you're really trying to achieve by manipulating @*ARGS before MAIN gets a shot at it 14:59
melezhik_ hoelrzo, "you should be able to do it in the part of your script not contained in any function" -
that's ok
perlpilot melezhik_: it could also be slightly confusing :) 15:00
15:00 pmurias_ is now known as pmurias
perlpilot m: sub MAIN(*@a) { say @a }; #`( ... ) @*ARGS = <a b c> 15:01
camelia rakudo-moar 664af9: OUTPUT«[a b c]␤»
pmurias hoelzro: \o 15:02
hoelzro o/ pmurias 15:03
15:03 melezhik_ left
pmurias feels silly after profiling uncovered that a compiling a simple file could me made twice as fast by removing debugging leftovers... 15:04
15:04 RabidGravy joined 15:09 khw joined
konobi pmurias: yeah, a newer chrome probably 15:11
15:11 marcel_ joined
pmurias konobi: is there a difference between a flame graph and a flame chart? 15:14
15:16 xinming joined 15:31 cdg joined, cdg left 15:35 kid51 left
pmurias nqp-js blog post: blogs.perl.org/users/pawel_murias/...qp-js.html 15:48
15:49 perigrin joined
[Coke] pmurias++ 15:52
15:55 abraxxa left
nine For better link detection: blogs.perl.org/users/pawel_murias/2...qp-js.html 15:57
15:57 cdg joined
nine pmurias: typo: "For know I implemented" 15:58
16:04 decent joined
pmurias afk& 16:06
konobi pmurias: nope... just naming
16:06 pmurias left
marcel_ m: Buf.new((my int $i = 10) +& 0xFF) 16:22
camelia ( no output )
marcel_ m: say Buf.new((my int $i = 10) +& 0xFF)
camelia rakudo-moar 664af9: OUTPUT«Buf:0x<0a>␤»
16:22 marcel_ is now known as MARTIMM 16:24 domidumont left 16:28 captain-adequate joined 16:34 sufrostico left 16:35 sufrostico joined, sno left
Frameless m: say $*SCHEDULER.max_threads 16:36
camelia rakudo-moar 664af9: OUTPUT«16␤»
dalek c: b341e44 | (Steve Mynott)++ | bin/p6doc:
remove unused code
Frameless Is this the maximum concurrent threads my program can run?
kinda LTA on my box: gist.github.com/zoffixznet/2ded8f6...8c242550b9 16:37
timotimo it's the maximum amount of threads that particular scheduler will start to schedule tasks on
when you create a Thread object, that'll be a stand-alone thread that doesn't factor into that number in any way
when you build another ThreadPoolScheduler, you get an entirely different set of threads, also
Frameless I guess what I'm trying to figure out if I—as a user—run a Perl 6 program on that box, I'm only utilizing 66% of available CPU time, right? 16:38
timotimo yeah 16:39
Frameless :(
I wonder if the make spectest is affected by this
timotimo no
almost none of our tests actually do any multithreading stuff at all 16:40
nine Frameless: make starts processes, not threads
timotimo well, make itself isn't important for the spectest parallelism
gfldex also, expect your problems to be memory bound
timotimo right, you'll get at the very least 4 megabytes of ram nommed for a nursery per thread you start
when it reaches the first GC, there'll be an additional 4 megabytes 16:41
Frameless gfldex: what do you mean? The speed of RAM?
16:41 lambd0x joined
lambd0x Hi folks! 16:42
Frameless I have 90GB on that box
hoelzro timotimo: what about all of the S17 tests?
gfldex yes, I got 2 boxed that 2 and 4 cores but both got dual channel ddr3. There is very little difference between them
timotimo they will use a bit of multithreading, but not nearly as many as zoffix has cores available
gfldex in speed to handle .pod that is
hoelzro ah, I see what you mean 16:43
gfldex if you actually do computations instead of just shifting strings around, you may get more out of it ofc
lambd0x timotimo o/ 16:44
timotimo heyo
16:44 TreyHarr1 left 16:45 zacts joined
lambd0x lads is there some encryption implementation for perl6? aes, rsa... 16:49
Frameless lambd0x: have you checked modules.perl6.org/ ? 16:50
timotimo github.com/sergot/openssl - this might help
16:50 ChristopherBotto joined
Frameless You can also use most modules from metacpan.org/ too, with :from<Perl5> (Inline::Perl5 module) 16:51
timotimo that's right
and stuff from python with Inline::Python, though the documentation for Inline::Python isn't as good
Frameless star: use Test::More:from<Perl5>; ok 42 16:52
camelia star-m 2016.04: OUTPUT«===SORRY!===␤Please install Inline::Perl5 for Perl 5 support. ␤»
Frameless aww
lambd0x Frameless: Will try using the perl5 ciphers then 16:53
ChristopherBotto Hello perl6 o/
Frameless \o
lambd0x thanks everyone
\o/
Frameless it works from command line: :) gist.github.com/zoffixznet/39fd17c...2f5422febf 16:54
16:54 TreyHarr1 joined
timotimo hax!! 16:54
ChristopherBotto Is there a simple way to increase the number of max threads in $*SCHEDULER ? I tried for @array.race( batch => 1, degree => 64) the other day and it only used 16 threads. 16:55
hoelzro ChristopherBotto: you can set RAKUDO_MAX_THREADS in your environment 16:56
or you can create your own $*SCHEDULER
timotimo you can just have my $*SCHEDULER = ThreadPoolScheduler.new(...), but i think $*SCHEDULER.max_threads might actually be changable?
16:56 wamba left
hoelzro oh, is it? 16:56
timotimo m: $*SCHEDULER.attributes>>.name.say 16:57
camelia rakudo-moar 18455a: OUTPUT«Method 'attributes' not found for invocant of class 'ThreadPoolScheduler'␤ in block <unit> at <tmp> line 1␤␤»
16:57 domidumont joined
timotimo m: $*SCHEDULER.^attributes>>.name.say 16:57
camelia rakudo-moar 18455a: OUTPUT«($!queue $!thread_start_semaphore $!loads $!threads_started $!counts_lock $!need_io_thread $!initial_threads $!max_threads $!started_any &!uncaught_handler)␤»
timotimo m: $*SCHEDULER.max_threads = 9999
camelia rakudo-moar 18455a: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at <tmp> line 1␤␤»
timotimo ah, no.
gfldex PROCESS::<$SCHEDULER> = ThreadPoolScheduler.new(initial_threads => 0, max_threads => $threads);
that works 16:58
hoelzro I think just my $*SCHEDULER = ThreadPoolScheduler.new(...) should do it, yeah?
ChristopherBotto m: $*SCHEDULER = ThreadPoolScheduler.new( max_threads => 64);
camelia rakudo-moar 18455a: OUTPUT«Cannot modify an immutable ThreadPoolScheduler␤ in block <unit> at <tmp> line 1␤␤»
16:58 wamba joined
ChristopherBotto m: my $*SCHEDULER = ThreadPoolScheduler.new( max_threads => 64); 16:59
hoelzro ChristopherBotto: throw a 'my' in front of that
camelia ( no output )
gfldex did you check if the number of used threads actually changed?
ChristopherBotto Wow! So we can create a "local" copy of $*SCHEDULER ? 17:00
gfldex i can't remember the details but I tried quite a few variations and none but the last worked
ChristopherBotto hoelzro, timotimo, and gfldex: Thanks! 17:04
17:04 kurahaupo joined 17:05 parisba left, Some-body_ joined, pnu_ joined, solarbunny left 17:06 japanoise_ joined, geekosaur left, hobbs left, Some-body_ is now known as DarthGandalf 17:07 ilmari joined 17:08 PotatoGim joined 17:09 kurahaupo left 17:10 mrsolo joined 17:11 [particle] joined 17:13 hobbs joined, hobbs left, hobbs joined, notbenh_ joined, captain-adequate left, gabiruh joined 17:14 zacts left, chee joined 17:16 geekosaur joined, mindos joined
Xliff Are there any graphical debuggers for perl? Or can perl6-gdb-m be used to inspect perl6 symbols? 17:17
17:18 tomboy64 joined, firstdayonthejob joined, olinkl joined, drforr1 joined 17:19 Lucas_One joined 17:20 timotimo joined, parisba joined, mithaldu_ joined, dylanwh_ joined, ssm joined, kurahaupo joined, kurahaupo left 17:23 hobbs left
ChristopherBotto hoelzro, timotimo, and gfldex: Oh, in should max_threads be max-threads to be consistent with other built-in methods? I remember a change from done_testing to done-testing a while back. (looking at github.com/rakudo/rakudo/blob/nom/...eduler.pm) 17:23
timotimo oh, i got kicked off of the server, it seems like
gfldex ChristopherBotto: it should 17:24
timotimo methods vs attributes, though?
mayhaps?
i dunno
gfldex there is no spec test for max_threads
ChristopherBotto gfldex: So I can change it to max-threads without causing problems? 17:25
17:25 petercommand joined
gfldex you can add max-threads as an alias without breaking existing code 17:25
timotimo Xliff: we have beginnings of a python plugin for gdb to ease using perl6-gdb-m; it could learn a whole lot more stuff
Frameless ChristopherBotto: generally low-level stuff uses underscores. Like ^find_method ^add_method etc
Xliff timotimo: Thanks 17:26
ChristopherBotto Frameless: Why the difference?
timotimo low_level, mid-level, high‾level
Frameless ChristopherBotto: to indicate it's low-level stuff
And you shouldn't be using it willy-nilly 17:27
17:27 hobbs joined 17:28 kid51 joined
ChristopherBotto Frameless: Oh. In that case, I should probably discard my current edit of github.com/perl6/doc/edit/master/d...ables.pod6 that would suggest changing max_threads if one needs more cores? 17:30
17:31 dha joined
Frameless ChristopherBotto: willy-nilly doesn't mean ever :D 17:32
17:32 spider-mario joined, acrussell joined
Frameless If that's the way to change the max threads, sure it should be documented. 17:32
Xliff timotimo: Are there any docs for that python plugin? 17:34
All I am looking for is breakpoints into the perl script and some introspection.
dalek osystem: 0d68a2c | (Marcel Timmerman)++ | META.list:
new module Semaphore::ReadersWriters
17:35
osystem: e949b15 | Altai-man++ | META.list:
Merge pull request #227 from perl6/MARTIMM-patch-1

new module Semaphore::ReadersWriters
timotimo Xliff: it has a bunch of comments in the source code; it's in moarvm's repository under tools/moar-gdb.py 17:36
Xliff timotimo, thanks. 17:38
timotimo if you know a bit of python, you'll likely be able to improve it :) 17:42
sad thing is, it's slow as molasses
mostly refering to the "moar-heap" command
gfldex ChristopherBotto: a proper fix would be to teach rakudo to respect %*ENV<PERL6-MAX-THREADS> 17:45
Xliff If anyone has some free time and could help me with a weird issue, I'd appreciate it. 17:47
Just PM me.
For some strange reason, nqp::bindattr and nativecast sometimes act as a no-op when they should be doing something and I cannot for the life of me figure it out. 17:48
It could be that I am trying to work with a type object, but I thought I had prevented that outcome by doing a $obj.defined check, which passes. 17:49
timotimo can you set MVM_SPESH_DISABLE to yesplease?
Xliff Yes. Did that. Same result. 17:50
timotimo OK
can you nopaste your code?
Xliff No. Project is too large.
And every time I try to pair it down, I can't reproduce the problem.
Code is here: github.com/Xliff/p6-XML-LibXML/ 17:51
Branch 07dtd
timotimo ugh
that gigantic thing :(
Xliff Heh. Yeah.
MARTIMM m: say "az", *.succ ... "bb"
camelia rakudo-moar 18455a: OUTPUT«(az ba bb)␤»
timotimo sorry, before i'm even read into the code it'll be dinner time here and i'll have lost all my thoughts on the matter 17:52
Xliff timotimo, No problem.
I'm at wits end, now.
17:53 dvinciguerra_ left
timotimo you can put a very rarely used nqp op near the code where it happens and then put a breakpoint into interp.c where that op gets handled 17:53
that'll let you single-step through the moar-level code
17:53 travis-ci joined
travis-ci Doc build failed. Brian Duggan 'done testing' 17:53
travis-ci.org/bduggan/doc/builds/145605107 github.com/bduggan/doc/compare/7dc...182cc90008
17:53 travis-ci left
Xliff m: use NativeCall; class A is repr('CStruct') { has int32 $.a; has int64 $.b; setA($a) { $!a = $a } }; class B is A is repr('CStruct') { }; my $a = A.new.setA(64); my $b = nativecast(B, $a); $b.setA(48); say $a.a; 17:58
camelia rakudo-moar 18455a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared. Did you mean '$!a'?␤at <tmp>:1␤------> 3') { has int32 $.a; has int64 $.b; setA(7⏏5$a) { $!a = $a } }; class B is A is repr␤»
Xliff m: use NativeCall; class A is repr('CStruct') { has int32 $.a; has int64 $.b; method setA($a) { $!a = $a } }; class B is A is repr('CStruct') { }; my $a = A.new.setA(64); my $b = nativecast(B, $a); $b.setA(48); say $a.a;
camelia rakudo-moar 18455a: OUTPUT«Native call expected return type with CPointer, CStruct, CArray, or VMArray representation, but got a P6opaque (Int)␤ in sub nativecast at /home/camelia/rakudo-m-inst-2/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 406…»
[Coke] docs, make test; we have a nice failure if URI::Escape isn't installed, but a horrible one if File::Temp is missing. 17:59
17:59 lambd0x left 18:00 cdg left
ChristopherBotto Should the "RAKUDO_" variables listed at docs.perl6.org/programs/00-running.html really be "PERL6_" variables? For example, it isn't immediately obvious to me why there should be RAKUDO_MAX_THREADS instead of PERL6_MAX_THREADS. 18:00
hoelzro RAKUDO_ tends to refer to implementation details; they sometimes are used as prototypes for language details, though 18:02
arnsholt m: use NativeCall; class A is repr('CStruct') { has int32 $.a; has int64 $.b; method setA($a) { $!a = $a } }; class B is A is repr('CStruct') { }; my $a = A.new; $a.setA(64); say $a.a; my $b = nativecast(B, $a); $b.setA(48); say $a.a; # Probably what you wanted, Xliff 18:03
camelia rakudo-moar 18455a: OUTPUT«64␤48␤»
18:04 solarbunny joined, ChoHag joined, domidumont left
[Coke] RAKUDO_ == "not spec" 18:09
18:09 dvinciguerra_ joined
dalek c: b676fce | (Jan-Olof Hendig)++ | doc/Type/Bool.pod6:
Added docs for methods 'succ', 'pred' and 'enums' in Bool
18:14
perlpilot ChristopherBotto: Is there some place it could be better documented such that it would be more obvious to you why it's RAKUDO_MAX_THREADS instead of PERL6_MAX_THREADS?
18:14 pecastro joined 18:16 riatre joined 18:17 hobbs left 18:18 nowan joined
gfldex ChristopherBotto: one could argue that one an install more then Perl 6 compiler (in a future/parallel universe) so the distinction would make sense. In fact any Perl 6 compiler should respect PERL6_* but only Rakudo should expect that _and_ RAKUDO_* while giving the latter priority. 18:18
s/one an/one can/ 18:19
18:19 lnrdo joined 18:20 hobbs joined 18:21 AlexDaniel left, labster joined 18:25 Tonik left 18:31 mohae joined, sno joined, Peter_R joined
perlpilot gfldex: Assuming @Larry elevates any PERL6_* vars to the level of "language spec" 18:31
18:33 addison joined 18:36 dwarring joined 18:38 labster left, rindolf left 18:41 huggable left, Cabanossi left, domidumont joined 18:44 Cabanossi joined 18:48 labster joined 18:50 girafe joined 18:51 rindolf joined 18:53 cpage_ joined 18:54 FROGGS joined 18:57 FROGGS left 18:58 FROGGS joined, kid51 left
gfldex design.perl6.org/S26.html is back for your viewing pleasure 18:59
19:00 dwarring left
ChristopherBotto hoelzro, timotimo, gfldex, Frameless, and perlpilot: Proposed documentation update as a result of our discussion: github.com/perl6/doc/pull/719 19:01
19:01 mcmillhj left
stmuk pl6anet.org/drop/rakudo-star-2016.07-RC1.tar.gz 19:02
timotimo ChristopherBotto: seems a bit misleading to say hyper operators use multiple threads; they don't do that yet 19:04
Frameless ChristopherBotto: the last line is either missing opening parenthesis or has an extra closing one :)
perlpilot ChristopherBotto: you might mention that they need to set the env var prior to the ThreadPoolScheduler being built. 19:05
19:05 domidumont left
perlpilot (which is usually prior to running the program :) 19:05
RabidGravy makes a pre-emptive fix for www.kb.cert.org/vuls/id/797896 in HTTP::UserAgent (seeing as it's been fixed in LWP::UserAgent for fifteen years ;-) 19:06
dalek sectbot: 25550c3 | MasterDuke17++ | benchable.pl:
Make the title of the graph the complete query
19:07 pecastro left
timotimo does RAKUDO_MAX_THREADS actually cause the max_threads to be set? 19:08
Frameless It does change $*SCHEDULER.max_threads, yeah
timotimo good 19:10
19:12 pecastro joined
perlpilot m: say $*SCHEDULER.max_threads; %*ENV<RAKUDO_MAX_THREADS> = 57; say $*SCHEDULER.max_threads; 19:13
camelia rakudo-moar 18455a: OUTPUT«16␤16␤»
perlpilot m: %*ENV<RAKUDO_MAX_THREADS> = 57; say $*SCHEDULER.max_threads;
camelia rakudo-moar 18455a: OUTPUT«57␤»
timotimo a lot of dynamic vars are set up the first time they are used 19:14
perlpilot ChristopherBotto: ^^^^ that's the situation I was suggesting you warn of.
19:14 setty1 joined 19:15 mcmillhj joined
Xliff arnsholt: Probably. LOL! Thanks. 19:17
At any rate, I've finally managed to get this segfault issue boiled down to a simple test case.
gisting it now.
19:17 pecastro left 19:18 pecastro joined
Xliff m: gist.github.com/Xliff/5d9fe7c62af7...49bcb521ce 19:18
camelia rakudo-moar 18455a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:35␤------> 3<BOL>7⏏5<EOL>␤»
Xliff m: gist.github.com/Xliff/5d9fe7c62af7...49bcb521ce
camelia rakudo-moar 18455a: OUTPUT«(signal SEGV)»
Xliff Yup!
This is using nqp::bindattr
timotimo um 19:19
wtf
why are you expecting Pointer.new to be decontable?
Xliff I figure even if what I am trying to do is wrong, it shouldn't segfault.
timotimo m: use NativeCall; use nqp; my $a = Pointer.new(); nqp::decont($a);
camelia ( no output )
timotimo m: use NativeCall; use nqp; my $a = Pointer.new(); say nqp::decont($a);
camelia rakudo-moar 18455a: OUTPUT«NativeCall::Types::Pointer<NULL>␤»
19:19 brrt joined
timotimo ... 19:20
Xliff timotimo: This is a barebones test case that I managed to coble together. It basically represents some of the things we are trying to do with p6-XML::LibXML
Passing around pointers is one of the things we need to do.
timotimo let me give it a little go
Xliff kk
timotimo but first i'll have to build some stuff at the latest revisions
Xliff No rush.
19:21 araujo_ joined
timotimo fwiw, using Pointers is a sure way to be able to segfault 19:21
Xliff If there is a better pure perl6 solution that doesn't involve the use of nativecast, then great
timotimo: Yes. I know. However binding to an attribute should be safe, yes?
As long as a bad dereference is not made behind the scenes? 19:22
timotimo getA seems to not be used at all?
Xliff No. Needed a method and didn't need it after all before I got a usable segv to represent the problem.
19:22 pecastro left
timotimo so you can still golf it further :) 19:23
19:23 pecastro joined 19:24 araujo left
timotimo m: gist.github.com/timo/51c0a4660a18b...fa84387a3b 19:25
camelia rakudo-moar 18455a: OUTPUT«(signal SEGV)»
timotimo mhm mhm
Xliff timotimo: Updated to show use of getA() and how we are currently working around the segv
m: gist.github.com/Xliff/5d9fe7c62af7...49bcb521ce # Updated 19:26
camelia rakudo-moar 18455a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3https:7⏏5//gist.github.com/Xliff/5d9fe7c62af79114␤ expecting any of:␤ colon pair␤»
Xliff :s
timotimo i don't see a reason to use nativecast there at all
Xliff If we don't use nativecast() to cast back to A, the segfault occurs. 19:27
This should work since "B is A" and both are repr('CStruct')
ChristopherBotto hoelzro, timotimo, gfldex, Frameless, and perlpilot: Updated my previous pull request. Thanks for the feedback (see github.com/perl6/doc/pull/719)
Xliff However, lately I've been worried that's not been the case in certain edge cases. 19:28
timotimo cool, thanks for contributing
19:29 pecastro left
timotimo Xliff: you do know you can bindattr to a superclass? 19:29
Xliff timotimo: I was hoping there would be a way. Could you show me how to do that, please? 19:30
arnsholt timotimo: You know, that's probably the problem! 19:31
nine Xliff: you do have to pass the type to bindattr. So just pass in the superclass
arnsholt Quoth nqp/docs/ops.markdown: "Binds `$new_value` to the attribute of name `$attributename` of object `$obj`, where the attribute was declared in type `$type`." 19:32
Xliff Will try that.
arnsholt So the class you pass in to bindattr has to be the class where the attribute is *declared*
Making this work in a generalized setting (like Xliff probably wants?) might be tricky
19:32 cdg joined
Xliff Still get segfault 19:33
Acually, before I hat setObjAttr() most of these were direct calls to bindattr. And we did try using the superclass, but ran into the segfault issue. 19:34
Hence the nativecast() to the actual superclass type.
timotimo we run try_get_slot on an object that isn't just not concrete, it's null
i suppose try_get_slot would be allowed to return failure in that case, instead of crashing 19:35
arnsholt The segfault is definitely LTA, but it looks like an error in application code, not a Moar-bug
Xliff arnsholt: gist.github.com/Xliff/5d9fe7c62af7...49bcb521ce
timotimo that's weird. how does a null pointer get into the name_map? 19:36
Xliff Let me actually stick something into P. This occurs even when the pointer is NOT null.
doing "$p = nativecast(Pointer, $a)" still causes crash. 19:38
arnsholt: So why is it that I can cast to the superclass and bindattr works, but when I use a subclass, it segfaults? 19:39
arnsholt Xliff: Works if you actually use the :$what named param
Xliff It crashes here.
timotimo it definitely does die in setObjAttr 19:40
19:40 darutoko left
timotimo what i get with a trivial fix is: 19:40
Can not bind non-existent attribute '$!four'
in sub setObjAttr at This%20will%20crash%20rakudo. line 21
Xliff Weird... now it does.
m: my class A { }; my $p = A; say $p.defined; 19:41
camelia rakudo-moar 18455a: OUTPUT«False␤»
Xliff arnsholt: The trick is determining when the named parameter is used.
I may just have to use a multi.
arnsholt I just made it :$what = $obj.WHAT 19:42
And then always use $what
Xliff Ah.
arnsholt Default values =)
Xliff arnsholt++
19:42 Actualeyes left
Xliff Boo ha. 19:44
And that fixed the issue I was having with the actual test. 19:45
19:45 labster left
Xliff Now all tests are passing. 19:47
timotimo++ && arnsholt++ # Thanks!! 19:48
19:48 brrt left
timotimo i just put a moarvm commit up that prevents the segfault 19:48
19:51 itaipu joined
Xliff Thanks, timotimo++! 19:52
rindolf timotimo++ 19:55
19:56 itaipu left 20:05 labster joined 20:13 TEttinger joined
timotimo but as arnsholt found out, you were violating protocol. still shouldn't segfault :) 20:15
we probably also want a similar commit for P6Opaque
20:16 rindolf left 20:20 rindolf joined 20:21 dha left 20:22 acrussell left, dha joined 20:29 Ven joined
[Coke] Xliff: OOC, why are you using nqp ops? 20:37
(and not straight p6?)
20:39 pecastro joined 20:40 kent\n joined, kent\n left, kent\n joined
Xliff [Coke] - Because sometimes rakudo will say an attribute is immutable, especially when dealing with values returned from C libs. 20:46
20:47 CIAvash left, molaf left 20:48 trnh left
timotimo could try := in those cases? 20:51
20:54 japanoise_ is now known as japanoise 21:03 TEttinger left 21:04 MARTIMM left 21:10 AlexDaniel joined
dalek c: f4843c3 | (Christopher Bottoms)++ | doc/Language/variables.pod6:
How to increase the maximum threads in $*SCHEDULER

Explain the current default limit on hyperoperators and methods.
21:10
c: 1c6b878 | (Christopher Bottoms)++ | doc/Language/variables.pod6:
Update variables.pod6

Updated my previous change to be more accurate.
c: 4a74da2 | (Christopher Bottoms)++ | doc/Language/variables.pod6:
removed trailing whitespace
c: e1f85c5 | ab5tract++ | doc/Language/variables.pod6:
Merge pull request #719 from molecules/patch-3

How to increase the maximum threads in $*SCHEDULER
21:12 mcmillhj left, skids left 21:13 dvinciguerra_ left 21:14 cyphase joined
dalek c: 5f27719 | (Aleks-Daniel Jakimenko-Aleksejev)++ | TODO:
We do not need TODO file anymore

Github issues were created for all TODO items (see #712)
21:15
timotimo waiting for my laptop to un-starve itself... 21:17
21:19 trnh joined, trnh left, trnh joined
Zoffix TimToady++ # good Slashdot AMA. I liked the responses to troll-ish questions :) 21:22
dha needs to read that.
21:25 itaipu joined 21:28 TEttinger joined
lizmat and another Perl 6 weekly hits the Net: p6weekly.wordpress.com/2016/07/18/...as-landed/ 21:30
Zoffix eyes the URL
Already exciting! :)
21:34 _28_ria joined
Zoffix lizmat++ good weekly. And thanks for the spotlight :) 21:34
21:35 Ven left
lizmat Zoffix: pretty sure you earned it :-) 21:38
21:40 Nex6 joined
Nex6 if you want to work with perl6 and linux which distort has update to date packages? 21:40
gfldex Nex6: none
ovibos archlinux has AUR packages for perl6 21:41
AlexDaniel debian testing has up-to-date rakudo
gfldex Package: rakudo (2016.06-1) 21:42
Nex6 tried 'opens use leap' = fail 21:43
AlexDaniel well, that's pretty much up-to-date :)
21:43 freezerburnv joined
Nex6 oddly, the mac package worked 21:43
gfldex Nex6: rakudo got very few dependencies, there is no reason not to build form source
Nex6 "opens use" fails to build 21:44
bin/sh: /root/rakudo-star-2016.04/install/bin/perl6-m: No such file or directory
Makefile:65: recipe for target 'modules-install-m' failed
make: *** [modules-install-m] Error 127
so its either dig in to that or use something with clean packages 21:45
AlexDaniel few dependencies also means that you can add “testing” repo and pull it from there, if you are using debian :)
Nex6 think I will go to debian testing
gfldex AlexDaniel: that can pull in new gcc versions
AlexDaniel gfldex: new gcc version! Great! 21:46
but yeah, gfldex is right of course
gfldex git clone github.com/rakudo/rakudo && cd rakudo && perl Configure.pl --gen-moar --gen-nqp --backends=moar && make all test install
21:47 ptolemarch left
Zoffix mentions github.com/tadzik/rakudobrew 21:47
gfldex Nex6: we got a -RC1 tar ball for Rakudo *: pl6anet.org/drop/rakudo-star-2016.07-RC1.tar.gz 21:48
that will bring some basic modules
konobi .tell pmurias awesome... nice work. I have an NQP conjecture I'd like to run past you
yoleaux konobi: I'll pass your message to pmurias.
21:50 Zoffix left 21:53 FROGGS left
dalek c: bf0e015 | (Jan-Olof Hendig)++ | doc/Type/Map.pod6:
Added docs for Map.Capture
21:54
21:55 cyphase left
Nex6 downloading debian testing iso 21:55
Nex6 will still jack with "OpenSuse" 21:56
parabolize m: my $value; my $count = 0; Proxy.new( FETCH => method {++$count; $value}, STORE => method ($new) {$value = $new} ); $count
camelia rakudo-moar 18455a: OUTPUT«WARNINGS for <tmp>:␤Useless use of $count in sink context (line 1)␤»
parabolize huh? 21:57
21:57 lue joined
parabolize updates rakudo 21:57
21:58 lue is now known as ShimmerFairy
parabolize I was getting 5 in the REPL 21:58
gfldex m: my $value; my $count = 0; Proxy.new( FETCH => method {++$count; $value}, STORE => method ($new) {$value = $new} ); dd $count
camelia rakudo-moar 18455a: OUTPUT«Int $count = 5␤»
geekosaur the repl autoprints values (that's the "p" in "repl")
the bot does not
parabolize oh right 21:59
22:00 cyphase joined
parabolize The FETCH block was run multiple times. I think this was mentioned before but I couldn't find record of it. Is this acceptable behavior or is it another bug involving Proxy? 22:00
Nex6 ok, perl6works on open sure in a half assed way, the unpack folder in /root in if ./perl6 -e 'say "Hello, world!";' it works
gfldex parabolize: that was likely in my advent post, and yes, containers are rather involved 22:01
Nex6 damn auto correct
22:02 itaipu left 22:03 TEttinger left, addison left 22:04 Sgeo joined 22:06 dogbert17 joined
timotimo shouldn't it actually be 2016.06.1? 22:10
instead of 2016.06-1?
the package, i mean
lizmat 2016.07.1 ? 22:11
22:11 dogbert17 left
timotimo sorry. yes. 22:11
22:12 trnh left
timotimo parabolize: it's to be expected. you are not to rely on how often FETCH gets called. there may be optimizations in the future that reduce that, though. 22:13
gfldex timotimo: i believe to have seen a written down rule how the naming works 22:14
timotimo the part after the dash is for distro-owned changes
22:15 mrsolo left 22:16 mrsolo joined 22:19 lucasb_ joined
lucasb_ lizmat: thanks for the weekly 22:20
lizmat lucasb_: you're welcome :)
22:21 spider-mario left
lucasb_ a small correction is that the recently added module Uzu lives on gitlab, not github 22:21
lizmat argh, ok, what is the correct URL ?
lucasb_ I think it is gitlab.com/samcns/uzu 22:22
22:23 frobisher joined, dha left
lizmat lucasb_: thanks and fixed 22:23
22:23 frobisher is now known as dha
lucasb_ thank you :) 22:23
22:24 firstdayonthejob left
parabolize timotimo: its a very strange thing to see when running perl6-debug-m. Also I'm used to using @property in python to debug when and where attributes are used. 22:25
timotimo you mean perl6-gdb-m? 22:27
parabolize I was using perl6-debug-m. but I'm guessing its the same thing in gdb if you actually step through the program 22:30
22:31 rgrinberg left 22:32 MadcapJake left
timotimo huh. i have both of those on my system 22:32
22:33 freezerburnv left
timotimo oh! 22:33
no, of course, perl6-debug-m is our perl6 debugger
epic brainfart
22:33 canopus left 22:35 lucasb_ left 22:36 ChristopherBotto left 22:41 canopus joined 22:44 skids joined 22:45 niko joined, girafe left 22:47 Nex6 left 22:54 TEttinger joined 22:55 canopus left 22:59 parisba is now known as DrParis 23:00 setty1 left 23:01 freezerburnv joined 23:02 canopus joined 23:03 rindolf left 23:10 canopus left 23:18 cyphase left 23:19 snarkyboojum joined 23:20 snarkyboojum left 23:21 canopus joined 23:22 cyphase joined 23:58 dha left