{"id":14128482,"url":"https://github.com/memowe/perlisp","last_synced_at":"2025-04-22T17:12:53.384Z","repository":{"id":1194925,"uuid":"1100548","full_name":"memowe/perlisp","owner":"memowe","description":"A simple Lisp interpreter, written in Perl","archived":false,"fork":false,"pushed_at":"2017-02-23T16:25:23.000Z","size":87,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T14:56:56.438Z","etag":null,"topics":["currying","interpreter","lisp-interpreter","perl","repl"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/memowe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-21T20:47:05.000Z","updated_at":"2025-01-15T15:33:58.000Z","dependencies_parsed_at":"2022-08-16T12:31:11.318Z","dependency_job_id":null,"html_url":"https://github.com/memowe/perlisp","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/memowe%2Fperlisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memowe%2Fperlisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memowe%2Fperlisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memowe%2Fperlisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memowe","download_url":"https://codeload.github.com/memowe/perlisp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285719,"owners_count":21405297,"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":["currying","interpreter","lisp-interpreter","perl","repl"],"created_at":"2024-08-15T16:01:45.667Z","updated_at":"2025-04-22T17:12:53.359Z","avatar_url":"https://github.com/memowe.png","language":"Perl","funding_links":[],"categories":["Perl"],"sub_categories":[],"readme":"# PerLisp [![Build Status](https://travis-ci.org/memowe/perlisp.svg?branch=master)](https://travis-ci.org/memowe/perlisp)\n\nThis is a simple statically scoped Lisp interpreter, written in Perl. During the\nlecture \"Structure and Interpretation of Programming Languages\", held by Achim\nClausing (WWU Münster, Germany), I needed to try out different things, so I\nwrote this.\n\n**DISCLAIMER** This is **not** production ready. I use it to play around and I\nthink there are many bugs lurking around. You have been warned! :-)\n\nHow to start?\n-------------\n\nInstall PerLisp like a normal Perl distro:\n\n    $ perl Makefile.PL\n    $ make\n    $ make test\n    $ make install\n    $ make clean\n\nNow you can call the perlisp script which starts a read eval print loop (see\nmore details below):\n\n    $ perlisp\n\nIf you want to hack PerLisp, view the API docs via\n\n    $ perldoc PerLisp\n\nIf you don't want to install all that stuff, you can call the `perlisp` script\nfrom the project root directory:\n\n    $ cd ~/code/perlisp\n    $ perl perlisp\n\nAnd it should just work. Now let's do some Lisp stuff!\n\nPerLisp uses the `bind` operator to bind values to names, you have a `lambda`\noperator to create function values and the convenience operator `define` to bind\na function to a name in one step. With the `bound` operator you get a list of\nall bound names. Most of them come from the `init.perlisp` file, which is loaded\nwhile the interpreter starts.\n\nStart typing something like this:\n\n\u003e `(+ 17 25)`  \n\u003e **42**  \n\u003e `(define (square x) (* x x))`  \n\u003e **Function: (x) -\u003e (* x x)**  \n\u003e `(square 42)`  \n\u003e **1764**\n\nYou can find more inspirations from `PerLisp::Init` and the tests, especially\n`t/50-init.t`, which shows some use cases for the init functions.\n\n### Some interesting stuff\n\n* Like Haskell, PerLisp fully supports **autocurryfication**, which means a\nfunction applied to too few arguments will return a function with parameters\nfor the remaining arguments automagically. It's super-easy to define useful\nfunctions using autocurryfication in combination with some well known higher\norder functions:\n\n\u003e `(bind product (reduce * 1))`  \n\u003e **Function: (l) -\u003e (cond (nil? l) 1 (* (car l) (reduce * 1 (cdr l))))**  \n\u003e `(product (list 2 7 3))`  \n\u003e **42**\n\n* PerLisp is able to interpret a simple Lisp interpreter written in Lisp which\nis able to run itself inside PerLisp. Amazing! And there's a test for it in\n`t/61-lisplisp.t`. However, to calculate even a simple expression in a\nthree-level nested interpreter chain takes some time so you have to enable the\ntest explicitly by setting the `LISPLISP` environment variable to a true value.\n\nInterpreter details\n-------------------\n\nThe implementation is straight forward. PerLisp uses objects from the following\nclasses to get you started with Lisp:\n\n* `PerLisp::Lexer` - generates a `PerLisp::TokenStream` from Lisp strings\n* `PerLisp::Parser` - generates `PerLixp::Expr::*` objects from a TokenStream\n* `PerLisp::Expr::*` - Lisp expressions\n* `PerLisp::Context` - objects which store value-name bindings\n* `PerLisp::Operators` - perl implementations of built-in operators\n* `PerLisp::Init` - a container package around the init script\n\nView the code for more implementation details, I tried hard to make it very\nreadable (even if you don't know much Perl).\n\nAuthor, bug reports, license\n----------------------------\n\nCopyright (c) Mirko Westermeier, \u003cmirko@westermeier.de\u003e\n\nThis software is released under the MIT license (view MIT-LICENSE for details).\n\nIf you found a bug, please contact me via mail or github. You can also use\ngithub's issue tracker. Please provide (failing) tests for your bugs, patches or\nfeature requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemowe%2Fperlisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemowe%2Fperlisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemowe%2Fperlisp/lists"}