{"id":22140067,"url":"https://github.com/thepuzzlemaker/sysf-rs","last_synced_at":"2025-03-24T10:44:48.844Z","repository":{"id":37072350,"uuid":"390155584","full_name":"ThePuzzlemaker/sysf-rs","owner":"ThePuzzlemaker","description":"A work-in-progress (and bad) implementation of a System F typechecker (WIP) and evaluator (not started yet).","archived":false,"fork":false,"pushed_at":"2022-06-17T21:02:20.000Z","size":67,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"new-dunfield2013","last_synced_at":"2025-01-29T16:12:25.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/ThePuzzlemaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-27T23:28:48.000Z","updated_at":"2021-10-10T08:07:36.000Z","dependencies_parsed_at":"2022-06-24T20:03:27.595Z","dependency_job_id":null,"html_url":"https://github.com/ThePuzzlemaker/sysf-rs","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%2Fsysf-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Fsysf-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Fsysf-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePuzzlemaker%2Fsysf-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePuzzlemaker","download_url":"https://codeload.github.com/ThePuzzlemaker/sysf-rs/tar.gz/refs/heads/new-dunfield2013","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245257970,"owners_count":20585976,"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:19.394Z","updated_at":"2025-03-24T10:44:48.823Z","avatar_url":"https://github.com/ThePuzzlemaker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System F in Rust\n\nThis is an implementation of [Dunfield and Krishnaswami's \"Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism\"](https://research.cs.queensu.ca/home/jana/papers/bidir/) in Rust.\n\nVery WIP at the moment.\n\n## TODOs\n\n- [ ] Clean up code\n- [ ] Proper testing\n- [ ] Proper REPL and CLI\n- [ ] Language-level fixpoint and conditional, maybe sum types/product types or isorecursive types, and/or other extensions\n- [ ] Evaluator\n- [ ] Actually use files and stuff\n- [ ] Definitions\n- [ ] Maybe add simple module includes?\n- [ ] Maybe add type/term arenas?\n- [ ] Better error handling\n\n## Syntax\n\n```ebnf\n(* =:= Basic definitions =:= *)\nalpha_upper = \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\" | \"H\" | \"I\" | \"J\" | \"K\"\n            | \"L\" | \"M\" | \"N\" | \"O\" | \"P\" | \"Q\" | \"R\" | \"S\" | \"T\" | \"U\" | \"V\"\n            | \"W\" | \"X\" | \"Y\" | \"Z\" ;\nalpha_lower = \"a\" | \"b\" | \"c\" | \"d\" | \"e\" | \"f\" | \"g\" | \"h\" | \"i\" | \"j\" | \"k\"\n            | \"l\" | \"m\" | \"n\" | \"o\" | \"p\" | \"q\" | \"r\" | \"s\" | \"t\" | \"u\" | \"v\"\n            | \"w\" | \"x\" | \"y\" | \"z\" ;\nalpha       = alpha_upper | alpha_lower ;\ndigit       = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" ;\n\n(* Whitespace is ignored. *)\nwhitespace = \"\\r\" | \"\\n\" | \"\\r\\n\" | \" \" | \"\\t\" ;\n\n(* =:= Identifiers =:= *)\n\nident_start    = alpha ;\nident_continue = ident_begin | digit | \"_\" ;\n\nident = ident_begin, [ ident_cont ] ;\ntyvar = \"'\", ident ;\n\n(* =:= Types =:= *)\n\ntype = \"unit\" | \"bool\"   (* Primitives               *)\n     | tyvar, \"=\u003e\", type (* Universal quantification *)\n     | type, \"-\u003e\", type  (* Arrow                    *)\n     | tyvar             (* Type variable            *)\n     | \"(\", type, \")\"    (* Grouping                 *)\n\n(* =:= Terms =:= *)\n\nterm = \"true\" | \"false\"       (* Booleans           *)\n     | \"()\"                   (* Unit               *)\n     | \"\\\\\", ident, \".\", term (* Lambda-abstraction *)\n     | term, term             (* Application        *)\n     | term, \"[\", type, \"]\"   (* Type application   *)\n     | term, \":\", type        (* Annotation         *)\n     | ident                  (* Variable           *)\n     | \"(\", term, \")\"         (* Grouping           *)\n```\n\nTypes of the form `'__exstX` (where X is some number) may be generated by typechecking--they are existential variables that may be generated during typechecking and inference. You can think of them as somewhat similar to `'_weakX` in OCaml. Note that these generally indicate that a type could not be checked without more information. If you can't seem to get rid of them, it's possible you can't express what you are trying to in the language.\n\nSee [`src/grammar.lalrpop`](src/grammar.lalrpop) for the exact grammar used by the parser.\n\n## Overall Process\n\n1. Parse input.\n2. Lower surface AST to core AST (i.e. convert named variables to De Bruijn indices)\n3. Run typechecking! (WIP)\n4. Evaluate (WIP)\n\n## Debugging\n\nThis project uses the [`tracing`](https://lib.rs/tracing) crate, so you can use the `RUST_LOG` flag to control what tracing information is printed. This is currently only in the typechecker, but will be extended further at some point. Tracing can be disabled at compile-time (which will not compile any tracing infrastructure at all) by disabling the `trace` feature.\n\nYou can set the debugging mode by commenting out/uncommenting one of the lines at the start of `fn main()` in [`src/main.rs`](src/main.rs), though this will be moved to a runtime method at some point in the future.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepuzzlemaker%2Fsysf-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepuzzlemaker%2Fsysf-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepuzzlemaker%2Fsysf-rs/lists"}