{"id":22140056,"url":"https://github.com/thepuzzlemaker/tethys","last_synced_at":"2025-07-25T22:32:59.075Z","repository":{"id":37019587,"uuid":"396546869","full_name":"ThePuzzlemaker/tethys","owner":"ThePuzzlemaker","description":"A toy functional programming language with a System F-based core calculus - Read-only mirror from sr.ht","archived":false,"fork":false,"pushed_at":"2024-02-03T04:20:17.000Z","size":1081,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-02-03T05:25:38.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sr.ht/~thepuzzlemaker/tethys","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThePuzzlemaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/README.md","governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-16T00:25:23.000Z","updated_at":"2024-02-03T05:25:39.503Z","dependencies_parsed_at":"2023-11-16T04:27:35.819Z","dependency_job_id":"39400511-2d5f-4557-ba8c-3c7cfbdac28f","html_url":"https://github.com/ThePuzzlemaker/tethys","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Ftethys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Ftethys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Ftethys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Ftethys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePuzzlemaker","download_url":"https://codeload.github.com/ThePuzzlemaker/tethys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227624551,"owners_count":17795505,"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":[],"created_at":"2024-12-01T20:26:18.204Z","updated_at":"2024-12-01T20:26:18.773Z","avatar_url":"https://github.com/ThePuzzlemaker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tethys\n\n\u003c!-- [![CI Status][ci_badge]][ci_link] --\u003e\n[![License][license_badge]][license_link] [![Discord](https://img.shields.io/discord/822290196057948171?style=flat-square\u0026color=blue)](https://discord.gg/26X6ChQQcG) ![Lines of Code][tokei_loc]\n\n[tokei_loc]: https://img.shields.io/tokei/lines/github/ThePuzzlemaker/Tethys?style=flat-square\n\n\u003c!-- [ci_badge]: https://img.shields.io/github/actions/workflow/status/ThePuzzlemaker/tethys/ci.yml?branch=main\u0026style=flat-square --\u003e\n\u003c!-- [ci_link]: https://github.com/ThePuzzlemaker/Tethys/actions --\u003e\n\n[license_badge]: https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square\n[license_link]: #license\n\n[calypso]: https://calypso-lang.github.io/\n\nTethys is a toy functional programming language based on a System\nF-based core calculus.\n\nThis language is mostly for learning about type systems, but I am\ngoing to make it into something half-fleshed (as opposed to\nfully-fleshed). It's not going to be *efficient* (most likely), but it\nwill be a good learning experience.\n\nNote that this code is very work-in-progress. Contributions are\nwelcome (and encouraged!), but it's likely that as a toy langauge,\nthis will never be in a state that is helpful or efficient to use in\nproduction. If you want a language that will (eventually) be robust\n(enough), see [Calypso][calypso].\n\n## Example\n\nThe following example is an implementation of\n[FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) up to 100. This is\nalso available at\n[`support/examples/fizzbuzz.tys`](./support/examples/fizzbuzz.tys). Note\nthat this is currently pseudocode, though it will likely not change\nmuch by the time most features are implemented.\n\n```elixir\ndef main\n  : () -\u003e ()\n  = \\_.\n    each (fizzbuzz 100) println\n\ndef fizzbuzz\n  : Int -\u003e List[String]\n  = \\max.\n    map (rangeI 1 100) (\\n.\n      if (divides n 15)\n      then \"FizzBuzz\"\n      else if (divides n 3)\n      then \"Fizz\"\n      else if (divides n 5)\n      then \"Buzz\"\n      # Typeclasses soon(tm)\n      else intToString n)\n```\n\n## Internals and Motivation\n\nThere are two parts of Tethys: the surface language, and the core\ncalculus. The core calculus is the intermediate representation of\nTethys which is used for type checking and inference, and for\ninterpretation. The surface language is the higher-level interface\nthat is eventually desugared by the compiler/interpreter to the core\ncalculus.\n\nThe reference implementation in Haskell will probably not use any\nparticular \"tricks\" in terms of interpretation (VM, JIT, AOT\ncompilation to native, etc.), instead just using a simple tree-walk\ninterpreter or similar. (At some point, it may end up compiling to\nCalypso's SaturnVM.)\n\nThis language was created in order to conduct informal research (i.e.,\nnot actually discovering anything interesting, probably) on type\nsystems, especially bidirectional typechecking and\npolymorphism. Tethys is named as such as it is the name of the\nco-orbital moon to Calypso; as my work on this language is\n\"co-orbital\", so to speak, to my work on Calypso.\n\nMore information on Calypso (the language, of course) is available at\n[https://calypso-lang.github.io][calypso].\n\nThis implementation is partially based on an implementation of\nbidirectional typechecking with unification of higher-rank\npolymorphism created by [Mark Barbone (aka\nMBones/mb64)](https://github.com/mb64). A slightly modified version of\nthis implementation is available at\n[`support/tychk_nbe.ml`](./support/tychk_nbe.ml). The original is\navailable [in this\nGist](https://gist.github.com/mb64/f49ccb1bbf2349c8026d8ccf29bd158e#file-tychk_nbe-ml).\n\nAdditionally, this implementation is based on an algorithm described\nby [András Kovács](https://github.com/AndrasKovacs) in their\n[elaboration\nzoo](https://github.com/AndrasKovacs/elaboration-zoo/tree/master/03_holes). Further\ninspiration comes from [Bálint Kocsis](https://github.com/balint99)'s\n[SFPL](https://github.com/balint99/sfpl). The core algorithm, created\nfor dependent types but made specific to System F, is available in\n[`support/typeck`](./support/typeck).\n\nA list of resources and bibliography used to make this is available in\nthe [paper](#paper). Note that this list is not necessarily up to\ndate. I'll try to update it as soon as I can, when I use new\nresources.\n\n### \"Paper\"\n\nThe source for the \"paper\" (really just a typeset informal writeup) is\nin [`paper/paper.tex`](paper/paper.tex) (requires pdftex). At some\npoints there may be a PDF in the repository but there is no guarantee\nthat it is up-to-date with the LaTeX source.\n\n## Contribution\n\nI have yet to draft up a CONTRIBUTING.md. If you'd like to contribute\nand don't know where to start, feel free to open an issue, ping me on\nDiscord or contact me elsewhere. I'll let you know if there's anything\nI think you can help with, and if so give you some\npointers. Contributions are greatly appreciated!\n\nThere is a semi-functional VSCode extension / TextMate grammar in\n[`support/highlight`](./support/highlight). It's not perfect, but it\nworks well enough.\n\n### Repository Overview\n\n- `paper/`: Source and occasionally PDF for the \"paper\" (really just a\n  typeset informal writeup). See [this section](#paper) for a bit more\n  information.\n- `support/`: Support files, including grammars, examples, tests,\n  etc. See [its README](./support/README.md) for a bit more\n  information.\n\n## License\n\nThis project is licensed under the BSD 3-Clause license:\n[LICENSE](LICENSE) or https://spdx.org/licenses/BSD-3-Clause.html.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, shall be licensed as\nabove, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepuzzlemaker%2Ftethys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepuzzlemaker%2Ftethys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepuzzlemaker%2Ftethys/lists"}