🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | log inspection situation still under development | For MoarVM see #moarvm
Set by lizmat on 22 May 2021.
timo because i've got a simple for/when with integers where ACCEPTS is called against an enum 00:01
and that was going via Numeric:D's ACCEPT, which tries to cast via .Numeric first, and then also checks for nan and inf
and putting an ACCEPTS into Int makes it much better 00:02
since the numeric accepts has a body too big to be inlined, the int one is much much smaller
00:02 reportable6 left
lizmat timo: sounds like a good idea... 00:07
timo 1.74s vs 9.5s user time for my code 00:09
rakudo -e 'enum lmao <first second third fourth>; sub do-my-bidding { for ^2000 { when first { print ">." }; when second { print "." }; when third { print "." }; when fourth { print ".\n" } } }; for ^1000 { do-my-bidding }'
i did not actually check what exact semantics we have for ACCEPTSing between two defined Int objects 00:11
so i just used literally self == other 00:14
spec tests look good so far 00:36
00:40 frost joined
Geth rakudo/int-accepts-int-quickly: 1b63dbf239 | (Timo Paulssen)++ | src/core.c/Int.pm6
Very simple ACCEPTS for Int:D vs Int:D

Otherwise running ACCEPTS on an Enum goes via Numeric's ACCEPTS, which first calls to .Numeric to coerce, and has checks for nan and inf on top of the numeric value comparison.
This new candidate has a bytecode small enough to be inlined, as opposed to the Numeric ACCEPTS method.
00:44
rakudo: timo++ created pull request #4625:
Very simple ACCEPTS for Int:D vs Int:D
00:46
timo passed my spec tests 00:49
[Coke] nice. 00:52
timo not sure if much real-world code will actually look much like this 01:00
01:03 reportable6 joined
timo Kaiepi: what's your suggestion, to make it look just like the other one, i.e. hllbool eq_I? 01:14
Kaiepi more or less, yeah
timo and Num gets one that looks just like Numeric's except without .Numeric on the "other" argument? 01:15
how useful is a num other than nan or inf accepting another num, when we have rounding and imprecision and all that to worry about 01:17
01:19 MasterDuke left
Kaiepi that one doesn't quite correspond 01:20
it would need to be similar to Int:D's candidates, but with an extra check for NaN i think 01:21
timo (try my \numeric = a.Numeric).defined 01:22
?? (self.isNaN && numeric.isNaN or numeric == self)
!! False
this one i mean
Geth rakudo/int-accepts-int-quickly: d7ecc018a7 | (Timo Paulssen)++ | src/core.c/Int.pm6
Very simple ACCEPTS for Int:D vs Int:D

Otherwise running ACCEPTS on an Enum goes via Numeric's ACCEPTS, which first calls to .Numeric to coerce, and has checks for nan and inf on top of the numeric value comparison.
This new candidate has a bytecode small enough to be inlined, as opposed to the Numeric ACCEPTS method.
01:37
timo does that look good to you?
Kaiepi i'm not sure how to type an Any:D coercion for Int.ACCEPTS and Num.ACCEPTS w/o the rounding errors off the top of my head. it would need a more narrow type to consider maybe
m: use nqp; say nqp::iseq_I(1, my $ = 1) 01:39
camelia P6opaque: get_boxed_ref could not unbox for the representation 'P6bigint' of type Scalar
in block <unit> at <tmp> line 1
timo i'm not entirely sure what you're looking to do; i'm mostly thinking of putting ACCEPTS for matching types in this spec test
ok, needs a decont
m: use nqp; say nqp::iseq_I(1, my \xyz = 1)
camelia 1
timo or not
Kaiepi it needs the decont i think 01:40
m: use nqp; sub foo(\topic) { nqp::iseq_I(1, topic) }(my $ = 1)
camelia P6opaque: get_boxed_ref could not unbox for the representation 'P6bigint' of type Scalar
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
timo indeed 01:41
Geth rakudo/int-accepts-int-quickly: 4d067e360c | (Timo Paulssen)++ | src/core.c/Int.pm6
Very simple ACCEPTS for Int:D vs Int:D

