Handling large flat values in ATS

A question raised by Matt Danish:

It occurred to me that there’s something awkward about this in ATS:

%{ typedef char buf_t[124]; %}

typedef t1 = $extype "buf_t"
typedef t2 = @(int, t1)

When I try to put together a value of this type it ends up using assignment
for each of the component parts. But then you end up with an assignment
of type “buf_t” and that’s an array, which C does not allow.

I could just circumvent this using some foreign functions but I wonder if
you’ve thought about this in ATS.

Yes, I have.

The ATS compiler cannot handle values of such a large flat type.

I put up an example showing how to use variables (rather than values) of a
large flat type: