{"id":16714816,"url":"https://github.com/ayazhafiz/plts","last_synced_at":"2025-06-19T22:32:46.265Z","repository":{"id":37377127,"uuid":"301215282","full_name":"ayazhafiz/plts","owner":"ayazhafiz","description":"A collection of programming languages and type systems.","archived":false,"fork":false,"pushed_at":"2025-05-11T23:53:19.000Z","size":167537,"stargazers_count":33,"open_issues_count":7,"forks_count":4,"subscribers_count":3,"default_branch":"base","last_synced_at":"2025-06-02T18:10:55.244Z","etag":null,"topics":["compiler","interpreter","programming-language","programming-language-theory","type-systems"],"latest_commit_sha":null,"homepage":"https://ayazhafiz.com/plts","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayazhafiz.png","metadata":{"files":{"readme":"README.mdx","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-04T19:56:49.000Z","updated_at":"2025-05-11T23:53:22.000Z","dependencies_parsed_at":"2024-08-15T03:52:45.333Z","dependency_job_id":"a5ac0643-2abc-4a03-a509-80f2de5cde6e","html_url":"https://github.com/ayazhafiz/plts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayazhafiz/plts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayazhafiz%2Fplts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayazhafiz%2Fplts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayazhafiz%2Fplts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayazhafiz%2Fplts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayazhafiz","download_url":"https://codeload.github.com/ayazhafiz/plts/tar.gz/refs/heads/base","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayazhafiz%2Fplts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260842531,"owners_count":23071346,"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":["compiler","interpreter","programming-language","programming-language-theory","type-systems"],"created_at":"2024-10-12T21:07:12.193Z","updated_at":"2025-06-19T22:32:41.243Z","avatar_url":"https://github.com/ayazhafiz.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"import Revision from \"../components/revision.tsx\"\nimport {Helmet} from \"react-helmet\";\nimport {Box, ThemeProvider, BaseStyles} from \"@primer/react\";\n\nexport default function Layout({children}) {\n  return (\u003c\u003e\n    \u003cHelmet\u003e\n      \u003ctitle\u003eplts\u003c/title\u003e\n      \u003clink\n        rel=\"stylesheet\"\n        href=\"https://unpkg.com/@primer/css/dist/primer.css\"\n      /\u003e\n    \u003c/Helmet\u003e\n    \u003cThemeProvider\u003e\n      \u003cBaseStyles\u003e\n        \u003cBox className=\"markdown-body\"\u003e\n          \u003cBox m={[4, 4, 10]}\u003e{children}\u003c/Box\u003e\n        \u003c/Box\u003e\n      \u003c/BaseStyles\u003e\n    \u003c/ThemeProvider\u003e\n  \u003c/\u003e);\n}\n\n# plts \u003cRevision /\u003e\n\nImplementations of type systems and programming languages I find interesting.\n\nRepository: [gh:ayazhafiz/plts](https://github.com/ayazhafiz/plts).\n\n- [Introductory](#introductory)\n- [Flow Typing](#flow-typing)\n- [Gradual Typing](#gradual-typing)\n- [Typed Assembly](#typed-assembly)\n- [Subtyping](#subtyping)\n- [Dependent Types](#dependent-types)\n- [Effects and Coroutines](#effects-and-coroutines)\n- [Roc](#roc)\n\n## Introductory\n\n- [Emulating the Lambda Calculus in TypeScript's Type System](https://ayazhafiz.com/articles/21/typescript-type-system-lambda-calculus): Evaluating the lambda calculus entirely using the TypeScript type system.\n\n- [TAPL](https://github.com/ayazhafiz/plts/blob/base/tapl): Selected\n  implementations of languages formalized in _Types and Programming Languages_\n  (Pierce 2002).\n\n- [Tiger][tiger-pg]: A compiler for the Tiger Language of Appel's 1998 [Modern\n    Compiler Implementation](https://www.cs.princeton.edu/~appel/modern/ml/index.html).\n\n## Flow Typing\n\n- [lang_narrow](https://ayazhafiz.com/lang_narrow): A language with unions,\n  records, and flow typing. A checker, interpreter, and C code generator is\n  implemented.\n\n  - [Playground](https://ayazhafiz.com/lang_narrow)\n  - [Blog post](https://ayazhafiz.com/articles/21/lang-narrow)\n\n- [FT][ft-pg]: The FT (flow typing) calculus from David\n  Pearce's 2012 paper [_Sound and Complete Flow Typing with Unions,\n  Intersections, and Negations_](https://ecs.wgtn.ac.nz/foswiki/pub/Main/TechnicalReportSeries/ECSTR12-20.pdf).\n  Like `lang_narrow`, but smaller and proven sound and complete. Includes a\n  self-designed type inferer guaranteed to infer principal types.\n  - [Playground][ft-pg]\n  - [Pearce, 2012](https://ecs.wgtn.ac.nz/foswiki/pub/Main/TechnicalReportSeries/ECSTR12-20.pdf)\n  - [Blog post](https://ayazhafiz.com/articles/21/type-inference-for-flow-typing): type inference for the calculus\n\n## Gradual Typing\n\n- [gtlc][gtlc-pg]: A compiler for the gradually-typed lambda calculus,\n  employing the type consistency relation of [Siek and Taha](http://www.schemeworkshop.org/2006/13-siek.pdf) (2006).\n  The GTLC allows a developer to omit type annotations during development at\n  the expense of run-time type casts. While the ahead-of-time typechecker will\n  catch any non-sensical type errors, the runtime system will catch any cast\n  errors.\n\n  The compiler is multi-phase, optimizing, includes an interpretive mode and a\n  type inferer, and provides code generators to C and TypeScript.\n\n  - [Playground][gtlc-pg]\n  - [Siek and Taha, 2006](http://www.schemeworkshop.org/2006/13-siek.pdf)\n  - [Type Inference for Gradual Typing (Siek and Vachharajani, 2008)](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.84.4703\u0026rep=rep1\u0026type=pdf)\n\n## Typed Assembly\n\n- [TAL][tal-pg]: A compiler from a System F-like language to the\n  Typed Assembly Language of [Morrisett, et.al. 1998](https://dash.harvard.edu/handle/1/2797451).\n  Also includes a compiler to x86 assembly using [Linear Scan Register\n  Allocation](http://web.cs.ucla.edu/~palsberg/course/cs132/linearscan.pdf)\n  (Poletto \u0026 Sarkar 1999).\n  - [Playground][tal-pg]\n\n## Subtyping\n\n- [HO21][ho21-pg]: An implementation of the\n  algorithmic duotyping calculus invented by Huang and Oliveira in\n  [Distributing Intersection and Union Types with Splits and Duality](https://dl.acm.org/doi/pdf/10.1145/3473594) (2021).\n  The calculus includes union, intersection, and arrow types in the presence\n  of non-trivial distributivity rules. The authors' duotyping algorithm is\n  somewhat novel in that it computes subtyping relationship entirely on\n  surface types of the language, without normalizing to a form like DNF.\n  This implementation includes a type-derivation tree generator.\n\n  - [Playground][ho21-pg]\n  - [Huang and Oliveira, 2021](https://dl.acm.org/doi/pdf/10.1145/3473594)\n\n- [simple_sub](https://github.com/ayazhafiz/plts/blob/base/simple_sub): A type system\n  that supports type inference in the presence of subtyping and polymorphism, as\n  described by Parreaux's _[The Simple Essence of Algebraic Subtyping](https://lptk.github.io/files/%5Bv1.8%5D%20simple-essence-algebraic-subtyping.pdf)_ (2020). Parreaux's\n  work distills Dolan's [2017 thesis](https://www.cs.tufts.edu/~nr/cs257/archive/stephen-dolan/thesis.pdf)\n  on Algebraic Subtyping into a simpler core.\n\n## Dependent Types\n\n- [deptypes](https://github.com/ayazhafiz/plts/blob/base/deptypes): A dependent\n  type theory as described in Chapter 2 of Pierce's _Advanced Topics in Types\n  and Programming Languages_.\n\n- [more deptypes](https://github.com/ayazhafiz/plts/pull/3): Additional,\n  alternate implementations of the basic dependently-typed lambda calculus.\n\n## Effects and Coroutines\n\n- [fx_cap](https://github.com/ayazhafiz/plts/blob/base/fx_cap): implements\n    effect handlers via monadic translation of the capability-passing style.\n\n- [co_lc](https://github.com/ayazhafiz/plts/blob/base/co_lc): a lambda calculus\n    with stackful coroutines and defunctionalized calls. Targets a bytecode stack\n    machine.\n\n    - [Playground][co_lc-pg]\n\n## Roc\n\n[cor](https://github.com/ayazhafiz/cor) is a minimalization of\n[Roc](https://roc-lang.org) used for experimenting on the language and its\ncompiler.\n\n- [cor/uls](https://github.com/ayazhafiz/cor/tree/base/experiments/uls): A\n    language with \"unspecialized lambda sets\", a novel extension of the\n    Hindley-Milner type system that supports efficient resolution of ad-hoc\n    polymorphic usages (a-la typeclasses) during unification.\n\n    - [Documentation](https://www.notion.so/rwx/Non-linear-monomorphization-0b26991a028949a285ca77a8ffcff3c5#1930c4eadf08465f9c7b96469f11f664)\n    - [Playground][uls-pg]\n\n- [cor/refine](https://github.com/ayazhafiz/cor/tree/base/experiments/refine):\n    An experimental extension of Roc with refinement of types bound in branch\n    patterns. Provides a flow-typing-like ergonomics for a unification-based HM\n    system.\n\n    Includes an compiler of pattern matching to decision trees, and various\n    other optimizations.\n\n    - [Playground][roc-refine-pg]\n\n- [cor/easy_tags](https://github.com/ayazhafiz/cor/tree/base/experiments/easy_tags):\n    An experimental extension of Roc with polymorphic variants' type variables\n    elided in output positions.\n\n    - [Playground][roc-easy-tags-pg]\n\n- [cor/compose_fx](https://github.com/ayazhafiz/cor/tree/base/experiments/compose_fx):\n    A demonstration of composable effects as designed in Roc.\n\n    - [Playground][roc-compose-fx-pg]\n\n- [cor/lss](https://github.com/ayazhafiz/cor/tree/base/experiments/lss):\n    A demonstration of lambda-set specialization as implemented in Roc.\n    Supports composable effects, as in `compose_fx`.\n\n    - [Playground][roc-lss-pg]\n\n[tiger-pg]: https://ayazhafiz.com/plts/playground/tiger\n[ft-pg]: https://ayazhafiz.com/plts/playground/ft\n[gtlc-pg]: https://ayazhafiz.com/plts/playground/gtlc\n[tal-pg]: https://ayazhafiz.com/plts/playground/tal\n[ho21-pg]: https://ayazhafiz.com/plts/playground/ho21\n[uls-pg]: https://ayazhafiz.com/plts/playground/cor/uls\n[roc-refine-pg]: https://ayazhafiz.com/plts/playground/cor/refine\n[roc-easy-tags-pg]: https://ayazhafiz.com/plts/playground/cor/easy_tags\n[roc-compose-fx-pg]: https://ayazhafiz.com/plts/playground/cor/compose_fx\n[roc-lss-pg]: https://ayazhafiz.com/plts/playground/cor/lss\n[co_lc-pg]: https://ayazhafiz.com/plts/playground/co_lc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayazhafiz%2Fplts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayazhafiz%2Fplts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayazhafiz%2Fplts/lists"}