{"id":19217911,"url":"https://github.com/iainmon/lambdascript","last_synced_at":"2025-02-23T08:47:47.525Z","repository":{"id":118615946,"uuid":"289152944","full_name":"Iainmon/LambdaScript","owner":"Iainmon","description":"A functional programming language implementing the semantic rules of the lambda calculus (λ-calculus).","archived":false,"fork":false,"pushed_at":"2020-12-18T05:44:47.000Z","size":9100,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-04T19:12:55.407Z","etag":null,"topics":["functional","functional-language","lambda","lambda-calculus"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Iainmon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-08-21T01:58:12.000Z","updated_at":"2022-11-22T02:43:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6a72188-ff79-4541-b4c0-248aefd418ef","html_url":"https://github.com/Iainmon/LambdaScript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iainmon%2FLambdaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iainmon%2FLambdaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iainmon%2FLambdaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iainmon%2FLambdaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iainmon","download_url":"https://codeload.github.com/Iainmon/LambdaScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240292358,"owners_count":19778311,"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":["functional","functional-language","lambda","lambda-calculus"],"created_at":"2024-11-09T14:24:19.735Z","updated_at":"2025-02-23T08:47:47.488Z","avatar_url":"https://github.com/Iainmon.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\".github/LambdaScript.svg\" width=\"200\" height=\"200\"\u003e\n\n# LambdaScript\n\nDear reader,\n\nI challenged myself to make a programming language during the summer before I started college. This project implemented the semantic rules of the lambda calculus, but with a few extra features. I have written a javascript code compiler for it, and an interpreter. The interpreter works well, but does not throw proper errors (haven't implemented exceptions), and resolve types properly. It is fully functional if you wish to only use pure lambda encodings, rather than the native arithmetical evaluation engine (infix +, -, *, / are supported). \n\nExamples:\n```haskell\n-- interactive mode\nid = (λx.x) (λx.x)\nλ -\u003e (λx.x)\n\nid 103\nλ -\u003e 103\n\nnot = \\b.(if b then fls else tru)\n\nnot tru\nλ -\u003e fls\n\nadd = λa.λb.(a + b)\n\nadd 2 3\nλ -\u003e 5\n\ninc = add 1\n\ninc 6\nλ -\u003e 7\n\nnot tru \nλ -\u003e fls\n\nneg = λn.(0 - n)\nneg 100\nλ -\u003e -100\n\nsub = λa.λb.(a - b)\n\nflip = λf.λa.λb.(f b a)\n\nsub 0 1\nλ -\u003e -1\n\nflip sub 0 1\nλ -\u003e 1\n\nfac = \\n.if n \u003c 2 then 1 else (n * (fac (n - 1)))\n\nfac 8\nλ -\u003e 40320\n\n```\n\n```haskell\n-- program.la\n(condition = tru)\n(if condition then print 1010 else print 2020)\n(not condition -\u003e print 3030 | print 4040)\n\n-- output\n1010\n4040\n```\n\n# Installation\nYou will need:\n * A modern C/C++ compiler (preferably clang/clang++)\n * CMake 3.1+ installed (on a Mac, run `brew install cmake`)\n * \n\n```bash\ngit clone https://github.com/Iainmon/extended-lambda-calculus-language.git\ncd extended-lambda-calculus-language\nmkdir build\ncd build\ncmake ..\nmake -j4\n./lcalc std.la --interactive\n```\n\n# Roadmap\n-   [x] Create language grammar rules\n-   [x] Construct Abstract Syntax Tree using the ANTLR visitor architecture\n-   [x] Implement Untyped λ Calculus semantic rules\n-   [x] Make interactive REPL mode\n-   [x] Implement the rest of the grammar rules: conditionals, imports, operations, etc.\n-   [x] Make lexer match custom operators\n-   [ ] Remove operations, print, and maybe imports from the language grammar. Symbols should parse as identifiers, and have native abstraction implementations (as well as print and import).\n-   [ ] Add string literals to language grammar\n-   [ ] Make a nice file interpreter with a good CLI\n-   [ ] Test everything before moving on to types\n-   [x] Implement type grammar\n-   [x] Implement type annotations\n-   [ ] Implement type resolution\n-   [ ] Implement type checking\n-   [ ] Implement stacks and module system (blocks, modules, exposures)\n-   [ ] Make LLVM IR code generator\n-   [ ] JavaScript code generation\n-   [ ] Handle lexing and parsing errors properly\n\n# Third Party Dependencies\n-   Antlr4 (a copy of the JAR and entire project as zip)\n-   Antlr4-cpp-runtime\n-   Switch - \n-   Argh! - https://github.com/adishavit/argh\n\n### ToDo\n-   Fix issue with imports needing to have an extra newline to avoid NL EOF warning.\n-   Add string literal [heres how](https://stackoverflow.com/questions/24557953/handling-string-literals-which-end-in-an-escaped-quote-in-antlr4)\n-   Add comments to language grammar\n-   Do a search for `[flag todo]`\n-   α-renaming\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiainmon%2Flambdascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiainmon%2Flambdascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiainmon%2Flambdascript/lists"}