Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-06-29

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

All times shown according to UTC.

Time Nick Message
01:49 ilbot3 joined #perl6-dev
01:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
04:25 astj joined #perl6-dev
04:38 astj joined #perl6-dev
04:58 astj joined #perl6-dev
06:23 [Tux] This is Rakudo version 2017.06-103-g2a8d1e7ce built on MoarVM version 2017.06-30-g389e9732
06:23 [Tux] csv-ip5xs        2.728
06:23 [Tux] test            12.485
06:23 [Tux] test-t           4.184 - 4.274
06:23 [Tux] csv-parser      12.911
06:40 timotimo buggable: speed
06:40 buggable timotimo, ███▆↑▇▃▄▄▄↑▃▅▃▃▃▃▃▃▅▃▂▃▃▃▃▆▅▁▂▂▂▃▃▄↑▃▃▅▄▄▃▄▆▆▅▃▂▇▅ data for 2017-06-13–2017-06-29; range: 3.907s–4.588s; 4% faster
06:40 timotimo huggable: speed
06:40 huggable timotimo, http://tux.nl/Talks/CSV6/speed4.html
06:53 * [Tux] runs it again. box was relatively busy
07:00 [Tux] This is Rakudo version 2017.06-103-g2a8d1e7ce built on MoarVM version 2017.06-30-g389e9732
07:00 [Tux] csv-ip5xs        2.634
07:00 [Tux] test            12.669
07:00 [Tux] test-t           4.097 - 4.187
07:00 [Tux] csv-parser      12.268
08:07 b2gills joined #perl6-dev
08:41 [TuxCM] joined #perl6-dev
08:50 donaldh joined #perl6-dev
08:53 robertle joined #perl6-dev
08:58 [TuxCM] joined #perl6-dev
09:06 pmurias joined #perl6-dev
09:08 donaldh joined #perl6-dev
09:22 [TuxCM] joined #perl6-dev
09:52 donaldh joined #perl6-dev
09:58 CQ joined #perl6-dev
10:35 DeadDelta m: class Foo does Iterable {}
10:35 camelia rakudo-moar 2a8d1e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Method 'iterator' must be implemented by Foo because it is required by roles: Iterable.␤at <tmp>:1␤»
10:35 DeadDelta But it IS implemented :/
10:36 DeadDelta m: class Foo {}.iterator.say
10:36 camelia rakudo-moar 2a8d1e: OUTPUT: «<anon|190488128>.new␤»
10:36 lizmat no, it isn't in that code
10:36 lizmat you don't need to be Iterable to have an iterator
10:36 lizmat m: dd 42.iterator
10:36 camelia rakudo-moar 2a8d1e: OUTPUT: «<anon|190488128>.new␤»
10:37 DeadDelta I inherit one. What does it care where it comes from?
10:37 lizmat if it inherits one, and the base class does Iterable
10:37 lizmat you don't need the "does Iterable" in your subclass
10:37 lizmat problem solved ?
10:38 DeadDelta Not really. I have a method in my class thought by a role I'm trying to do, but it complains that it's not there.
10:38 DeadDelta s/thought/sought/;
10:38 lizmat hmmm...
10:39 DeadDelta m: class Foo { method x {} }; role Meow { method x {…} }; class Bar is Foo does Meow {}
10:39 camelia rakudo-moar 2a8d1e: ( no output )
10:39 DeadDelta And actually seems to work here ^ when the inherited-from class isn't a Mu
10:39 lizmat so you're saying the implementation check should be a .can() check rather than an exists check on the stash ?
10:40 DeadDelta m: class Foo { method x {} }; role Meow { method elems {…} }; class Bar is Foo does Meow {}
10:40 camelia rakudo-moar 2a8d1e: ( no output )
10:40 DeadDelta Works for Any
10:40 DeadDelta m: class Foo { method x {} }; role Meow { method x {…} }; class Bar is Foo does Meow {}
10:40 camelia rakudo-moar 2a8d1e: ( no output )
10:40 DeadDelta m: class Foo { method x {} }; role Meow { method Bool {…} }; class Bar is Foo does Meow {}
10:40 camelia rakudo-moar 2a8d1e: ( no output )
10:40 DeadDelta Oh, it's the Iterable that complains?
10:41 DeadDelta m: class Foo { method x {} }; role Meow { method iterator {…} }; class Bar is Foo does Meow {}
10:41 camelia rakudo-moar 2a8d1e: ( no output )
10:41 lizmat the does Iterable states that you need to implement an iterator method
10:41 lizmat at composition time of Foo it doesn't see one in Foo and complains
10:42 DeadDelta method iterator() { ... } ? Is that it?
10:42 lizmat think so
10:42 DeadDelta So why doesn't above it doesn't complain with Meow role?
10:42 DeadDelta m: role Meow { method iterator {…} }; class Bar does Meow {}
10:42 camelia rakudo-moar 2a8d1e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Method 'iterator' must be implemented by Bar because it is required by roles: Meow.␤at <tmp>:1␤»
10:42 DeadDelta :|
10:42 lizmat hmmm.. that smells wrong
10:43 lizmat :-)
10:46 DeadDelta Filed as https://rt.perl.org/Ticket/Display.html?id=131676
11:33 Geth ¦ rakudo/nom: 5e34258850 | (Elizabeth Mattijsen)++ | src/core/Rakudo/QuantHash.pm
11:33 Geth ¦ rakudo/nom: Introducing R:Q.COERCE-MAP-TO-(SET|BAG|MIX)
11:33 Geth ¦ rakudo/nom:
11:33 Geth ¦ rakudo/nom: Shortcuts that don't need to check for existence of keys.
11:33 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5e34258850
11:36 * [Coke] fires up a docker container with ubuntu to see if his mac segv happens elsewhere... can't build rakudo... there is no /tmp in there. weird.
11:38 nebuchadnezzar joined #perl6-dev
11:39 Geth ¦ rakudo/nom: f34af72fc7 | (Elizabeth Mattijsen)++ | src/core/Rakudo/QuantHash.pm
11:39 Geth ¦ rakudo/nom: Tweaks in R:Q.COERCE-MAP-TO-(BAG|MIX)
11:39 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f34af72fc7
11:39 Geth ¦ rakudo/nom: 72e5d61411 | (Elizabeth Mattijsen)++ | src/core/Map.pm
11:39 Geth ¦ rakudo/nom: Make Map.(Bag|Mix) 2.5x to 5x faster
11:39 Geth ¦ rakudo/nom:
11:39 Geth ¦ rakudo/nom: - based on a 26-element hash
11:39 Geth ¦ rakudo/nom: - 2.5x for normal hash
11:39 Geth ¦ rakudo/nom: - 5x for object hash
11:39 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/72e5d61411
11:49 llfourn [Coke]: I just pulled ubuntu:latest and it had /tmp
11:57 [Coke] llfourn: weird. wonder what happened to it in my container.
11:58 dogbert2 lizmat: 'say $?BITS' returns 64 on my 32 bit linux VM
11:58 lizmat :-(
11:59 lizmat dogbert2: what does int.Range say ?
11:59 jnthn Well, what's it supposed to represent?
11:59 lizmat the size of a native int
11:59 dogbert2 lizmat: -9223372036854775808..9223372036854775807
12:00 jnthn Then it's correct in that that's alwasy 64 bits on MoarVM
12:00 lizmat yeah, that's the 64 bit one
12:00 lizmat jnthn: even on a 32 bit system ?>?
12:00 jnthn Depending what definition of "native" you're suing :)
12:00 jnthn lizmat: Yes
12:00 jnthn s/suing/using/ :)
12:01 lizmat ok, then how can one know whether you're running on a 32bit system or not ?
12:01 jnthn I guess see how nativecall figures out the size_t size :)
12:02 lizmat well, but don't we want to be able to do that in core?
12:02 * lizmat is getting confused now
12:03 jnthn NativeCall surely does it by asking the VM
12:03 jnthn Anything in the VM that it's using, you could use in CORE.setting too :)
12:05 pmurias https://paste.debian.net/973884 - does this nqp::spawnprocasync test look sane? it passes I just want to make sure it tests for proper behavior
12:06 dogbert2 m: $*KERNEL.bits
12:06 camelia rakudo-moar 72e5d6: ( no output )
12:06 dogbert2 m: say $*KERNEL.bits
12:06 camelia rakudo-moar 72e5d6: OUTPUT: «64␤»
12:06 jnthn pmurias: Just glanced over it, seems reasonable to me
12:07 dogbert2 lizmat: that one gives 32 on my system
12:08 dogbert2 dunno if that should be used though
12:08 lizmat well, I don't know either anymore  :-(
12:15 Geth ¦ rakudo/nom: 495fb5f8ac | (Elizabeth Mattijsen)++ | src/core/set_operators.pm
12:15 Geth ¦ rakudo/nom: Make Map (+) Map between 3x and 6x faster
12:15 Geth ¦ rakudo/nom:
12:15 Geth ¦ rakudo/nom: - based on a 26-element hash with itself
12:15 Geth ¦ rakudo/nom: - 3x for normal hash (+) normal hash
12:15 Geth ¦ rakudo/nom: - 6x for object hash (+) object hash
12:15 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/495fb5f8ac
12:18 AlexDaniel joined #perl6-dev
12:23 dogbert2 m: Buf.new((my int $i = 10) +& 0xFF)
12:23 camelia rakudo-moar 72e5d6: ( no output )
12:24 dogbert2 lizmat: I may be wrong but it looks as if RT #128655 has been fixed at some point
12:24 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=128655
12:27 dogbert2 bisect: Buf.new((my int $i = 10) +& 0xFF)
12:27 bisectable6 dogbert2, On both starting points (old=2015.12 new=495fb5f) the exit code is 0 and the output is identical as well
12:27 bisectable6 dogbert2, Output on both points: «»
12:28 lizmat bisect: old=2016.06 Buf.new((my int $i = 10) +& 0xFF)
12:29 bisectable6 lizmat, On both starting points (old=2016.06 new=495fb5f) the exit code is 0 and the output is identical as well
12:29 bisectable6 lizmat, Output on both points: «»
12:29 lizmat hmmm
12:29 lizmat m: dd Buf.new((my int $i = 10) +& 0xFF)
12:29 DeadDelta So Gabor is now spreading anti-Perl 6 propaganda? Must be raising too much money on that Perl 6 Web book
12:29 camelia rakudo-moar 72e5d6: OUTPUT: «Resource temporarily unavailable»
12:30 lizmat DeadDelta: if this is about http://fayerplay.com/perl-is-schrodinger_state/ , don't blame the messenger :-)
12:30 DeadDelta IIRC that bug was fixed by pmurias with the removal of optimizer bit, which was then reverted, but the bug remained fixed somehow
12:31 DeadDelta I'm not blaming. I'm just amused
12:31 dogbert2 cool, if that one is fixed then RT #128624 must also be fixed
12:31 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=128624
12:32 DeadDelta IIRC there's commented out code in rakudo for 128655
12:32 DeadDelta That could be uncommented now
12:32 DeadDelta Ohh... or maybe that's why the bug is not there, cause the native candidates are commented out
12:33 DeadDelta Or maybe i'm thinking of a different bug :/
12:33 DeadDelta s: &infix:<+&>
12:33 SourceBaby DeadDelta, Sauce is at https://github.com/rakudo/rakudo/blob/495fb5f/src/core/Numeric.pm#L320
12:34 * DeadDelta shrugs
12:34 dogbert2 DeadDelta: if you think that 128655 is sorted then RT #129844 can also be closed, that's three RT's for the price of one :)
12:34 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=129844
12:35 Geth ¦ rakudo/nom: ae4c04cef7 | (Elizabeth Mattijsen)++ | src/core/Setty.pm
12:35 Geth ¦ rakudo/nom: Make Setty.(Bag|Mix) about 5% faster
12:35 Geth ¦ rakudo/nom:
12:35 Geth ¦ rakudo/nom: - based on a 1000 elem Set
12:35 Geth ¦ rakudo/nom: - don't call raw_hash, use $!elems directly
12:35 Geth ¦ rakudo/nom: - don't use helper sub
12:35 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ae4c04cef7
12:38 pmurias DeadDelta: the problem with the Bufs was 2 part, the multi dispatch optimizer bug (which was fixed and reverted as it speeds some other stuff up) and Buf.new failing when passed a native int (which I didn't fix)
12:39 DeadDelta "...and reverted..."
12:39 DeadDelta Yeah, but it looks like even after the revert the bug is gone?
12:45 DeadDelta lizmat: what do you think about generalizing this commit to use a hash of options instead of a single dynvar? https://github.com/rakudo/rakudo/commit/af145848bba81402f223758c933eba47f6a4e64d
12:46 DeadDelta lizmat: it's probably not the only thing users will want to have configurable. Or perhaps there could be an option to provide a parsing class (like GetOpt::Whatever)
12:46 lizmat All for it, I see MAIN-ALLOW...  as a hack really
12:46 pmurias DeadDelta: if the native candidates are commented out they multi inliner won't see it (and do it's incorrect but sometimes wanted optimalization)
12:48 pmurias m: my int $x = 123;my $y = Buf.new($x+1)
12:48 camelia rakudo-moar 495fb5: OUTPUT: «Type check failed in initializing element #0 to Buf; expected uint8 but got Int (124)␤  in block <unit> at <tmp> line 1␤␤»
12:48 pmurias DeadDelta: it's still a problem for ops that are too important to comment their fast path out
12:49 DeadDelta Oh, ok, the bug's still there
12:50 pmurias m: my $x = 2**63-1;say($x+1)
12:50 camelia rakudo-moar 495fb5: OUTPUT: «9223372036854775808␤»
12:50 pmurias m: my int $x = 2**63-1;say($x+1)
12:50 camelia rakudo-moar 495fb5: OUTPUT: «-9223372036854775808␤»
12:50 DeadDelta And disappears with --optimize=off
12:51 donaldh joined #perl6-dev
12:51 dogbert2 :(
12:51 jnthn I suspect we'll have to at some point consider whether the native integer literal handling stuff in the optimizer really belongs in the optimizer, since it's actually required for resolving which literals are compiled as int and which are compiled as Int
12:52 jnthn otoh, do we want slower compilers by adding another pass?
12:52 jnthn *compiles
12:52 DeadDelta greppable6: MAIN-ALLOW-NAMED-ANYWHERE
12:52 greppable6 DeadDelta, https://gist.github.com/fe7f6681e9b331914cad69d2ac6b2039
12:56 pmurias jnthn: we do have QAST::Want so the optimizer could turn $native-int + 123 into a add_i in native int context and a bignumy infix:<+> when we want an object
12:57 jnthn pmurias: That's not the only reason
12:57 jnthn pmurias: It's much more generally used by the QAST compiler
12:58 jnthn So anywhere that an nqp::op is used and there's an integer/num/string literal, it knows it can use the native version for the nqp::op
12:58 CQ left #perl6-dev
12:58 lizmat DeadDelta: if that's the only occurrence of MAIN-ALLOWED, I guess we're good  :-)
12:59 pmurias jnthn: what would be an example of that?
13:00 jnthn nqp::substr($foo, 0, 1)
13:01 DeadDelta lizmat: yeah. I'll implement a hash tonight
13:01 Geth ¦ rakudo/nom: d5bf5b0c25 | (Elizabeth Mattijsen)++ | src/core/Rakudo/QuantHash.pm
13:01 Geth ¦ rakudo/nom: Add some internal documentation
13:01 Geth ¦ rakudo/nom:
13:01 Geth ¦ rakudo/nom: Was actually part of a bigger commit, but realized in time it was
13:01 Geth ¦ rakudo/nom: mostly bogus, so dropped the code but kept the improved comments.
13:01 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d5bf5b0c25
13:01 DeadDelta Oh, and another question that was asked before awhile back
13:01 DeadDelta m: say set() ~~ Iterable
13:01 camelia rakudo-moar ae4c04: OUTPUT: «False␤»
13:02 DeadDelta Should QuantHash be Iterable? Maps are. But on the other hand the fact that slurpies break Maps into Pairs is kidna meh, so would we want the same to happen with QuantHashes?
13:02 pmurias jnthn: you mean when the nqp::substr is inside the multi which we are inlining?
13:03 jnthn pmurias: I mean in general
13:03 DeadDelta m: sub foo (*@a) { dd @a }; foo %(:a, :b); foo (:a, :b).Bag
13:03 camelia rakudo-moar ae4c04: OUTPUT: «[:a, :b]␤[("b"=>1,"a"=>1).Bag]␤»
13:03 DeadDelta m: sub foo (*@a) { dd @a }; foo $%(:a, :b); foo (:a, :b).Bag.pairs
13:03 camelia rakudo-moar ae4c04: OUTPUT: «[{:a, :b},]␤[:b(1), :a(1)]␤»
13:04 pmurias jnthn: the reverted commit only changed how multis are inlined
13:05 * pmurias is confused
13:05 DeadDelta I think current way is fine. But I might write an article about Perl 6 Iterables and so wanted to find out if QuantHash isn't one on purpose :)
13:05 jnthn pmurias: Yes, it changed it so that for $a + 1 where $a is declared as a native int so they never were!
13:06 jnthn By removing the allomorph analysis
13:08 pmurias which is not correct in generally but speeds things like my int $a = 2; $a = $a + 1 up
13:09 lizmat DeadDelta: could you check if something breaks if you add "does Iterable" to the QuantHash role ?
13:10 DeadDelta lizmat: it cries about wanting iterator (the bug I found this morning) and when I worked around it by adding method iterator { self.pairs.iterator } it wanted .kv implemented too. Then I left to work
13:10 pmurias what I mean is that we could explicitly do it for the things that we know work the same with a int or a Int
13:11 DeadDelta s: set, 'iterator', \()
13:11 SourceBaby DeadDelta, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Function "set" may not be called without arguments (please use () or whitespace to denote arguments, or &set to refer to the function as a noun, or use .set if you meant to call it as a method on $_)␤at -e:6␤------>     put sourcery( set<HERE>, 'iterator', \() )[1];␤
13:11 DeadDelta *groan*
13:11 DeadDelta s: set(), 'iterator', \()
13:11 SourceBaby DeadDelta, Sauce is at https://github.com/rakudo/rakudo/blob/495fb5f/src/core/Set.pm#L36
13:12 DeadDelta Yeah, it already got its own iterator. So I think what will be affected is how QuantHashes flatten in slurpies or .deepmap or .nodemap or ».foo
13:15 * DeadDelta &
13:17 pmurias jnthn: do more complex things then simple ops even get inlined?
13:18 jnthn pmurias: Not in the static optimizer, no
13:18 jnthn pmurias: We used to try and do more
13:18 jnthn There's certainly some cleanups to be had in this area
13:18 jnthn It dates back to before we were running on VMs that can do inlining
13:18 jnthn Nowadays all we really want to do is worry about native ops
13:19 jnthn In terms of transformations
13:19 jnthn Though we also do a bunch of catching impossible code at compile time too
13:20 jnthn Transformation wise, though, we only care about natives
13:20 pmurias so if I get the ops to run as fast as they do know without the allomorph analysis I can remove that again?
13:21 jnthn And doing the allomorphic lowering
13:21 jnthn Uh
13:21 jnthn But the allomorph analysis is key to it, no?
13:21 jnthn We have to compile-time dispatch $a + 1 considering the 1 native
13:22 Geth ¦ rakudo/nom: 41ed2c03ab | (Elizabeth Mattijsen)++ | src/core/Rational.pm
13:22 Geth ¦ rakudo/nom: Allow for "does Rational" and "does Rational[foo]"
13:22 Geth ¦ rakudo/nom:
13:22 Geth ¦ rakudo/nom: From a question by cschwenz++ on #perl6
13:22 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/41ed2c03ab
13:22 jnthn That is to say, we treat the fact $a is known native as implying the literal should also be considered native in this context
13:22 pmurias yes, but we can do it in a more precise way then just assume multi dispatch works differently then it really does at runtime
13:23 jnthn Probably, but it's still going to be the case that multi-dispatch at runtime can't know what's a literal and what's not
13:23 jnthn And at compile time we do know that
13:26 pmurias do we want to have 2 different multi dispatch algorithms?
13:27 jnthn What do you consider the alternative?
13:28 jnthn I mean, I don't think making users write int(1) everywhere is really going to fly
13:28 pmurias the optimizer having knowledge where treating a literal as a native int works
13:28 jnthn That's what it has now, though?
13:29 jnthn It just uses "there's a declared native argument" as its source of knowledge
13:31 pmurias on the jvm if it doesn't inline it just selects a multi variant with a native argument and then just passes a regular not native int
13:32 jnthn Yeah, that approach didn't work out so well with having dynamic optimization stuff going on
13:33 jnthn Maybe what we want is just
13:33 pmurias m: my int $x = 2**63-1;say($x+1)
13:33 camelia rakudo-moar 41ed2c: OUTPUT: «-9223372036854775808␤»
13:33 jnthn That result is fine
13:34 pmurias jnthn: it works differently with optimize=off
13:34 jnthn 1) if there is a call to a subroutine taking two arguments and one of them is declared native and the other is a literal that has a native value, then replace the QAST::Want with the native value
13:34 jnthn 2) Then the multi-dispatch just works the same way
13:34 jnthn Yes, I already said earlier that it's only part of optimize for avodiing a separate pass
13:35 jnthn But if people are upset about --optimize=off making the difference we can do that.
13:35 jnthn In fact
13:35 jnthn Since it's a really quite local analysis anyway
13:35 jnthn We can pull it up trivially into actions I think
13:35 ufobat joined #perl6-dev
13:35 jnthn Since we know the types of our lexicals when we compile a call
13:36 pmurias so we want to change the semantics?
13:36 jnthn And we also can see the two args and the literal
13:36 jnthn So that's perhaps the best way to handle it
13:36 jnthn And then it's not affected by --optimize any more; that will just do the inlining
13:37 jnthn That's probably the way to do it.
13:38 pmurias do we want $x + 1 to have a different result than $y = 1; $x + $y?
13:38 jnthn Please write an example with types
13:38 jnthn So we can actually discuss this clearly
13:39 jnthn Because without them the answer is "yes" and "no" :P
13:39 pmurias m: my Int $y = 1;my int $x = 2**63-1;say($x+$y)
13:39 camelia rakudo-moar 41ed2c: OUTPUT: «9223372036854775808␤»
13:39 pmurias m: my $y = 1;my int $x = 2**63-1;say($x+$y)
13:40 camelia rakudo-moar 41ed2c: OUTPUT: «9223372036854775808␤»
13:40 pmurias m: my int $x = 2**63-1;say($x+1)
13:40 camelia rakudo-moar 41ed2c: OUTPUT: «-9223372036854775808␤»
13:40 jnthn Yes, thsoe three are what I'd expect under the rules today, and under what I'm suggesting we do
13:41 jnthn It's either that or we make the user always write stuff like int(1)
13:41 jnthn So we don't have to try and infer what the literal should be
13:43 pmurias rules = the proposed rules?
13:44 pmurias m: my Int $y = 1;my int $x = 2**63-1;say($x+(1+1))
13:45 camelia rakudo-moar 41ed2c: OUTPUT: «-9223372036854775807␤»
13:45 jnthn Hm, that one way well change because it relies on constant folding having happened first
13:46 jnthn (With the move I suggested into actions)
13:46 jnthn Since we'd be moving the analysis ahead of constant folding
13:50 jnthn At the end of the day, all we're really trying to achieve here is making the language user get decent code produced when they use native types without having to annotate every single literal they mention
13:51 jnthn To me, if you've already decided to involve something that you *declared* native in an operation, and the other operand is a literal, then you most likely are expecting the native operation to take place.
13:52 jnthn That seems like a reasonable and quite easy to teach heuristic
13:53 jnthn That's what the allomorph code in Perl6::Optimizer is there to achieve today
13:53 jnthn The compile-time multi dispatch semantics were only intended, so far as I recall, to reflect what the result would be given something else already made a decision on whether a literal would count as native or not.
13:54 jnthn My proposal to move this into the actions would both resolve the "--optimize changes semantics" issue and completely decouple it from multiple dispatch, since it would take effect for single dispatch too
13:55 jnthn We are, however, left with the chaining issue
13:55 jnthn ($x + $y) + 1
13:55 jnthn Which is harder to solve "peephole"-like
13:56 jnthn (Since a post-declared + may come later)
13:56 jnthn Though we could still move such things ahead or out of the optimization phase.
13:56 lizmat afk&
14:00 pmurias jnthn: I feel TimToady should have a look at the proposed semantics as it feels like a "if we tweak the semantics that way, I'll compile so right" sort of proposal
14:01 mr_ron joined #perl6-dev
14:02 jnthn For sure, maybe he'll spot something I'm missing
14:02 jnthn So far as natives go, "we get this compile into the right thing" is the point :P
14:02 jnthn *compiled
14:05 SourceBaby joined #perl6-dev
14:08 pmurias jnthn: of course, the question is if we should add a 'literal is a native int literal under the right circumstances rule' or have the user just store the result of the operation in a native var (or pass it to a native op)
14:10 jnthn We already have that rule, so the question is if we want to remove it.
14:10 jnthn And it's there based on previous discussions about how we'd like to have things work
14:10 jnthn I agree how/where it happens could use some refinement.
14:12 epony joined #perl6-dev
14:13 cschwenz joined #perl6-dev
14:21 raschipi joined #perl6-dev
14:38 pmurias jnthn: I mean add in terms of have it be the 'official' specced & documented way
14:39 jnthn I'd been under the impression that we had spectests that relied on it, but apparently not
15:32 ugexe https://gist.github.com/ugexe/799542ce4d1d05a7636ed4ac86096746 So I was chasing down this bug last night. While iterating and digging through strace output that I don't understand anything about I found this which *looked* interesting https://gist.github.com/ugexe/686d1f7758362f144c3feb9439a9fd8c#file-gistfile1-txt-L20-L25
15:33 geekosaur that's just from the "cat" exiting
15:34 ugexe darn
15:37 geekosaur so, I would not want to bet on it being safe to close the output just because the input thread exited
15:37 geekosaur that's not async-think
15:38 geekosaur you are, in effect, assuming that the write thread finishing means that the cat synchronously finished reading what it wrote and writing it back out
15:38 ugexe well i've also tried $proc.out.slurp
15:41 jnthn $proc.out.Supply?!
15:42 jnthn I mean, it should work but it's a hell of a lot of indirection :)
15:42 ugexe that was just the latest iteration. I also tried $proc.out.slurp
15:43 jnthn This version is awaiting the wrong thing, for sure. It'd have to have a Promise that is kept when the output supply is done
15:44 jnthn slurp, otoh, really should Just Work
15:50 jnthn Seems it must be something in Proc
15:50 jnthn Because https://gist.github.com/jnthn/0add6b73021c02010ae5aacc95d62d50 works very reliably here
15:50 geekosaur my test used saving the Supply and .wait it
15:50 geekosaur but it makes me wonder if, say, we're not restarting the final read
15:54 jnthn A version that uses a Channel and Proc::Async also works
15:54 jnthn (That's interesting to try because Proc works by having Proc::Async dump incoming stuff into a Channel, so a .read-internal in Pipe just receives from the Channel)
15:55 geekosaur huuuuh
15:55 geekosaur one of my runs got: Cannot invoke null object  in block  at test.pl6 line 16
15:56 geekosaur line 16 being:     $s.tap({ $total += .bytes });
15:56 jnthn eek
15:56 jnthn That's...odd indeed
15:56 geekosaur ($s is the Supply, which I saved so I can .wait it)
15:57 ugexe i played with .wait too with no luck
15:57 geekosaur right, something weird is going on and my message might indicate it's not as simple as losing input
15:57 geekosaur like, somehow the closure is being lost
15:58 cschwenz left #perl6-dev
15:59 jnthn Yeah, I'm also somewhat suspecting a data race hiding somewhere
16:00 jnthn In Proc. Grrr.
16:00 jnthn I sometimes think I'm never going to escape working on this. :/
16:00 geekosaur doing this both correctly and portably is known to be littered with random mines :/
16:01 jnthn But please, for anything that matters, use Proc::Async.
16:03 jnthn Proc is...trying to make something inherently async Just Work in a sync way.
16:04 jnthn And it's full of "but if we do X then we fix Y but break Z"
16:05 jnthn I suspect this issue is probably that in amongst the cleverness to try and Just Work there's no something nasty. :/
16:05 jnthn *there's now
16:06 jnthn I'm not immediately seeing it right now, though
16:14 jnthn oh hah
16:14 jnthn That was dumb
16:15 jnthn Bad assumptions'll always get you
16:15 * jnthn spectests
16:18 Geth ¦ rakudo/nom: 7b175bd4b3 | (Jonathan Worthington)++ | 2 files
16:18 Geth ¦ rakudo/nom: Make Proc cope with zero-length buffers.
16:18 Geth ¦ rakudo/nom:
16:18 Geth ¦ rakudo/nom: It seems libuv sometimes hands over an empty buffer from stdout or
16:18 Geth ¦ rakudo/nom: stderr. These are dutifully passed along, meaning they may also be
16:18 Geth ¦ rakudo/nom: observed coming out of Proc::Async. Proc and IO::Pipe assumed that
16:18 Geth ¦ rakudo/nom: this would not happen, and mis-handled it doing so as an indication
16:19 Geth ¦ rakudo/nom: of the end.
16:19 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/7b175bd4b3
16:19 jnthn ugexe: That seems to fix the slurp
16:20 jnthn Probably the Supply too, but I need to wander home now
16:20 [Coke] jnthn++
16:46 AlexDaniel joined #perl6-dev
16:51 ugexe ah awesome
17:03 robertle joined #perl6-dev
17:10 ugexe jnthn: how did you you hunt that down?
17:15 jnthn ugexe: Eliminated Proc::Async and the .Channel coercion as likely contenders, then looked carefully at the .read-internal codepath and took a lucky guess at what might be going on :)
17:19 ugexe ah, so there is a level of intuition that is needed to debug such things effectively
17:20 jnthn Well, I figured we were looking for a reason for the slurp loop to terminate prematurely, or a way that something could get dropped
17:21 jnthn And the loop was predicated on "did we get an empty buffer"
17:34 timotimo ooooh
18:04 mr_ron left #perl6-dev
19:07 travis-ci joined #perl6-dev
19:07 travis-ci Rakudo build failed. Jonathan Worthington 'Make Proc cope with zero-length buffers.
19:07 travis-ci https://travis-ci.org/rakudo/rakudo/builds/248437879 https://github.com/rakudo/rakudo/compare/41ed2c03abcc...7b175bd4b367
19:07 travis-ci left #perl6-dev
19:07 buggable [travis build above] ☠ Did not recognize some failures. Check results manually.
19:08 HelpBot[perl6] github errors
19:09 buggable joined #perl6-dev
19:09 HelpBot[perl6] https://travis-ci.org/rakudo/rakudo/builds/248437879
19:09 buggable [travis build above] ✓ All failures are due to timeout (0), missing build log (0), GitHub connectivity (1), or failed make test (0).
21:08 dogbert2 m: say [1,2,3].dynamic # does the dynamic method tell you whether the (array in this case) has been declared with the 'is dynamic' trait?
21:08 camelia rakudo-moar 7b175b: OUTPUT: «False␤»
21:10 dogbert2 m: my @a = ^3 is dynamic; say @a.dynamic
21:10 camelia rakudo-moar 7b175b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my @a = ^37⏏5 is dynamic; say @a.dynamic␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤       …»
21:11 dogbert2 m: my @a is dynamic = ^3; say @a.dynamic
21:11 camelia rakudo-moar 7b175b: OUTPUT: «True␤»
21:11 jnthn Yes.
21:12 jnthn m: my @*a; say @a.dynamic
21:12 camelia rakudo-moar 7b175b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3my @*a; say 7⏏5@a.dynamic␤»
21:12 jnthn m: my @*a; say @*a.dynamic
21:12 camelia rakudo-moar 7b175b: OUTPUT: «True␤»
21:12 jnthn And * applies it for you
21:12 dogbert2 jnthn: thx, it the trai is documented but the method is not. Will fix that
21:13 dogbert2 so is * syntactic sugar for is dynamic?
21:13 jnthn In a declaration, yes
21:14 dogbert2 anything else I should know about it from a doc standpoint?
21:14 jnthn @*foo outside of a decalration means to look it up using dynamic scope, not lexical scope
21:15 dogbert2 cool, so even if a var is declared as 'is dynamic' you can choose which scope to use?
21:15 jnthn Well, thing is
21:16 jnthn my @*foo installs the variable under the name @*foo
21:16 jnthn my @foo is dynamic installs it under the name @foo
21:16 lizmat joined #perl6-dev
21:16 jnthn And that means you can't look the latter up as @*foo, you'd have to do something like DYNAMIC::<@foo> or so
21:17 dogbert2 interesting
21:20 dogbert2 will write something up for Hash and Array then
21:28 dogbert2 my @*foo is dynamic # what happens now
21:28 dogbert2 m: my @*foo is dynamic # what happens now
21:28 camelia rakudo-moar 7b175b: ( no output )
21:31 jnthn That's just a waste of chars :)
21:44 dogbert2 jnthn: should I add/change anything in the doc? https://gist.github.com/dogbert17/8260285b5e63b01849324ac775dd4afe
21:45 jnthn Yes, though you may want to note that in the Scalar case you ahve to ask $foo.VAR.dynamic
21:46 dogbert2 will do
21:58 nebuchadnezzar joined #perl6-dev
22:00 dogbert2 updated the gist
22:07 dogbert2 .ask AlexDaniel when did you last run your script which finds broken links in the docs?
22:07 yoleaux dogbert2: I'll pass your message to AlexDaniel.
22:07 AlexDaniel .
22:07 yoleaux 22:07Z <dogbert2> AlexDaniel: when did you last run your script which finds broken links in the docs?
22:07 AlexDaniel when it was marked in the ticket
22:07 AlexDaniel I'll run it again right now then
22:08 dogbert2 AlexDaniel++
22:09 AlexDaniel dogbert2: FWIW, so far I've been doing just this: checklink -b -D 25 -q doc.perl6.org | tee "$(date '+%F')"
22:09 AlexDaniel so it's something anybody can run, actually
22:10 AlexDaniel in fact, it would be nice to do it in some sort of automated way…
22:10 HelpBot[perl6] ZOFFLOP: t/spec/S12-attributes/class.t
22:11 HelpBot[perl6] ZOFFLOP: t/spec/S17-supply/supplier-preserving.t
22:11 HelpBot[perl6] t/spec/S03-operators/mix.t
22:11 HelpBot[perl6] I'm guess the failures in /mix.t ain't due to my change
22:12 AlexDaniel dogbert2: it will take ≈30 minutes I think :)
22:16 AlexDaniel dogbert2: https://github.com/perl6/doc/blob/master/doc/Type/Any.pod6#L402-L403
22:19 dogbert2 AlexDaniel: nice find: L<SetHash|/type/BSetash>
22:20 AlexDaniel awwww… some broken html…
22:20 AlexDaniel didn't we fix <a> inside <a> problem?
22:21 dogbert2 I thought so
22:22 AlexDaniel https://docs.perl6.org/type/Pod::Block::Para
22:22 AlexDaniel see line 322 for example
22:22 AlexDaniel <a class="u" href="#___top" title="go to top of document"><a href="/routine/contents#class_Pod%3A%3ABlock">
22:30 astj joined #perl6-dev
22:32 Geth ¦ roast: a1d5c4e6d0 | (Zoffix Znet)++ | S06-other/main.t
22:32 Geth ¦ roast: Remove trailing whitespace
22:32 Geth ¦ roast: review: https://github.com/perl6/roast/commit/a1d5c4e6d0
22:33 Geth ¦ rakudo/nom: 40b0169d08 | (Zoffix Znet)++ | src/core/Main.pm
22:33 Geth ¦ rakudo/nom: Replace $*MAIN-ALLOW-NAMED-ANYWHERE
22:33 Geth ¦ rakudo/nom:
22:33 Geth ¦ rakudo/nom: With %*SUB-MAIN-OPTS. The way the arguments are parsed is a contentious
22:33 Geth ¦ rakudo/nom: issue and we might see more options being proposed. There's a motion[^1]
22:33 Geth ¦ rakudo/nom: to have the $*MAIN-ALLOW-NAMED-ANYWHERE be specced, which was mostly
22:33 Geth ¦ rakudo/nom: added as a hack[^2] (for panda?). So, pre-emptively let's spec an
22:33 Geth ¦ rakudo/nom: options hash in which we can keep this and all future options.
22:33 Geth ¦ rakudo/nom: <…commit message has 7 more lines…>
22:33 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/40b0169d08
22:33 Geth ¦ roast: 754a45c006 | (Zoffix Znet)++ | S06-other/main.t
22:33 Geth ¦ roast: Spec %*SUB-MAIN-OPTS<named-anywhere>
22:33 Geth ¦ roast:
22:33 Geth ¦ roast: Rakudo impl: https://github.com/rakudo/rakudo/commit/40b0169d08
22:33 Geth ¦ roast: Closes https://github.com/perl6/roast/issues/274
22:33 Geth ¦ roast: review: https://github.com/perl6/roast/commit/754a45c006
22:40 AlexDaniel “zoffixznet commented 9 hours ago” :)
22:40 AlexDaniel that was pretty accurate
22:43 HelpBot[perl6] ?
22:43 HelpBot[perl6] Ah my saying in 10 hours
22:47 astj joined #perl6-dev
22:47 AlexDaniel e: dd %*SUB-MAIN-OPTS
22:47 evalable6 AlexDaniel, rakudo-moar 40b0169d0: OUTPUT: «{}»
22:48 HelpBot[perl6] e: say $*PERL.compiler.version
22:48 evalable6 HelpBot[perl6], rakudo-moar 40b0169d0: OUTPUT: «v2017.06.112.g.40.b.0169.d.0»
22:48 AlexDaniel HelpBot[perl6]: can we put named-anywhere => False there by default?
22:49 HelpBot[perl6] Dunno. Avoiding repetition is nice :/
22:49 AlexDaniel what repetition?
22:49 AlexDaniel I'm just thinking that it will make it easier for users
22:50 AlexDaniel just dump %*SUB-MAIN-OPTS and see what options are available and what their default values are
22:50 HelpBot[perl6] m: say %*ENV<PERL6_TEST_DIE_ON_FAIL>
22:50 camelia rakudo-moar 7b175b: OUTPUT: «(Any)␤»
22:50 HelpBot[perl6] AlexDaniel: ah. OK
23:07 Geth ¦ rakudo/nom: e2517f802b | (Zoffix Znet)++ | src/core/Main.pm
23:07 Geth ¦ rakudo/nom: Include default %SUB-MAIN-OPTS arguments in it; AlexDaniel++
23:07 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e2517f802b
23:08 Geth ¦ roast: c72357d46a | (Zoffix Znet)++ | S06-other/main.t
23:08 Geth ¦ roast: Test %SUB-MAIN-OPTS has stuff in it
23:08 Geth ¦ roast:
23:08 Geth ¦ roast: Discussion:  https://irclog.perlgeek.de/perl6-dev/2017-06-29#i_14806565
23:08 Geth ¦ roast: Rakudo impl: https://github.com/rakudo/rakudo/commit/e2517f802b
23:08 Geth ¦ roast: review: https://github.com/perl6/roast/commit/c72357d46a
23:10 AlexDaniel .oO( what if that's the only option we will ever add :) )
23:21 HelpBot[perl6] Unlikely. %SUB-MAIN-OPTS<parser> = Getopts::Whatever looks very attractive
23:28 travis-ci joined #perl6-dev
23:28 travis-ci Rakudo build errored. Zoffix Znet 'Replace $*MAIN-ALLOW-NAMED-ANYWHERE
23:28 travis-ci https://travis-ci.org/rakudo/rakudo/builds/248567744 https://github.com/rakudo/rakudo/compare/7b175bd4b367...40b0169d0846
23:28 travis-ci left #perl6-dev
23:28 buggable [travis build above] ☠ Did not recognize some failures. Check results manually.
23:30 AlexDaniel dogbert2: I think I'll rerun it with a hope of a better result…
23:31 AlexDaniel because BSetHash appears way too many times, I think :)
23:32 AlexDaniel why do we see travis complaining for docs?
23:32 AlexDaniel “The job exceeded the maximum time limit for jobs, and has been terminated.” – sure, but what maybe it slower?
23:33 HelpBot[perl6] syntax highlights IIRC
23:33 HelpBot[perl6] Or rather, building all the stuff
23:33 HelpBot[perl6] For syntax highlights. + more docs maybe? ::)
23:48 astj joined #perl6-dev

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