{"id":23231311,"url":"https://github.com/aartaka/stdlambda","last_synced_at":"2026-01-19T07:09:50.837Z","repository":{"id":215504544,"uuid":"739101344","full_name":"aartaka/stdlambda","owner":"aartaka","description":"Standard library for Lambda Calculus, finally making LC a practical programming language.","archived":false,"fork":false,"pushed_at":"2025-01-20T17:18:29.000Z","size":58,"stargazers_count":14,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T17:16:58.220Z","etag":null,"topics":["arithmetic","boolean-logic","cons","lambda-calculus","list","recursion","set","stdlib"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aartaka.png","metadata":{"files":{"readme":"README.org","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-04T19:17:47.000Z","updated_at":"2025-01-20T17:18:31.000Z","dependencies_parsed_at":"2024-04-26T20:33:03.539Z","dependency_job_id":"147a51a9-2e10-4a7c-b1b7-ef4c83f0c6a6","html_url":"https://github.com/aartaka/stdlambda","commit_stats":null,"previous_names":["aartaka/stdlambda"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aartaka%2Fstdlambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aartaka%2Fstdlambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aartaka%2Fstdlambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aartaka%2Fstdlambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aartaka","download_url":"https://codeload.github.com/aartaka/stdlambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247388467,"owners_count":20931032,"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":["arithmetic","boolean-logic","cons","lambda-calculus","list","recursion","set","stdlib"],"created_at":"2024-12-19T02:14:16.520Z","updated_at":"2026-01-19T07:09:50.831Z","avatar_url":"https://github.com/aartaka.png","language":null,"readme":"#+TITLE:stdlambda—Standard Library for Lamdba Calculus\n\nLambda Calculus is an inspiring idea, but most of the resources about\nit list just a couple of utilities and ways to encode data, without\ngetting deep enough into building a _practical_ set of\nprimitives. ~stdlambda~ tries to do just that: provide a more or less\npractical set of primitives for programming in Lambda\nCalculus. Included are:\n- Frequent combinators like ~S~, ~K~, ~I~, and ~Y~.\n- Church Booleans and all the possible logical operations on them.\n- Church Numerals and arithmetics on them.\n  - List-encoded numerals might be provided in the future.\n- Church Pairs (with an opinionated ~nil = false~) and Haskell/Lisp-inspired utilities on them.\n  - nil = ~λx.true~ pairs might be provided in the future.\n\nNote that stdlambda is mostly deprecated by [[https://github.com/aartaka/lamber][Lamber and its extensive standard library]].\nAlso note that the code is slightly more readable there, having multi-letter variables \u0026c.\n\nSources of inspiration and code:\n- [[http://www.golfscript.com/lam/][Universal Lambda page]].\n- Justine Tunney's [[https://justine.lol/lambda/][SectorLambda page]].\n- Hikaru Ikuta's [[https://github.com/woodrush/lambdacraft][Lambdacraft]]\n\n* Getting Started\n- Feed the definitions from provided files into your Lambda Calculus\n  interpreter. The files (and their interdependencies) are:\n  - ~combinators.lambda~ :: Logical/stack combinators, no deps.\n  - ~bool.lambda~ :: Boolean ops, no deps.\n  - ~numbers.lambda~ :: Numeric, arithmetics. Depends on ~combinators.lambda~ and ~bool.lambda~.\n  - ~cons.lambda~ :: Conses. Depends on ~bool.lambda~.\n  - ~list.lambda~ :: Linked lists and utils for them. Mostly fold operations. Depends on ~cons.lambda~, ~numbers.lambda~, ~combinators.lambda~, ~bool.lambda~.\n    - ~set.lambda~ :: Operations on lists-as-sets. Depends on ~list.lambda~ and its transitive dependencies.\n  - ~alist.lambda~ :: Associative (key-value) lists. Depends on ~cons.lambda~ and ~combinators.lambda~.\n  - ~alias.lambda~ :: Aliases for all of the above.\n- Run the code using these primitives. Say\n#+begin_src lisp\n  fac = Y λr.λn.(if (=0 n) 1 (× n (r (1- n))))\n  (fac 5)\n#+end_src\n\n* Format\nThe format is the single-letter single-argument lambdas. The approximate regex would be:\n#+begin_src\n.* = (λ[a-z]\\.)*.*\n#+end_src\nNot all function applications are enclosed into parentheses and not all applications are single-argument. Example:\n#+begin_src \nfirst = compose car (0 cdr)\n#+end_src\nand not\n#+begin_src \nfirst = ((compose car) (0 cdr))\n#+end_src\nIt's too much work to maintain such a code.\nI might reconsider that in the future, though.\n\n* Acknowledgements\n- Many logical combinators come from [[https://wiki.xxiivv.com/site/logic][Devine Lu Linvega logic page]].\n- Lists (and ~foldr~ especially) come from the [[http://www.golfscript.com/lam/][Golfscript Universal Lambda page]].\n- Many list primitives and names for things come from Common Lisp and Scheme.\n  - Things like ~conjoin~ and ~compose~ especially come from Alexandria library.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faartaka%2Fstdlambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faartaka%2Fstdlambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faartaka%2Fstdlambda/lists"}