{"id":13687387,"url":"https://github.com/dundalek/liz","last_synced_at":"2025-05-07T07:20:24.196Z","repository":{"id":58326990,"uuid":"316718841","full_name":"dundalek/liz","owner":"dundalek","description":"Lisp-flavored general-purpose programming language (based on Zig)","archived":false,"fork":false,"pushed_at":"2021-10-02T12:30:44.000Z","size":397,"stargazers_count":275,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T07:34:21.727Z","etag":null,"topics":["clojure","compiler","language","lisp","liz","zig"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/dundalek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-11-28T11:30:32.000Z","updated_at":"2025-03-18T07:28:34.000Z","dependencies_parsed_at":"2022-09-11T07:01:29.485Z","dependency_job_id":null,"html_url":"https://github.com/dundalek/liz","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fliz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fliz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fliz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dundalek%2Fliz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dundalek","download_url":"https://codeload.github.com/dundalek/liz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831440,"owners_count":21810806,"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":["clojure","compiler","language","lisp","liz","zig"],"created_at":"2024-08-02T15:00:53.860Z","updated_at":"2025-05-07T07:20:24.162Z","avatar_url":"https://github.com/dundalek.png","language":"Clojure","funding_links":[],"categories":["Languages","Applications","Clojure","Lisp"],"sub_categories":["C/C++"],"readme":"\n# Liz: Lisp-flavored general-purpose programming language (based on Zig)\n\nBorrowing [Zig](https://github.com/ziglang/zig)'s tagline:\n\u003e General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.\n\n- Written as Clojure-looking S-expressions ([EDN](https://github.com/edn-format/edn)) and translated to Zig code.\n- [Type-A](https://github.com/dundalek/awesome-lisp-languages#classification) Lisp-flavored language. I call it \"Lisp-flavored\" because Liz is missing many fundamental features to be called a Lisp or even a Clojure dialect (no closures, no persistent data structures).\n- When you need a language closer to the metal and Clojure with GraalVM's native image is too much overhead.\n- Supports many targets including x86, ARM, RISC-V, WASM and [more](https://ziglang.org/#Wide-range-of-targets-supported)\n\nWhy is Zig an interesting choice as a lower-level language for Clojure programmers? (compared to Rust, Go or other languages):\n\n- Focus on simplicity\n- Seamless interop with C without the need to write bindings.  \n  Similar quality like Clojure seamlessly interoperating with Java.\n- Incremental compilation with the Zig self-hosted compiler.  \n  To accomplish this Zig uses a Global Offset Table for all function calls which is similar to Clojure Vars. Therefore it will be likely possible to implement a true REPL.\n- Decomplecting principles  \n  Most higher-level languages have bundled memory management, which disqualifies them from certain use cases. Zig decomplects memory management by introducing explicit Allocator interface, programmer can choose fitting memory management mechanism with regard to performance/convenience trade-offs.\n\n**Status:** *Experimental, but proving itself on a few projects.*\n\n## Examples\n\nHello World:\n\n```clojure\n;; hello.liz\n(const print (.. (@import \"std\") -debug -print))\n\n(defn ^void main []\n  (print \"Hello, world!\\n\" []))\n```\n\nIt will get translated into:\n\n```zig\nconst print = @import(\"std\").debug.print;\npub fn main() void {\n    print(\"Hello, world!\\n\", .{});\n}\n```\n\nRun with:\n\n```\n$ liz hello.liz \u0026\u0026 zig run hello.zig\nHello, world!\n```\n\nFizzBuzz example:\n\n```clojure\n(const print (.. (@import \"std\") -debug -print))\n\n(defn ^void main []\n  (var ^usize i 1)\n  (while-step (\u003c= i 100) (inc! i)\n    (cond\n      (zero? (mod i 15)) (print \"FizzBuzz\\n\" [])\n      (zero? (mod i 3)) (print \"Fizz\\n\" [])\n      (zero? (mod i 5)) (print \"Buzz\\n\" [])\n      :else (print \"{}\\n\" [i]))))\n```\n\nSee also:\n- more [examples](./examples)\n- Advent of Code [solutions](https://github.com/dundalek/adventofcode/tree/master/2020/src/)\n- Rendering [TUI with Notcurses](https://github.com/dundalek/notcurses-zig-example)\n\n## Documentation\n\nRead the work in progress [language guide](./doc/guide.md).  \nTo see how a form is used you can also take a look at [samples](./test/resources/docs-samples.liz) adapted from Zig docs.\n\n## Usage\n\n\n\nDownload [Liz](https://github.com/dundalek/liz/releases/latest) and [Zig](https://ziglang.org/download/#release-0.7.1). To compile files from Liz to Zig pass them as parameters:\n```sh\nliz file1.liz file2.liz\n# file1.zig and file2.zig will be created\n```\n\nThen use `zig run` or `zig build-exe` on the generated `.zig` files.\n\nAlternatively you can use the JAR:\n```\njava -jar liz.jar file1.liz file2.liz\n```\n\n### Extension and Syntax highlighting\n\nUse `.liz` file extension. It works pretty well to use Clojure syntax highlighting, add `-*- clojure -*-` metadata to the source file for Github and text editors to apply highlighting.\n\n```\n;; -*- clojure -*-\n```\n\n## Design principles\n\n- Create 1:1 mapping, everything expressible in Zig should be expressible in Liz, or can be considered a bug.\n- If a Zig feature maps cleanly to Clojure then use the Clojure variant and name.\n- If the mapping conflicts then use the Zig vocabulary.\n\n## License\n\nMIT\n\n## Development\n\nGet the source:\n\n```sh\ngit clone https://github.com/dundalek/liz.git\ncd liz\n```\n\nBuild platform independent uberjar:\n```sh\nscripts/build-jar\n```\n\nBuild the native binary (requires [GraalVM](https://www.graalvm.org/downloads/)):\n```sh\n# If you don't have native-image on PATH then you need to specify GRAALVM_HOME\nexport GRAALVM_HOME=/your/path/to/graal\nscripts/build-native\n```\n\nUse Clojure CLI:\n\n```sh\nclj -M -m liz.main file1.liz file2.liz\n```\n\nRun tests:\n```sh\nclj -Mtest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdundalek%2Fliz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdundalek%2Fliz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdundalek%2Fliz/lists"}