{"id":13442857,"url":"https://github.com/SquidDev/urn","last_synced_at":"2025-03-20T15:31:10.883Z","repository":{"id":81349663,"uuid":"75342752","full_name":"SquidDev/urn","owner":"SquidDev","description":"Yet another Lisp variant which compiles to Lua","archived":true,"fork":false,"pushed_at":"2019-01-08T10:26:47.000Z","size":4119,"stargazers_count":366,"open_issues_count":4,"forks_count":18,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-28T06:00:02.596Z","etag":null,"topics":["compiler","language","lisp","lisp-dialect","lisp-variant","lua"],"latest_commit_sha":null,"homepage":"http://urn-lang.com/","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SquidDev.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}},"created_at":"2016-12-01T23:42:02.000Z","updated_at":"2024-09-15T03:44:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b31c623-8d25-4679-8091-faa0eaa1eae1","html_url":"https://github.com/SquidDev/urn","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Furn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Furn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Furn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Furn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SquidDev","download_url":"https://codeload.github.com/SquidDev/urn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244639992,"owners_count":20485964,"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":["compiler","language","lisp","lisp-dialect","lisp-variant","lua"],"created_at":"2024-07-31T03:01:52.241Z","updated_at":"2025-03-20T15:31:10.500Z","avatar_url":"https://github.com/SquidDev.png","language":"Common Lisp","readme":"# ![](https://i.imgur.com/XqKyCMC.png) Urn [![Travis Build Status](https://travis-ci.org/SquidDev/urn.svg?branch=master)](https://travis-ci.org/SquidDev/urn) [![Build status](https://gitlab.com/urn/urn/badges/master/build.svg)](https://gitlab.com/urn/urn/commits/master)\n\nUrn is a new language developed by SquidDev, and demhydraz. Urn is a Lisp dialect with a focus on minimalism which compiles\nto Lua.\n\n## What?\n - A minimal¹ Lisp implementation, with full support for compile time code execution and macros.\n - Support for Lua 5.1, 5.2 and 5.3. Should also work with LuaJIT.\n - Lisp-1 scoping rules (functions and data share the same namespace).\n - Influenced by a whole range of Lisp implementations, including Common Lisp and Clojure.\n - Produces standalone, optimised Lua files: no dependencies on a standard library.\n\n¹: Minimalism is an implementation detail.\n\n## Features\n### Pattern matching\n\u003cpre style=\"color:#ffffff;background-color:#2e3436;\"\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e(case \u0026#39;(\u0026quot;x\u0026quot; (foo 2 3))\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e  [(string?  @ ?x) (.. \u0026quot;Got a string \u0026quot; x)]\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e  [(\u0026quot;x\u0026quot; (foo . ?x)) (.. \u0026quot;Got some remaining values \u0026quot; (pretty x))])\nout = \u003cspan style=\"color:#ff9d3a;\"\u003e\u0026quot;Got some remaining values (2 3)\u0026quot;\u003c/span\u003e\n\u003c/pre\u003e\n\n### Various looping constructs\n\u003cpre style=\"color:#ffffff;background-color:#2e3436;\"\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e(loop [(o \u0026#39;())\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e       (l \u0026#39;(1 2 3))]\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e  [(empty? l) o]\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e  (recur (cons (car l) o) (cdr l)))\nout = \u003cspan style=\"color:#ff9d3a;\"\u003e(3 2 1)\u003c/span\u003e\n\u003c/pre\u003e\n\n### Powerful assertion and testing framework\n\u003cpre style=\"color:#ffffff;background-color:#2e3436;\"\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e(import test ())\nout = \u003cspan style=\"color:#ff9d3a;\"\u003enil\u003c/span\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e(affirm (eq? \u0026#39;(\u0026quot;foo\u0026quot; \u0026quot;bar\u0026quot; \u0026quot;\u0026quot;)\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e             (string/split \u0026quot;foo-bar\u0026quot; \u0026quot;-\u0026quot;)))\n\u003cspan style=\"color:#cc0000;\"\u003e[ERROR] \u0026lt;stdin\u0026gt;:1 (compile#111{split,temp}:46): Assertion failed\u003c/span\u003e\n(eq? (quote (\u0026quot;foo\u0026quot; \u0026quot;bar\u0026quot; \u0026quot;\u0026quot;)) (string/split \u0026quot;foo-bar\u0026quot; \u0026quot;-\u0026quot;))\n     |                        |\n     |                        (\u0026quot;foo\u0026quot; \u0026quot;bar\u0026quot;)\n     (\u0026quot;foo\u0026quot; \u0026quot;bar\u0026quot; \u0026quot;\u0026quot;)\n\u003c/pre\u003e\n\n### First-class support for Lua tables\n\u003cpre style=\"color:#ffffff;background-color:#2e3436;\"\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e{ :foo 1\n\u003cspan style=\"color:#8ae234;\"\u003e. \u003c/span\u003e  :bar 2 }\nout = \u003cspan style=\"color:#ff9d3a;\"\u003e{\u0026quot;bar\u0026quot; 2 \u0026quot;foo\u0026quot; 1}\u003c/span\u003e\n\u003c/pre\u003e\n\n### Friendly error messages\n\u003cpre style=\"color:#ffffff;background-color:#2e3436;\"\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e(]\n\u003cspan style=\"color:#cc0000;\"\u003e[ERROR] Expected \u0026#39;)\u0026#39;, got \u0026#39;]\u0026#39;\u003c/span\u003e\n\u003cspan style=\"color:#ff9d3a;\"\u003e  =\u0026gt; \u0026lt;stdin\u0026gt;:[1:2 .. 1:2] (\u0026quot;]\u0026quot;)\u003c/span\u003e\n\u003cspan style=\"color:#8ae234;\"\u003e 1 │\u003c/span\u003e (]\n\u003cspan style=\"color:#8ae234;\"\u003e   │\u003c/span\u003e ^... block opened with \u0026#39;(\u0026#39;\n\u003cspan style=\"color:#8ae234;\"\u003e 1 │\u003c/span\u003e (]\n\u003cspan style=\"color:#8ae234;\"\u003e   │\u003c/span\u003e  ^ \u0026#39;]\u0026#39; used here\n\u003cspan style=\"color:#8ae234;\"\u003e\u0026gt; \u003c/span\u003e\n\u003c/pre\u003e\n\n## Getting started\nWe have a [getting started guide](https://squiddev.github.io/urn/tutorial/01-introduction.html) to help you get set up. Or\nyou can [clone the repo](https://gitlab.com/urn/urn) and jump right in!\n\nThe website also contains [documentation for all functions and macros](https://squiddev.github.io/urn/docs/lib.prelude.html),\nshould you need to check how something works.\n\nIf you have any questions, would like to contribute or just feel like chatting, do join us in the `#urn` channel on FreeNode.\n","funding_links":[],"categories":["Common Lisp"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSquidDev%2Furn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSquidDev%2Furn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSquidDev%2Furn/lists"}