{"id":13610669,"url":"https://github.com/naver/lispe","last_synced_at":"2026-03-02T15:02:19.588Z","repository":{"id":43656432,"uuid":"315270604","full_name":"naver/lispe","owner":"naver","description":"An implementation of a full fledged Lisp interpreter with Data Structure, Pattern Programming and High level Functions with Lazy Evaluation à la Haskell.","archived":false,"fork":false,"pushed_at":"2026-02-09T13:10:15.000Z","size":7637884,"stargazers_count":496,"open_issues_count":0,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-09T14:31:04.333Z","etag":null,"topics":["data-structures","function-composition","haskell-like-high-level-function","interpreter","language","lazy-evaluation","lisp","pattern-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naver.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-23T09:56:08.000Z","updated_at":"2026-02-09T14:24:25.000Z","dependencies_parsed_at":"2023-01-26T06:45:43.534Z","dependency_job_id":"f889782c-12da-4b7b-8d47-490280920e2c","html_url":"https://github.com/naver/lispe","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/naver/lispe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Flispe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Flispe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Flispe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Flispe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naver","download_url":"https://codeload.github.com/naver/lispe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Flispe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30007047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T14:08:50.421Z","status":"ssl_error","status_checked_at":"2026-03-02T14:08:50.037Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-structures","function-composition","haskell-like-high-level-function","interpreter","language","lazy-evaluation","lisp","pattern-programming"],"created_at":"2024-08-01T19:01:46.915Z","updated_at":"2026-03-02T15:02:19.582Z","avatar_url":"https://github.com/naver.png","language":"C++","readme":"# LispE: Lisp Elémentaire\n\n#### (_To test LispE in your browser click:_ [HERE](https://naver.github.io/lispe))\n  \nWelcome to __Lisp Elémentaire__, a version of Lisp that is both compact and offers a large variety of functional and array language features. The code also comes with a small internal editor from another NAVER's project: [TAMGU](https://github.com/naver/tamgu).\n\nThe main goal of __LispE__ is to provide a multi-platform language that can harness the power of functional languages with array languages.\nThe real strength of the Lisp language, of which _LispE_ is a dialect, is its very simple but pretty versatile formalism that helps combining all these programming trends together in one single language.\n\nI based a large part of this work on the following article: [The Root of Lisp](http://www.paulgraham.com/rootsoflisp.html).\n\n* The description of the language is available here: [Introduction to LispE](https://github.com/naver/lispe/wiki/1.-Introduction)\n* LispE provides a large set of functions, see the [index here](https://github.com/naver/lispe/wiki/Index-of-functions).\n* A help to the available functions is here: [LispE Language Description](https://github.com/naver/lispe/wiki/5.-Description-of-Functions,-Operators-and-Libraries)\n* The wiki index is here: [HOME](https://github.com/naver/lispe/wiki)\n* Artificial Intelligence libraries:\n  * [lispe_torch](https://github.com/naver/lispe/tree/master/lispetorch): encapsulates PyTorch internal libtorch library and SentencePiece\n  * [lispe_gguf](https://github.com/naver/lispe/tree/master/lispegguf): based on `llama.cpp`, load and run gguf models\n  * [lispe_mlx](https://github.com/naver/lispe/tree/master/lispemlx): based on the `MLX` library to access Mac GPUs\n  * [lispe_tiktoken](https://github.com/naver/lispe/tree/master/lispetiktoken): based on the `tiktoken` library by Open AI for tokenization\n  \n## TEST LispE in your browser\n\nSince LispE is _also_ a WASM library: you can test [LispE HERE](https://naver.github.io/lispe).\n\nSee also: [Predicate-Based Agent in the Browser (PREDIBAG)](https://github.com/naver/lispe/wiki/6.1.5-PREDIBAG-in-the-Browser)\n  \n## CHECK binaries\n\nWe have stashed [here](https://github.com/naver/lispe/tree/master/binaries) precompiled versions for Window and Mac OS (including M1)...\n\n## A Lisp with all the bells and whistles\n__LispE__ is a true Lisp with all the traditional operators that one can expect from such a language:\n\n```Lisp\n(cons 'a '(b c)) ; (a b c)\n(cdr '(a b c d e)) ; '(b c d e)\n(car '(a b c d e)) ; 'a\n\n(+ 10 20 (* 3 4)) ; 42\n\n(list 'a 'b 'c 'd 'e) ; (a b c d e)\n\n; It also provides some built-in types to handle numbers\n\n(setq l1 (integers 1 2 3))\n(setq l2 (integers 4 5 6))\n\n; We can then add these lists together\n(+ l1 l2) ; 5 7 9\n\n; or strings\n\n(setq s1 (strings \"a\" \"b\" \"c\"))\n(setq s2 (strings \"d\" \"e\" \"f\"))\n\n; We can then add these lists together\n(+ s1 s2) ; (\"ad\" \"be\" \"cf\")\n\n; Lists are treated as vectors\n\n(@ s1 1) ; \"b\"\n(@ l1 2) ; 3\n\n; You can loop in a list\n(loop i s1 (println i))\n```\n\n### You can easily run threads\n\n```Lisp\n; Variables in threadspace are protected against\n; value concurrencies.\n(threadspace\n   (seth titi 10)\n   (seth toto (rho 2 10 '(0)))\n)\n\n; You declare a thread with the keyword: dethread\n(dethread tst(x y)\n   (threadspace\n      (+= titi x)\n      (set@ toto 0 y titi)\n   )\n)\n\n; We launch 10 threads\n(loop i (range 1 10 1)\n   (tst (+ i 10) i)\n)\n\n; We wait for the threads to terminate\n(wait)\n\n; threadspace is actually a specific name space\n(space thread\n   (println titi) ; 145\n   ; Note that the order of values is random, due to thread execution\n   (println toto) ; ((0 21 46 34 60 75 108 92 126 145) (0 0 0 0 0 0 0 0 0 0))\n)\n\n```\n\n## Modern Functional Properties\n\n__LispE__ provides an alternative to parentheses with the [composition operator: \".\"](https://github.com/naver/lispe/wiki/5.-Description-of-Functions,-Operators-and-Libraries#composition-):\n\n```Lisp\n(sum (numbers 1 2 3)) can be written (sum . numbers 1 2 3)\n```\n\n__LispE__ provides a powerfull built-in [pattern matching](https://github.com/naver/lispe/wiki/6.1-Pattern-Functions) mechanism:\n\n```Lisp\n; You can call a function in the pattern definition of the function\n(defun checking (x y) (eq 0 (% y x)))\n\n; the argument should be an integer, whose value is a multiple of 15\n; The argument is stored in x\n(defpat fizzbuzz ((integer_ (checking 15 x))) 'fizzbuzz)\n(defpat fizzbuzz ((integer_ (checking 3 x))) 'fizz)\n(defpat fizzbuzz ((integer_ (checking 5 x))) 'buzz)\n(defpat fizzbuzz (x) x)\n(mapcar 'fizzbuzz (range 1 100 1))\n```\n\n__LispE__ provides also some interesting properties such as: [Data Structures](https://github.com/naver/lispe/wiki/6.7-Data-Structures)\n\n```Lisp\n; First we define some data structures\n; nil or _ this is the same value\n\n(data@ (Point integer_ integer_) (Pixel _ _) (Circle (Point _ _)  _) (Rectangle (Point _ _)  _ nil))\n\n; Then some pattern methods\n(defpat Surface ((Circle (Point x y) r)) (* _pi r r))\n(defpat Surface ((Rectangle _ h w)) (* h w))\n(defpat Surface (true) 'wrong)\n\n(println \"Circle:\" (Surface (Circle (Point 12 32) 10)))\n(println \"Rectangle:\" (Surface (Rectangle (Point 21 20) 10 20)))\n\n(setq x 10)\n(setq y 20)\n(setq r 12)\n\n(setq cercle (Circle (Point x y) r))\n\n(println \"Circle:\" (Surface cercle))\n(println \"Point:\" (Surface (Point 10 20)))\n(println \"Circle:\" (Surface ((atom \"Circle\") (Point 20 30) 3)))\n\n(data@ Shape (Triangle _) (Square _))\n\n(defpat dimension ( (Shape x))\n   (println 'Dimension x)\n)\n(dimension (Triangle 10))\n(dimension (Square 20))\n```\n\n__LispE__ provides also some OOP such as: [Classes](https://github.com/naver/lispe/wiki/6.21-Classes)\n\n```Lisp\n; Defines a class named 'truc' with fields x, y, and z\n(class@ truc (x y z)\n\n   (defun appel(u)\n      (setq x 100)\n      (println x y z)\n      (+ x y z u)\n   )\n)\n\n; Defines a class named 'machin' with fields x, y, and z (with a default value of 1).\n\n(class@ machin (x y (z 1))\n    ; Defines a method 'appel' that takes one argument 'u'.\n    (defun appel(u)\n       (println 'machin)(+ x y z u)) \n\n    ; Defines a method 'configure' that takes one argument 'e'.\n    (defun configure(e)\n        (setqi x e)\n        (setqi v 100))) ; add a new field: `v`\n```\n\n## But also array language capabilities\n\nThanks to an internal structure implemented with [arrays](https://github.com/naver/lispe/wiki/2.3-Lists), we also provide some array operators.\n\nFor instance, here is how [Game of life](https://github.com/naver/lispe/wiki/6.20-Conway-Game-of-Life-in-LispE) can be solved in one single instruction:\n\n```Lisp\n(defmacro ⊖(l n) (rotate l n true))\n\n(defun lifeinit(x y) (rho x y . random_choice (* x y) (integers 0 1) 17))\n\n(setq r (lifeinit 20 40))\n(defun gol8(⍵) ((λ(⍺) (| (\u0026 (== ⍺ 4) r) (== ⍺ 3))) (⌿ '+ (⌿  '+ (° (λ (x ⍺) (⊖ ⍺ x)) '(1 0 -1) (↑ (λ (x) (⌽ ⍵ x)) '(1 0 -1)))))))\n\n(println . prettify (gol8 r) 20)\n```\n\nSee: [Array Operators](https://github.com/naver/lispe/wiki/5.3-A-la-APL)\n\n## Play with it\n\nFinally, __LispE__ can also be used as a _Shell_: [Shell](https://github.com/naver/lispe/wiki/7.-Shell)\n\nCome and discover __LispE__: the __Lisp Elémentaire__.\n\nWe provide a fun little program to discover some of the most interesting aspects of LispE: [minizork](https://github.com/naver/lispe/blob/master/examples/patterns/minizork_en.lisp)\n\n_Have a look and try it_\n\n\n## License\n\nBSD 3-Clause License\n\n```\nLispE\nCopyright (c) 2020-present NAVER Corp.\n\nRedistribution and use in source and binary forms, with or without \nmodification, are permitted provided that the following conditions \nare met:\n\n1. Redistributions of source code must retain the above copyright \nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright \nnotice, this list of conditions and the following disclaimer in the \ndocumentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its \ncontributors may be used to endorse or promote products derived from \nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE \nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \nPOSSIBILITY OF SUCH DAMAGE.\n```\n","funding_links":[],"categories":["Uncategorized","C"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Flispe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaver%2Flispe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Flispe/lists"}