FROGGS jnthn: the current model how shapes on arrays work is not enough for CArrays inlined in CStructs 10:20
jnthn: the shape information must be present at the time the CStruct is composed
ohh, bbi1h 10:21
jnthn FROGGS: Yeah, the current model was designed with the other problem in mind (making my @x[$len] working). 10:31
Which is rather more common
I think we should be able to find an extension that works out
FROGGS jnthn: yes, I already made my-scoped CArrays work fwiw 11:23
jnthn It's only really a problem for HAS though, not has? 11:24
In that has is a pointer to a CArray? 11:25
FROGGS aye
jnthn OK, good. :)
FROGGS has is unproblematic like my
jnthn Then we understanding the problem the same :)
FROGGS :o)
jnthn *understand
nwc10 groupthink! 11:27
FROGGS so I guess I'd need to tweak $*W.container_type_info, to pass the $shape along to $*W.parameterize_type_with_args or so 11:28
jnthn In general though we don't want to do that...
I'm a bit more inclined to stick a shape property on Attribute...somehow...and for HAS mandate that it is a compile time known value 11:29
FROGGS hmmmm 11:30
jnthn Which is a tad special-casey, but HAS kinda is anyway...
And it'll let us do decent error reporting
FROGGS I see 11:31
jnthn I think you'll need to pass the shape down through the REPR composition protocol in this case. 11:32
m: class A { HAS $.a } 11:33
camelia rakudo-moar 5d7f65: OUTPUT«===SORRY!=== Error while compiling /tmp/qAJewBedua␤Variable $.a used where no 'self' is available␤at /tmp/qAJewBedua:1␤------> class A { HAS $.a⏏ }␤ expecting any of:␤ argument list␤ term␤»
jnthn oh, it's a NativeCall thing
m: use NativeCall; class A { HAS $.a }
camelia rakudo-moar 5d7f65: OUTPUT«===SORRY!===␤Can only use HAS-scoped attributes in classes with repr CStruct, CPPStruct and CUnion, not P6opaque␤»
jnthn m: use NativeCall; class A is repr('CStruct') { HAS A $.a }
camelia rakudo-moar 5d7f65: OUTPUT«(signal SEGV)»
jnthn wowser!
FROGGS /o\
jnthn heh, that makes no sense though :)
"Sure, inline yourself flatly into yourself!"
m: use NativeCall; class A is repr('CStruct') { has int32 $.x; }; class B is repr('CStruct') { HAS A $.a } 11:34
camelia ( no output )
FROGGS that could be the base of an awesome compression algorithm :o)
jnthn m: use NativeCall; class A is repr('CStruct') { has int32 $.x; }; class B is repr('CStruct') { HAS A $.a }; B.^attributes.say
camelia rakudo-moar 5d7f65: OUTPUT«(A $!a)␤»
jnthn m: use NativeCall; class A is repr('CStruct') { has int32 $.x; }; class B is repr('CStruct') { HAS A $.a }; say B.^attributes.^methods>>.name
camelia rakudo-moar 5d7f65: OUTPUT«(from-iterator from-slurpy from-slurpy-onearg from-slurpy-flat new to from sum fmt BIND-POS reification-target iterator Seq sink STORE eager Capture FLATTENABLE_LIST FLATTENABLE_HASH Supply CALL-ME is-lazy pick roll reverse rotate rotor combinations permut…»
jnthn m: use NativeCall; class A is repr('CStruct') { has int32 $.x; }; class B is repr('CStruct') { HAS A $.a }; say B.^attributes.^methods(:local)>>.name 11:35
camelia rakudo-moar 5d7f65: OUTPUT«(from-iterator from-slurpy from-slurpy-onearg from-slurpy-flat new to from sum fmt BIND-POS reification-target iterator Seq sink STORE eager Capture FLATTENABLE_LIST FLATTENABLE_HASH Supply CALL-ME is-lazy pick roll reverse rotate rotor combinations permut…»
jnthn hmm
oh duh
m: use NativeCall; class A is repr('CStruct') { has int32 $.x; }; class B is repr('CStruct') { HAS A $.a }; say B.^attributes[0].^methods(:local)>>.name
camelia rakudo-moar 5d7f65: OUTPUT«(<anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> compose apply_handles get_value set_value container readonly package inlined WHY set_why Str gist)␤»
jnthn Ah, inlined
But yeah, we want to somehow get the shape available in there...
But now I see that HAS is special-cased in NativeCall, I can see why that's a bit of fun :) 11:36
FROGGS nods
lizmat looks interesting perhaps for multidim natives? blogs.apache.org/foundation/entry/...nnounces87 19:02
"Arrow's cross platform and cross system strengths will enable Python and R to become first-class languages across the entire Big Data stack" 19:03
spot the missing language :-)
TimToady Intercal? 19:04
timotimo malbogle 19:05
FROGGS jnthn: I've got a working implementation of fixed sized CArrays now (inlined and standalone) 19:08
there might be an issue because I do not handle alignment yet though 19:09
timotimo oooooooooooooooooooooooooooh
FROGGS the box2d library is a good test candidate btw
timotimo <3
dalek Heuristic branch merge: pushed 42 commits to MoarVM/even-moar-jit by bdw 23:55