{"id":13782861,"url":"https://github.com/apg/surd","last_synced_at":"2026-01-30T21:35:04.423Z","repository":{"id":2626461,"uuid":"3612212","full_name":"apg/surd","owner":"apg","description":"an absurd lisp interpreter","archived":false,"fork":false,"pushed_at":"2025-05-03T18:22:37.000Z","size":95,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T19:19:54.752Z","etag":null,"topics":[],"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/apg.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}},"created_at":"2012-03-03T17:15:16.000Z","updated_at":"2023-01-14T19:07:34.000Z","dependencies_parsed_at":"2024-04-24T12:59:53.529Z","dependency_job_id":null,"html_url":"https://github.com/apg/surd","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/apg%2Fsurd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apg%2Fsurd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apg%2Fsurd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apg%2Fsurd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apg","download_url":"https://codeload.github.com/apg/surd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253596003,"owners_count":21933492,"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-08-03T18:01:46.490Z","updated_at":"2026-01-30T21:35:04.417Z","avatar_url":"https://github.com/apg.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"Surd - An absurd Lisp interpreter\n---------------------------------\n\nThis really doesn't do much but serve as an example of constructing a\nvery basic Lisp interpreter in C. It may, in the future serve as the \nbasis for a larger project, but currently is absurd.\n\nIt supports abstraction, lists, symbols and fixnums. It does support\ntop level definitions with the `def` keyword, but at the moment doesn't\nsupport \"fancy forms\" such as `let` and `letrec` nor does it support\nmacros. There's no first class `eval` or a way to report the current\nlexical environment. But, everything *is* built out of conses and\ncells, including closures. Closures are tagged as such, but stored\nusing the same cell fields that a cons uses.\n\nIn other words:\n\n    c = cell()\n    c.type = CLOSURE\n    c.car = CODE\n    c.cdr = ENV\n\nWhere as a cons:\n   \n    c = cell()\n    c.type = CONS\n    c.car = CAR\n    c.cdr = CDR\n\nOf course you can evaluate expressions:\n\n    $ ./surd \n    surd 0\u003e (((fn (y) (fn (x) (+ x y))) 1) 2)\n    result 0: 3\n\nThe Allocator / GC\n==================\n\nsurd uses libgc for now, though it did at one point use the one-pass \nmark-sweep as described by Armstong and Virding in \"One Pass\nReal-Time Generational Mark-Sweep Garbage Collection (1995)\"\n([link](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.7791))\n\n\nTo do\n=====\n\n1. \u003cstrike\u003eGenerational collection -- this should be easy\u003c/strike\u003e\n2. Box top level definitions so that they can be replaced\n3. First class `read`, `write`, `eval`.\n4. Implement let, letrec (might require a special rec form)\n5. tail-call optimization.\n6. Larger standard library implemented in surd.\n7. hygienic defmacros and quasiquote, unquote, unquote-splicing\n8. ... \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapg%2Fsurd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapg%2Fsurd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapg%2Fsurd/lists"}