{"id":21509894,"url":"https://github.com/bzf/risp-lang","last_synced_at":"2025-07-25T21:36:16.058Z","repository":{"id":48090868,"uuid":"516506606","full_name":"bzf/risp-lang","owner":"bzf","description":"Lisp interpreter written in Rust 🛤","archived":false,"fork":false,"pushed_at":"2022-07-26T18:24:13.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T19:58:01.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/bzf.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}},"created_at":"2022-07-21T20:02:10.000Z","updated_at":"2022-07-26T18:24:40.000Z","dependencies_parsed_at":"2022-08-12T18:20:58.420Z","dependency_job_id":null,"html_url":"https://github.com/bzf/risp-lang","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/bzf%2Frisp-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzf%2Frisp-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzf%2Frisp-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzf%2Frisp-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bzf","download_url":"https://codeload.github.com/bzf/risp-lang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056430,"owners_count":20390720,"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-11-23T21:33:42.628Z","updated_at":"2025-03-17T15:16:20.127Z","avatar_url":"https://github.com/bzf.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"risp-lang\n=========\n\nA Lisp interpreter written in Rust for fun and giggles.\n\n## Building it\n\n```sh\ncargo build\n```\n\n## Running the REPL\n\n```sh\ncargo run\n```\n\n## Examples\n\n```scheme\n\u003e (add 1 2 3)\n6\n```\n\n```scheme\n\u003e (subtract 3 2)\n1\n```\n\n```scheme\n\u003e (define foo (add 5 5))\n10\n\u003e (add foo 5)\n15\n```\n\n```scheme\n\u003e (defn hello [a] 3)\n#\u003cFunction:hello\u003e\n\u003e (hello 10)\n3\n\u003e (defn count [a]\n    (if (is-empty a) 0 (add (count (cdr a)) 1)))\n#\u003cFunction:hello\u003e\n\u003e (count (list))\n0\n\u003e (count (list 1 2 3))\n3\n```\n\n```scheme\n\u003e (if true 1 0)\n1\n\u003e (if false 1 0)\n0\n```\n\n```scheme\n\u003e (is-nil 1)\nfalse\n\u003e (is-nil nil)\ntrue\n```\n\n```scheme\n\u003e (list 1 2 3)\n(1 2 3)\n\u003e (define foo (list 1 2 3))\n(1 2 3)\n\u003e (append foo 1)\n(1 2 3 1)\n\u003e (prepend foo 1)\n(1 1 2 3)\n\u003e (car foo)\n1\n\u003e (cdr foo)\n(2 3)\n\u003e (is-empty foo)\nfalse\n\u003e (is-empty (list))\ntrue\n```\n\n```sh\n# Running a program from a file\n$ cat example.rsp\n(defn add-two [a] (add a 2))\n\n(define a 123)\n(println (add-two 1))\n(println (add-two a))\n$ cargo run -- example.rsp 2\u003e/dev/null\n3\n125\n\n# Implementing count and reverse\n$ cat example.rsp\n(define my-list (list 1 2 3))\n(println \"my-list =\" my-list)\n\n(defn count [a]\n  (if (is-empty a) 0 (add (count (cdr a)) 1)))\n\n(println \"count:\" (count my-list))\n\n(defn reverse [a]\n  (if (is-empty a) (list) (append (reverse (cdr a)) (car a))))\n\n(println \"reverse:\" (reverse my-list))\n$ cargo run -- example.rsp 2\u003e/dev/null\nmy-list = (1 2 3)\ncount: 3\nreverse: (3 2 1)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzf%2Frisp-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbzf%2Frisp-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzf%2Frisp-lang/lists"}