{"id":13648467,"url":"https://github.com/fogus/ulithp","last_synced_at":"2025-12-18T08:56:29.751Z","repository":{"id":2308237,"uuid":"3267670","full_name":"fogus/ulithp","owner":"fogus","description":"A micro LISP implementation in 24 lines of Ruby.","archived":false,"fork":false,"pushed_at":"2020-02-13T16:24:16.000Z","size":51,"stargazers_count":270,"open_issues_count":4,"forks_count":32,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-02T21:38:45.118Z","etag":null,"topics":["langdev"],"latest_commit_sha":null,"homepage":"http://fogus.github.com/ulithp/","language":"Ruby","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/fogus.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":"2012-01-25T19:23:59.000Z","updated_at":"2025-02-06T19:03:41.000Z","dependencies_parsed_at":"2022-09-05T14:50:30.992Z","dependency_job_id":null,"html_url":"https://github.com/fogus/ulithp","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/fogus%2Fulithp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogus%2Fulithp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogus%2Fulithp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogus%2Fulithp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fogus","download_url":"https://codeload.github.com/fogus/ulithp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773721,"owners_count":20993639,"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":["langdev"],"created_at":"2024-08-02T01:04:16.904Z","updated_at":"2025-10-24T13:50:18.630Z","avatar_url":"https://github.com/fogus.png","language":"Ruby","readme":"# μLithp\n\n### [Official website and deep analysis](http://fogus.github.com/ulithp)\n\nA micro LISP implementation in 24 lines of Ruby, with a reader in 33 lines, REPL in 35 lines, a compiler in 15 lines and Ruby interop in 13 lines.  Really frickin' small.\n\n* `car`\n* `cdr`\n* `quote`\n* `atom`\n* `if`\n* `label`\n* `cons`\n* `eq`\n* `lambda`\n\nSee the `src/lithp.rb` file for source and `doc/index.org` for implementation details and the original announcement in the  [μLithp blog post](http://blog.fogus.me/2012/01/25/lisp-in-40-lines-of-ruby/).\n\n*this is my entry into the December 2012 [PLT Games](http://www.pltgames.com)*\n\n## Embedded usage\n\nThe LISP interpreter is just a Ruby class that evals expressions in Ruby data structures, like so:\n\n```ruby\n\t l = Lisp.new\n\n\t l.eval [:label, :a, 42]\n\n\t l.eval :a\n\t #=\u003e 42\n\n\t l.eval [:eq, 42, :a]\n\t #=\u003e true\n\n\t l.eval [:quote, [1, 2]]\n\t #=\u003e [1, 2]\n\n\t l.eval [:car, [:quote, [1, 2]]]\n\t #=\u003e 1\n\n\t l.eval [:cdr, [:quote, [1, 2]]]\n\t #=\u003e [2]\n\n\t l.eval [:cons, 1, [:quote, [2,3]]]\n\t #=\u003e [1, 2, 3]\n\n\t l.eval [:if, [:eq, 1, 2], 42, 43]\n\t #=\u003e 43\n\n\t l.eval [:atom, [:quote, [1,2]]]\n\t #=\u003e false\n\n\t l.eval [:label, :second, [:quote, [:lambda, [:x], \t [:car, [:cdr, :x]]]]]\n\n\t l.eval [:second, [:quote, [1, 2, 3]]]\n\t #=\u003e 2\n```\n\nHave fun!\n\n## REPL usage\n\nIn your shell use Ruby 1.9.2 to run the REPL:\n\n```sh\n    rvm use ruby-1.9.2\n\truby -I . repl.rb\n```\n\nYou'll then see a prompt:\n\n    \u003e\n\nStart typing uLithp code:\n\n```lisp\n    (car (quote (1 2 3)))\n\n\t(cdr (quote (1 2 3)))\n\n\t(label third (quote (lambda (x) (car (cdr (cdr x))))))\n\t(third (quote (1 2 3 4 5)))\n```\n\nEnjoy!\n\n## thanks\n\nThanks to [Russ Olsen](http://eloquentruby.com) for the reader and REPL.\n\n## License\n\nThis software is provided as-is under the [MIT license](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogus%2Fulithp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffogus%2Fulithp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogus%2Fulithp/lists"}