{"id":16563725,"url":"https://github.com/nathsou/girafe","last_synced_at":"2025-07-19T22:36:05.223Z","repository":{"id":42835091,"uuid":"264766219","full_name":"nathsou/Girafe","owner":"nathsou","description":"Term Rewriting Systems infrastructure","archived":false,"fork":false,"pushed_at":"2023-03-01T19:01:12.000Z","size":1839,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T19:43:46.765Z","etag":null,"topics":["compiler","decision-trees","functional-programming","girafe","rewriting","rewriting-system","term-rewriting"],"latest_commit_sha":null,"homepage":"https://nathsou.github.io/Girafe/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathsou.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":null,"governance":null}},"created_at":"2020-05-17T22:10:32.000Z","updated_at":"2024-12-20T12:20:47.000Z","dependencies_parsed_at":"2023-02-06T12:01:46.226Z","dependency_job_id":"77c465f1-a34c-4009-8c89-f8f6846805f2","html_url":"https://github.com/nathsou/Girafe","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/nathsou%2FGirafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsou%2FGirafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsou%2FGirafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsou%2FGirafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathsou","download_url":"https://codeload.github.com/nathsou/Girafe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238738072,"owners_count":19522303,"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","decision-trees","functional-programming","girafe","rewriting","rewriting-system","term-rewriting"],"created_at":"2024-10-11T20:42:08.715Z","updated_at":"2025-02-13T21:31:33.054Z","avatar_url":"https://github.com/nathsou.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Package][npm]][npm-url]\n[![Build Size][build-size]][build-size-url]\n\n# Girafe\n\nTry it in the [playground](https://nathsou.github.io/Girafe).\n\n ### Term Rewriting Systems infrastructure\n\nGirafe provides a set of tools based on a minimal [term rewriting systems](https://en.wikipedia.org/wiki/Rewriting) language that can be interpreted or compiled to various targets.\n\nSee the examples/ folder for small demos.\n\nMultiple preprocessors and transformations can be applied to support laziness, imports, currying, non-linearity etc.. see src/Compiler/Passes/\n\n## Installing\n\n```bash\n$ npm install -g girafe\n```\n\n## Compiling\nGirafe programs can be compiled to javascript, ocaml or haskell using:\n```bash\n$ grf src.grf out.ext js/ocaml/haskell\n```\n\nOr interpreted using:\n```bash\n$ grf src.grf [query]\n```\n## Use Cases\n\n- Target language for functional (lazy or eager) programming languages (see [croco](https://github.com/nathsou/Croco))\n- Symbolic computation\n- Automated theorem proving\n- Abstract data type specifications\n\n### Todo\n\n- [x] Use a necessity heuristic when building decision-trees\n- [x] Simulate lazy rewriting correctly\n- [ ] Add targets (c/rust/wasm)\n- [ ] Confluence checks\n- [x] Tail call elimination\n- [ ] Simple optimizations\n\n### References\n\n1. Maranget, Luc (2008) [Compiling Pattern Matching to Good Decision Trees](http://moscova.inria.fr/~maranget/papers/ml05e-maranget.pdf)\n2. Martelli \u0026 Montanari (1982) [An Efficient Unification Algorithm](http://moscova.inria.fr/~levy/courses/X/IF/03/pi/levy2/martelli-montanari.pdf)\n3. Fokkink, Wan \u0026 Kamperman, Jasper \u0026 Walters, Pum. (1999). [Lazy Rewriting on Eager Machinery.](https://www.researchgate.net/publication/277293248_Lazy_Rewriting_on_Eager_Machinery) ACM Transactions on Programming Languages and Systems. 22. 10.1145/345099.345102. \n4. Klop, jan willem. (2000). [Term Rewriting Systems.](https://www.researchgate.net/publication/2472655_Term_Rewriting_Systems) \n\n[npm]: https://img.shields.io/npm/v/girafe\n[npm-url]: https://www.npmjs.com/package/girafe\n[build-size]: https://badgen.net/bundlephobia/minzip/girafe\n[build-size-url]: https://bundlephobia.com/result?p=girafe","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathsou%2Fgirafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathsou%2Fgirafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathsou%2Fgirafe/lists"}