Typology is a work in progress attempt to implement type checking of Swift in Swift itself. Currently it uses SwiftSyntax as a parser, but is ready to switch to other pure Swift parsers in the future when any are available.
- Education: understanding how type checking can be implemented in a Swift compiler
- User Experience: finding the best way to report type errors and to improve related developer tools
- Research and Experimentation: prototyping advanced features that could be fully developed within Swift's type system.
How does it work?
Type systems and type checkers
- Apple's Swift Compiler Type Checker Design and Implementation by multiple contributors
- A Type System From Scratch by @CodaFi
- Write You a Haskell: Hindley-Milner Inference by @sdiehl
- Typing Haskell in Haskell by Mark P Jones
- “What part of Hindley-Milner do you not understand?” question and answers on StackOverflow
- So you want to write a type checker... by @psygnisfive
- Exponential time complexity in the Swift type checker by @mattgallagher
- A Swift Playground containing Martin Grabmüller's "Algorithm W Step-by-Step" by @CodaFi
Optimizing type checker's performance for large projects
- Apple's Swift Compiler Dependency Analysis by multiple contributors