💾 Archived View for dcreager.net › swanson › rethinking-enum-and-struct.gmi captured on 2023-09-28 at 16:23:56. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-07-22)
-=-=-=-=-=-=-
I've had ‘enum’ and ‘struct’ primitive modules for the longest time, but I don't actually use them anywhere. So far, when I've needed sum or product types in other S₁ code, I've just implemented them directly via S₁ closures. I don't know if that will be sustainable, but it's worked well so far.
That makes me think that those modules aren't needed. Thinking through it more, I think the modules are conflating (or were meant to conflate) multiple concerns: how to define sum and product types, and how to have fine-grained control over the memory layout of those types. But as I've discovered, you don't need primitives for the former if you don't care about the latter. And the primitives that I've implemented so far don't actually provide control over the memory layout!
So I think I'm going to remove them.