Perl 6 - the future is here, just unevenly distributed

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

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

All times shown according to UTC.

Time Nick Message
00:47 cognominal joined #perl6-dev
01:48 ilbot3 joined #perl6-dev
01:48 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
02:08 MasterDuke m: sub foo(Int $bar is rw where {$bar > 0}) { $bar }; say foo(Int)
02:08 camelia rakudo-moar 338a70: OUTPUT«Parameter '$bar' expected a writable container, but got Int value␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:08 MasterDuke m: sub foo(Int $bar where {$bar > 0}) { $bar }; say foo(Int)
02:08 camelia rakudo-moar 338a70: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:10 MasterDuke m: sub foo(Int $bar? where {$bar > 0}) { $bar }; say foo()
02:10 camelia rakudo-moar 338a70: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:10 MasterDuke i'm still trying to get a more informative error message for that third case, but i can't figure out why the parameter name isn't available
02:13 MasterDuke both errors are happening in bind_one_param in src/Perl/Metamodel/BOOTSTRAP.nqp
02:13 MasterDuke Perl6
02:15 MasterDuke but if i add a say($varname) at the site of the second error, it's just <anon>, no matter whether the parameter is named or position, required or optional
04:18 committable6 joined #perl6-dev
04:23 committable6 joined #perl6-dev
04:25 committable6 joined #perl6-dev
04:31 AlexDaniel why was #126956 closed?
04:31 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126956
04:31 AlexDaniel is it actually resolved?
04:45 dalek roast: def87d1 | usev6++ | / (9 files):
04:45 dalek roast: Unfudge tests on JVM
04:45 dalek roast: review: https://github.com/perl6/roast/commit/def87d1cd1
06:52 [Tux] joined #perl6-dev
07:09 nine lizmat: many, many thanks for fixing DIR-RECURSE :)
07:37 lizmat nine: so what's the timing now ?
07:38 lizmat Files=1146, Tests=53237, 218 wallclock secs (12.85 usr  3.59 sys + 1330.10 cusr 123.95 csys = 1470.49 CPU)
07:38 lizmat seems to have a good effect on running spectests as well  :-)
07:39 lizmat although it does seem one of the precomp tests fails now  :-(
07:51 nine lizmat: 1.089s :)
07:52 lizmat ah, down from 47 or so?  :-)
07:52 nine yes
07:52 nine Ticket is https://rt.perl.org/Public/Bug/Display.html?id=129776 btw
07:57 nine lizmat: I get All tests successful.
07:57 lizmat ah, hmmm....
07:57 lizmat yesterday I also got that, and now not... it's not a flapper
07:57 lizmat anyways... where is the SHA to check against stored anyway?
07:58 RabidGravy joined #perl6-dev
07:59 nine In the .repo-id files in the precomp directories.
08:00 nine It's basically an "If the repos are still the same as the state recorded in .repo-id, we can trust the dependency list. Otherwise we have to check if any of them got updated."
08:01 lizmat nine: so, if we would store the sha1 of each file of the repo it has found in there
08:01 lizmat so filename\tsha1
08:02 lizmat we would be able to check file by file and bail as soon as we have a mismatch
08:02 nine You'd still have to look for new files.
08:02 lizmat well, if the number of files is different, we'd bail without checking any of them
08:03 nine That would also break the abstraction as for example CURI calculates the id in a completely different way
08:03 lizmat ah, ok
08:03 lizmat so how about the idea of using filename / modified as the string to sha
08:04 lizmat with the exception of when it is too current, use now.Str
08:04 nine With your cool "round to now()" idea, it might even work :)
08:04 lizmat it would give some false positives
08:05 nine I just wonder if it'd be worth it. < 1s for an insane worst case doesn't sound that bad to me. In normal scenarios, you won't notice the shaing
08:05 lizmat if you would run again after the 2 second period
08:05 nine Well, could be tricky for the precomp tests, now that I think of it.
08:07 nine Could be. Doesn't have to be though.
08:08 lizmat well, running a profile shows that the private method in the new DIR-RECURSE iterator is the largest consumer of CPU
08:08 lizmat and that's already in NQP
08:11 lizmat so the overhead is really in scanning the dirs
08:11 nine Which we'll have to do in any case.
08:12 lizmat yup, so maybe shaing isn't the worst then
08:12 lizmat being able to sha1 directly from disk would be better
08:13 nine Unless we throw the whole architecture over board and devise a plan that works by looking for specific files...
08:13 lizmat but how would we spot new files then ?
08:14 nine New files only matter if they are dependencies of the module we load. But considering that the whole repo-id business is specifically for avoiding a dependency resolution, I'd say, don't got there :)
08:16 nine Also we only need to calculate the repo-id once per program run. Which ought to help a lot in really large applications which is also where you'll notice module loading time the most.
08:16 nine I would love to have Perl 6 versions of our applications at work just to compare load times :) Because when you load enough modules, you really start to notice Perl 5's compile time, even though it's crazy fast at compiling already.
08:36 lizmat afk&
09:05 psch r: say "foo".split(/./, 1)
09:05 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(foo)␤»
09:05 psch r: say "foo".split(/./, 2)
09:05 camelia rakudo-moar 338a70: OUTPUT«( oo)␤»
09:05 camelia ..rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:05 psch that's probably gonna be fun
09:06 psch r: "foo".match(/./, :1x)
09:06 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:06 psch r: "foo".match(/./, :2x)
09:06 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:06 psch *that* is weird, 'cause split with limit calls into .match with :x
09:07 psch oh, wait, as a Range
09:07 psch r: "foo".match(/./, :x(^2))
09:07 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:07 psch r: "foo".match(/./, :x(1..2))
09:07 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:07 psch r: "foo".match(/./, :x(1..2), :g)
09:07 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:08 psch huh, the leaking exception is $EX_CAT_RETURN..?
09:12 psch r: say "foo".split(/./, *)
09:12 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(   )␤»
09:13 psch r: say "foo".match(/./, :x(Inf))
09:13 camelia rakudo-jvm 2a1605: OUTPUT«in Str.match, got invalid value of type Num for :x, must be Int or Range␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
09:13 camelia ..rakudo-moar 338a70: OUTPUT«in Str.match, got invalid value of type Num for :x, must be Int or Range␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
09:13 psch r: say "foo".match(/./, :x(*))
09:13 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(「f」 「o」 「o」)␤»
09:13 psch r: say "foo".match(/./, :x(1..3))
09:13 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(「f」 「o」 「o」)␤»
09:44 psch r: my \matches = "foo".match(/./, :x(1..3)); say +matches
09:44 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:44 camelia ..rakudo-moar 338a70: OUTPUT«3␤»
09:44 psch aha!
09:44 psch r: my \matches = "foo".match(/./, :x(1..3)); say matches.WHAT
09:44 camelia rakudo-moar 338a70: OUTPUT«(List)␤»
09:44 camelia ..rakudo-jvm 2a1605: ( no output )
09:44 psch r: my \matches = "foo".match(/./, :x(1..3)); say matches.WHAT
09:44 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(List)␤»
09:44 psch r: my \matches = "foo".match(/./, :x(1..3)); say matches.elems
09:45 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:45 camelia ..rakudo-moar 338a70: OUTPUT«3␤»
09:45 psch r: my \matches = "foo".match(/./, :x(1..3)); say matches[0]
09:45 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«「f」␤»
09:45 psch r: my @matches = "foo".match(/./, :x(1..3)); say @matches.elems
09:45 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:45 camelia ..rakudo-moar 338a70: OUTPUT«3␤»
09:46 psch r: "foo".match(/./, :x(1..3)); say $/
09:46 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«(「f」 「o」 「o」)␤»
09:46 psch r: "foo".match(/./, :x(1..3)); say +$/
09:46 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:46 camelia ..rakudo-moar 338a70: OUTPUT«3␤»
09:54 psch so basically we get some kind of really wonky List, from the looks of it?
09:56 psch r: gather do for (1,2,3) -> $x { take $x }.cache
09:56 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: ( no output )
09:56 psch r: say +(gather do for (1,2,3) -> $x { take $x }.cache)
09:56 camelia rakudo-jvm 2a1605, rakudo-moar 338a70: OUTPUT«3␤»
09:56 psch r: say +(gather do for (1,2,3) -> $x { take $x; last }.cache)
09:56 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:56 camelia ..rakudo-moar 338a70: OUTPUT«1␤»
09:57 psch ...i think we have that in a test already somewhere that's not bound to .split
09:58 psch r: say +(gather do for (1,2,3) -> $x { take $x; last })
09:59 camelia rakudo-jvm 2a1605: OUTPUT«Error in socket connection:org.perl6.nqp.runtime.UnwindException␤     at org.perl6.nqp.runtime.ThreadContext.<init>(ThreadContext.java:125)␤  at org.perl6.nqp.runtime.GlobalContext.getCurrentThreadContext(GlobalContext.java:340)␤ at org.perl6.nqp.runtime.G…»
09:59 camelia ..rakudo-moar 338a70: OUTPUT«1␤»
09:59 psch r: say +(gather do for (1,2,3) -> $x { take $x; last; return 0 })
09:59 camelia rakudo-moar 338a70: OUTPUT«1␤»
09:59 camelia ..rakudo-jvm 2a1605: ( no output )
10:00 psch aaanyway, yeah, enough spam probably :|
10:27 psch right, so something in GATHER or the resultant Iterator leaks an UnwindException on jvm
10:28 psch which probably means we're missing to gen an unwind handler for &GATHER..?
10:41 arnsholt Sounds like it, yeah
10:42 jnthn GATHER is interesting in that it also resumes after the take exception
10:42 psch ooh, actually i think we change what kind of handlers we gen depending on whether we have anything that throws CX
10:43 jnthn (No idea if that's related to what you're hunting, though.)
10:43 jnthn (But it does mean the same handler can be hit many times)
10:43 psch so if we have the last call we might mess up some other handler..?
10:44 psch jnthn: it sounds like it could be related.  i mean, the leaking UnwindException is EX_CAT_RETURN, so it's not the last itself
10:45 jnthn Hmm
10:45 psch and it leaks out all the way to qb_11, which is the perl6 entry point afaict
10:45 psch so it's looking for a specific return handler and doesn't find it i guess?
10:46 jnthn Well, uncaught UnwindException would I guess mean that we found the handler "in theory", but then something went very wrong when trying to unwind to it
10:46 jnthn Which might suggest a mismatch between what was really on the call stack and the .caller chain
10:48 psch i mostly don't get where the return unwind comes from, honestly
10:51 psch uh
10:51 psch okay, so i have a debugnoop before the gather/take/last statement
10:51 psch and wanted to stop at ExceptionHandling.handlerDynamic
10:51 psch and we didn't even go there
10:52 psch as in, it went straight ahead to the leaking unwind in invokeDirect
10:52 psch maybe it's a lexical handler..?
10:53 psch it shouldn't be, right?  cause there was already talk of the caller chain, and that's handlerDynamic...
10:53 psch aha, but it *is* lexical
10:54 psch and it is a return CX that ends up in handlerLexical
11:04 tadzik joined #perl6-dev
11:06 ilmari[m] joined #perl6-dev
11:19 pmurias joined #perl6-dev
11:32 geekosaur joined #perl6-dev
11:41 tadzik joined #perl6-dev
11:55 dalek rakudo/nom: 9eae3c2 | lizmat++ | src/core/Rakudo/Internals.pm:
11:55 dalek rakudo/nom: Squeeze another 25% out of DIR-RECURSE
11:55 dalek rakudo/nom:
11:55 dalek rakudo/nom: Turns out stats at nqp level aren't as expensive as they were thought
11:55 dalek rakudo/nom: to be.  So do those first before checkng whether the name is acceptable
11:55 dalek rakudo/nom: as file or dir.  Since the $*REPO.id uses a regex, this makes things
11:55 dalek rakudo/nom: a lot faster as there are fewer matches needed.
11:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9eae3c2144
12:00 nine Perl, the language with the fastest and the slowest regexes...
12:07 lizmat :-)
12:08 lizmat Str.match still way up in the profiles
12:15 AlexDaniel joined #perl6-dev
12:28 dalek rakudo/nom: 12a71fe | lizmat++ | src/core/Regex.pm:
12:28 dalek rakudo/nom: Make Regex.Bool about 2x as fast
12:28 dalek rakudo/nom:
12:28 dalek rakudo/nom: - rewrite using nqp ops
12:28 dalek rakudo/nom: - don't return on success, just fall off
12:28 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/12a71feba9
12:30 ilmari lizmat++ # MOAR FASTAR!
12:41 travis-ci joined #perl6-dev
12:41 travis-ci Rakudo build failed. Elizabeth Mattijsen 'Squeeze another 25% out of DIR-RECURSE
12:41 travis-ci https://travis-ci.org/rakudo/rakudo/builds/165502441 https://github.com/rakudo/rakudo/compare/338a70a236a3...9eae3c2144ca
12:41 travis-ci left #perl6-dev
12:41 buggable [travis build above] ☠ Did not recognize some failures. Check results manually
12:50 pmurias is it known that state variables are not serialized properly?
12:50 pmurias that is, their content is not serialized at all
12:55 lizmat do you mean state variables that get initialized in a BEGIN block ?
12:55 lizmat otherwise, how would they need to be serialized ?
12:58 jnthn Don't think it was ever intended to serialize them
12:58 jnthn Same with lexicals generally except those explicitly installed at compile time
13:03 dalek nqp: 2d88d98 | usev6++ | src/vm/jvm/QAST/Compiler.nqp:
13:03 dalek nqp: Fix handling of QAST::Want on JVM (2)
13:03 dalek nqp:
13:03 dalek nqp: There were two places where 'v' was used instead of $RT_VOID.
13:03 dalek nqp: After changing those, we can test for void context in handling
13:03 dalek nqp: of QAST::Want.
13:03 dalek nqp:
13:03 dalek nqp: Fixes NPE with 'sub f { sub { say 1 } }; f()()'.
13:03 dalek nqp: review: https://github.com/perl6/nqp/commit/2d88d98201
13:03 dalek nqp: 82cae67 | (Zoffix Znet)++ | src/vm/jvm/QAST/Compiler.nqp:
13:03 dalek nqp: Merge pull request #311 from usev6/jvm_qast_want
13:03 dalek nqp:
13:03 dalek nqp: Fix handling of QAST::Want on JVM (2)
13:03 dalek nqp: review: https://github.com/perl6/nqp/commit/82cae672b4
13:03 psch bartolin++
13:03 pmurias lizmat: yes, the bug is when we create a closure with a state variable in a variable and then serialize it
13:04 * [Coke] is very excited to see all these JVM fixes!
13:05 pmurias jnthn, lizmat: http://paste.debian.net/857808 # example of the bug in place
13:12 jnthn .oO( DIHWIDT )
13:18 perlpilot pmurias: how important is it that you do that with BEGIN?   Could you use  my $closure = once { ... }  instead?
13:19 jnthn I guess if it's really wanted it's likely not all that difficult to implement.
13:22 pmurias perlpilot: it's not something I want to do, I just noticed that bug while looking how state is implemented while preparing to reimplement it on the js backend
13:25 perlpilot jnthn: I know this is a weak argument for keeping things the way they are, but in Perl 5, BEGIN blocks are ephemeral, compile-time things.  So, a P5er might balk at my $closure = BEGIN { } even working.
13:25 perlpilot (maybe that's really an argument for making it work because this is Perl 6 after all  :)
13:25 jnthn Yeah...
13:25 jnthn I mean, I don't really consider it a bug in so far as I conciously decided (3 times - Parrot, Moar, and JVM) not to actually implement it. ;)
13:26 jnthn And it's taken until now for somebody to notice, and it's not even a concrete use case :)
13:26 perlpilot indeed
13:27 jnthn That said, I don't have any particular objections to it happening.
13:27 jnthn I don't immediately see it'll cause us problems
13:33 * pmurias sent a mail to rakudobug@perl.org
13:35 dalek rakudo/nom: faea193 | lizmat++ | src/core/CompUnit/Repository/FileSystem.pm:
13:35 dalek rakudo/nom: Make $*REPO.id again 35% faster
13:35 dalek rakudo/nom:
13:35 dalek rakudo/nom: - call Str.match directly
13:35 dalek rakudo/nom: - use nqp::ops to open/set encoding/ read file
13:35 dalek rakudo/nom:
13:35 dalek rakudo/nom: use lib "."; say $*REPO.id now down to .35 seconds in rakudo checkout
13:35 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/faea193ec9
13:35 lizmat afk&
13:36 perlpilot I guess it's the same thing as   my $foo = BEGIN 5;  except that "5" is more like "do { ... };"
13:37 jnthn Heh, and that used to be 5s? :) lizmat++
13:47 MasterDuke_ joined #perl6-dev
13:51 MasterDuke_ there seem to be a bunch more people around now, would anyone happen to have a thought about my question from last night? https://irclog.perlgeek.de/perl6-dev/2016-10-06#i_13343690
13:53 p3rln00b_ joined #perl6-dev
13:54 nine Oh, yes, lizmat++
13:56 pyrimidine joined #perl6-dev
13:57 psch m: sub f(Int $bar? where { $_.VAR.name.say }) { }; f(1)
13:57 camelia rakudo-moar faea19: OUTPUT«$topic␤»
13:58 psch MasterDuke_: ^^^ i think it's related to that, BOOTSTRAP.nqp:393-508 is around where i'd look closer
13:59 psch MasterDuke_: post constraints do lexpad stuff, as well as the binding before, although i don't have the brains right now to look closer
14:00 MasterDuke_ hmm, what is "attributive binding"?
14:02 psch i think that's the BUILD magic?
14:02 psch i.e. BUILD($!a) { }
14:05 MasterDuke_ so line 393 is this: "unless $is_attributive || !$has_varname {". so all the code inside that unless has an actual $varname (i.e., not '<anon>') to work with
14:06 MasterDuke_ and i don't understand why my examples don't have a $varname
14:09 MasterDuke_ since the signature isn't sub foo(Int $) or anything like that, and i also get the same error with a named parameter and explicitly passing a type instance for that parameter
14:13 psch m: sub f(Int $bar) { }; f(Int)
14:13 camelia rakudo-moar faea19: ( no output )
14:13 psch m: sub f(Int:D $bar) { }; f(Int)
14:13 camelia rakudo-moar faea19: OUTPUT«Parameter '$bar' requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:14 psch m: sub f(Int $bar where Int:D) { }; f(Int)
14:14 camelia rakudo-moar faea19: OUTPUT«Constraint type check failed for parameter '$bar'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:14 psch m: Int > 0
14:14 camelia rakudo-moar faea19: OUTPUT«WARNINGS for <tmp>:␤Useless use of ">" in expression "Int > 0" in sink context (line 1)␤Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at <tmp> line 1␤␤»
14:14 psch MasterDuke_: ^^^ that is the error you get
14:14 psch MasterDuke_: from that place, too
14:14 psch MasterDuke_: as in, the '<anon>' varname is for the &infix:['<'] call inside the post constraint
14:15 psch m: sub f(Int $bar where { try $bar > 0; False if $! } ) { }; f(Int)
14:15 camelia rakudo-moar faea19: OUTPUT«WARNINGS for <tmp>:␤Useless use of ">" in expression "$bar > 0" in sink context (line 1)␤Constraint type check failed for parameter '$bar'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:16 psch m: sub f(Int $bar where { try so $bar > 0 or False if $! } ) { }; f(Int) # without sink warning
14:16 camelia rakudo-moar faea19: OUTPUT«Constraint type check failed for parameter '$bar'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:16 psch ...i think, i might've gotten my precs confused a bit :P
14:17 psch yeah, i think i did.  statement if is always the whole statement isn't it
14:17 MasterDuke_ interesting
14:17 psch anyway, yeah, the point stands.  the "Invocant..." is for the &infix:['<'] call
14:18 psch m: sub f(Int $bar where { ($bar // -1) < 0 }) { }; f(Int)
14:18 camelia rakudo-moar faea19: ( no output )
14:18 psch m: sub f(Int $bar where { ($bar // -1) > 0 }) { }; f(Int)
14:18 camelia rakudo-moar faea19: OUTPUT«Constraint type check failed for parameter '$bar'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:20 MasterDuke_ however, i believe in my testing i printed out the varname at the very beginning of bind_one_param and i never saw the name i gave it
14:21 MasterDuke_ i guess i don't grok the complete binding control flow
14:21 MasterDuke_ it's evaluating the post-constraint first? which is why it doesn't know the name?
14:22 psch no, it dies during running the code that is the post constraint, and prints the exception it dies with there
14:22 MasterDuke_ wait, but it has to know the name, because the post-constraint can refer the parameter by name
14:23 psch which is &infix:['<'], which binds params again
14:23 travis-ci joined #perl6-dev
14:23 travis-ci Rakudo build failed. Elizabeth Mattijsen 'Make $*REPO.id again 35% faster
14:23 travis-ci https://travis-ci.org/rakudo/rakudo/builds/165527590 https://github.com/rakudo/rakudo/compare/12a71feba966...faea193ec956
14:23 travis-ci left #perl6-dev
14:23 MasterDuke_ ah, binds parameters again, of course
14:23 buggable [travis build above] ☠ Did not recognize some failures. Check results manually
14:23 dalek roast: acf4330 | (Zoffix Znet)++ | S32-num/int.t:
14:23 dalek roast: [coverage] Cover all* of Int.pm
14:23 dalek roast:
14:23 dalek roast: *The several currently commented out subs due to RT#128655
14:23 dalek roast: possibly remain uncovered.
14:23 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128655
14:23 dalek roast:
14:23 dalek roast: https://rt.perl.org/Ticket/Display.html?id=128655
14:23 dalek roast: review: https://github.com/perl6/roast/commit/acf4330ac9
14:24 MasterDuke_ any thoughts on how to get the name(s) available to the call to &infix:['<']?
14:24 * [Coke] tries out the google translate app on ios after years of not looking at it. wow
14:25 * [Coke] uses it to turn this IRC window into German.
14:25 dalek rakudo/nom: a8006cd | (Zoffix Znet)++ | src/core/Int.pm:
14:25 dalek rakudo/nom: Include RT# in comments to clarify why subs are commented out
14:25 dalek rakudo/nom:
14:25 dalek rakudo/nom: https://rt.perl.org/Ticket/Display.html?id=128655
14:25 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a8006cd5aa
14:25 psch MasterDuke_: i'd probably CATCH the stuff inside the post constraint and add it to the constraint type check error
14:26 psch MasterDuke_: although to do that neatly you'd probably want a typed exception for post constraint failures that has a $!nested_ex or something attr
14:27 psch m: sub f($x where { $x == 5 or try die "not like this"; $!.message.say andthen False if $! }) { }; f 1
14:27 camelia rakudo-moar faea19: OUTPUT«not like this␤not like this␤Constraint type check failed for parameter '$x'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:27 psch so you get something sorta like that, maybe
14:28 psch well, except probably the other way around, i.e. "Constraint type check..." first, then the inner cause for the failure if any
14:29 MasterDuke_ cool, i'll try playing around with that
14:31 MasterDuke_ psch: thanks for the help. now off to less fun things...
14:33 lucasb_ joined #perl6-dev
14:35 [Coke] t/04-nativecall/13-union.t failing here.
14:36 [Coke] ... rebuilding with one or two more commits...
14:36 p3rln00b [Coke]: what OS?
14:37 [Coke] os x, I just saw you mentioned this in #perl6
14:37 p3rln00b Yeah, it's been flapping for ages.
14:38 p3rln00b 23 days ago, to be exact. That's when harness was fixed and travis started to complain, but it was flopping earlier too, most likely.
14:38 jnthn Anyone tried running it under valgrind or ASAN?
14:38 * p3rln00b doesn't have OSX :(
14:38 jnthn Me either
14:39 jnthn Though running it under that on Linux may show up a problem we "get away with"
14:40 jnthn (I've more than once fixed an "on OSX only" bug that left me thinking "how did it ever work anywhere..." :))
14:40 p3rln00b :)
14:42 [Coke] jnthn: I can try.
14:44 [Coke] "valgrind ./perl6 -Ilib t/04-nativecall/13-union.t" causes it to pass.
14:44 jnthn bah
14:45 [Coke] (valgrind-3.11.0)
14:45 jnthn oh
14:45 jnthn It passes on Linux
14:45 jnthn But
14:45 jnthn ok 24 - sizeof(UnionOfStructs)
14:45 jnthn ==13957== Conditional jump or move depends on uninitialised value(s)
14:45 jnthn ==13957==    at 0x5004341: get_attribute (CUnion.c:403)
14:45 [Coke] \o/
14:45 jnthn That looks a tad dubious
14:46 * [Coke] tries to upgrade his valgrind to see if he can at least get that error.
14:48 jnthn Did it on a second run too
14:48 jnthn I'm a bit tied up with $other-job task at the moment alas
14:49 [Coke] p3rln00b: can you open a ticket with the bug and jnthn's notes here?
14:50 p3rln00b Is "new ticket" button ever comming back to RT?
14:52 nine CUnion.c:402 and 403 are: void *cobj = get_ptr_at_offset(body->cunion, repr_data->struct_offsets[slot]); if (cobj) { ...
14:52 nine I wonder how cobj can be uninitilized there
14:53 p3rln00b [Coke]: done: https://rt.perl.org/Ticket/Display.html?id=129819
14:53 nine Ah, it's the field in body->cunion that may be uninitialized
14:54 [Tux] This is Rakudo version 2016.09-140-gfaea193 built on MoarVM version 2016.09-15-gc8b4228
14:54 [Tux] csv-ip5xs        3.139
14:54 [Tux] test            18.918
14:54 [Tux] test-t           7.190
14:54 [Tux] csv-parser      17.865
14:54 nine As get_ptr_at_offset is really just hiding the pointer arithmetic there
14:57 [Coke] p3rln00b: not until we have a fix for whatever allowed the spam storm in the perl5 queue.
14:58 p3rln00b I may just write a bug reporting program...
15:31 travis-ci joined #perl6-dev
15:31 travis-ci Rakudo build failed. Zoffix Znet 'Include RT# in comments to clarify why subs are commented out
15:31 travis-ci https://travis-ci.org/rakudo/rakudo/builds/165542790 https://github.com/rakudo/rakudo/compare/faea193ec956...a8006cd5aaad
15:31 travis-ci left #perl6-dev
15:39 zostay joined #perl6-dev
15:40 FROGGS joined #perl6-dev
17:02 dogbert17 joined #perl6-dev
17:03 * dogbert17 it's silent in here
17:05 * p3rln00b bangs on pots and pans
17:05 dogbert17 FWIW I got inspired by [Coke] and jnthn discussing t/04-nativecall/13-union.t so I valgrinded all tests in t/04-nativecall/. Five of them complains about fifferent things.
17:06 dogbert17 uninitalized reads, suspicious jumps etc
17:07 psch dogbert17: that sounds useful to know
17:07 dogbert17 02-simple-args.t, 08-callbacks.t, 11-cpp.t, 13-union.t and 15-rw-args.t
17:07 psch dogbert17: afair valgrind output is pretty comprehensive, maybe you wanna try and take a crack at digging deeper?
17:09 dogbert17 in that case I need to know how to compile wuth debug because now I get:
17:09 dogbert17 ok 10 - Perl's rw variable was passed and returned by C (float)
17:09 dogbert17 ==6858== Invalid write of size 8
17:09 dogbert17 ==6858==    at 0x40F1A34: MVM_nativecall_invoke (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
17:09 dogbert17 y
17:10 psch dogbert17: configuring moar with --debug --no-optimize and then make install should give you debug symbols
17:10 dogbert17 psch: thx
17:10 psch dogbert17: you don't need to recompile nqp and rakudo if they've been built with the current checkout of your moar repo
17:10 dogbert17 good to know
17:15 p3rln00b don't forget to pass the right --prefix
17:15 psch right, you do have to keep what's currently configured
17:15 psch well, aside from --debug and --no-optimize
17:25 dogbert17 :( fail. This is what I usually do: perl Configure.pl --gen-moar --gen-nqp --backends=moar
17:25 psch dogbert17: you shouldn't do anything in $rakudo-checkout
17:26 dogbert17 where then
17:26 psch dogbert17: go to $rakudo-checkout/nqp/MoarVM/
17:26 psch dogbert17: there you do 'perl Configure.pl --no-optimize --debug --prefix=$rakudo-prefix'
17:26 psch dogbert17: then 'make install'
17:27 psch dogbert17: note that $rakudo-prefix is the prefix you gave to Configure.pl in $rakudo-checkout
17:27 psch dogbert17: it's *probably* $rakudo-checkout/install, but not necessarily
17:27 dogbert17 psch: thx again will try immediately
17:30 p3rln00b joined #perl6-dev
17:36 dogbert17 stupid question, the Comfigure line I posted (and have used) doesn't have a $rakudo-prefix
17:36 dogbert17 should I refrain from specifying one then?
17:39 psch dogbert17: rakudo defaults to ./install for --prefix
17:39 psch dogbert17: in fact it should even say so during Configure.pl
17:40 psch dogbert17: so your MoarVM prefix would be $rakudo-checkout/install
17:41 dogbert17 and $rakudo-checkout is the directory where I cloned rakudo?
17:44 dogbert17 it works ..... psch++ for being patient with a noob :-)
17:45 p3rln00b joined #perl6-dev
17:46 nine dogbert17: we've all been there at one point :)
17:47 dogbert17 here's the relevant output from running t/04-nativecall/02-simple-args.t
17:47 dogbert17 ok 14 - passed ssize_t -42
17:47 dogbert17 ==12118== Conditional jump or move depends on uninitialised value(s)
17:47 dogbert17 ==12118==    at 0x40BA2D0: MVM_callsite_destroy (callsite.c:100)
17:47 dogbert17 ==12118==    by 0x40BA2F7: MVM_callsite_destroy (callsite.c:105)
17:47 dogbert17 ==12118==    by 0x41C8A0F: cleanup_callsite_interns (moar.c:373)
17:47 dogbert17 ==12118==    by 0x41C94E1: MVM_vm_destroy_instance (moar.c:444)
17:48 dogbert17 ==12118==    by 0x8048EB8: main (main.c:194)
17:50 psch that looks a lot to moar-gutsy for my knowledge
17:50 psch maybe nine++ has an idea
17:56 nine No idea. But I've started looking through places where MVMCallsite objects are allocated but arg_names is not initialized
18:01 nine Well, callsite.c is clean
18:04 nine Oh, it's NativeCall related. So NativeCall code might be a better place to look at...
18:04 psch nine: so the best guess is that NC sets up a not-fully-alloc'd CallSite?
18:10 nine The only place in NativeCall code that allocates a Callsite is unmarshal_callback but that uses MVM_calloc, so arg_names should be properly NULLed
18:13 nine Actually MVM_callsite_copy can leave arg_flags uninitialized if cs_flags_count is 0
18:15 nine find_invokee_internal may be guilty. Uses malloc to allocate the MVMCallsite but doesn't initialize arg_names
18:25 nine dogbert17: if you're bored, you could re-test with this commit :) https://github.com/niner/MoarVM/commit/0475edeeb94de456336920d43f3a73a49b38bb86
18:36 dogbert17 nine: not borde at all, will test
18:36 dogbert17 s/borde/bored/
18:49 dogbert17 and ..... the error is gone, nine++
18:49 p3rln00b \o/ nine++
18:50 psch nine++
18:51 nine :)
18:51 dogbert17 I had the same error in t/04-nativecall/11-cpp.t and it is also gone :-)
18:53 geekosaur hm, while poking at callback stuff, perhaps a default exception handler would be a good idea
18:54 geekosaur there's not much you can do other than output the exception and die, but that's better than the current situation (outputs "unwound stack and didn't find handler" and dies, with no indication of the actual exception)
18:55 FROGGS nine++
18:58 nine Btw FROGGS, you may be able to answer my question about CUnion: If cunion points at the actual C union, why do we interpret its members as pointers in get_ptr_at_offset?
19:01 FROGGS nine: that is about a union holding a struct, union or pointer or somthing
19:01 FROGGS something*
19:02 nine Aah...because it's in the case MVM_reg_obj
19:02 FROGGS aye
19:04 nine But if it's an inlined struct?
19:05 * lizmat just merged nine++ 's PR
19:06 nine FROGGS: if it's an inlined struct as in class UnionOfStructs is repr('CUnion') { HAS MyStruct   $.a; HAS YourStruct $.b; }, it's not actually a pointer but one of the struct's members, isn't it?
19:07 * geekosaur pops the callback thing onto the recent ticket
19:07 FROGGS nine: if it is HAS, then it is inlined, true
19:07 FROGGS I guess that's not supported atm though
19:08 FROGGS (except when it is)
19:10 nine Yes, that seems to be the reason for valgrind complaining about 13-union.t :)
19:11 FROGGS hmm
19:12 nine Fix coming up
19:13 dalek roast: 1533f71 | usev6++ | S05-modifier/counted.t:
19:13 dalek roast: Relax fudging for JVM a bit
19:13 dalek roast: review: https://github.com/perl6/roast/commit/1533f71908
19:14 nine Oh, the same is wrong with inlined CPP structs. Easy to spot because those too don't access cobj :)
19:14 FROGGS I see
19:15 FROGGS so we just have to check upfront that things are inlined?
19:24 nine spectesting
19:25 dogbert17 here's same scary valgrind stuff to look at while spectesting :) https://gist.github.com/dogbert17/b763306be530345d1da3a50323a56228
19:27 p3rln00b did you run perl6 with full cleanup or whatever it is?
19:27 p3rln00b there's a perl6*vallgrind* executable in rakudo's checkout
19:28 dogbert17 I ran ./perl6-valgrind-m -Ilib t/04-nativecall/15-rw-args.t
19:28 p3rln00b k :)
19:29 p3rln00b buggable is leaking too. Gonna try to find some time to narrow down the leakage (likely regexes) after roast coverage work is done.
19:31 nine PR sent
19:32 lizmat merged
19:33 lizmat afk again&
19:33 moritz that escalated quickly :-)
19:37 lucasb_ moar/nqp bump still required to silence travis failures, right?
19:38 nine think so
19:39 p3rln00b yeah
19:40 p3rln00b Anyone doing it? :)
19:47 p3rln00b Guess not :) I
19:47 p3rln00b I'm gonna do it in 1 hour then
19:49 dalek nqp: 9a29753 | moritz++ | tools/build/MOAR_REVISION:
19:49 dalek nqp: Bump moar version
19:49 dalek nqp: review: https://github.com/perl6/nqp/commit/9a29753c28
19:49 * moritz faster
19:49 p3rln00b \o/
19:49 moritz free karma \o/
19:49 dalek rakudo/nom: 605f272 | moritz++ | tools/build/NQP_REVISION:
19:49 dalek rakudo/nom: Bump NQP version
19:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/605f272881
19:49 p3rln00b moritz++
19:50 nine dogbert17: I think...I got your scary 32 bit 15-rw-args.t bug
20:00 nine PR sent :)
20:07 nine dogbert17: PR has been merged. As I don't have quick access to a 32 bit installation, I'd be grateful if you could re-valgrind 15-rw-args.t
20:07 [Coke] nine++ dogbert17++
20:13 dalek roast: 819a390 | usev6++ | S0 (5 files):
20:13 dalek roast: Unfudge tests for JVM
20:13 dalek roast: review: https://github.com/perl6/roast/commit/819a3907c6
20:16 dogbert17 sry, was watching TV, nine++
20:17 dogbert17 will test once the build is complete
20:18 nine The CUnion fix should fix 2 RT tickets :)
20:18 FROGGS \o/
20:18 nine At least there are 2 I could find
20:27 FROGGS nine: fyi: valgring is happy with t/04-nativecall using libffi on my x64 linux box
20:31 nine cool :)
20:31 FROGGS t/04-nativecall/05-arrays.t .............. 1/? ==20253== Invalid read of size 4
20:31 FROGGS :o(
20:32 FROGGS using dyncall
20:32 nine Odd. It doesn't report that here?
20:35 FROGGS ==20253==    at 0x4FC207C: MVM_nativecall_make_cstruct (nativecall.c:152)
20:35 FROGGS ==20253==    by 0x500073F: at_pos (CArray.c:297)
20:35 FROGGS my test is still running but afterwards I'll try to reproduce it
20:35 dogbert17 nine++ the errors are gone on 32 bit
20:38 FROGGS damn, cant reproduce
20:43 FROGGS well, that settles it...
20:43 FROGGS gnight
20:46 nine I guess I'll never again be able to make clames to NativeCalls beauty :) https://rt.perl.org/Ticket/Display.html?id=125243#txn-1430469
20:47 mst oh my fucking god.
20:47 geekosaur it's trying to talk to C. it'll never be truly beautiful
20:48 nine Well some way to map a type to char[65] would help a lot there :)
20:49 geekosaur you have to parse C structures. this is perl5's h2ph, haskell's hsc2hs, etc.
20:53 mst nine: yeah. which is presumably doable.
20:55 geekosaur well, it loses the intended "it just works". but, when it comes to C, "it just works" stops when you run headlong into C's conflation of array and pointer
21:10 dogbert17 nine: it turns out that there's one test which still outputs scary stuff t/04-nativecall/08-callbacks.t
21:10 dogbert17 and this scary stuff can be found here: https://gist.github.com/dogbert17/2eff5a72b684f4d46728526395b8ec88
22:39 bisectable6 joined #perl6-dev
22:47 AlexDaniel for those using bisectable: we are at 850+ commits right now. Normally this would've been done long time ago, but due to #129781 we can't really parallelize it. This means that right now you can bisect from about 2016.07
22:47 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129781
22:47 AlexDaniel bisectable6: old=2016.07 new=HEAD my @a; @a.splice(0, 0, 42)
22:47 bisectable6 AlexDaniel, Bisecting by exit code (old=2016.07 new=62d8382). Old exit code: 1
22:47 bisectable6 AlexDaniel, bisect log: https://gist.github.com/388317c5f94f266ad22ab41c2decc664
22:47 bisectable6 AlexDaniel, (2016-07-28) https://github.com/rakudo/rakudo/commit/cc212cebf80fd37d52922967cca0a27ab1b68e57
22:48 AlexDaniel bisectable6: old=2016.06 new=HEAD my @a; @a.splice(0, 0, 42)
22:48 bisectable6 AlexDaniel, No build for revision “2016.06”
22:48 AlexDaniel ;) :(

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