Now that you’ve had a few days to digest “Completion”: Here is “Existential Type...
Slava Pestov @slava@mathstodon.xyz
Now that you’ve had a few days to digest “Completion”: Here is “Existential Types”. No monoids or proofs this time, just my usual crazy mix of language semantics and implementation, too abstract for C++ weenies and too concrete for CS chumps, but for you, it’s just right. If you’ve ever wanted to know the answer to any of the following, it’s all there:
- What does it mean to “open” an existential, and what is an existential archetype?
- What does existential opening and erasure look like in the AST?
- How does type substitution in the SIL specializer interact with existential archetypes?
- Which protocol members can be accessed with an existential, and how is this related to the subtyping relation?
- For that matter, what *is* the Swift subtyping relation? (You won’t find this written down anywhere else!)
- How are existential types actually represented in memory, and how is the representation determined from the type?
- How can the SIL optimizer (occasionally) eliminate usage of existential types altogether?
- Under what circumstances do existential types conform to protocols, and why doesn’t this work in general, unlike some languages?