Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
Zoffix .ask TimToady what's your opinion on changing 6.c spec's test that tests for "4" in this exception: `my $x = 4/0; say 42 + $x; => Attempt to divide 4 by zero using div`. There are a couple of bugs to fix and some performance benefits to reap if we don't report any particular value. We'd do so by normalizing all zero-denominator Rationals to <-1/0>, <0/0>, and <1/0> 09:17
yoleaux Zoffix: I'll pass your message to TimToady.
Zoffix .tell TimToady well, bugs could be fixed with other means, by basically slowing down the common Rational ops with edge-case logic to handle zero-denominator Rationals (ZDRs). Basically by normalizing them the check for ZDRs becomes just a denominator check (and I tried marking them with a role instead and doing MMD in the past, but dispatch ambiguities creep up due to Rational role) 09:26
yoleaux Zoffix: I'll pass your message to TimToady.
Zoffix
.oO( throw/fail in Rat.new if denominator is zero and get rid of ZDR concept entirely )
09:28
s/Rat/Rational/ 09:29
Geth roast: f3b860105d | (Zoffix Znet)++ | 2 files
[v6.d REVIEW] Test actual exceptions in Bag/BagHash throwage

Orig: github.com/perl6/roast/commit/7a88a38e2
10:06
roast: 2e35d674e9 | (Zoffix Znet)++ | 2 files
[v6.d REVIEW] Test actual exceptions in Mix/MixHash throwage

Orig: github.com/perl6/roast/commit/f83f07757
10:10
dogbert2 ZOFFLOP: t/spec/S12-meta/classhow.t 12:20
Zoffix jnthn: does 6.d's `start` in sink context just print the exception or does it actually behave like if the exception was thrown at that point? like, is it equivalent to `start { CATCH { default { .say } }; die }` or `start { await my $p := start { die }; $p.result }`? 12:30
hm 12:31
Well, not even sure how to write the second one. How to have it non-block, but throw exception at that place
.oO( maybe that answers my question )
12:32
Geth rakudo: c14df18932 | (Elizabeth Mattijsen)++ | src/core/Rakudo/Internals/JSON.pm6
Revert "Attempt #2 at making R:I:JSON.from-json faster"