Otherwise running ACCEPTS on an Enum goes via Numeric's ACCEPTS, which first calls to .Numeric to coerce, and has checks for nan and inf on top of the numeric value comparison.
This new candidate has a bytecode small enough to be inlined, as opposed to the Numeric ACCEPTS method.
01:42
timo that's what i get for using \ sigil 01:51
hold on, perhaps it's actually faster now to use $ sigil
don't actually hold on, tho 02:00
the latest commit passes spec tests, or at least hasn't failed any yet
anyway, feel like hitting merge on the PR if you think it looks good, we can add more ACCEPTS candidates in other places later 02:14
(when the tests pass) 02:15
02:19 linkable6 left, evalable6 left 02:20 evalable6 joined 03:39 squashable6 left, evalable6 left, tellable6 left, notable6 left, bloatable6 left, nativecallable6 left, quotable6 left, sourceable6 left, coverable6 left, statisfiable6 left, greppable6 left, unicodable6 left, benchable6 left, shareable6 left, bisectable6 left, reportable6 left, committable6 left, releasable6 left 03:40 squashable6 joined, notable6 joined, reportable6 joined 03:41 sourceable6 joined, shareable6 joined, committable6 joined, bloatable6 joined, unicodable6 joined, nativecallable6 joined 03:42 greppable6 joined, releasable6 joined, evalable6 joined 04:20 linkable6 joined 04:41 benchable6 joined 04:42 coverable6 joined, statisfiable6 joined 04:44 frost left, dogbert17 left, gfldex left 04:45 frost joined, dogbert17 joined, gfldex joined 05:37 casaca left 05:42 tellable6 joined, quotable6 joined 05:54 japhb left 06:02 reportable6 left 06:05 reportable6 joined 06:23 frost left 06:49 japhb joined 08:57 MasterDuke joined 09:56 casaca joined 10:56 linkable6 left, evalable6 left 10:58 linkable6 joined
timo skarsnik's example code with gumbo and XML got slower between 2021.09 and master, but at least int-accepts-int-quickly seems to make it perform better 11:11
11:41 bisectable6 joined 12:02 reportable6 left
Geth rakudo/add-Any.infer: 402d434b7c | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Add an Any(iterable).infer method

Given an iterable thing of values, will return the type / role that is tightest for the values given.
As proposed by jnthn on logs.liz.nl/moarvm/2021-11-09.html#10:25-0001
13:27
rakudo: lizmat++ created pull request #4626:
Add an Any(iterable).infer method
13:28
rakudo: MasterDuke17++ created pull request #4627:
Change SetHash.values() from `is rw` to `is raw`
13:45
13:48 Geth left, Geth joined
Geth rakudo: 6598746027 | (Daniel Green)++ | src/core.c/SetHash.pm6
Change SetHash.values() from `is rw` to `is raw`

Doesn't change the semantics, but makes it consistent with
  (Mix|Bag)Hash.values().
13:49
rakudo: 4ea2ca2d18 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | src/core.c/SetHash.pm6
Merge pull request #4627 from MasterDuke17/consistently_use_is-raw_for_(Mix|Bag|Set)Hash_.values

Change SetHash.values() from `is rw` to `is raw`
14:56 [Coke] left 14:58 evalable6 joined 14:59 [Coke] joined 15:03 reportable6 joined
Geth rakudo/replace-attrinited: 6 commits pushed by (Jonathan Worthington)++ 15:09
rakudo: db136bc52d | (Stefan Seifert)++ | 5 files
Fix segfaults when multiple threads initialize dynamics

When multiple threads try to access an uninitialized dynamic like $*PROGRAM-NAME at the same time, they all will run the initialization code. This is mostly benign (just a little wasteful) but the actual assignment into the PROCESS:: stash may lead to segfault as that's unsafe writing into a hash. Indeed, this not only affects PROCESS variables, but stashes in general. Since stashes are ... (7 more lines)
15:14
rakudo: 09f5069cc5 | (Jonathan Worthington)++ (committed using GitHub Web editor) | 5 files
Merge pull request #4622 from rakudo/fix_stash_threading_issues

