Second draft: Sum Type by Struct
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Sat Sep 12 18:36:35 UTC 2026
On 12/09/2026 10:42 PM, Per Nordlöw wrote:
> On Friday, 11 September 2026 at 22:12:16 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>> On 12/09/2026 10:07 AM, Per Nordlöw wrote:
>>> On Thursday, 10 September 2026 at 17:56:21 UTC, Richard (Rikki)
>>> Andrew Cattermole wrote:
>>>> No.
>>>
>>> Can you please give a motive to why you don't want to support this?
>>> And I don't understand why you are pasting the code failure. The code
>>> works for me.
>> Bit packing requires assumptions.
>
> And how is that blocker? The optimization could kick only when the
> alignment of the pointed to types give room to tag bits which is often
> the case for struct types.
That would require reordering the fields.
The tag goes first.
And quite frankly nobody is implementing this. Its not how struct &
union field layouting works.
>> The bottom bits are used, it is not a modulas of a the type size.
>
> For what values of `Types` passed to my `GCWordVariant` are you
> referring to here?
int, int*
More information about the dip.development
mailing list