This reverts commit c9432c20721104ced7e2408da5ba1f15ad320975.
Alas, the quick parser accepts JSON that is valid, but does not contain any curly blocks. This causes R#2299. I currently don't see a quick way to fix this in a way that doesn't leave the way open for other valid JSON to not be parsed correctly.
I guess we just need to make the NQP regex engine faster.
12:35
synopsebot R#2299 [open]: github.com/rakudo/rakudo/issues/2299 t/spec/S10-packages/require-and-use.t hangs
Zoffix jnthn: also what happens in this case: `start { die; CATCH { when X::Meows {...} } }` ? 12:58
.oO( convert the sunk versions to `start { CATCH { default { .say } }; { die; CATCH { when X::Meows {...} } } }`
12:59
well, with `nqp::handle(…, 'CATCH', EXCEPTION(nqp::exception).say)` for the sinker catcher 13:00
timotimo it's not possible to "behave like if the exception was thrown at that point", as the call frame in that situation is probably already gone 13:33
hmm
Zoffix
.oO( how to mark a block to not show up in the list of locations of exceptions? )
$ ./perl6 -e 'use v6.d.PREVIEW; start { die }; sleep ½; say "meows"'
Died
in block at -e line 1
in code at -e line 1
Like I wanna get rid of the "in code"
timotimo is hidden-from-backtrace
Zoffix In QAST 13:34
timotimo hmm
Zoffix Ah, OK. It's still uses the trait 13:35
OK then, I'll use that 13:36
$*W.find_symbol(['&trait_mod:<is>'])($code,:hidden-from-backtrace) that is
lizmat Zoffix jnthn : I am living under the impression that we should *NOT* check for specific throwage in roast, to allow other Perl 6 implementations freedom in how to implement their exceptions. Am I wrong ? 13:39
Zoffix lizmat: do you mean for specific exception types or specific exception wording. Currently, the roast does test for types, but not for exact wording (tho there are some old 6.c spec tests that still do that) 13:40
And if rakudo throws X::AdHoc, then we don't spec for AdHoc, but just for generic Exception 13:41
lizmat so if we later make it more specific, then the test should change or not ?
Zoffix Yeah. 13:42
lizmat but isn't that changing the spec then ?
Zoffix lizmat: no, you'd change it in later spec versions. Earlier versions would still pass because all exceptions are of type Exception
lizmat hmmm... 13:43
Zoffix m: sub meows { die }; use Test; throws-like meows(), Exception;
camelia Died
in sub meows at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: sub meows { die class X::Meows is Exception {}.new }; use Test; throws-like meows(), Exception;
camelia Died with X::Meows
in sub meows at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix well, missing block around the call, but both would pass 13:44
lizmat so how is that different from using dies-ok ?
I just want to make sure that I'll be writing tests correctly in the future 13:46
because it appears I've been doing it wrong
Zoffix heh, like which ones?
lizmat like when writing tests with dies-ok that don't throw X::AdHoc
Zoffix If they don't throw X::AdHoc, then we can be more precise than dies-ok and spec the actual exception type with throws-like 13:48
Also, there's this:
m: use Test; dies-ok { (a => "a").Bog }, "passes";
camelia ok 1 - passes
Zoffix m: use Test; throws-like { (a => "a").Bog }, X::Str::Numeric
camelia 1..2
ok 1 - code dies
not ok 2 - right exception type (X::Str::Numeric)
# Failed test 'right exception type (X::Str::Numeric)'
# at /home/camelia/rakudo-m-inst-2/share/perl6/precomp/BEDCA39DF8A31F12A34A40CDB05730390C84982E/…
Zoffix And it doesn't have to be a typo, but some internal LTA error and the test would still pass even tho the error is wrong (pretty sure we already had such a case in the past) 13:49
I mean, dies-ok is not wrong. It's just more precise to use something else.
Same with `is-deeply foo(), ().Seq`. It's not precise enough to spec that the return type is a `Seq`, because if it's a `List` the test would still pass
m: use Test; is-deeply (), ().Seq 13:50
camelia ok 1 -
Zoffix (there's an `is-eqv` helper in Test::Utils)
lizmat we've had many cases of tests passing for that reason in the past
Zoffix And `is` is crap for many tests ( twitter.com/zoffix/status/1041318801197989888 )
lizmat but again, I was under the impression we didn't want to enforce so much on other implementations 13:51
because, let's face it, the X:: namespace is pretty ad-hoc collection of classes, roles and methods
Zoffix That was only for exact text content of exceptions. I don't recall any discussions for avoiding exception types at all.
Yeah, it's quite a mess. 13:52
lizmat ah, ok, well, then I probably misremember
Zoffix lizmat: but you bring up a good point. Maybe we should avoid speccing new exceptions in 6.d. But... will we review them later at all or will it be a mess forever?
lizmat good question 13:53
Zoffix and change all the new tests to `Exception` for now
lizmat but in the case of the Bag test just changed
the difference between X::Str::Numeric and X::Numeric::CannotConvert seems minimal 13:54
the latter being a more general case of the former
Zoffix
.oO( nested exception types: X::QuantHashCreation.new: :why(X::Numeric::CannotConvert.new) )
13:55
Like when I filed R#2300 I thought "why ain't it some single exception", but then thought "well, actually I do want to know exactly why the creation failed" 13:56
synopsebot R#2300 [closed]: github.com/rakudo/rakudo/issues/2300 [6.d review] Inconsistent exceptions from Bag/Mix creation throwage
lizmat so I feel we should maybe put more effort in unifying similar exceptions before codifying them in roast
Zoffix +1
Geth 6.d-prep: 69a7d9c5e5 | (Zoffix Znet)++ (committed using GitHub Web editor) | TODO/README.md
Add TODO: Throw out / Appendicize Exception Tests

  colabti.org/irclogger/irclogger_log...09-21#l142
13:58
Zoffix $ ./perl6 -e 'use v6.d.PREVIEW; sub { start { die } }(); sleep ½; say "meows"' 14:01
meows
Zoffix this doesn't die. Attaching handler only when `start` is in sink context without using `.sink` kinda smelly. 14:02
Zoffix timotimo: hm, I actually managed to get it to "behave like if the exception was thrown at that point" :) 14:18
By accident :P I was trying to get custom exception handlers to work, but looks like .handle-exception method exits the program too 14:19
m: use nqp; nqp::handle(die, 'CATCH', nqp::getcomp('perl6').handle-exception: nqp::exception) 14:21
camelia Died
in block <unit> at <tmp> line 1
Zoffix that one
timotimo oh, huh. 14:24
Geth rakudo: 369068aed0 | (Elizabeth Mattijsen)++ | src/core/Match.pm6
Make make an only

Not sure why it should be a multi. Having it have to do a getlexcaller sure doesn't help. This appears to have a marginal improvement on R:I:J.from-json
14:33
Zoffix lizmat: that will probably fail `make test`: github.com/rakudo/rakudo/blob/mast...unt.t#L270 14:35
lizmat: it was made a multi back when we made everything a multi so users could override stuff or something 14:36
lizmat make test was clean for me
Zoffix Ah, ok 14:36
lizmat as make spectest and make stresstest
there maybe some ecosystem fallout, but then we can revert 14:37
lizmat in any case, "make" is *very* specific 14:37
Zoffix yeah 14:38
lizmat and since it is use a lot in (slow) grammars, I thought it would be helpful
Zoffix +1
lizmat especially since it skips an extra getlexref 14:39
Zoffix m: sub foo {}; dd &foo.dispatchees.head.count
camelia Cannot resolve caller head(List: ); none of these signatures match:
(Any:D: *%_)
(Any:D: Callable:D $w, *%_)
(Any:D: $n, *%_)
in block <unit> at <tmp> line 1
Zoffix Ah, it's a List:U
lizmat cycling&
Zoffix ZOFVM: Files=1309, Tests=153185, 169 wallclock secs (26.36 usr 3.97 sys + 3641.08 cusr 183.12 csys = 3854.53 CPU) 15:00
Zoffix ah, crap. I should've read the 6.d-prep notes. I was meant to use uncaught_handler thing 15:02
I think I'll just commit and let jnthn judge if the uncaught_handler thing is better 15:04
Geth rakudo: 6ee5f75778 | (Zoffix Znet)++ | 2 files
[6.d] Attach ex. handler to `start` in sink context

Per 6.d-prep: github.com/perl6/6.d-prep/blob/69a...or-handler
I've used the normal handler instead of `uncaught_handler` the 6.d-prep notes say because I don't know how to use the latter (and noticed that note too late). I'm also unsure if the uncaught_handler handles custom ... (9 more lines)
15:08
roast: 7a426fb4a3 | (Zoffix Znet)++ | MISC/misc-6.d.t
[6.d] Spec `start` in sink context attaches ex. handler

POV: github.com/rakudo/rakudo/commit/6ee5f75778 Per 6.d-prep: github.com/perl6/6.d-prep/blob/69a...or-handler
15:10
6.d-prep: c4016d2d79 | (Zoffix Znet)++ | 2 files
Mark sunk `start` as completed

POV: github.com/rakudo/rakudo/commit/6ee5f75778 Propspec: github.com/perl6/roast/commit/7a426fb4a3 Docs: github.com/perl6/doc/commit/df0b71d8d6
15:12
Zoffix .tell jnthn FYI: I took a crack at sunk `start`. github.com/rakudo/rakudo/commit/6ee5f75778 spec: github.com/perl6/roast/commit/7a426fb4a3 docs: github.com/perl6/6.d-prep/commit/c4016d2d79 `sub { start die }(); sleep ⅓` doesn't die which sucks, but I don't know how to make that work. Also I didn't use any `uncaught_handler` mentioned in 6.d-prep. Dunno if it's good or bad. 15:13
yoleaux Zoffix: I'll pass your message to jnthn.
TimToady . 15:41
yoleaux 09:17Z <Zoffix> TimToady: what's your opinion on changing 6.c spec's test that tests for "4" in this exception: `my $x = 4/0; say 42 + $x; => Attempt to divide 4 by zero using div`. There are a couple of bugs to fix and some performance benefits to reap if we don't report any particular value. We'd do so by normalizing all zero-denominator Rationals to <-1/0>, <0/0>, and <1/0>
09:26Z <Zoffix> TimToady: well, bugs could be fixed with other means, by basically slowing down the common Rational ops with edge-case logic to handle zero-denominator Rationals (ZDRs). Basically by normalizing them the check for ZDRs becomes just a denominator check (and I tried marking them with a role instead and doing MMD in the past, but dispatch ambiguities creep up due to Rational role)
TimToady I'm fine with normalizing the inv/nan rats 15:41
Zoffix \o/
TimToady it's not like nums carry that info along either 15:42
Geth nqp/nqp-mbc: 4 commits pushed by (Stefan Seifert)++ 16:35
Geth 6.d-prep: 8c1881421c | (Zoffix Znet)++ (committed using GitHub Web editor) | TODO/FEATURES.md
Update ZDR normalization entry with path forward

  colabti.org/irclogger/irclogger_log...09-21#l248
17:50
[Coke] (exceptions) I think at some point we need to do a pass over all the exceptions and have a sane hierarchy; but zoffix's notes about text vs. types is correct, as far as I recall. 18:21
Zoffix .tell jnthn oops, gave wrong link to docs commit. It's github.com/perl6/doc/commit/df0b71d8d6 18:25
yoleaux Zoffix: I'll pass your message to jnthn.
samcv AlexDaniel`: i plan on release today 19:43
AlexDaniel` samcv: nice 21:53
lizmat .ask jnthn what are your feelings to adding a sub ord(str $s) { nqp::ord($s) } candidate ? Looks like it makes it 1.8x as fast 22:15
yoleaux lizmat: I'll pass your message to jnthn.
lizmat .ask jnthn also: I would like to add a "pos" parameter to ord(), so we can pass that on directly to nqp::ordat 22:16
yoleaux lizmat: I'll pass your message to jnthn.
lizmat sleep&