patrickb MVM_nativecall_invoke is effectively unused and replaced by MVM_nativecall_dispatch. Correct? 22:34
timo that's quite possible 22:45
patrickb Is it possible to put a trait on a capture? If so, is it possible to reach for that trait in the dispatcher when processing said call? 23:08
I'm off to bed soon, but will backlog.
timo oh, capture? i'm not exactly sure, but if the thing you want to put on it is only a few different kinds of values, you could parameterize a type 23:09
MVMCapture wouldn't allow something like mixing in roles to get more attributes, see, because only P6Opaque (and maybe CStruct?) can do that 23:10
patrickb I want to add a list of types of the variadic args on native-calls. 23:16
Context: I want to add vararg support to nativecall. I somehow need to specify the types of the variadic args when calling. 23:17
A named arg containing a list could do the trick. But syntactically an annotation would be more fitting IMHO. But maybe I'll just go for the named arg, because it's simpler. 23:18
github.com/Raku/problem-solving/issues/473 My ramblings surrounding this are captured there 23:19
lizmat couldn't the logic for setting up the nqp::istype list be used for that ? 23:23
timo do varargs actually care about types we may want to pass? 23:39
var args in C and the calling conventions we support is already very wibbly wobbly 23:41
we do want to have some stuff like "when passing a Str, it has to be encoded as a windows-style wide string" for example
that probably doesn't want to be specified at every call site, which would mean it should probably go near the sub declaration site 23:43
the "is variadic" trait could also go on the first parameter that is part of the variadic argument list
or on the last one that isn't
japhb timo: According to patrickb's research on a MacOS/ARM problem, varargs don't Just Work on the MacOS/ARM ABI. But of course they do on Linux/x64, which may have been why people didn't run into this earlier. 23:46
timo thinking of the possibly most common var arg functions printf and scanf, we'll want to be able to support at the very least "is rw" so individual args can be passed as "out" parameters. otherwise the user of the bound function would have to pass a CPointer 23:47
yeah, some ABIs need some information about the var args in a register IIRC. maybe the number of var args being passed?
presumably the system5 abi or whichever it is that we have on linux/x86 doesn't need anything like that and so if you just define a couple of subs that bind to the "sprintf" symbol and have different signatures it Just Works. maybe even with just a `*@args` parameter? 23:48
now, while we can't very easily put traits on a Capture, we can actually put information on a Scalar's descriptor if that would fit 23:57