{"id":13872177,"url":"https://github.com/MaxDesiatov/Typology","last_synced_at":"2025-07-16T01:33:16.355Z","repository":{"id":63917741,"uuid":"182141244","full_name":"MaxDesiatov/Typology","owner":"MaxDesiatov","description":"Swift type checking and semantic analysis for developer tools","archived":false,"fork":false,"pushed_at":"2022-03-16T11:14:19.000Z","size":190,"stargazers_count":81,"open_issues_count":23,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-18T21:31:47.618Z","etag":null,"topics":["developer-tools","hindley-milner","semantic-analysis","semantic-analyzer","swift","type-checker","type-checking","type-inference","type-system"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxDesiatov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"MaxDesiatov","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-04-18T18:52:33.000Z","updated_at":"2024-08-25T02:00:04.000Z","dependencies_parsed_at":"2023-01-14T13:45:52.649Z","dependency_job_id":null,"html_url":"https://github.com/MaxDesiatov/Typology","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxDesiatov%2FTypology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxDesiatov%2FTypology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxDesiatov%2FTypology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxDesiatov%2FTypology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxDesiatov","download_url":"https://codeload.github.com/MaxDesiatov/Typology/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226090030,"owners_count":17572114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","hindley-milner","semantic-analysis","semantic-analyzer","swift","type-checker","type-checking","type-inference","type-system"],"created_at":"2024-08-05T23:00:35.820Z","updated_at":"2024-11-23T19:31:40.788Z","avatar_url":"https://github.com/MaxDesiatov.png","language":"Swift","funding_links":["https://github.com/sponsors/MaxDesiatov"],"categories":["Swift"],"sub_categories":[],"readme":"[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)\n\n# Typology\n\n![CI status](https://github.com/MaxDesiatov/Typology/workflows/CI/badge.svg?branch=main)\n[![Coverage](https://img.shields.io/codecov/c/github/MaxDesiatov/Typology/main.svg?style=flat)](https://codecov.io/gh/maxdesiatov/Typology)\n\nTypology is a work in progress attempt to implement type checking of Swift in Swift itself.\nCurrently it uses [SwiftSyntax](https://github.com/apple/swift-syntax) as a parser, but is ready\nto switch to other pure Swift parsers in the future when any are available.\n\n## Goals\n\n- **Education**: understanding how type checking can be implemented in a Swift\n  compiler\n- **User Experience**: finding the best way to report type errors and to improve\n  related developer tools\n- **Research and Experimentation**: prototyping advanced features that could be\n  fully developed within Swift's type system.\n\n## How does it work?\n\nSame as [the type checker in Apple's Swift\ncompiler](https://github.com/apple/swift/blob/master/docs/TypeChecker.rst),\nTypology relies on the fact that you can express [type\nsystems](https://en.m.wikipedia.org/wiki/Hindley–Milner_type_system) with a set of constraints\non types that are resolved through [unification](\u003chttps://en.wikipedia.org/wiki/Unification_(computer_science)\u003e).\n\n## See also\n\n### Type systems and type checkers\n\n- [Apple's Swift Compiler Type Checker Design and Implementation](https://github.com/apple/swift/blob/master/docs/TypeChecker.rst) by multiple contributors\n- [A Type System From Scratch](https://www.youtube.com/watch?v=IbjoA5xVUq0) by [@CodaFi](https://github.com/CodaFi)\n- [Write You a Haskell: Hindley-Milner Inference](http://dev.stephendiehl.com/fun/006_hindley_milner.html) by [@sdiehl](https://github.com/sdiehl)\n- [Typing Haskell in Haskell](http://web.cecs.pdx.edu/~mpj/thih/TypingHaskellInHaskell.html) by [Mark P Jones](https://web.cecs.pdx.edu/~mpj/)\n- [“What part of Hindley-Milner do you not understand?”](https://stackoverflow.com/questions/12532552/what-part-of-hindley-milner-do-you-not-understand) question and answers on StackOverflow\n- [So you want to write a type checker...](http://languagengine.co/blog/so-you-want-to-write-a-type-checker/) by [@psygnisfive](https://github.com/psygnisfive)\n- [Exponential time complexity in the Swift type checker](https://www.cocoawithlove.com/blog/2016/07/12/type-checker-issues.html) by [@mattgallagher](https://github.com/mattgallagher)\n- [A Swift Playground containing Martin Grabmüller's \"Algorithm W Step-by-Step\"](https://gist.github.com/CodaFi/ca35a0c22fbd96eca505b5df45f2509e) by [@CodaFi](https://github.com/CodaFi)\n\n### Error reporting\n\n- [Compiler Errors for Humans](https://elm-lang.org/blog/compiler-errors-for-humans) on [Elm blog](https://elm-lang.org/blog)\n- [Shape of errors to come in Rust compiler](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html) by [Jonathan Turner](https://github.com/jonathandturner)\n\n### Optimizing type checker's performance for large projects\n\n- [Apple's Swift Compiler Dependency Analysis](https://github.com/apple/swift/blob/master/docs/DependencyAnalysis.rst) by multiple contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaxDesiatov%2FTypology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMaxDesiatov%2FTypology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaxDesiatov%2FTypology/lists"}