{"id":13568460,"url":"https://github.com/squint-cljs/cherry","last_synced_at":"2025-06-10T22:45:03.436Z","repository":{"id":47192668,"uuid":"515929877","full_name":"squint-cljs/cherry","owner":"squint-cljs","description":"Experimental ClojureScript to ES6 module compiler","archived":false,"fork":false,"pushed_at":"2025-05-09T14:07:23.000Z","size":870,"stargazers_count":589,"open_issues_count":8,"forks_count":23,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-09T14:36:46.231Z","etag":null,"topics":["cherry-cljs","clojure","clojurescript"],"latest_commit_sha":null,"homepage":"https://squint-cljs.github.io/cherry","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squint-cljs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"borkdude"}},"created_at":"2022-07-20T10:09:47.000Z","updated_at":"2025-05-09T14:07:24.000Z","dependencies_parsed_at":"2023-12-03T12:28:29.801Z","dependency_job_id":"1e5470da-1fed-4f31-b337-eb50d63c44d0","html_url":"https://github.com/squint-cljs/cherry","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squint-cljs%2Fcherry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squint-cljs%2Fcherry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squint-cljs%2Fcherry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squint-cljs%2Fcherry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squint-cljs","download_url":"https://codeload.github.com/squint-cljs/cherry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squint-cljs%2Fcherry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259166397,"owners_count":22815549,"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":["cherry-cljs","clojure","clojurescript"],"created_at":"2024-08-01T14:00:26.213Z","updated_at":"2025-06-10T22:45:03.409Z","avatar_url":"https://github.com/squint-cljs.png","language":"Clojure","funding_links":["https://github.com/sponsors/borkdude"],"categories":["Clojure"],"sub_categories":[],"readme":"## Cherry :cherries:\n\nExperimental ClojureScript to ES6 module compiler.\n\nReducing friction between ClojureScript and JS tooling.\n\n\u003e :warning: This project is an experiment and not recommended to be used in\n\u003e production. It currently has many bugs and will undergo many breaking changes.\n\nAlso check out [Squint](https://github.com/squint-cljs/squint) which\nis a CLJS _syntax_ to JS compiler.\n\n## Quickstart\n\nAlthough it's early days and far from complete, you're welcome to try out cherry and submit issues.\n\n``` shell\n$ mkdir cherry-test \u0026\u0026 cd cherry-test\n$ npm init -y\n$ npm install cherry-cljs@latest\n```\n\nCreate a `.cljs` file, e.g. `example.cljs`:\n\n``` clojure\n(ns example\n  (:require [\"fs\" :as fs]\n            [\"url\" :refer [fileURLToPath]]))\n\n(prn (fs/existsSync (fileURLToPath js/import.meta.url)))\n\n(defn foo [{:keys [a b c]}]\n  (+ a b c))\n\n(js/console.log (foo {:a 1 :b 2 :c 3}))\n```\n\nThen compile and run (`run` does both):\n\n```\n$ npx cherry run example.cljs\ntrue\n6\n```\n\nRun `npx cherry --help` to see all command line options.\n\n## Examples\n\nA few examples of currenly working projects compiled by cherry:\n\n- [Cherry ClojureScript template on livecodes.io](https://livecodes.io/?template=clojurescript)\n- [playground](https://squint-cljs.github.io/cherry/)\n- [wordle](https://squint-cljs.github.io/cherry/examples/wordle/index.html)\n- [react](https://squint-cljs.github.io/cherry/examples/react/index.html)\n- [vite](examples/vite)\n- [cherry-action-example](https://github.com/borkdude/cherry-action-example)\n\nSee the [examples](examples) directory for more.\n\n## Project goals\n\nGoals of cherry:\n\n- Compile `.cljs` files on the fly into ES6-compatible `.mjs` files.\n- Compiler will be available on NPM and can be used from JS tooling, but isn't\n  part of the compiled output unless explicitly used.\n- Compiled JS files are fairly readable and have source map support for\n  debugging\n- Compiled JS files are linked to one shared NPM module `\"cherry-cljs\"` which\n  contains `cljs.core.js`, `cljs.string`, etc.  such that libraries written in\n  cherry can be compiled and hosted on NPM, while all sharing the same\n  standard library and data structures. See [this\n  tweet](https://twitter.com/borkdude/status/1549830159326404616) on how that\n  looks.\n- Output linked to older versions of cherry will work with newer\n  versions of cherry: i.e. 'binary' compatibility.\n- Light-weight and fast: heavy lifting such as optimizations are expected to be\n  done by JS tooling\n- No dependency on Google Closure: this project will use it for bootstrapping\n  itself (by using the CLJS compiler), but users of this project won't use it for compilation\n- Macro support\n- REPL support\n- Async/await support. See [this tweet](https://twitter.com/borkdude/status/1549843802604638209) for a demo.\n- Native support for JS object destructuring: `[^:js {:keys [a b]} #js {:a 1 :b 2}]`\n- Native support for JSX via `#jsx` reader tag. See [example](https://github.com/squint-cljs/cherry/blob/main/examples/jsx/pages/component.cljs).\n\nCherry may introduce new constructs such as `js-await` which won't be compatible\nwith current CLJS. Also it might not support all features that CLJS offers. As\nsuch, using existing libraries from the CLJS ecosystem or compiling Cherry CLJS\ncode with the CLJS compiler may become challenging. However, some results of\nthis experiment may end up as improvements in the CLJS compiler if they turn out\nto be of value.\n\nSee [slides](https://www.dropbox.com/s/955jgzy6hgpx67r/dcd2022-cljs-reimagined.pdf?dl=0) of a presentation given at Dutch Clojure Days 2022 about cherry and squint.\n\nDepending on interest both from people working on this and the broader\ncommunity, the above goals may or may not be pursued. If you are interested in\nmaturing cherry, please submit\n[issues](https://github.com/squint-cljs/cherry/issues) for bug reports or share\nyour thoughts on [Github\nDiscussions](https://github.com/squint-cljs/cherry/discussions).\n\nCherry started out as a fork of\n[Scriptjure](https://github.com/arohner/scriptjure). Currently it's being\nreworked to meet the above goals.\n\n\u003c!-- ## Funding --\u003e\n\n\u003c!-- This project is developed with the following partners, either by funding time --\u003e\n\u003c!-- and/or money: --\u003e\n\n\u003c!-- - [Nextjournal](https://nextjournal.com/) --\u003e\n\u003c!-- - The main author's [Github Sponsors](https://github.com/sponsors/borkdude) --\u003e\n\n## Embed cherry in a CLJS/shadow app\n\nSee [embed.md](doc/embed.md).\n\n## Development\n\n``` shell\n$ git clone git@github.com:squint-cljs/cherry.git\n$ cd cherry\n$ bb dev\n```\n\n## `defclass`\n\nSee [squint docs](https://github.com/squint-cljs/squint/blob/main/doc/defclass.md).\n\n## `js-template`\n\nSee [squint docs](https://github.com/squint-cljs/squint/blob/main/doc/defclass.md).\n\nLicense\n=======\nCherry is licensed under the EPL, the same as Clojure core and [Scriptjure](https://github.com/arohner/scriptjure). See epl-v10.html in the root directory for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquint-cljs%2Fcherry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquint-cljs%2Fcherry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquint-cljs%2Fcherry/lists"}