{"id":29633731,"url":"https://github.com/tibordp/lambdars","last_synced_at":"2025-07-21T14:06:20.453Z","repository":{"id":53491826,"uuid":"293282342","full_name":"tibordp/lambdars","owner":"tibordp","description":"Simple REPL for untyped lambda calculus","archived":false,"fork":false,"pushed_at":"2021-03-28T15:28:09.000Z","size":4101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T03:59:58.145Z","etag":null,"topics":["lambda-calculus","repl"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/tibordp.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}},"created_at":"2020-09-06T13:27:44.000Z","updated_at":"2023-03-02T01:56:27.000Z","dependencies_parsed_at":"2022-08-19T22:11:13.554Z","dependency_job_id":null,"html_url":"https://github.com/tibordp/lambdars","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tibordp/lambdars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tibordp%2Flambdars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tibordp%2Flambdars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tibordp%2Flambdars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tibordp%2Flambdars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tibordp","download_url":"https://codeload.github.com/tibordp/lambdars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tibordp%2Flambdars/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266315763,"owners_count":23909802,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["lambda-calculus","repl"],"created_at":"2025-07-21T14:06:19.944Z","updated_at":"2025-07-21T14:06:20.444Z","avatar_url":"https://github.com/tibordp.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lambdars\n\nlambdars is a REPL for playing with untyped lambda calculus.\n\n## Demo\n\n![](./docs/demo.gif)\n\n## Usage\n\nlambdars accepts a lambda expression on every line and then tries to reduce it to a canonical form with a sequence of β-reductions and α-conversions.\n\nBoth `λ` and `\\` are accepted for specifying a lambda abstraction, for example:\n\n```\n\u003e (\\f.\\x.f (f x)) (\\f.\\x.f (f x))\n INFO  lambdars::runtime \u003e Reduced in 6 iterations, total α: 3, total β: 6\nλx.λy.x (x (x (x y)))\n```\n\nThe result of previous reduction is available with `@`:\n```\n\u003e \\x.x x\nλx.x x\n\u003e @ @\n WARN  lambdars \u003e Runtime error: Exceeded limit of 100 iterations.\n```\n\nBy default all the expressions entered are eagerly reduced to normal form. In order to change this behavior, `#auto_reduce` command can be used:\n\n```\n\u003e (\\x.x) (\\x.x)\n INFO  lambdars::runtime \u003e Reduced in 2 iterations, total α: 1, total β: 1\nλx.x\n\u003e #auto_reduce false\n\u003e (\\x.x) (\\x.x)\n(λx.x) (λx.x)\n\u003e #reduce @\n INFO  lambdars::runtime \u003e Reduced in 2 iterations, total α: 1, total β: 1\nλx.x\n```\n\nlambdars also supports defining macros that are substituted before reduction in order to make the lengthy expressions a bit more manageable:\n\n```\n\u003e #define 0 \\f.\\x.x\n\u003e #define 1 \\f.\\x.f x\n\u003e #define plus \\m.\\n.\\f.\\x.m f (n f x)\n\u003e plus 1 1\n INFO  lambdars::runtime \u003e Reduced in 6 iterations, total α: 2, total β: 6\nλx.λy.x (x y)\n```\n\nAll the macro definitions are eagerly evaluated (and reduced to canonical form). In order to give a name to a lambda expression that may not have a canonical form such as the Y-combinator or `(λx.x x) (λx.x x)`, a `#declare` command can be used. In this case, no substitution will be performed and macro will be stored as-is. \n\nAll the defined macros can be dumped with `#dump`.\n\nAs a lambda expression may not converge to a normal form by repeated β and α reductions (lossely speaking, may never terminate), there are some execution limits in place, they can be controlled as such:\n\n```\n#max_reductions 10000\n#max_depth 1000\n#max_size 1000000\n```\n\nA preamble file (see e.g. [Church numerals and combinators](./examples/church.txt)) can be specified using a command line parameter\n\n```\nlambdars --preamble ./example/church.txt\n```\n\nAn alternative Javascript output mode is available:\n```\n\u003e #output_mode default\n\u003e \\f.\\x.f (f x)\nλx.λy.x (x y)\n\u003e #output_mode javascript\n\u003e @\nx =\u003e y =\u003e x(x(y))\n```\n\n## Installation\n\nlambdars can be built using standard Rust tooling out of the box, but it requires nightly compiler due to `box_syntax` and `box_patterns` features that are not stabilized yet.\n\n```\n$ git clone https://github.com/tibordp/lambdars.git\n$ cd lambdars\n$ cargo +nightly install --path .\n$ lambdars\n\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibordp%2Flambdars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftibordp%2Flambdars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibordp%2Flambdars/lists"}