Capital on Nostr: I've been thinking about the type system of #CrystalLang. It's got me wanting a ...
I've been thinking about the type system of #CrystalLang. It's got me wanting a language where types are grouped exclusively through sets. This can be either explicitly defined unions, interfaces, or something else.
But, there has been something bothering me. Something always felt off about inheritance under this model. And, I think I have finally figured it out!
Let's say you've got class A. You then derive classes B and C from A. If the type A is set of types, what would that be set?
Published at
2023-06-20 07:09:14Event JSON
{
"id": "be065d07e9d70effbeadc6f7d3584b0f20e0b55b2b3f601b4d955035504e6559",
"pubkey": "19132ebf4163a2399191bc90c23f33d1fe4945cbe9c807b0d196b172a2701961",
"created_at": 1687244954,
"kind": 1,
"tags": [
[
"t",
"crystallang"
],
[
"mostr",
"https://furry.engineer/users/CapitalEx/statuses/110575285359115431"
]
],
"content": "I've been thinking about the type system of #CrystalLang. It's got me wanting a language where types are grouped exclusively through sets. This can be either explicitly defined unions, interfaces, or something else.\n\nBut, there has been something bothering me. Something always felt off about inheritance under this model. And, I think I have finally figured it out!\n\nLet's say you've got class A. You then derive classes B and C from A. If the type A is set of types, what would that be set?",
"sig": "470b85808f302605b9a2808828af549508cb3838026581c931bbca2cccea9c174b99320aff90c8f6630e7455a130bba62a06660ab123329af890128c9d2cd6fd"
}