Fix segfaults when multiple threads initialize dynamics
15:16 squashable6 left
Geth rakudo/replace-attrinited: 77720e06e2 | (Jonathan Worthington)++ | 2 files
Fix Array/Hash attribute initialization

We need to clear the UninitializedAttribute descriptor upon a STORE to an array or hash, otherwise we'll consider it uninitialized and wrongly give errors or apply defaults.
15:49
rakudo/int-accepts-int-quickly: f537ac880e | (Timo Paulssen)++ | src/core.c/Int.pm6
Use sigiled parameter instead of sigil-less
16:14
timo ^- running spectests right now 16:16
16:26 [Coke]_ joined 16:28 [Coke] left, [Coke]_ is now known as [Coke]
timo spec tests succeeded 16:28
17:28 evalable6 left, linkable6 left 17:31 linkable6 joined
Geth roast: b112eb0f4c | (Jonathan Worthington)++ | S12-class/attributes-required.t
Cover `is required` with @ and % sigils
17:39
rakudo/replace-attrinited: 10 commits pushed by (Jonathan Worthington)++
review: github.com/rakudo/rakudo/compare/7...049edeebb3
17:40
18:03 reportable6 left 18:31 evalable6 joined
Geth rakudo/add-Any.infer: fd16f72bda | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Make .infer take a fast path for all identical types

And fall back to the old algorithm if a different type is detected.
This makes (1,2,3,4,5,6,7,8,9,10).infer about 9x as fast.
18:32
nqp/new-disp-nativecall: b7c05b2ff0 | (Stefan Seifert)++ | 4 files
API for asking whether the compiler supports a certain nqp op

This can be used to conditionally compile backend specific code in modules like NativeCall
18:52
nqp/new-disp-nativecall: 3945533f58 | (Stefan Seifert)++ | src/vm/moar/QAST/QASTOperationsMAST.nqp
Remove last remnant of old invocation protocol
rakudo/new-disp-nativecall: 12 commits pushed by (Stefan Seifert)++
review: github.com/rakudo/rakudo/compare/5...e5e6a0dfad
18:53
rakudo: niner++ created pull request #4629:
New disp nativecall
18:54
19:03 reportable6 joined
Geth rakudo/add-Any.isa-all: 2ca8fddfcb | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Add Any(iterable).isa-all(type) method

This returns a boolean whether all values produced by the iterable match the given type. Intended to be used in e.g. constraints such as:
   sub foo(@a where .isa-all(Int))
... (10 more lines)
19:12
rakudo: lizmat++ created pull request #4630:
Add Any(iterable).isa-all(type) method
19:43 Geth left, TempIRCLogger left 19:45 RakuIRCLogger left, lizmat left 19:47 lizmat joined 19:48 Geth joined 19:51 Kaipi joined 19:53 childlikempress joined
Geth rakudo/add-Any.isa-any: 1a930fd87c | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Add Any(iterable).isa-any(type) method

This returns a boolean whether *any* values produced by the iterable match the given type. Intended to be used in e.g. constraints such as:
   sub foo(@a where .isa-any(Int))
... (5 more lines)
19:57
rakudo: lizmat++ created pull request #4631:
Add Any(iterable).isa-any(type) method
19:58
20:00 Kaiepi left, discord-raku-bot left, moon-child left
Geth rakudo/add-Any.isa-none: 7fd4deec42 | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.pm6
Add Any(iterable).isa-none(type) method

This returns a boolean whether none of the values produced by the iterable match the given type. Intended to be used in e.g. constraints such as:
   sub foo(@a where .isa-none(Str))
... (5 more lines)
20:17
rakudo: lizmat++ created pull request #4632:
Add Any(iterable).isa-none(type) method
20:18
20:26 childlikempress is now known as moon-child 21:07 [Tux] left 21:16 squashable6 joined 21:25 [Tux] joined 21:30 discord-raku-bot joined
Geth rakudo: jnthn++ created pull request #4633:
Replace nqp::attrinited with a descriptor-based approach
21:59
rakudo: MasterDuke17++ created pull request #4634:
Make concurrent access to an enum by value safe
22:33
23:44 dogbert17 left