code gen for returning a single array
.. In this case, the return type can't be t* as the mem it points to is no longer available outside the function call. We decide to wrap it in a struct. It complicates code-gen a lot. I hope the C gen for dargent can shed some light on how to structure the code generator module. Hence this ticket as a reminder.
For now, the work around is to not return an array alone. Since we don't have singleton tuples, we can still wrap the returning array in a singleton unboxed record.
Yeah, we should do the struct-wrapping thing.
Wouldn't say dargent would change this much.
I'd recommend wrapping all arrays in a singleton struct.
It won't. I hope the dargent implementation can subsume the changes I have to make in the code base for it.
(I try to be lazy, to line up with the lazy language I'm using.)