Perl 6 - the future is here, just unevenly distributed

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

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

All times shown according to UTC.

Time Nick Message
01:48 dalek joined #perl6-dev
05:57 RabidGravy joined #perl6-dev
06:37 FROGGS joined #perl6-dev
06:45 [Tux] This is Rakudo version 2016.10-9-g906719c built on MoarVM version 2016.10-5-g3f1ef57
06:45 [Tux] csv-ip5xs        3.161
06:45 [Tux] test            15.977
06:45 [Tux] test-t           7.386
06:45 [Tux] csv-parser      17.999
07:31 lizmat joined #perl6-dev
08:12 vendethiel joined #perl6-dev
08:36 lizmat joined #perl6-dev
09:16 FROGGS jnthn: I got now something that works: https://gist.github.com/FROGGS/b49225ac2e445f8d595579a12f2600b9#file-4_tests-sh
09:16 FROGGS jnthn: (needs lots of cleanup though)
09:16 FROGGS and the proper implementation like you said :o)
09:24 geekosaur joined #perl6-dev
10:28 dalek joined #perl6-dev
10:29 dalek rakudo/nom: 20d37a1 | lizmat++ | src/core/Rakudo/Internals.pm:
10:29 dalek rakudo/nom: Introducing Rakudo::Internals.SeqSkipNFromIterator
10:29 dalek rakudo/nom:
10:29 dalek rakudo/nom: Create a Seq from an iterator skipping N generated values first
10:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/20d37a1fcd
11:03 pmurias joined #perl6-dev
11:14 FROGGS jnthn: I've hit a problem... for nativecall subs we build info hashes in NC.pm for params and return types so that moar knows what todo...
11:14 FROGGS jnthn: now, we dont touch attributes, so we dont have these hashes for attributes which have a signature
11:30 FROGGS I mean, I can do the same hack like what I did with HAS, but I'd like to not do that...
11:44 nine https://github.com/tadzik/panda/issues/331 is a stereotypical "I shot this guy, how can I fix him? I don't want to bring him to the hospital."
11:51 tadzik hah
11:57 lizmat_ joined #perl6-dev
12:11 jnthn FROGGS: At what point is the signature needed?
12:13 FROGGS after instanciating the class I guess... not before
12:16 FROGGS jnthn: or when accessing the attribute, but I dunno how we could intercept that
12:18 jnthn What should the attribute contain?
12:18 vendethiel joined #perl6-dev
12:18 jnthn I guess some kind of Code that when invoked will make the call?
12:19 jnthn If so...maybe we can give NativeCall an "example" object when configuring the CStruct
12:19 jnthn Plus an attribute pointing to a native callsite
12:19 jnthn And it can clone + set that attr
12:19 jnthn (clone the object that is)
12:19 jnthn So it happens as part of the marshalling of the struct back from C-land
12:19 jnthn Would that help?
12:20 FROGGS I guess... but how would we configure the CStruct in NativeCall.pm?
12:20 jnthn Hmmm
12:21 jnthn Yeah, I guess there's a slight timing issue there
12:22 jnthn Or something like.
12:22 FROGGS aye
12:23 jnthn In that the CStruct REPR is decoupled from nativecall itself
12:29 FROGGS m: multi sub trait_mod:<is>(Mu $a, :$repr = 'CStruct') { say 42 }; class Foo is repr<CStruct> { has int8 $.a } # :o(
12:29 camelia rakudo-moar 20d37a: ( no output )
12:30 FROGGS m: multi sub trait_mod:<is>(Mu $a, :$repr!) { say 42 }; class Foo is repr<CStruct> { has int8 $.a }
12:30 camelia rakudo-moar 20d37a: ( no output )
12:31 FROGGS uhh
12:31 FROGGS method trait_mod:sym<is>($/) {
12:31 FROGGS # Handle is repr specially.
12:31 FROGGS if ~$<longname> eq 'repr' {
12:32 FROGGS (it sets $*REPR in the actions fwiw)
12:35 jnthn Right
12:35 jnthn That has to be a special form
12:36 FROGGS but cant the trait just set $*REPR?
12:36 jnthn ...don't do that :P
12:36 FROGGS damn
12:36 FROGGS *g*
12:36 jnthn It'll be fragile in ways we'll regret later
12:36 jnthn But
12:36 jnthn In the attribute composition
12:37 jnthn You can detect the target package has repr CStruct
12:37 jnthn And do something differently there
12:37 jnthn (nqp::reprname)
12:38 FROGGS yes, but all of what I'd liked to do is in NativeCall.pm
12:38 FROGGS and I dont think we want to move that stuff
12:39 FROGGS or do think of something else?
12:40 jnthn Well, we could have NativeCall install a hook on load, for example using nqp::bindhllsym or so, and look for that if we see we have repr CStruct
12:41 FROGGS ahhh
12:42 FROGGS sure, the user would have loaded NativeCall at that time...
12:42 jnthn In combination with a Callable type
12:42 jnthn Right
12:42 FROGGS ????
12:42 jnthn And if they didn't we can complain "Can only use Callable attributes inside of a CStruct after loading a native calling module"
12:43 FROGGS yes... I love it!
12:43 jnthn Then we don't couple it too tightly to the present NativeCall :)
12:43 FROGGS aye
12:45 brrt joined #perl6-dev
13:29 cognominal joined #perl6-dev
13:44 iBakeCake Seems like NativeCall tests are failing on Windows: https://ci.appveyor.com/project/moritz/rakudo/build/1.0.1285/job/fa73f1p27ci1t03j Lots of "x"s on https://github.com/rakudo/rakudo/commits/nom
13:45 iBakeCake And based on cursory glance, they started from when FROGGS++ did "bump nqp/moar for num->bigint fix": https://github.com/rakudo/rakudo/commit/228cbc3971e73d7fa4f3eba64c31ccca446a7ae2
13:49 [Coke] m: "{".uniname.say
13:49 camelia rakudo-moar 20d37a: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> "{".uniname.say⏏<EOL>␤    expecting any of:␤        double quotes␤        term␤»
13:49 [Coke] m: d'"{'.uniname.say
13:49 camelia rakudo-moar 20d37a: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> d⏏'"{'.uniname.say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statement …»
13:49 [Coke] m: '{'.uniname.say
13:49 camelia rakudo-moar 20d37a: OUTPUT«LEFT CURLY BRACKET␤»
13:50 [Coke] our docs refer to braces, curleys, curlys ...
13:50 iBakeCake curleys and curlys look like incorrect spelling of curlies :)
13:50 [Coke] crap, wrong window! :)
13:51 iBakeCake .oO( better than wrong door... )
13:59 iBakeCake m: use Test; is-deeply sin(my num $ = 0e0), my num $ = 1e0;
13:59 camelia rakudo-moar 20d37a: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: 1e0␤#      got: 0e0␤»
13:59 iBakeCake m: use Test; is-deeply sin(my num $ = 0e0), my num $ = 0e0;
13:59 camelia rakudo-moar 20d37a: OUTPUT«ok 1 - ␤»
13:59 iBakeCake Is this a safe test or should all floating point tests use is-approx()?
14:02 iBakeCake m: say sin pi
14:02 camelia rakudo-moar 20d37a: OUTPUT«1.22464679914735e-16␤»
14:02 iBakeCake m: say sin 2*pi
14:02 camelia rakudo-moar 20d37a: OUTPUT«-2.44929359829471e-16␤»
14:03 FROGGS iBakeCake: will look at it in a few hours
14:04 iBakeCake FROGGS++
14:06 tbrowder timotimo: any relation to github:timo?
14:08 iBakeCake tbrowder: yes
14:08 tbrowder the same person?
14:08 iBakeCake Yes.
14:08 tbrowder thanks
14:11 iBakeCake m: say (sin τ/8) == ½*sqrt 2
14:11 camelia rakudo-moar 20d37a: OUTPUT«False␤»
14:12 iBakeCake m: say (sin τ/8) ≅ ½*sqrt 2
14:12 camelia rakudo-moar 20d37a: OUTPUT«True␤»
14:12 tbrowder .tell timotimo I was introduced to Jupyter at a Python group mtg and wonder if yr project iperl6kernel could use some help? or is there no longer any interest?
14:12 yoleaux2 tbrowder: I'll pass your message to timotimo.
14:12 iBakeCake I guess better use is-approx everywhere and not rely on 0 being speshul or anything
14:22 pyrimidine tbrowder: +1 on assisting w/ iperl6kernel with timotimo
14:23 pyrimidine tbrowder: I've used Jupyter for a bit now (on and off), having a working kernel would definitely help bring in the science-types (bio, chem, etc)
14:24 arnsholt tbrowder: If you wanna work in IPerl6, I think that'd be very cool!
14:24 pyrimidine TBH I keep forgetting there is a IPerl6 :)
14:25 arnsholt I think I may be the last person to have touched the code
15:04 iBakeCake m: say (0/0) <= 0
15:04 camelia rakudo-moar 20d37a: OUTPUT«True␤»
15:04 iBakeCake m: say (0/0) => 0
15:04 camelia rakudo-moar 20d37a: OUTPUT«Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:04 vendethiel joined #perl6-dev
15:05 iBakeCake m: say (0/0) <= 1e-5
15:05 camelia rakudo-moar 20d37a: OUTPUT«False␤»
15:07 iBakeCake Oh, => is a pair :}
15:08 * iBakeCake wishes we had fancy versions of these
15:10 iBakeCake m: say (0/0) <= 0e0
15:10 camelia rakudo-moar 20d37a: OUTPUT«False␤»
15:12 bartolin_ .tell psch I (also) spend some time looking at those UnwindExceptions. didn't find a solution, but at least I think I understand why we get them with for loops and not with 'while' or 'loop'
15:12 yoleaux2 bartolin_: I'll pass your message to psch.
15:12 bartolin_ .tell psch maybe this is of interest for you: https://gist.github.com/usev6/78beac8113b8a54cf02acba66c3cd68f
15:12 yoleaux2 bartolin_: I'll pass your message to psch.
15:12 bartolin_ j: say gather while True { take 42; last } # works fine
15:12 camelia rakudo-jvm 2a1605: OUTPUT«(42)␤»
15:12 iBakeCake m: use nqp; my ($a, $b) = (0/0).Num, 1e0; say nqp::p6bool(nqp::isle_n(nqp::unbox_n($a), nqp::unbox_n($b)))
15:12 camelia rakudo-moar 20d37a: OUTPUT«False␤»
15:13 iBakeCake m: use Test; is-approx :rel-tol(1e0), 0, 0;
15:13 camelia rakudo-moar 20d37a: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤Attempt to divide by zero using div␤  in sub is-approx-calculate at /home/camelia/rakudo-m-inst-1/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 301␤  in sub is-approx at /home/…»
15:13 iBakeCake m: use Test; is-approx :rel-tol(1), 0, 0;
15:13 bartolin_ j: say gather for ^3 { take 42; last } # UnwindException
15:13 camelia rakudo-moar 20d37a: OUTPUT«ok 1 - ␤»
15:13 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…»
15:13 iBakeCake I don't get it, why one Num triggers the div-by-zero, but Int doesn't?
15:13 iBakeCake Code's here: https://github.com/rakudo/rakudo/blob/nom/lib/Test.pm6#L274
15:17 iBakeCake m: say 0/0 <= 1
15:17 camelia rakudo-moar 20d37a: OUTPUT«True␤»
15:17 iBakeCake m: say 0/0 <= 1e0
15:17 camelia rakudo-moar 20d37a: OUTPUT«False␤»
15:17 iBakeCake something with this
15:18 iBakeCake I see.
15:18 iBakeCake (the num version coerces Rat to Num
15:18 iBakeCake )
15:19 iBakeCake m: say (0/0).Bridge
15:19 camelia rakudo-moar 20d37a: OUTPUT«NaN␤»
15:29 [Coke] m: say '['.uniname
15:29 camelia rakudo-moar 20d37a: OUTPUT«LEFT SQUARE BRACKET␤»
15:32 iBakeCake m: dd [ 0/0 == 0, 0/0 < 0, 0/0 <= 0 ]
15:32 camelia rakudo-moar 20d37a: OUTPUT«[Bool::False, Bool::False, Bool::True]␤»
15:32 * iBakeCake claims that to be a bug
15:34 dalek roast: d5a9ebb | usev6++ | S32-list/head.t:
15:34 dalek roast: Unfudge test for rakudo-j
15:34 dalek roast:
15:34 dalek roast: ... lizmat++ added a bandaid with rakudo commit 666128fc6e
15:34 dalek roast: review: https://github.com/perl6/roast/commit/d5a9ebb334
15:34 tbrowder ref iperl6: can someone cobble together a rudimentary getting started guide or todoroadmap list to help a noob?
15:35 tbrowder s/todoroadmap/todo list or roadmap/
15:36 tbrowder (whatever...)
15:49 sivoais timotimo tbrowder arnsholt pyrimidine : hey all, as the author of IPerl (for Perl 5), I can help out with anything you all need
15:49 sivoais link is <https://github.com/EntropyOrg/p5-Devel-IPerl>
15:49 iBakeCake \o/
15:52 tbrowder sivoais: and very cool Iperl5 is--looked at it last night after i saw Jupyter for the first time--looks like a great tool for Perl [56] teaching, marketing, and evangelism
15:53 pyrimidine sivoais++
15:53 iBakeCake m: multi foo (1/3) {}
15:53 camelia rakudo-moar 20d37a: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> multi foo (1/3⏏) {}␤    expecting any of:␤        infix stopper␤»
15:53 iBakeCake aww :(
15:55 sivoais speaking of the last bit, I'm working on that :-) I'm writing some lesson plans for Perl and that's why I made this EntropyOrg GitHub organisation. I want to have a central place where people can learn how to apply Perl to science problems
15:56 sivoais I've put together a quick site at <http://entropyorg.github.io/>. Planning on hosting some Jupyter notebooks on there.
15:59 iBakeCake Rakudobugged: https://rt.perl.org/Ticket/Display.html?id=129911
16:01 dalek rakudo/nom: f7770ed | (Zoffix Znet)++ | / (2 files):
16:01 dalek rakudo/nom: Fix edge case in is-approx that triggers DivByZero exception
16:01 dalek rakudo/nom:
16:01 dalek rakudo/nom: If both $got and $expected are zero, their absolute max is also zero,
16:01 dalek rakudo/nom: so we end up dividing by zero to calculate relative difference. This
16:01 dalek rakudo/nom: was actually silent due to 0/0 <= Int returning True, however other
16:01 dalek rakudo/nom: Numerics give False, triggering test failure, and the explosion when
16:01 dalek rakudo/nom: attempting to print the resultant relative difference to user.
16:01 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f7770ed2fb
16:06 iBakeCake m: say (0/0) == (0/0)
16:06 camelia rakudo-moar 20d37a: OUTPUT«True␤»
16:06 iBakeCake m: say (0/0).Num == (0/0).Num
16:06 camelia rakudo-moar 20d37a: OUTPUT«False␤»
16:06 iBakeCake m: say (0/0).Int == (0/0).Int
16:06 camelia rakudo-moar 20d37a: OUTPUT«Attempt to divide by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:06 iBakeCake Pretty nuts, but at least it makes perfect sense :)
16:07 geekosaur m: (0/0).WHAT.say
16:07 camelia rakudo-moar 20d37a: OUTPUT«(Rat)␤»
16:07 geekosaur yeh. I guess that covers it...
16:09 iBakeCake m: say 100/0 == 42/0
16:09 camelia rakudo-moar 20d37a: OUTPUT«True␤»
16:09 iBakeCake This makes lesser sense...
16:10 geekosaur aren't they both infinity?
16:10 iBakeCake m: say -100/0 == 42/0
16:10 camelia rakudo-moar 20d37a: OUTPUT«True␤»
16:10 iBakeCake Fine, how about this one? :)
16:10 iBakeCake (by IEEE that'd be -Inf == Inf)
16:11 geekosaur except this is Rat, not Num
16:11 iBakeCake Exactly, so I'd expect it to compare more sanely
16:11 iBakeCake And our Nums give NaN for 0/0
16:11 iBakeCake m: dd (0/0).Num
16:11 camelia rakudo-moar f7770e: OUTPUT«NaN␤»
16:12 iBakeCake m: dd (my num $ = 0) / (my num $ = 0)
16:12 camelia rakudo-moar f7770e: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
16:12 iBakeCake m: dd (my num $ = 0e0) / (my num $ = 0e0)
16:12 camelia rakudo-moar f7770e: OUTPUT«This type cannot unbox to a native number: P6opaque, Failure␤  in block <unit> at <tmp> line 1␤␤»
16:12 geekosaur which, arguably Rat is not handling signs ideally there, but I'm not sure how you handle it --- think it's one of those cases where different use cases expect different behavior
16:14 * iBakeCake decides not to go down that rabbit hole and continues covering nummy trig :)
16:30 iBakeCake m: say tan(π/2) == Inf
16:30 camelia rakudo-moar f7770e: OUTPUT«False␤»
16:30 iBakeCake Booo! Bug :}
16:33 moritz m: say tan(π/2)
16:33 camelia rakudo-moar f7770e: OUTPUT«1.63312393531954e+16␤»
16:35 [Coke] m: use Test; is-approx( tan(/2), Inf);
16:35 camelia rakudo-moar f7770e: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> use Test; is-approx( tan(/2⏏), Inf);␤    expecting any of:␤        argument list␤        infix stopper␤        term␤»
16:35 [Coke] m: use Test; is-approx( tan(/2), Inf);
16:35 camelia rakudo-moar f7770e: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> use Test; is-approx( tan(/2⏏), Inf);␤    expecting any of:␤        argument list␤        infix stopper␤        term␤»
16:35 [Coke] arglebargle.
16:35 iBakeCake m: use Test; is-approx( tan(π/2), Inf);
16:35 camelia rakudo-moar f7770e: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# maximum absolute tolerance: 1e-05␤# actual absolute difference: Inf␤»
16:35 [Coke] (the answer is no, btw.)
16:36 iBakeCake The answer is yes, and I can prove it! :)
16:36 iBakeCake m: say π/2 == atan ∞
16:36 camelia rakudo-moar f7770e: OUTPUT«True␤»
16:36 iBakeCake boom :P
16:36 iBakeCake ^_^
16:37 geekosaur m: say (π/2).WHAT
16:37 camelia rakudo-moar f7770e: OUTPUT«(Num)␤»
16:37 geekosaur ok, so at least it's not that silliness...
16:37 iBakeCake :)
16:38 FROGGS Failed to create directory 'C:\rakudo\lib\.precomp\65678D71BDBB5D2550E231A8B22B6669961F1184.1476807230.24051' with mode '0o777': Failed to mkdir: 2
16:38 FROGGS :o(
16:38 iBakeCake No, it's 'cause our π/2 is not exact π/2 in mathematical sense so it's not exactly at tan's assymptote :)
16:38 FROGGS it creates the dir and then explodes... I guess it tries to create it twice
16:40 jnthn FROGGS: If you re-run it then mysteriously works :/
16:40 jnthn FROGGS: That's been driving me nuts the last couple of days, been doing a little module development on Windows
16:40 FROGGS jnthn: yes, have to run it several times though
16:40 jnthn FROGGS: Yes, but for me at least it is a different directory each time...
16:40 FROGGS https://gist.github.com/FROGGS/215ca7354be0ccc99c4b2216159c44fd
16:40 jnthn And eventually works
16:41 FROGGS nine: do you have a clue offhand?
16:41 jnthn I was considering using some of my Perl 6 tuits tomorrow to look into it, but feel free to beat me to it...
16:41 FROGGS sure
16:44 FROGGS might be about the stat buffer? we'll see...
16:47 geekosaur welp, was trying to look but my line numbers differ and the local notwork is sufficiently not that updating git is hanging :/
16:47 FROGGS C:\rakudo>perl6 -e "my $foo = 'foo'.IO; say $foo.e; say $foo.mkdir"
16:47 FROGGS False
16:47 FROGGS Failed to create directory 'C:\rakudo\foo' with mode '0o777': Failed to mkdir: 2
16:50 FROGGS it acts as like success<=>failure are inverted for nqp::mkdir
16:52 FROGGS wow
16:52 FROGGS mkdir "foo" returns true if "foo" is a file
16:52 FROGGS :S
16:53 ugexe from nqp, or from its existence being cached by $foo.e?
16:54 iBakeCake m: subset InfTan of Num where * % (π/2) ≅ 0; multi tan (InfTan) { ∞ }; dd [ tan(π), tan(π/2), tan(2) ]
16:54 camelia rakudo-moar f7770e: OUTPUT«Cannot invoke this object (REPR: Null; VMNull)␤  in whatevercode  at <tmp> line 1␤  in any accepts_type at gen/moar/m-Metamodel.nqp line 3472␤  in sub tan at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:54 FROGGS ugexe: moar
16:54 FROGGS ugexe: moar does a stat after calling mkdir
16:56 FROGGS ugexe: see https://github.com/MoarVM/MoarVM/blob/master/src/io/dirops.c#L46
17:01 FROGGS jnthn: if "last couple of days" is like 9, then I might know why :o)
17:02 * geekosaur just spotted the cause of that true-on-file...
17:02 FROGGS yeah, it is JimmyZ's patch that is intended to not change meaning
17:02 FROGGS geekosaur: yeah
17:03 FROGGS brb
17:03 geekosaur (you will get EEXIST in mkdir_p if a component mkdir fails because it's a file, but MVM_dir_mkdir thinks all EEXIST mean the dir existed beforehand
17:03 iBakeCake Rakudobugged: https://rt.perl.org/Ticket/Display.html?id=129912
17:07 geekosaur in fact, since the errno we're seeing is EEXIST, this is probably both bugs :)
17:24 iBakeCake m: use Test; is-approx :rel-tol(1e-15), sin(τ), 0
17:24 camelia rakudo-moar f7770e: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# maximum relative tolerance: 1e-15␤# actual relative difference: 1␤»
17:24 iBakeCake commitable: 2016.10 use Test; is-approx :rel-tol(1e-15), sin(τ), 0
17:24 committable6 iBakeCake, ¦«2016.10»: not ok 1 - ␤␤# Failed test at /tmp/ALIDT91faL line 1␤# maximum relative tolerance: 1e-15␤# actual relative difference: 1 «exit code = 1»
17:24 iBakeCake Well, damn.
17:25 iBakeCake My is-approx version totally sucks in real-world usage :(
17:26 iBakeCake At least now I know what all that trickery about using abs-tol closer to zero was all about :'(
17:29 iBakeCake Point to learn: pay more attention to real world usage, not how n00b-friendly your interface is
17:33 hoelzro_ joined #perl6-dev
17:33 Ulti_ joined #perl6-dev
17:33 jsimonet joined #perl6-dev
17:33 facetious joined #perl6-dev
17:33 stmuk joined #perl6-dev
17:34 ugexe joined #perl6-dev
17:34 moritz joined #perl6-dev
17:34 go|dfish joined #perl6-dev
17:35 iBakeCake How terrible would it be to amend the no-arg behaviour of is-approx? 'cause I know roast will still pass, but that's largely due to there being no tests for it in roast.
17:36 nine FROGGS: I'm glad you've already found it because I'd have had no idea :)
17:37 iBakeCake Basically, while the original idea that default abs-tol of 1e-5 is easy to understand worked great... Unfortunatelly, in real world usage that default is kinda useless. I keep running into cases where that value is too high or too low, so I keep having to explicitly specify :rel-tol, but then if you do that, you run into cases where you have to switch to abs-tol if you're testing in proximity to zero. So
17:37 iBakeCake the old is_approx handled that actually well; I was just too stupid to see it.
17:37 Hotkeys joined #perl6-dev
17:38 iBakeCake So I want to plug the old is_approx behaviour when no tolerances are specified. Giving us both the DWIMMI version and fully configurable version
17:39 zostay joined #perl6-dev
17:41 * geekosaur saw the commit was reverted... proper fix for that would have been to see not-a-dir and immediately return -1/ENOTDIR, so -1/EEXIST specifically means valid dir already existed. although unsure whether that would also fix the Windows misbehavior.
17:43 FROGGS geekosaur: we can fix it in a branch... just wanted to unbust windows build quickly
17:43 geekosaur sure.
17:46 tbrowder joined #perl6-dev
17:47 [Coke] is that a post-release commit?
17:47 dalek roast: 441508d | usev6++ | S02-types/num.t:
17:47 dalek roast: Fudge failing test for infix<**>(num, num) on JVM
17:47 dalek roast: review: https://github.com/perl6/roast/commit/441508d2e9
17:48 dalek nqp: b270833 | FROGGS++ | tools/build/MOAR_REVISION:
17:48 dalek nqp: bump moar to unbust windows
17:48 dalek nqp: review: https://github.com/perl6/nqp/commit/b2708330f8
17:49 dalek rakudo/nom: 208a4c2 | FROGGS++ | tools/build/NQP_REVISION:
17:49 dalek rakudo/nom: bump nqp/moar to unbust windows
17:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/208a4c2927
17:49 FROGGS [Coke]: was pre release
17:49 iBakeCake FROGGS: is Windows sufficiently busted that R* release is best not based on it?
17:50 iBakeCake on the build with that commit in
17:50 FROGGS well, one could patch it manually... or we'd do a point release
17:50 FROGGS both would work
17:50 geekosaur since installing packages requires multiple attempts, I'd say yes it is too broken
17:51 iBakeCake stmuk: ^^^ what are we doing? Are you going to patch manually? From what I understand the issue is down in MoarVM. If you need me to do a point-release, let me know
17:52 FROGGS .tell stmuk have a look at https://github.com/MoarVM/MoarVM/commit/0402247933
17:52 yoleaux2 FROGGS: I'll pass your message to stmuk.
18:00 FROGGS iBakeCake: btw, the nativecall test fails are also gone on windows: https://ci.appveyor.com/project/moritz/rakudo/build/job/6c9ywwxthhffbg2v
18:00 FROGGS iBakeCake: perhaps related... dunno
18:01 iBakeCake cool
18:04 moritz note that the appveyor tests have been flapping for quite some time
18:05 iBakeCake j: my num $n1 = 1e0; my num $nu; dd $n1 ** $nu
18:05 camelia rakudo-jvm 2a1605: OUTPUT«NaN␤»
18:09 iBakeCake m: use NativeCall; sub pow(num64, num64-->num64) is native {}; dd pow 1e0, NaN
18:09 camelia rakudo-moar f7770e: OUTPUT«1e0␤»
18:12 iBakeCake I wonder if that's a backend difference that should be acceptable? 'cause we're basically using native VM ops and JVM's uses the version of pow() that gives a NaN for 1**NaN
18:18 [Coke] I'd like to think that rakudo has one right answer there, and we have to work around the vms that disagree, but that may be unreasonable.
18:18 iBakeCake j: multi infix:<**> (num, NaN) { 1e0 }; my num $n1 = 1e0; my num $nu; dd $n1 ** $nu
18:18 camelia rakudo-jvm 2a1605: OUTPUT«NaN␤»
18:18 iBakeCake I guess that can be one way
18:19 iBakeCake well.. if it atually worked :D
18:25 AlexDaniel joined #perl6-dev
18:26 bartolin_ I'm not sure how to handle that. for the records a link to the java docs where it says 'if the second argument is NaN, then the result is NaN' https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#pow-double-double-
18:28 iBakeCake bartolin_: yeah, and that's correct :) Both versions are correct
18:29 bartolin_ yeah. I tend to think those differences should be okay.
18:40 dalek rakudo/nom: 82432a4 | (Zoffix Znet)++ | lib/Test.pm6:
18:40 dalek rakudo/nom: Make is-approx DWIM when no tolerances are provided
18:40 dalek rakudo/nom:
18:40 dalek rakudo/nom: When current version was designed, the default was chosen to abs-tol of 1-e5, with
18:40 dalek rakudo/nom: reasoning behind that it would be easy for users to understand it (as compared with
18:40 dalek rakudo/nom: rel-tol or some DWIM mechanism). While that goal was accomplished, when using the
18:40 dalek rakudo/nom: function in real-world application, the abs-tol default proves to be nearly useless.
18:40 dalek rakudo/nom: It's too small for large numbers and too large for small numbers, forcing the user to
18:40 dalek rakudo/nom: specify manually. Moreover, rel-tol can't be used when $expected is zero, so the user
18:40 dalek rakudo/nom: constantly has to think about which tolerances to plug into the function.
18:40 dalek rakudo/nom:
18:40 dalek rakudo/nom: This commit restores the DWIMmy behaviour of old is_approx for the default case where
18:40 dalek rakudo/nom: no tolerances are given: if $expected.abs() is smaller than 1e-6, use absolute
18:40 dalek rakudo/nom: tolerance of 1e-5; else, use relative tolerance of 1e-6.
18:40 iBakeCake https://github.com/rakudo/rakudo/commit/82432a4581d06213990e97a8e8a094444d9991d5
18:46 iBakeCake Zoffix--
19:27 pyrimidi_ joined #perl6-dev
19:31 iBakeCake ZOFVM: Files=1198, Tests=130033, 129 wallclock secs (21.45 usr  3.11 sys + 2387.52 cusr 190.78 csys = 2602.86 CPU)
19:34 dalek rakudo/nom: b4fe680 | (Zoffix Znet)++ | lib/Test.pm6:
19:34 dalek rakudo/nom: Make is-approx include actual received values in failure output
19:34 dalek rakudo/nom:
19:34 dalek rakudo/nom: Sample, when both tolerances are set:
19:34 dalek rakudo/nom: │not ok 1 -
19:34 dalek rakudo/nom: │
19:34 dalek rakudo/nom: │# Failed test at -e line 1
19:34 dalek rakudo/nom: │#     expected approximately: -0.785398163397448
19:34 dalek rakudo/nom: │#                        got: 2.35619449019234
19:34 dalek rakudo/nom: │# maximum absolute tolerance: 1e-100
19:34 dalek rakudo/nom: │# actual absolute difference: 3.14159265358979
19:34 dalek rakudo/nom: │# maximum relative tolerance: 0.1
19:34 iBakeCake dalek: you're doing a very poor job with this commit business... I may just replace you!
19:35 pyrimidine joined #perl6-dev
19:35 bartolin_ *g* Zoffix++
19:46 * iBakeCake Zoffix http://temp.perl6.party/trig-tests.txt
19:46 iBakeCake oops
19:46 iBakeCake Good thing it wasn't top secret information I tried to message :}
19:51 dalek rakudo/nom: 43dbc96 | (Zoffix Znet)++ | lib/Test.pm6:
19:51 dalek rakudo/nom: Make _diag propagate indents to each line of diag message
19:51 dalek rakudo/nom:
19:51 dalek rakudo/nom: Fixes staggered indents with multi-line failure messages/user-triggered
19:51 dalek rakudo/nom: diag() messages that are output while running inside a subtest()
19:51 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/43dbc96976
19:51 * iBakeCake &
20:17 jdv79 Could we do a pay per bug kind of thing?
20:18 timotimo you're looking for that gnarly concurrency bug to be hunted down and slain?
20:18 yoleaux2 14:12Z <tbrowder> timotimo: I was introduced to Jupyter at a Python group mtg and wonder if yr project iperl6kernel could use some help? or is there no longer any interest?
20:18 jdv79 not that it matters much in the large but I've stopped playing with perl6 because of a couple async bugs blocking a personal project.
20:19 timotimo tbrowder: all the help is needed
20:21 tbrowder timotimo: would it help to study p5 version or are you starting from scratch?
20:22 timotimo i'm not actually investing any time in that project, haven't in a year or two
20:22 [Coke] jdv79: what's your RT again?
20:22 timotimo the current stuff in there is arnsholt's work, iirc
20:22 timotimo feel free to go to extreme measures to tackle this project: Inline::Perl5, Inline::Python, whatever ;)
20:22 [Coke] timotimo: Inline::Tcl or bust.
20:23 timotimo heh.
20:24 [Coke] I picked bust, btw.
20:24 timotimo i see
20:25 sivoais timotimo, tbrowder: would you be open to using a similar API to the P5 version that I wrote? Or even collaborating under the EntropyOrg GitHub repo?
20:25 sivoais I'm asking because that way we can share the load of marketing and documentation.
20:26 timotimo what does that API add on top of the ipython api?
20:26 timotimo er, i mean jupyter api
20:27 Ven_ joined #perl6-dev
20:27 sivoais The Jupyter API only gives the messaging spec. What I did is create a set of Perl-side interfaces that any objects can use to advertise that they can be displayed in the browser.
20:27 sivoais "multimedia capabilities"
20:27 sivoais I'll link an example
20:28 sivoais essentially, any object that can be displayed implements this method <https://github.com/EntropyOrg/p5-Devel-IPerl/blob/master/lib/Devel/IPerl/Display/Role/Displayable.pm>
20:29 sivoais that returns a hash of MIME types to representations
20:30 sivoais I then have specific versions of that for different file formats such as PNG or SVG
20:30 sivoais e.g., <https://github.com/EntropyOrg/p5-Devel-IPerl/blob/master/lib/Devel/IPerl/Display/SVG.pm>
20:33 timotimo what's the value of the representations hash?
20:33 sivoais I have also done the work of converting Jupyter Notebooks to POD so that they can be used as CPAN documentation. :-) Very useful for image processing libraries.
20:33 timotimo cool
20:34 timotimo sorry, not "the value of the hash", "the values in the hash"
20:37 sivoais The values are byte-strings. They are used to respond to the frontend with the display_data message type <http://jupyter-client.readthedocs.io/en/latest/messaging.html#id4>
20:37 sivoais You can send multiple representations so that the frontend can choose which one is appropriate for its interface.
20:39 sivoais so for a PNG, it's { "image/png" => (raw bytes of PNG), "text/html" => '<img src="data:..."/>' }
20:41 sivoais So an example of where this interface would be useful is if I made a PDL subclass that indicated that the contents are RGB images. That way I can automatically display the contents after doing a calculation.
20:43 sivoais Another example of it in action <http://nbviewer.jupyter.org/github/zmughal/zmughal-iperl-notebooks/blob/master/IPerl-demos/20150209_IPerl_display_demo.ipynb>
21:01 dalek rakudo/nom: eb6907e | (Zoffix Znet)++ | lib/Test.pm6:
21:01 dalek rakudo/nom: Consider current $indent when blanking empty _diag() lines
21:01 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/eb6907ee01
21:14 timotimo sivoais: i was wondering if maybe it could be "lazy", i.e. the backend and frontend would decide on one type and the backend would generate the bytestring for that, then
21:18 sivoais timotimo: I was thinking about that as well, but we're working with a message spec that is a little limited by the capabilities of the frontend. It doesn't have any content negotiation yet.
21:18 timotimo right
21:19 dalek joined #perl6-dev
21:20 ilmari[m] joined #perl6-dev
21:20 tadzik joined #perl6-dev
21:21 sivoais We'd have to create a proposal (JEP) in order to get something like that. Another reason why they haven't gone in that direction is that all the representations are stored in the notebook format so that post-processors can make use of it.
21:21 sivoais For example, if you wanted to turn a notebook into a PDF via LaTeX.
21:32 pyrimidine It's funny, I don't recall whether you can easily jump back and forth from various languages with Jupyter (I think so, but not sure)
21:34 pyrimidine for instance, I use perl (5 and 6), python, R.  It's quite conceivable I would use a mix of all of those in one bioinformatics project depending on the tools I am using
21:34 sivoais pyrimidine: you can switch kernels in Jupyter Notebook, but the last I tried, a language applies to the entire notebook when you are trying to use syntax highlighting. It's not really well thought out for that use case.
21:35 sivoais But Beaker Notebook uses the same backend and has some support for that idea
21:35 pyrimidine May have to look at Beaker.  We're running into this more and more
21:36 sivoais I have not yet tried it, but that requires some more work to get right. afaict, it doesn't handle complex data types... so transferring a PDL or an R data.frame or a NumPy nd-array isn't exactly going to happen
21:37 sivoais your best bet might be storing in HDF? :-/
21:38 pyrimidine or we could use Perl 6 and just use Inline::Perl5/Python.  Now just need to get Inline::R :)
21:40 timotimo inline r is probably easy ish
21:41 pyrimidine timotimo: well-volunteered!
21:43 pyrimidine looking at beaker, it appears they support some autotranslation between languages (example is processing data w/ python, model in R, viz in JS).
21:43 pyrimidine however, it appears that perl is not one of their supported languages :/
21:50 sivoais pyrimidine: I have the R interface in P5 <https://github.com/EntropyOrg/p5-Statistics-NiceR>
21:51 sivoais You can see that I'm building out an entire science ecosystem ;-)
21:52 pyrimidine sivoais: nice!
22:00 Zoffix jdv79, it would help your bug, if you could reproduce it with something smaller than an entire XML module :}
22:00 Zoffix [Coke], it's https://rt.perl.org/Ticket/Display.html?id=128833
22:23 dalek roast: e692da7 | (Zoffix Znet)++ | S02-types/num.t:
22:23 dalek roast: [coverage] Cover nummy trig: [a]sin, [a]cos, and [a]tan
22:23 dalek roast: review: https://github.com/perl6/roast/commit/e692da7419
22:24 samcv i am trying to update learnxinyminutes.com for perl6 and want to double check before i change this line: # Hashes are actually arrays of Pairs
22:25 samcv as far as i am aware perl 6 makes it easy to use hashes `as` arrays and convert between them, but the underlying implementation is very different yes? at least in perl 5 it is
22:25 geekosaur my understanding is that the external representation of a hash's content is an array of pairs, but it's something mroe actual-hash-like internally
22:26 Zoffix samcv, I wouldn't put that as that, since hashes are meant to be unordered, yet array means ordered. Underlying implementation should be irrelevant.
22:26 geekosaur (because otherwise the kinds of things you want a hash for have bad performance)
22:26 samcv exactly geekosaur :) then it wouldn't really be a 'hash table' would it :p
22:26 samcv ok cool thanks Zoffix. I will update it to be more correct.
22:29 samcv it seems to print them out 'ordered' but i don't think that is its underlying structure at all {1 => one, 100 => one hundred, 15 => fifteen, 9 => nine}
22:30 Zoffix samcv, yeah, I think the "unordered" bit isn't done yet
22:30 samcv so it does store them in order atm? but it's not guaranteed by the spec?
22:31 geekosaur stored in order would be kinda bad for internals
22:32 geekosaur I have a vague recollection that the default output was changed to unordered and that broke some other ops that turned out to rely on it being sorted; and those other ops need to be tracked down and fixed
22:32 geekosaur (I *think* it was related to metaops?)
22:34 dalek roast: afd32c2 | (Zoffix Znet)++ | S02-types/num.t:
22:34 dalek roast: Adjust spacing in formatting
22:34 dalek roast: review: https://github.com/perl6/roast/commit/afd32c2b2b

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