Perl 6 - the future is here, just unevenly distributed

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

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

All times shown according to UTC.

Time Nick Message
01:31 japhb viki: IMO, Str.Numeric should handle literally any number format or characters that are valid any other way that Perl 6 parses source.
01:32 japhb viki: Unfortunately, I wrote it long before TimToady expanded the characters that could be used to write numbers.
01:32 japhb viki: Which is to say, Str.Numeric is due for some fixes.
02:49 ilbot3 joined #perl6-dev
02:49 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
05:05 mst joined #perl6-dev
06:38 psch r: class A { has int $!x }; use nqp; say nqp::iscont(nqp::getattr(A.new, A, '$!x'))
06:38 camelia rakudo-moar 53d7b7, rakudo-jvm 76b061: OUTPUT«0␤»
06:40 psch that's kind of the trouble i have with the attributive store bug on jvm
06:40 psch clearly a native Attribute itself doesn't have a container
06:41 psch so we might need a ContainerSpec for Attributes..?
06:45 psch actually, the Binder knows it's native and could probably just do the right coerce_* and bindattr_* call..?
06:45 psch unless there's something special we might have to call STORE for, but that should only happen for typeds or Proxy, right?
06:48 psch oh geez, actually that's kinda tough there
06:49 psch m: class A { has int $!x; method foo($!x) { } }; A.new.foo(2)
06:49 camelia rakudo-moar 53d7b7: ( no output )
06:49 psch .foo doesn't have a native constraint
06:51 RabidGravy joined #perl6-dev
06:56 psch m: class A { has int $!x; method foo($!x) { } }; A.new.foo(2e0)
06:56 camelia rakudo-moar 53d7b7: OUTPUT«This type cannot unbox to a native integer: P6opaque, Num␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:56 psch aha
06:57 psch not sure if that's LTA, honestly, but it alleviates one concern with the patch idea i'm having right now :)
07:34 psch uhh
07:34 psch am i wrong in thinking that having a STable with .REPRData.flattenedSTables == null is kinda weird and shouldn't really happen..?
08:04 psch anyway
08:04 psch $ ./perl6-j -e'class A { has int $!foo; method bar($!foo) { $!foo } }; say A.new.bar(2)'
08:04 psch 2
08:05 psch 'make test' passes, too, spectest probably still is way to noisy to say what's going on though... :/
08:08 dalek rakudo/nom: 88152b1 | peschwa++ | src/vm/jvm/runtime/org/perl6/rakudo/Binder.java:
08:08 dalek rakudo/nom: Implement attributive parameter binding on the JVM.
08:08 dalek rakudo/nom:
08:08 dalek rakudo/nom: As noted in the patch itself, there seem to be cases where we lose the
08:08 dalek rakudo/nom: flattened STables in the REPRData for a given STable. As of now this patch just
08:08 dalek rakudo/nom: ignores that and tries to DTRT regardless, which means falling back to the
08:08 dalek rakudo/nom: previous behavior of simply assuming a boxed Attribute.
08:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/88152b180c
08:12 psch r: say $*PERL.compiler # hrm :/
08:12 camelia rakudo-jvm 76b061: OUTPUT«rakudo (2016.10.266.g.76.b.0618)␤»
08:12 camelia ..rakudo-moar 88152b: OUTPUT«rakudo (2016.10.302.g.88152.b.1)␤»
08:28 psch r: class A { has int $.x is rw; method x($.x) { $.x } }; A.new.x(10)
08:28 camelia rakudo-jvm 76b061: OUTPUT«java.lang.RuntimeException: $.x parameters NYI␤  in method x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:28 camelia ..rakudo-moar 88152b: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in method x at <tmp> line 1␤  in method x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:29 psch oh, moar complains because .x isn't the accessor...
08:29 psch r: class A { has int $.x is rw; method foo($.x) { $.x } }; A.new.foo(10)
08:29 camelia rakudo-jvm 76b061: OUTPUT«java.lang.RuntimeException: $.x parameters NYI␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:29 camelia ..rakudo-moar 88152b: ( no output )
08:29 psch r: class A { has int $.x is rw; method foo($.x) { $.x } }; A.new.foo(10).say
08:29 camelia rakudo-jvm 76b061: OUTPUT«java.lang.RuntimeException: $.x parameters NYI␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:29 camelia ..rakudo-moar 88152b: OUTPUT«10␤»
08:30 psch r: class A { has int $.x; method foo($.x) { $.x } }; A.new.foo(10).say
08:30 camelia rakudo-jvm 76b061: OUTPUT«java.lang.RuntimeException: $.x parameters NYI␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:30 camelia ..rakudo-moar 88152b: OUTPUT«Cannot find method 'STORE': no method cache and no .^find_method␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:30 psch actually, i think i'll leave that alone for now :S
09:26 Ulti joined #perl6-dev
09:28 FROGGS joined #perl6-dev
09:47 cognominal joined #perl6-dev
09:49 pmurias joined #perl6-dev
09:49 dalek nqp: e1e73a2 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files):
09:49 dalek nqp: [js] Make nqp::decode changed the VMArray instead of returning a hacked NQPArray.
09:49 dalek nqp: review: https://github.com/perl6/nqp/commit/e1e73a288e
09:49 dalek nqp: 4693bb8 | (Pawel Murias)++ | t/nqp/082-decode.t:
09:49 dalek nqp: Test that nqp::decode modifies the passed buffer instead of returning a fresh one.
09:49 dalek nqp: review: https://github.com/perl6/nqp/commit/4693bb8294
10:33 dalek nqp: 3f0dece | (Pawel Murias)++ | src/vm/js/ (2 files):
10:33 dalek nqp: [js] Make nqp::can and nqp::findmethod make use of HOW.find_method.
10:33 dalek nqp: review: https://github.com/perl6/nqp/commit/3f0dece35d
11:19 dalek nqp: c57e973 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (3 files):
11:19 dalek nqp: [js] Serialize/deserialize the method cache authenticity.
11:19 dalek nqp:
11:19 dalek nqp: Set it in places where we are constructing method caches manually.
11:19 dalek nqp: review: https://github.com/perl6/nqp/commit/c57e973248
12:12 AlexDaniel joined #perl6-dev
12:58 AlexDaniel joined #perl6-dev
13:43 dalek rakudo/nom: b4592c0 | (Zoffix Znet)++ | src/core/Rational.pm:
13:43 dalek rakudo/nom: Improve readability of Rational.Str code
13:43 dalek rakudo/nom:
13:43 dalek rakudo/nom: - Avoid single-letter variables
13:43 dalek rakudo/nom: - Do not reuse the same variable for different purposes
13:43 dalek rakudo/nom:
13:43 dalek rakudo/nom: Part of bug hunt for 0.9999999999999999999999.Str => "0.10"
13:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b4592c0465
13:44 DrForr "It's a bug hunt, man!"
13:44 lizmat viki++
14:00 lizmat m: say <a b b c c c d d d d>.pick(*-4)   # I sorta expected that to work, am I wrong ?
14:00 camelia rakudo-moar b4592c: OUTPUT«Cannot resolve caller Numeric(WhateverCode: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
14:00 timotimo that'd make sense
14:00 lizmat m: say <a b b c c c d d d d>.Bag.pick(*-4)   # same issue
14:00 camelia rakudo-moar b4592c: OUTPUT«Cannot resolve caller Numeric(WhateverCode: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
14:07 [Coke] lizmat: what would you expect it to be: pick all but 4?
14:07 lizmat yes
14:08 [Coke] ok, what about .pick(**4) ?
14:08 [Coke] er, .pick(* * 4)
14:08 lizmat well, for .pick that wouldn't make sense
14:08 lizmat for roll it would: generate 4x the values in List in random order
14:13 viki Would you say this should print True? say $_ === .perl.EVAL given 0.9999999999999999999999
14:14 viki The equality gets lots in the floating point noise here: https://github.com/rakudo/rakudo/blob/nom/src/core/Rat.pm#L12-L16
14:14 viki So I'm wondering why it does it at all and not just output the <$!numerator/$!denominator> thing all the time
14:26 lizmat well, since .perl is supposed to roundtrip, seems to me that should be True
14:28 viki Alright.
14:30 lizmat m: say "0.9999999999999999999999".perl
14:30 camelia rakudo-moar b4592c: OUTPUT«"0.9999999999999999999999"␤»
14:30 lizmat m: say "0.9999999999999999999999" eq "0.9999999999999999999999".perl
14:30 camelia rakudo-moar b4592c: OUTPUT«False␤»
14:30 arnsholt Are we sure this isn't one of those unavoidable problems with floating point?
14:30 arnsholt IIRC stringification of floats is actually extremely hard to get right
14:31 lizmat arnsholt: but these are supposed to be Rats, no ?
14:31 arnsholt Oh, that's true I guess
14:32 arnsholt In that case, never mind me
14:32 lizmat m: say (0.9999999999999999999999).WHAT
14:32 camelia rakudo-moar b4592c: OUTPUT«(Rat)␤»
14:32 arnsholt My brain still parses decimal notation as float >.<
14:34 dalek nqp: 6de4df5 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files):
14:34 dalek nqp: [js] Fix style issues found by make js-lint.
14:34 dalek nqp: review: https://github.com/perl6/nqp/commit/6de4df5f58
14:37 viki m: say 0.9999999999999999999999.perl
14:37 camelia rakudo-moar b4592c: OUTPUT«0.A␤»
14:37 psch ...what
14:37 viki Well, I fixed that, but now got a screenful of spectest failures :(
14:38 viki m: say (42/10).base: 10, *
14:38 camelia rakudo-moar b4592c: OUTPUT«4.2␤»
14:38 lizmat :-(
14:38 viki With that fix that now gives 4.20000000000000017763568394002504646778106689453125 :)
14:38 lizmat that *may* be more precise, but not expected  :-)
14:45 arnsholt Yeah, that's floats rearing their ugly heads it looks like
14:47 arnsholt m: say (0.9999999999999999999999).abs.WHAT
14:47 camelia rakudo-moar b4592c: OUTPUT«(Rat)␤»
14:48 viki m: 'say [/] ($_ - .floor).nude given (0.9999999999999999999999).abs
14:48 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> ude given (0.9999999999999999999999).abs⏏<EOL>␤    expecting any of:␤        single quotes␤        …»
14:48 viki m: say [/] ($_ - .floor).nude given (0.9999999999999999999999).abs
14:48 camelia rakudo-moar b4592c: OUTPUT«1␤»
14:48 viki :)
14:49 * viki spectest Fix #2
14:51 arnsholt Definitely looks like you're getting Nums in there somewhere
14:52 viki arnsholt: yeah, the first attempt was using .Num
14:52 viki .oO( well, *there's* yo problem :)) )
14:53 timotimo there it is, you're problem!
14:54 viki \o/ only half a screen of spectest failures this time :)
14:55 * lizmat hopes the screen is not a 27" 5K monitor
15:04 ggoebel joined #perl6-dev
15:23 viki Well, I have something a bit yuky, bit it fixes the bug, makes Rat.perl roundtrip, and passes all the spectests
15:24 lizmat and it still performs  :-)
15:24 * lizmat hides
15:27 viki doesn't :(
15:27 viki m: say 2.5836995/1.6390246
15:27 camelia rakudo-moar b4592c: OUTPUT«1.576364077␤»
15:28 viki 0.5.perl becomes 1.5x slower
15:29 viki Beucase the yuky bit is comparing whether the converted value still == the original before giving the decimal-point format
15:29 viki and if we always give the <nu/de> format, the spectests break, because they expectfor 0.5.perl to give 0.5, not <1/2>
15:31 lizmat if it's only .perl becoming slower, then that's ok if it's now correct
15:31 lizmat at least to me
15:32 viki unfortunately, it isn't
15:32 * viki tests slow down for the other two areas
15:32 viki m: say "0.5.base\(10,*) is {2.1249518 / 1.51316579}x slower"
15:32 camelia rakudo-moar b4592c: OUTPUT«0.5.base(10,*) is 1.40430864x slower␤»
15:32 viki yikes
15:34 viki and worst of all:
15:34 viki m: say "0.5.Str is {1.1812173/0.63130963}x slower"
15:34 camelia rakudo-moar b4592c: OUTPUT«0.5.Str is 1.871058580x slower␤»
15:34 viki yikes
15:35 viki That's comparing it with  2016.08.1-56-gdc7f279
15:38 * viki will knead this a bit more
15:39 lizmat viki: these slowdowns feel like quite unavoidable to me, looking at what you're trying to fix
16:05 dalek nqp: c38b28e | jnthn++ | tools/build/MOAR_REVISION:
16:05 dalek nqp: Bump to 2016.11 MoarVM release.
16:05 dalek nqp: review: https://github.com/perl6/nqp/commit/c38b28ef80
16:05 viki :o
16:05 jnthn viki: 2016.11 MoarVM release done well in time this month :)
16:06 viki sweet. jnthn++
16:08 * |Tux| realizes he missed out on timings today. <blush>
16:19 |Tux| This is Rakudo version 2016.10-303-gb4592c0 built on MoarVM version 2016.10-172-g1ba1dd2
16:19 |Tux| csv-ip5xs        3.071
16:19 |Tux| test            13.852
16:19 |Tux| test-t           6.238
16:19 |Tux| csv-parser      13.996
16:19 |Tux| new low :)
16:23 timotimo wow, was ip5xs always this fast?
16:23 timotimo yes, yes it was.
16:23 timotimo (well, ever since nine got to improving it)
16:24 viki lizmat: actually, I think I may end up making the whole thing faster than the old way :)
16:24 lizmat viki++  :-)
16:25 viki At least after my first optimization 0.5.Str runs in 95% of the old time :)
16:25 lizmat cool!
16:29 |Tux| timotimo, https://gist.github.com/Tux/4aa22a4090bd05ccceab6235fa010cc1
16:29 timotimo man, that initial 18-to-10 second drop
16:29 timotimo looks so good :D
16:30 lizmat and then from 9.1 to 4.5
16:30 lizmat that was a sad day
16:30 timotimo sad?
16:30 lizmat it make ip5xs faster than test-t again  :-)
16:30 timotimo oh, hehe
16:36 psch jnthn: ooc, do you have any idea why we might sometimes be missing flattenedSTables on r-j?
16:36 psch jnthn: Set was one such type i noticed it with, during {install,upgrade}-core-dist.pl
16:53 jnthn psch: Hmm, I thought we only had them for types that had native (or otherwise flattened-in) attributes...
16:53 jnthn (Which I don't think Set does)
16:53 psch jnthn: ah, that would probably explain it already, yes :)
16:54 psch i came across it during 88152b18
16:54 psch which fixes attributive binding of natives on r-j
16:54 psch it's a bit hacky because the signature doesn't necessarily demand a native type...
16:55 psch still, thanks for the info jnthn++
16:56 jnthn Thanks for working on r-j :)
16:58 jnthn dinner &
16:59 lizmat so, is there a way to check if a Str exists as a Type (with that name) without actually creating it ?
16:59 lizmat m: say ::("foo")
16:59 camelia rakudo-moar b4592c: OUTPUT«No such symbol 'foo'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:59 lizmat aahhh
16:59 lizmat :-)
16:59 lizmat I was trying "X"  and that exists, duh!
17:03 psch the 'sub MAIN(Enum $foo)' ticket seems to me like another notch on the "maybe we have to rethink coercion"... belt?
17:04 psch although nothing but "more syntax" comes to mind, honestly
17:05 psch m: enum Foo <A B C>; say Foo('A').WHAT
17:05 camelia rakudo-moar b4592c: OUTPUT«(Foo)␤»
17:05 psch m: enum Foo <A B C>; sub f(Foo(Str) $) { }; f 'A' # nope :/
17:05 camelia rakudo-moar b4592c: OUTPUT«No such method 'Foo' for invocant of type 'Str'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:05 psch hm, maybe "trying from both sides" in that case is already enough, actually..?
17:06 psch i.e. 'if we don't have $coercee."$coercer"($arg), try $coercer.($arg) and hope it matches the type"... probably not
17:07 psch m: enum Foo <A B C>; say A ~~ Cool
17:07 camelia rakudo-moar b4592c: OUTPUT«True␤»
17:09 psch err, that probably should have been '$coercer.coercee($arg)', but yeah, that just makes it worse
17:09 viki So  Foo(Bar) would accept both Bars that it would convert to Foos as well as Foos that it would convert to Bars?
17:09 psch otoh, maybe enums just are that special because we have Foo('A') in the first place..?
17:09 psch viki: no, it would first try to turn Bar into a Foo, and then ask Foo if it can make sense of a Bar
17:10 psch viki: but i think that's probably bogus, and the enum is a special case here
17:10 viki So $argf.Foo or Foo.Bar($arg)
17:11 psch viki: right, but that's bogus because Foo.Bar is the coercer already
17:11 psch so, yes, if it was implemented as i wrote your interpretation would be the result, and that's not really TRT
17:11 psch hence 'maybe enum is special', and instead of adding a method name after the methodop, the methodop would have to leave
17:11 psch mind, i'm not sure *that* is a good idea either
17:12 psch m: enum Foo <1+0i 0+1i>; say 1+0i
17:12 camelia rakudo-moar b4592c: OUTPUT«1+0i␤»
17:12 psch m: enum Foo <1+0i 0+1i>; say 1+0i.WHAT
17:12 camelia rakudo-moar b4592c: OUTPUT«Use of uninitialized value of type Complex in numeric context␤  in block <unit> at <tmp> line 1␤1␤»
17:12 psch m: enum Foo <1+0i 0+1i>; say (1+0i).WHAT
17:12 camelia rakudo-moar b4592c: OUTPUT«(Complex)␤»
17:13 psch anyway, i think an enum type constraint as a Str subtype that tries the enum-coercion might work out there
17:14 viki I think harmil also ran into this type of thing and the general issue is our coercers expect the given thing to know how to coerce to wanted thing, rather than reverse. And this basically limits any coercions with custom user types. I can't write sub foo(UserName(Str)) {} for example and let UserName class be automatically instantiated from the given Str
17:14 psch i.e. 'sub MAIN(Foo $) { }' is kinda like 'Str $ where Foo(*).defined'
17:14 psch where Foo is an enum
17:15 psch viki: right, that's the redo-from-the-top approach :)
17:15 viki yup
17:15 psch generally probably the better idea, but i haven't encountered much movement in that area
17:15 psch there was a gist a few months or a year or so back i think..?
17:16 FROGGS joined #perl6-dev
17:16 FROGGS o/
17:17 viki \o\
17:17 lizmat FROGGS \o
17:18 lizmat psch viki looking at handling Enums sensibly in src/core/Main.pm
17:18 lizmat shouldn't be too much problem, I think
17:18 lizmat but post release for sure  :-)
17:19 psch lizmat: right, i think that probably works for now
17:20 psch lizmat: though the coercion stuff in general might want to have a different behind-the-scenes
17:20 psch the issue of not being able to reasonably define coercion to user types is a real one
17:20 lizmat true; especially testing of something is an Enum is problematic
17:20 lizmat Metamodel::EnumHOW.ACCEPTS($foo)
17:20 psch m: enum Foo <A B>; say A.HOW.^name
17:20 camelia rakudo-moar b4592c: OUTPUT«Perl6::Metamodel::EnumHOW␤»
17:20 lizmat is the only way I've found so far
17:22 psch m: enum Foo ('A' => 0.2, 'B', 'C'); say +A
17:22 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Undeclared name:␤    A used at line 1␤␤»
17:22 psch m: enum Foo ('A' => 0.2, 'B', 'C'); say +B
17:22 camelia rakudo-moar b4592c: OUTPUT«1␤»
17:22 psch m: enum Foo ('A' => 2, 'B', 'C'); say +A
17:22 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Undeclared name:␤    A used at line 1␤␤»
17:22 psch yeaah, apparently i just forgot how to do that :S
17:23 psch oh, wait, autoquoting
17:23 psch m: enum Foo (A => .2, B, C); say +A
17:23 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Undeclared names:␤    B used at line 1␤    C used at line 1␤␤»
17:24 psch m: enum Foo (A => .2, 'B', 'C'); say +A
17:24 camelia rakudo-moar b4592c: OUTPUT«0.2␤»
17:24 psch right, so enum values don't have to be Int, that's what i wanted to find out... :)
17:24 psch m: enum Foo (A => 1+2i, B, C); say +A
17:24 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Undeclared names:␤    B used at line 1␤    C used at line 1␤␤»
17:24 psch m: enum Foo (A => 1+2i, 'B', 'C'); say +B
17:24 camelia rakudo-moar b4592c: OUTPUT«2+2i␤»
17:24 viki m: enum Foo ('A' => 2, 'B', 'C'); say A
17:24 camelia rakudo-moar b4592c: OUTPUT«===SORRY!=== Error while compiling <tmp>␤Undeclared name:␤    A used at line 1␤␤»
17:24 psch m: enum Foo (A => 1+2i, 'B', 'C'); say Foo(3+2i)
17:24 camelia rakudo-moar b4592c: OUTPUT«C␤»
17:25 psch okay so
17:25 viki m: enum Foo ('A' => 2, 'B', 'C'); say Pair.new: 'A', 2;
17:25 camelia rakudo-moar b4592c: OUTPUT«A => 2␤»
17:25 viki oh, I think there's a ticket for this case
17:25 psch 'sub MAIN(Foo $)' with Foo as an enum could mean 'sub MAIN(Str $ where * ~~ Str|Int and Foo(*).defined)'
17:25 psch err
17:25 psch s/Int/Numeric/ # geez
17:26 psch not sure that's a great way to implement it, but it probably would work out for this case
17:26 viki But it always be a Str
17:26 lizmat sub MAIN(:$country! where (Country.enums{$_}:exists)) {   # my solution
17:26 viki well, always ~~ Str
17:26 psch viki: oh, right, allomorphs
17:26 psch m: enum Foo <A B>; Foo.enums{1}:exists.say
17:26 camelia rakudo-moar b4592c: OUTPUT«False␤»
17:26 psch m: enum Foo <A B>; Foo.enums{<1>}:exists.say
17:26 camelia rakudo-moar b4592c: OUTPUT«False␤»
17:27 psch dunno, in my head the coercer takes either key or value
17:27 psch might be a bad idea though :)
17:28 psch anyway, yeah.  that's my enum coercer musings
17:28 lizmat m: enum Foo <A B>; Foo.enums{B}:exists.say
17:28 camelia rakudo-moar b4592c: OUTPUT«True␤»
17:29 lizmat but yeah
17:29 lizmat m: enum Foo <A B>; Foo.enums<B>:exists.say
17:29 camelia rakudo-moar b4592c: OUTPUT«True␤»
17:38 lizmat m: enum E <A B C>; say val(A)   # sorta expected that to say IntStr.new(0,"A")
17:38 camelia rakudo-moar b4592c: OUTPUT«Value of type E uselessly passed to val()␤  in block <unit> at <tmp> line 1␤A␤»
18:02 viki ZOFVM: Files=1203, Tests=130170, 154 wallclock secs (20.77 usr  3.53 sys + 2713.73 cusr 247.93 csys = 2985.96 CPU)
18:02 dalek rakudo/nom: b5aa3c5 | (Zoffix Znet)++ | src/core/Rat (2 files):
18:02 dalek rakudo/nom: Fix incorrect results in string-returning methods of Rationals
18:02 dalek rakudo/nom:
18:02 dalek rakudo/nom: Fixes RT#126016: https://rt.perl.org/Ticket/Display.html?id=126016
18:02 dalek rakudo/nom: The issues observed in the ticket result from floating point math noise when
18:02 dalek rakudo/nom: handling the fractional part after splitting the Rational into whole part and
18:02 dalek rakudo/nom: fractional parts. That fractional part remains a Rat, and when further
18:02 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126016
18:02 dalek rakudo/nom: operations on it coerce it into a Num, the f.p. math noise results in it being
18:02 dalek rakudo/nom: a whole number, but still treated under the assumption of being less than 1.
18:02 dalek rakudo/nom:
18:02 dalek rakudo/nom: Fix by checking for that case and adjusting fractional/whole parts accordingly.
18:02 dalek rakudo/nom: Also, fix Rat.perl.EVAL roundtrip for Rats that end up not being equal to the
18:02 viki ...original Rat due to f.p. math noise by outputting those in <nu/de> notation.
18:02 viki Performance impact of this commit: Rational.Str about 40% faster,
18:03 viki Rational.base about 30% faster, Rat.perl 5% slower
18:03 viki https://github.com/rakudo/rakudo/commit/b5aa3c591e4f0fdf6ccf9e5132fdf6a15618151d
18:03 viki Lazy robot!
18:04 dalek roast: b1a305a | (Zoffix Znet)++ | S32-num/rat.t:
18:04 dalek roast: Test stringification of Rats with floating point math noise issues
18:04 dalek roast:
18:04 dalek roast: RT#126016: https://rt.perl.org/Ticket/Display.html?id=126016
18:04 dalek roast: review: https://github.com/perl6/roast/commit/b1a305a489
18:04 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126016
18:05 lizmat viki++
18:17 viki r: say 10 ** 10 ** 10
18:17 camelia rakudo-jvm 76b061: OUTPUT«Inf␤»
18:17 camelia ..rakudo-moar b5aa3c: OUTPUT«Numeric overflow␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:22 viki m: say 1e200 * 10e200
18:22 camelia rakudo-moar b5aa3c: OUTPUT«Inf␤»
18:23 viki Seems like it'd make sense to return Inf instead of throwing for ** too?
18:23 viki And that would align the results between JVM and MoarVM too
18:25 viki m: say 10e0 ** 10000000000e0
18:25 camelia rakudo-moar b5aa3c: OUTPUT«Inf␤»
18:25 viki :)
18:26 viki m: say <10/1> ** <10000000000/1>
18:26 camelia rakudo-moar b5aa3c: OUTPUT«Inf␤»
18:28 viki oh heh and in the Num case we throw for Underflow instead
18:28 viki m: say 10e0 ** -10000000000e0
18:28 camelia rakudo-moar b5aa3c: OUTPUT«Numeric underflow␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:28 viki m: say 10 ** -10000000000
18:28 camelia rakudo-moar b5aa3c: OUTPUT«Attempt to divide 1 by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:32 viki .tell Zoffix check https://rt.perl.org/rt3//Public/Bug/Display.html?id=126992
18:32 yoleaux2 viki: I'll pass your message to Zoffix.
18:35 [Coke] viki, thanks.
18:36 viki Will be only in about 20 hours tho :)
18:39 [Coke] no rush whatsoever
18:39 [Coke] just seemed like a likely closable ticket.
18:39 timotimo [Coke]: *carefully prods about angular 2 profiler ui*
18:40 * [Coke] gingerly sets down the thoughts about Str on the JVM, and reconsiders his life choices.
18:44 viki .tell Zoffix and write a test for this one, while you're at it: https://rt.perl.org/Ticket/Display.html?id=129291#ticket-history
18:44 yoleaux2 viki: I'll pass your message to Zoffix.
18:46 [Coke] timotimo: so, my stumbling block at this point is that angular2 seems designed to be run as an app, not inside a standalone html file.
18:46 timotimo huh, really?
18:46 timotimo i thought the point was to have it for single-page-application
18:46 [Coke] I am sure this is fixable without changing things on the nqp side, but I need to do more research/playing around.
18:47 timotimo OK
18:47 timotimo someone suggested we put the profiler data into sqlite instead of a json blob
18:47 [Coke] the docs seem geared towards people writing full on applications, not standalone pages.
18:47 timotimo we don't have convenient NativeCall at the nqp level, though
18:51 [Coke] timotimo: it is quite possible I'm just super confused. :)
18:51 timotimo i haven't looked into angular 2 yet, so ... who knows!
19:15 [Coke] timotimo: so, following the initial example, you have a about a dozen files on disk, then run "npm start", which launches the html page, which loads a dozen+ files remotely, including files compiled from your component's .ts source.
19:27 timotimo ugh
19:27 timotimo what fun
19:33 [Coke] I found an active (non-irc) chat channel for angular, hopefully this will help. :)
19:52 dalek rakudo/nom: 546dbd9 | lizmat++ | src/core/Main.pm:
19:52 dalek rakudo/nom: Fix for RT #130131
19:52 dalek rakudo/nom:
19:52 dalek rakudo/nom: Basically, extend the functionality of val() to include looking up
19:52 dalek rakudo/nom: whether the string is an Enum.  Possibly, this should be expanded to
19:52 dalek rakudo/nom: all uses of val(), but that might be v6.d worthy.
19:52 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130131
19:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/546dbd99b1
19:54 lizmat afk&
19:57 [Coke] timotimo: best comment so far: Why are you even using angular?
19:57 [Coke] second best: why not leave it in angular1?
19:57 viki heh
19:57 psch [Coke]: is that a "general help" kinda channel..?
19:57 [Coke] psch: https://gitter.im/angular/angular
19:58 psch i mean, the questions sound kinda "what are you even doing here"-ish?
19:59 psch maybe i'm just spoiled by #perl6 being kind and such :S
19:59 [Coke] to be fair, I'm doing something weird.
20:03 psch i suppose that makes the replies a bit more fair
20:05 [Coke] timotimo: so, the real goal was "make it usable with large amounts of data", right?
20:05 [Coke] at this point, probably easier for me to optimize JS than it is to get a2 to work. :)
20:05 mst [Coke]: the last JS experiment I did (which was react + mobx) used webpack, so I got an HTML file and an index.js
20:35 dalek roast/usev6-patch-1: a151379 | bartolin++ | integration/error-reporting.t:
20:35 dalek roast/usev6-patch-1: Make test for output of backtrace less specific
20:35 dalek roast/usev6-patch-1:
20:35 dalek roast/usev6-patch-1: After the recent changes to backtrace handling this test
20:35 dalek roast/usev6-patch-1: started to fail on rakudo-j. There are references to lines
20:35 dalek roast/usev6-patch-1: in gen/jvm/CORE.setting which are causing the test to fail
20:35 dalek roast/usev6-patch-1: because of the 's' in 'setting'.
20:35 dalek roast/usev6-patch-1:
20:35 dalek roast/usev6-patch-1: Allowing additional lines in the backtrace still fits the test
20:35 dalek roast/usev6-patch-1: description 'Thrown Failure outputs dual backtraces'.
20:35 dalek roast/usev6-patch-1: review: https://github.com/perl6/roast/commit/a151379e39
20:38 bartolin oops, didn't expect dalek to report this here ...
20:42 viki How come JVM still references setting?
20:43 * bartolin doesn't know (yet)
20:43 jnthn Prolly 'cus the code-gen would need updating
20:44 viki m: BEGIN @*ARGS = <--country=America>; enum Country<China America Brazil>; sub MAIN(Country :$country!) { say $country; }
20:44 camelia rakudo-moar 546dbd: OUTPUT«America␤»
20:44 dalek roast: a27c062 | usev6++ | S32-basics/warn.t:
20:44 dalek roast: Fudge failing test for JVM
20:44 dalek roast: review: https://github.com/perl6/roast/commit/a27c062aa3
20:44 viki m: BEGIN @*ARGS = <--country=Brazil>; enum Country<China America Brazil>; sub MAIN(Country :$country!) { say $country; }
20:44 camelia rakudo-moar 546dbd: OUTPUT«Brazil␤»
20:45 viki m: BEGIN @*ARGS = <--country=China>; enum Country<China America Brazil>; sub MAIN(Country :$country!) { say $country; }
20:45 camelia rakudo-moar 546dbd: OUTPUT«Usage:␤  <tmp> --country=<Country> ␤»
20:45 viki m: BEGIN @*ARGS = <--country=China>; enum Country<Blah China America Brazil>; sub MAIN(Country :$country!) { say $country; }
20:45 camelia rakudo-moar 546dbd: OUTPUT«China␤»
20:45 viki .tell lizmat seems MAIN doesn't like the very first enum for some reason: https://irclog.perlgeek.de/perl6-dev/2016-11-18#i_13592785
20:45 yoleaux2 viki: I'll pass your message to lizmat.
20:46 viki When "China" is the first element of the enum, it doesn't accept it as a proper value
20:46 jnthn m: BEGIN @*ARGS = <--country=China>; enum Country (:China(1), :America); sub MAIN(Country :$country!) { say $country; }
20:46 camelia rakudo-moar 546dbd: OUTPUT«===SORRY!===␤Incompatible MROs in P6opaque rebless for types Bool and Country␤»
20:47 jnthn m: BEGIN @*ARGS = <--country=China>; enum Country (:China(1), :America(2)); sub MAIN(Country :$country!) { say $country; }
20:47 camelia rakudo-moar 546dbd: OUTPUT«China␤»
20:47 jnthn m: BEGIN @*ARGS = <--country=America>; enum Country (:China(1), :America(0)); sub MAIN(Country :$country!) { say $country; }
20:47 camelia rakudo-moar 546dbd: OUTPUT«Usage:␤  <tmp> --country=<Country> ␤»
20:47 jnthn Looks like whichever one has a value of 0
20:47 * jnthn suspects an `if` used where a `with` was meant, or some such
20:47 FROGGS m: BEGIN @*ARGS = <--country=China>; enum Country (China => 42, 'America' => 0, 'Brazil'); sub MAIN(Country :$country!) { say $country; }
20:47 camelia rakudo-moar 546dbd: OUTPUT«China␤»
20:47 FROGGS m: BEGIN @*ARGS = <--country=America>; enum Country (China => 42, 'America' => 0, 'Brazil'); sub MAIN(Country :$country!) { say $country; }
20:47 camelia rakudo-moar 546dbd: OUTPUT«Usage:␤  <tmp> --country=<Country> ␤»
20:48 FROGGS ahh, already shown
20:48 viki That's what I thought too but I don't see any obvious spot: https://github.com/rakudo/rakudo/commit/546dbd99b1
20:53 dalek rakudo/nom: 4f581ab | (Zoffix Znet)++ | docs/ChangeLog:
20:53 dalek rakudo/nom: Log all changes to date
20:53 dalek rakudo/nom:
20:53 dalek rakudo/nom: Documents commits:
20:53 dalek rakudo/nom: 29db214 2d56751 395f369 4ccb2f3 53d7b72 546dbd9 58a4826 7f32243
20:53 dalek rakudo/nom: b068e3a b5aa3c5 c1d2599 cd765e6 ee8ae92
20:53 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4f581abf6e
20:55 cognominal joined #perl6-dev
21:31 viki don't got a computer at hand to try it out, but reading the code it seems like all args are checked for whether they're any enums?
21:31 viki Would that interfere with, say, attempting to pass string 'False' just as a string?
21:32 viki say, to Str $whatever
21:34 FROGGS m: BEGIN @*ARGS = <--country=False>; sub MAIN(Str :$country!) { say $country; }
21:34 camelia rakudo-moar 4f581a: OUTPUT«False␤»
21:34 FROGGS m: BEGIN @*ARGS = <--country=False>; sub MAIN(Bool :$country!) { say $country; }
21:34 camelia rakudo-moar 4f581a: OUTPUT«Usage:␤  <tmp> --country ␤»
21:35 viki m: BEGIN @*ARGS = <--country=False>; sub MAIN (Str :$country) { say "$country $country.^name()" }
21:35 camelia rakudo-moar 4f581a: OUTPUT«False Str␤»
21:35 viki ok. nevermind :)
21:35 viki m: BEGIN @*ARGS = <--country=False>; sub MAIN (:$country) { say "$country $country.^name()" }
21:35 camelia rakudo-moar 4f581a: OUTPUT«False Str␤»
21:36 seatek joined #perl6-dev
22:02 MasterDuke bartolin, jnthn: i'm working on the backtraces on JVM now, but i'm finding it less straightforward than the moar stuff
22:04 jnthn Welcome to JVM ;)
22:04 bartolin MasterDuke++
22:04 Zoffix joined #perl6-dev
22:08 MasterDuke right now it seems to be getting the line numbers from the directives, but not the filename, haven't figured out why/how yet
22:29 Zoffix m: enum Country (|<China Canada USA>, Foo => False);
22:29 yoleaux2 18:32Z <viki> Zoffix: check https://rt.perl.org/rt3//Public/Bug/Display.html?id=126992
22:29 camelia rakudo-moar 4f581a: OUTPUT«===SORRY!===␤Incompatible MROs in P6opaque rebless for types Bool and Country␤»
22:29 yoleaux2 18:44Z <viki> Zoffix: and write a test for this one, while you're at it: https://rt.perl.org/Ticket/Display.html?id=129291#ticket-history
22:29 Zoffix viki, shoo
22:31 viki ahh, I see where the bug is with the MAIN stuff
22:47 viki buut... I see another bug
22:50 Zoffix For some reason using enum as either positional or named works, but both together doesn't
22:50 Zoffix Unless I'm passing the args incorrectly.
22:50 * Zoffix devours a plate of chicken wings before proceeding with the fix
22:50 * lizmat is back
22:50 yoleaux2 20:45Z <viki> lizmat: seems MAIN doesn't like the very first enum for some reason: https://irclog.perlgeek.de/perl6-dev/2016-11-18#i_13592785
22:53 Zoffix lizmat, I'm about to push a fix for that. So nevermind :)
22:53 lizmat ah, cool
22:53 lizmat what did I miss ?
22:53 dalek rakudo/nom: bca0ae5 | (Zoffix Znet)++ | src/core/Main.pm:
22:53 dalek rakudo/nom: Fix sub MAIN(SomeEnum ...) not handling the falsy enum value
22:53 dalek rakudo/nom:
22:53 dalek rakudo/nom: The check for whether we got an enum is checking for falsiness, but
22:53 dalek rakudo/nom: enum values can be false. Check for definedness instead.
22:53 dalek rakudo/nom:
22:53 dalek rakudo/nom: IRC conversation: https://irclog.perlgeek.de/perl6-dev/2016-11-18#i_13592785
22:54 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/bca0ae5fc6
22:54 Zoffix And I wrote this test, but the case where both positional and named are given fails for some reason, even though separately they work: https://gist.github.com/zoffixznet/42ed3b55b8df6e0bc340a7a434212acd#file-p6-p6-L11
22:55 * Zoffix & # food
22:56 lizmat Zoffix++
23:12 Zoffix No bug. I was passing pos/named in the wrong order.
23:13 lizmat *phew*  :-)
23:13 * lizmat goes to get some shuteye
23:13 lizmat good night, #perl6-dev!
23:13 dalek roast: 8ff3ab7 | (Zoffix Znet)++ | S06-other/main.t:
23:13 dalek roast: Test sub MAIN can type-constrain using Enums
23:13 dalek roast:
23:13 dalek roast: RT#130131: https://rt.perl.org/Ticket/Display.html?id=130131
23:13 dalek roast: review: https://github.com/perl6/roast/commit/8ff3ab7391
23:13 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130131
23:13 Zoffix night
23:58 MasterDuke ah, i misspoke, it is getting the filename, i'm just not sure how to get that filename into the backtrace

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