Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2016-10-20

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

All times shown according to UTC.

Time Nick Message
00:29 MasterDuke is travis down?
00:33 MasterDuke just checked and it's still working, just not reporting to the channel it seems
00:36 geekosaur maybe they're finally fixing the irc notifier
00:36 geekosaur (the big problem with the current one: someone forks your repo and enables travis for it without changing the travis.yml. you get all the notifications for their builds as well as your own)
01:25 geekosaur joined #perl6-dev
03:42 cognominal joined #perl6-dev
05:51 RabidGravy joined #perl6-dev
06:26 FROGGS joined #perl6-dev
06:39 [Tux] This is Rakudo version 2016.10-24-g74d0e36 built on MoarVM version 2016.10-15-g715e39a
06:39 [Tux] csv-ip5xs        3.470
06:39 [Tux] test            18.482
06:39 [Tux] test-t           7.512
06:39 [Tux] csv-parser      20.299
06:44 nine 7.5? Now that looks good!
06:49 geekosaur joined #perl6-dev
06:57 FROGGS often I wish I could remember what these numbers mean...
06:57 FROGGS like if it is not called "test" but "p6something" or so... or that there would be comments after the numbers
07:44 pochi joined #perl6-dev
07:45 samcv does anybody know if this is supposed to be possible? `open 'foo' or say "Something happened $!"´
07:49 gfldex $! is only valid in a try block. IIRC there is one implicit try block on file scope level but I have no idea what happens in a module.
07:51 gfldex `or` will coerce a Failure (open should return that as its "undefined value") to Bool what marks the exception as handled.
07:51 FROGGS wont open return Failure?
07:51 gfldex if you want to be sure not to catch nonsense have a CATCH block that matches against X::IO
07:51 samcv ah okay. just wanted to check it wasn't a regression and was the correct functionality
07:51 FROGGS what about the orelse constructs?
07:52 samcv orelse also worked in older rakudo but doesn't work now
07:52 samcv open 'foo' orelse say/die "something happened $!"
07:52 gfldex it should return a Failure if the error is IO based.
07:53 gfldex samcv: orelse is very very loose. You may want to try //.
07:53 FROGGS $ perl6 -e 'open "foo" orelse say "something happened $_"'
07:53 FROGGS something happened (HANDLED) Failed to open file /home/froggs/foo: no such file or directory
07:53 FROGGS samcv: ^^
07:54 FROGGS orelse topicalizes
07:55 gfldex $! should stay untouched tho
07:56 gfldex samcv: you may have spotted a rakudobug
07:56 lizmat nine: 7.5 means we lost .6 since yesterday ?
07:57 samcv $_ works. though $! it seems should work says the documentation. hopefully it's a bug gfldex, as i would like to be able to just do `something or say $!´
07:58 samcv is there a way to get the bot to test on an older rakudo?
07:58 gfldex samcv: please file a bug report. That's one of those cases that will hardly be tested by users.
07:58 samcv ok :) cool. glad to help
07:59 gfldex one may replace or with orelse because it sounds correcterer without checking if there error is still handled properly
08:16 nine lizmat: ooh...indeed, we were at 6.8 yesterday. I've been off by 1
08:27 samcv gfldex, ok i'm logged into rt.perl.org but i can't see how to create a bug report (this is the correct location right?)
08:28 gfldex write a mail to rakudobug@perl.org
08:29 samcv ah ok
09:01 geekosaur joined #perl6-dev
10:01 Zoffix joined #perl6-dev
10:42 brrt left #perl6-dev
11:23 dalek rakudo/nom: 71a01e9 | lizmat++ | src/core/ (2 files):
11:23 dalek rakudo/nom: Introduce Iterator.skip-one
11:23 dalek rakudo/nom:
11:23 dalek rakudo/nom: A method that can be overriden if you're writing an iterator that can
11:23 dalek rakudo/nom: be significantly cheaper when skipping a generated value.  Use case,
11:23 dalek rakudo/nom: the :10nth parameter with Str.match (aka, give me only the 10th match).
11:23 dalek rakudo/nom: By default, it is just a slightly more expensive .pull-one.
11:23 dalek rakudo/nom:
11:23 dalek rakudo/nom: Also use let Iterator.skip-at-least-pull-one use skip-one, as well
11:23 dalek rakudo/nom: as in Rakudo::Internals.SeqSkipNFromIterator .
11:23 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/71a01e956f
11:24 lizmat in benchmarks, this allows Str.match(/./,:10th) to be about 5x as fast
11:31 DrForr Ah, the Nth stuff we were chatting about at OSCON.
11:49 lizmat DrForr: indeed
12:13 AlexDaniel joined #perl6-dev
12:18 ggoebel joined #perl6-dev
12:24 iBakeCake m: MixHash.new-from-pairs( 'a' => -42 ).Bag
12:24 camelia rakudo-moar 71a01e: OUTPUT«Use of Nil in string context␤  in block <unit> at <tmp> line 1␤Use of Nil in string context␤  in block <unit> at <tmp> line 1␤Found negative values for  in ␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> l…»
12:25 iBakeCake Kinda weird that Mixies can have negatives, but baggies can't
12:25 iBakeCake Or rather, kinda weird that Baggies can't have negatives, but Mixies can
12:35 AlexDaniel :O negative values
12:37 dalek roast: 37c8fd4 | (Harrison Chienjo)++ | S32-basics/pairup.t:
12:37 dalek roast: Add tests for pairup. (#174)
12:37 dalek roast:
12:37 dalek roast: * Add test for pairup keys and values.
12:37 dalek roast:
12:37 dalek roast: * Add test for pairup list size.
12:37 dalek roast:
12:37 dalek roast: * Use clearer test descriptions.
12:37 dalek roast:
12:37 dalek roast: * Test for exceptions.
12:37 dalek roast: review: https://github.com/perl6/roast/commit/37c8fd4c0b
12:41 lizmat iBakeCake: you can't have a negative number of things
12:41 lizmat iBakeCake: but you can assign a negative weigth to a thing
12:41 lizmat *weight
12:42 lizmat that's the rationale between Bag and Mix
12:42 lizmat if you want a negative number of things, use a Mix  :-)
12:42 lizmat and just give it Int values
12:42 AlexDaniel “class Bag – Immutable collection of distinct objects with integer weights”
12:43 iBakeCake Sounds like a distinction without a difference. Here's at least what our docs say:
12:43 iBakeCake Bag: Immutable collection of distinct objects with integer weights
12:43 AlexDaniel “Class Mix – Immutable collection of distinct objects with Real weights”
12:43 iBakeCake Mix: Immutable collection of distinct objects with Real weights
12:43 AlexDaniel hehe…
12:43 AlexDaniel that's a very interesting issue
12:44 * jnthn likes lizmat's "number of things" vs "weights" explanation, fwiw
12:44 iBakeCake As far as speculations go, for bags it clearly says negatives aren't allowed, but for mixes it says impl. may warn on negatives
12:45 AlexDaniel m: say MixHash.new-from-pairs( 'a' => NaN ) # there's also this
12:45 camelia rakudo-moar 71a01e: OUTPUT«MixHash.new(a(NaN))␤»
12:45 iBakeCake :(
12:45 iBakeCake m: say Bag.new-from-pairs( 'a' => NaN )
12:45 camelia rakudo-moar 71a01e: OUTPUT«Type check failed in assignment; expected Int but got Num (NaN)␤  in block <unit> at <tmp> line 1␤␤»
12:45 iBakeCake ah right
12:50 AlexDaniel and it's also interesting that once you have Inf/NaN in one of the weights you can no longer do anything with your Mix…
12:51 AlexDaniel ah no… nvm
12:51 iBakeCake m: my $m = MixHash.new-from-pairs( 'a' => NaN );  $m<a> = 42; dd $m
12:51 camelia rakudo-moar 71a01e: OUTPUT«MixHash $m = ("a"=>42).MixHash␤»
12:52 lizmat perhaps we should disallow NaN as a valid weight
12:53 AlexDaniel m: say Mix.new-from-pairs( ‘a’ => 42, ‘b’ => Inf).roll
12:53 camelia rakudo-moar 71a01e: OUTPUT«Nil␤»
12:54 lizmat AlexDaniel: that feels like a bug
12:54 AlexDaniel dunno
12:54 iBakeCake Is this crappy? multi method AT-KEY(QuantHash:U \SELF: $key) is raw { SELF = self.new; SELF.AT-KEY($key); }
12:54 iBakeCake Trying to make Setties and Baggies to autovivify
12:55 iBakeCake m: my BagHash $b; $b<foo>++; # and fix this
12:55 camelia rakudo-moar 71a01e: OUTPUT«Type check failed in assignment to $b; expected BagHash but got Hash (${})␤  in block <unit> at <tmp> line 1␤␤»
12:55 lizmat iBakeCake: feels ok to me
12:55 iBakeCake cool
12:57 AlexDaniel m: say Mix.new-from-pairs( ‘a’ => Inf, ‘b’ => -Inf).total # makes sense
12:57 camelia rakudo-moar 71a01e: OUTPUT«NaN␤»
13:29 FROGGS joined #perl6-dev
13:30 FROGGS o/
13:31 lizmat FROGGS  \o
13:48 iBakeCake ZOFVM: Files=1198, Tests=130069, 130 wallclock secs (21.05 usr  3.02 sys + 2348.45 cusr 198.65 csys = 2571.17 CPU)
13:50 FROGGS jnthn: I've added a SignatureCheckHOW, but its compose method does not get called... what am I doing wrong?
13:50 FROGGS iBakeCake: this gets recorded?
13:51 dalek rakudo/nom: 79bb867 | (Zoffix Znet)++ | src/core/QuantHash.pm:
13:51 dalek rakudo/nom: Make QuantHash:U AT-KEY autovivify to QuantHash object, not Hash
13:51 dalek rakudo/nom:
13:51 dalek rakudo/nom: Currently, when attempting to do AT-KEY operations on Setties and Baggies,
13:51 dalek rakudo/nom: the autovivification is handled by Any:U.AT-KEY, which defaults to creating
13:51 dalek rakudo/nom: a Hash object. This causes issues with my BagHash $b; $b<foo>++, since an
13:51 dalek rakudo/nom: attempt to assign a Hash to BagHash variable results in an exception.
13:51 dalek rakudo/nom:
13:51 dalek rakudo/nom: Fix by adding AT-KEY for QuantHash:U; a role that Setties and Baggies do
13:51 dalek rakudo/nom: that will create an appropriate object instead of a Hash.
13:51 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/79bb867145
13:52 dalek roast: 207ad2b | (Zoffix Znet)++ | S02-types/ (6 files):
13:52 dalek roast: Test autovivification of Setties and Baggies works right
13:52 dalek roast: review: https://github.com/perl6/roast/commit/207ad2b710
13:52 jnthn FROGGS: What were you expecting to call it?
13:52 iBakeCake FROGGS: hm? well, it's recorded in logs
13:53 iBakeCake So far, I see too much variance for the numbers to be overly useful. There are half a dozen test files that take forever to run and I think they skew the results, since the other 18 cores are just sitting there.,..
13:53 FROGGS jnthn: well, NativeHOW has such a method which sets up a hash that nativecall (moar) uses.... I want to do the same
13:53 FROGGS jnthn: are we calling it explicitly?
13:54 jnthn Yes, compose methods on meta-objects are called explicitly
13:54 jnthn For meta-attributes, they are called by the meta-object of the type at its compose time
13:54 FROGGS ahh, okay...
13:55 jnthn But if you consider a class, then class A { creates the ClassHOW, and the closing } is the point that we trigger the compose call
13:55 FROGGS I guess that's what I had expected...
13:56 FROGGS but I think I'll just call it in the callback that resides in NativeCall.pm or so
13:56 jnthn I think for example SubsetHOW is never composed
13:56 jnthn It's just created and "is"
13:56 FROGGS yeah
13:56 jnthn Hm, if the goal is for it to take what it knows and configure some other object then it maybe doesn't belong in a compose method
13:57 jnthn Since compose is about a meta-object getting its own house in order
13:57 FROGGS it is more about configuring itself
13:57 jnthn Ah...hm
13:58 FROGGS very close to what we do in NativeHOW
14:08 dalek rakudo/nom: 87bba04 | (Zoffix Znet)++ | src/core/Mix (2 files):
14:08 dalek rakudo/nom: Make Mix/MixHash.Bag/BagHash coersion ignore negative weights
14:08 dalek rakudo/nom:
14:08 dalek rakudo/nom: Mixies can have negative weights, but Bag/BagHash can't. If we
14:08 dalek rakudo/nom: have a Mixy with negative weights the coercion fails. Make it
14:08 dalek rakudo/nom: succeed by having the Mixies toss negative weights before the coersion.
14:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/87bba047a2
14:09 dalek roast: 381cf28 | (Zoffix Znet)++ | S02-types/mix (2 files):
14:09 dalek roast: Test Mixies with negative weights can coerse to Bag/BagHash
14:09 dalek roast: review: https://github.com/perl6/roast/commit/381cf28326
15:01 japhb [Tux]: Is there a publicly-visible file somewhere with at least the last, oh say 20 or so, of those csv test timings?
15:02 |Tux| yes
15:02 |Tux| http://tux.nl/Talks/CSV6/speed4.html click on timing log
15:04 japhb |Tux|: Ah, excellent, thank you
15:36 japhb star: use LWP::Simple; my @recent = LWP::Simple.get('http://tux.nl/Talks/CSV6/speed.log').lines[(*-30)..Inf].map(*.words[*-1]); my ($min, $max) = @recent.min, @recent.max; my $range = max($max - $min, .1 * $min); my @bar = (0x2581 .. 0x2588)>>.chr; my $spark = @recent.map({ @bar[(($_ - $min) / $range * (@bar - 1)).round] }).join; say $spark;
15:36 camelia star-m 2016.04: OUTPUT«▃▂▂▃▃▂▇▄▄▅▄▃▄▂▅█▅▃▂▁▂▂▂▁▂▂▅▁▁▅␤»
15:36 timotimo cute
15:36 japhb |Tux|: Something to add to your daily postings? ^^
15:37 timotimo japhb: do you know about .minmax?
15:37 timotimo m: say ^10 .pick.minmax.perl
15:37 camelia rakudo-moar 87bba0: OUTPUT«7..7␤»
15:37 timotimo m: say ^10 .pick.minmax.perl
15:37 camelia rakudo-moar 87bba0: OUTPUT«7..7␤»
15:37 timotimo ... huh?
15:37 japhb timotimo: Didn't work right for me for some reason.  Seemed to be defined only on Range?
15:37 timotimo oh, haha
15:37 timotimo m: say ^10 .roll(10).minmax.perl
15:37 camelia rakudo-moar 87bba0: OUTPUT«0..9␤»
15:37 timotimo m: say ^10 .roll(10).minmax.perl
15:37 camelia rakudo-moar 87bba0: OUTPUT«0..9␤»
15:38 timotimo m: say ^10 .roll(10).minmax.perl
15:38 camelia rakudo-moar 87bba0: OUTPUT«0..9␤»
15:38 timotimo m: say ^10 .roll(3).minmax.perl
15:38 camelia rakudo-moar 87bba0: OUTPUT«1..8␤»
15:38 timotimo m: say ^10 .roll(3).minmax.perl
15:38 camelia rakudo-moar 87bba0: OUTPUT«0..3␤»
15:38 timotimo that's better
15:38 timotimo it's defined on a list of things, it gives you a range as its result
15:38 |Tux| note that there is a bit of noise in the timing. I guess about .25sec over or under
15:38 timotimo though, tbf, if you want to unpack it into its min and its max, that'll require some accessor method calls?
15:40 japhb |Tux|: That was what the 'my $range = max($max - $min, .1 * $min);' bit was about -- the .1 was to try to not blow tiny changes out of proportion, so the full range of the spark line was at *least* 10% of the $min.
15:40 japhb timotimo: Yeah, not a savings then.
15:40 japhb That .1 can be tuned to match the noisiness of the data set.
15:41 japhb Or we can just arbitrarily choose a minimum of .25 if that timing noise is truly scale-independent.
15:41 timotimo japhb: you can save a few characters by using ^7 + 0x2581 instead of 0x2581 .. 0x2588
15:41 japhb (Or apply both minimums, actually)
15:41 japhb timotimo: golfing welcome.  :-)
15:41 timotimo oh, i'm not in the mood for a full golfing
15:41 timotimo just a tiny bit
15:42 japhb Fair enough.
15:42 jsimonet joined #perl6-dev
15:42 japhb It would be ^8 instead of .7
15:42 japhb Er ^7
15:43 timotimo sorry, yes.
15:43 timotimo i'm not wearing my glasses! :P
15:43 timotimo hold on
15:43 timotimo oh yeah, you're totally right 8)
15:44 japhb star: use LWP::Simple; my @recent = LWP::Simple.get('http://tux.nl/Talks/CSV6/speed.log').lines[(*-30)..Inf].map(*.words[*-1]); my ($min, $max) = @recent.min, @recent.max; my $range = max($max - $min, .1 * $min, .25); my @bar = (^8 + 0x2581)>>.chr; my $spark = @recent.map({ @bar[(($_ - $min) / $range * (@bar - 1)).round] }).join; say $spark;
15:44 camelia star-m 2016.04: OUTPUT«▃▂▂▃▃▂▇▄▄▅▄▃▄▂▅█▅▃▂▁▂▂▂▁▂▂▅▁▁▅␤»
15:44 japhb ^^ both suggestions applied
15:45 jnthn m: uniname 0x2581
15:45 camelia rakudo-moar 87bba0: ( no output )
15:45 jnthn m: say uniname 0x2581
15:45 camelia rakudo-moar 87bba0: OUTPUT«LOWER ONE EIGHTH BLOCK␤»
15:45 jnthn m: say uniname 0x2582
15:45 camelia rakudo-moar 87bba0: OUTPUT«LOWER ONE QUARTER BLOCK␤»
15:46 jnthn TIL :P
15:49 timotimo japhb: are you on a linux system, btw? have you ever experimented with rendering to a window that has an actual alpha channel?
15:50 timotimo https://twitter.com/loltimo/status/789060624324128769 <- japhb
16:01 geekosaur or just enumerate visuals and pick one with ARGB. you can find sample code in most programs that use opengl directly
16:01 timotimo geekosaur: you're very free to patch SDL2 to allow that :)
16:05 [Coke] use iterm2, render actual gifs into your output
16:08 timotimo hehe
16:15 lizmat joined #perl6-dev
16:15 lizmat iBakeCake: re 79bb8671454171bed3ec , I wonder what autovivification means for immutables such as Set,Bag,Hash
16:15 lizmat m: my Bag $b; $b<a>++
16:15 camelia rakudo-moar 87bba0: 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 is rw…»
16:15 lizmat m: my BagHasH $b; $b<a>++
16:15 camelia rakudo-moar 87bba0: OUTPUT«===SORRY!===␤Type 'BagHasH' is not declared. Did you mean 'BagHash'?␤at <tmp>:1␤------> my BagHasH⏏ $b; $b<a>++␤Malformed my␤at <tmp>:1␤------> my⏏ BagHasH $b; $b<a>++␤␤»
16:16 lizmat m: my BagHasH $b; $b<a>++
16:16 camelia rakudo-moar 87bba0: OUTPUT«===SORRY!===␤Type 'BagHasH' is not declared. Did you mean 'BagHash'?␤at <tmp>:1␤------> my BagHasH⏏ $b; $b<a>++␤Malformed my␤at <tmp>:1␤------> my⏏ BagHasH $b; $b<a>++␤␤»
16:16 lizmat m: my BagHash $b; $b<a>++
16:16 camelia rakudo-moar 87bba0: ( no output )
16:17 lizmat I guess it's still better than it trying to make a Hash
16:17 dalek roast: f06324c | (Sterling Hanenkamp)++ | S12-subset/subtypes.t:
16:17 dalek roast: Test using fail in subset for custom message (#175)
16:17 dalek roast: review: https://github.com/perl6/roast/commit/f06324ca25
16:19 dalek roast: c6e3283 | (Zoffix Znet)++ | S12-subset/subtypes.t:
16:19 dalek roast: Add test description
16:19 dalek roast: review: https://github.com/perl6/roast/commit/c6e3283944
16:20 dalek roast: 455a94c | (Sterling Hanenkamp)++ | S32-array/splice.t:
16:20 dalek roast: Resolves #164: tests callable args on splice (#176)
16:20 dalek roast: review: https://github.com/perl6/roast/commit/455a94c0b2
16:22 iBakeCake There's one case I've not thought of tho
16:22 iBakeCake m: my Bag $b; try $b<a>++; dd $b
16:22 camelia rakudo-moar 87bba0: OUTPUT«Bag $b = ().Bag␤»
16:23 iBakeCake So I think I'll add an AT-KEY to immutables that throws
16:23 iBakeCake on :U immutables
16:25 lizmat ah, what would be the sig for that ?
16:25 lizmat I came up with:
16:25 lizmat SELF.^name.chars == 3 # shoddy heuristic for Set/Bag/Mix
16:25 lizmat ?? die "Cannot auto-vivify an immutable {SELF.^name}"
16:25 lizmat !! (SELF = self.new).AT-KEY($key)
16:25 iBakeCake Well, they'd have to go into Set.pm, Bag.pm, ....
16:25 iBakeCake Oh, yeah, that;'s better
16:25 lizmat ok, will commit :-)
16:25 iBakeCake lizmat++ thanks
16:27 dalek rakudo/nom: b1f77c8 | lizmat++ | src/core/QuantHash.pm:
16:27 dalek rakudo/nom: Immutable Set/Bag/Mix cannot be auto-vivified
16:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b1f77c842e
16:29 * lizmat goes back to optimizing Str.match
16:29 lizmat a little heads up on that: I had to scrap my original approach as it in the end did not bring the optimizations I was going for
16:30 lizmat now looking at being 1.5 to 5x faster, depending in which named parameters are (not) specified
17:32 Ven_ joined #perl6-dev
17:41 Ven__ joined #perl6-dev
17:55 dalek roast: c17a0bf | (Zoffix Znet)++ | S02-types/ (3 files):
17:55 dalek roast: Adjust exceptions thrown by autovivification of immutable QuantHashes
17:55 dalek roast:
17:55 dalek roast: The tests were added today as part of testing new autovivification behaviour
17:55 dalek roast: of QuantHashes[^1]. However, that work did not handle immutable QuantHashes
17:55 dalek roast: well, which was later fixed[^2].
17:55 dalek roast:
17:55 dalek roast: Adjust tests to accomodate that fix.
17:55 dalek roast:
17:55 dalek roast: [1] https://github.com/rakudo/rakudo/commit/79bb8671454171bed3ece027b8facfe56d6665f5
17:55 dalek roast: [2] https://github.com/rakudo/rakudo/commit/b1f77c842e10c2e5b4d11a3781aef9edb69067bc
17:55 dalek roast: review: https://github.com/perl6/roast/commit/c17a0bf51f
17:56 nine Oh boy, I'd not have thought that it would be _that_ easy to prove NativeCall leaking memory. I literally hit it by writing a single LOC
17:56 Ven_ joined #perl6-dev
18:03 nine I guess since the unbounded growth is in the "still reachable" category, this is a case for the heap profiler
18:03 FROGGS joined #perl6-dev
18:26 nine Looks like TakeStringCallback(sub (Str $x) {}) for ^10000; is accumulating frames while TakeStringCallback(&swallow-str) for ^10000; is not.
18:26 awwaiid joined #perl6-dev
18:32 FROGGS o/
18:35 nine my $swallower = sub (Str $x) {}; TakeStringCallback($swallower) for ^10000; doesn't accumulate frames either.
18:38 jnthn nine: If you pass --full-cleanup to Moar, does valgrind still show it as leaked/still reachable?
18:38 nine That is with --full-cleanup (which is in perl6-valgrind-m)
18:42 jnthn Hmm...that means the GC *didn't* nom it
18:42 jnthn Meaning that you might have more luck with massif
18:43 jnthn (Since the heap profiler is about GC-able things)
18:43 nine moar-ha shows the frames as: <anon> (08-callbacks.t:72)               3,532,672 bytes
18:45 jnthn o.O
18:45 jnthn It maybe is more useful than I suspected, then ;)
18:45 jnthn What does path say about such a frame?
18:45 nine And that line is exactly: TakeStringCallback(sub swallow-str(Str $x) {}) for ^10000;
18:45 nine I haven't figured out yet how to refer to those frames in moar-ha
18:46 nine They are kind of nameless :)
18:46 jnthn Hmm
18:47 jnthn Could you try it as ^10000 .map(sub xxx { TakeStringCallback(...) })
18:47 jnthn In case it's that particular closure?
18:51 nine ^10000 .map(sub xxx { TakeStringCallback(sub swallow-str(Str $x) {}) }) doesn't seem to leak
18:51 jnthn o.O
18:51 nine Probably because it doesn't even run :) Should pay more attention
18:56 nine Root (0) --[ Inter-generational Roots ]--> Inter-generational Roots (5) --[ Index 4224 ]--> xxx (08-callbacks.t:73) (Frame) (202616)
18:59 jnthn Do all the examples look like that?
19:00 jnthn That one means that the frame got promoted to gen2 and then had something assigned to it that was in the nursery, so ended up in the inter-gen root set
19:01 nine Yes, allways the same
19:04 mst jnthn: http://blog.faraday.io/saved-by-the-compiler-parallelizing-a-loop-with-rust-and-rayon/ is really quite interesting if you didn't already see it 17 times
19:04 jnthn nine: Very interesting.
19:05 jnthn nine: If you do a normal --profile and look at the GC runs, do we ever do a full collect?
19:05 jnthn mst: No, nobody pointed me at it yet
19:06 timotimo it could be we don't consider those things consuming memory so we don't go for a full one?
19:06 jnthn Well, you just did but... :)
19:06 nine The profiled code did 6 garbage collections. There were 0 full collections involving the entire heap.
19:09 nine The profiled code did 62 garbage collections. There were 0 full collections involving the entire heap.
19:10 jnthn mst: Yes, interesting indeed
19:10 jnthn nine: Hmmm
19:10 jnthn That's...interesting.
19:11 mst jnthn: seemed like the sort of thing that might Give You Ideas
19:11 nine Why would those frames even be promoted? They're useful only during that single very short call.
19:12 jnthn Yeah, something (TM) must be keeping them alive
19:12 jnthn It'd be interesting to catch a young one
19:12 jnthn That didn't end up in gen2 yet
19:13 jnthn Urgh, cold--...afk for a bit
19:15 nine jnthn: ah, I've been through that last week. Hope you'll be better soon
19:33 nine Root (0) --[ Thread Roots ]--> Thread Roots (4) --[ Native callback cache target ]--> BOOTCode (Object) (423322) --[ Unknown ]--> xxx (08-callbacks.t:75) (Frame) (17895)
19:38 timotimo so it's just a cache?
19:42 nine I can't find any code that removes anything from the Native callback cache, which would be a rather simple explanation :)
19:43 timotimo yeah, totally legit
19:44 nine The cache seems to be just a hash. This raises the question of how we could know that we should remove something from this cache.
19:45 timotimo we have one kind of weak hash in moar already, it's for the serialization contexts i think
19:56 nine Good to know. Will have a look
19:57 timotimo SCWeakHash might be the right word to look for
19:57 timotimo i have no idea how it's actually built to do its weakness
19:57 timotimo we do want to have general weakhash objects in the future
19:57 timotimo or, weak references in general
20:05 nine That's odd. I can't find any place in the code that actually assigns to instance->sc_weakhash.
20:06 timotimo probably uses something roundabout
20:06 timotimo src/6model/sc.c has access
20:07 timotimo it all goes through the HASH_ macros
20:07 nine Yep. I find a couple of places which access, I find where it's destroyed and I find where the mutex that protects it is initialized. But not initialization of the hash itself.
20:08 dalek nqp: 56a637c | (David Warring)++ | examples/rubyish/rubyish.nqp:
20:08 dalek nqp: [examples/rubyish] adapt to latest HLL::Grammar.O precedence declarations
20:08 dalek nqp: review: https://github.com/perl6/nqp/commit/56a637c8fd
20:15 lizmat decommute&
20:15 timotimo 429:    MVM_HASH_DESTROY(hash_handle, MVMSerializationContextBody, instance->sc_weakhash);
20:15 MasterDuke joined #perl6-dev
20:17 nine timotimo: yes, that's where it's destroyed. But it must be allocated somewhere?
20:19 timotimo i expect HASH_BIND will initialize the hash upon first writing to it?
20:19 timotimo VMHash uses uthash, too. it doesn't have an initialize function, either
20:21 nine You're right! 3rdparty/uthash.h:163
20:25 nine Ok, so the weakness of sc_weakhash just comes from SCRef not marking the hash entries in its gc_mark.
20:26 nine But that doesn't work as well for the Native callback cache. I'd guess that the cache hides some missing MVMROOT
20:26 timotimo OK, but it somehow also has to understand when the SCRef has died
20:26 timotimo otherwise the pointers in the hash will point into freed memory
20:29 nine The SCRef removes itself from instance->sc_weakhash in its gc_free
20:33 timotimo oh
20:33 timotimo ok, that's definitely not a sensible thing to give other things :D
20:38 nine We'd have to wrap the callback object in a kind of WeakHashEntry that could do this trick.
20:47 Zoffix left #perl6-dev
20:55 dalek joined #perl6-dev
20:55 synopsebot6 joined #perl6-dev
20:58 Ven_ joined #perl6-dev
21:10 ilbot3 joined #perl6-dev
21:10 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
21:15 MasterDuke would anybody mind testing out my most recent attempt at removing BOOTSTRAPATTRs?
21:15 MasterDuke https://github.com/MasterDuke17/rakudo/tree/remove_BOOTSTRAPATTR_where_possible_2nd_attempt
21:16 [Coke] joined #perl6-dev
21:17 MasterDuke i think it passes both moar and jvm spectests, but i'd appreciate some independent verification
21:43 lizmat joined #perl6-dev
22:15 FROGGS omg, it works: https://gist.github.com/FROGGS/bd727a2408ee66053a4569c4b8765a8c
22:16 FROGGS .tell jnthn I got it to work now: https://gist.github.com/FROGGS/bd727a2408ee66053a4569c4b8765a8c
22:16 yoleaux2 FROGGS: I'll pass your message to jnthn.
22:17 timotimo oh my gosh YES!
22:19 stmuk_ joined #perl6-dev
22:20 FROGGS :o)
22:20 FROGGS I knew you liked it
22:26 timotimo can we also use function pointers returned from functions?
22:26 FROGGS you can cast these using a signature, yes
22:26 FROGGS since a while
22:27 FROGGS say nativecast( :(int8 --> Str), $something )(42)
22:27 FROGGS $something would be a ptr
22:28 FROGGS next would be to allow Perl 6 subs in attribute slots and call them from C
22:28 dalek nqp: ec44da2 | (David Warring)++ | examples/rubyish/rubyish.nqp:
22:28 dalek nqp: [examples/rubyish] cut/pasto in comments
22:28 dalek nqp: review: https://github.com/perl6/nqp/commit/ec44da23c4
22:29 timotimo whoa
22:30 timotimo i did not realize that
22:35 FROGGS gnight
22:50 dalek nqp: 7cdbcea | (David Warring)++ | examples/rubyish/rubyish.nqp:
22:50 dalek nqp: [examples/rubyish] simplify heredoc tokens
22:50 dalek nqp: review: https://github.com/perl6/nqp/commit/7cdbcea355

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