Skip to main content

ClojureScript (Cherry)

ClojureScript is a robust, practical, and fast programming language with a set of useful features that together form a simple, coherent, and powerful tool.

ClojureScript is a compiler for Clojure that targets JavaScript.
In LiveCodes, it runs in the browser using Cherry.

Deprecation

The language aliases: clojurescript, cljs, cljc, clj, edn, clojure will use the self-hosted ClojureScript compiler in the future. If you want to use the Cherry-based ClojureScript compiler, use the alias: clojurescript-cherry or cljs-cherry instead.

Language Info​

Name​

clojurescript-cherry

Aliases​

cljs-cherry

Deprecated aliases: clojurescript, cljs, cljc, clj, edn, clojure

Editor​

script

Compiler​

Cherry

If JSX is used (using #jsx reader tag - example), it is also compiled (JSX). See example usage.

Version​

cherry-cljs: v0.6.38

Code Formatting​

Using Parinfer.

Example Usage​

show code
import { createPlayground } from 'livecodes';

const options = {
"params": {
"cljs": "(ns demo\n ;; you can use npm modules\n (:require [\"canvas-confetti$default\" :as confetti]))\n\n(let [el (js/document.getElementById \"test\")]\n (.addEventListener el \"click\"\n (fn []\n (confetti)\n (println \"test\"))))\n",
"html": "<button id=\"test\">test</button>",
"console": "open"
}
};
createPlayground('#container', options);

Using React (with JSX):

show code
import { createPlayground } from 'livecodes';

const options = {
"template": "clojurescript"
};
createPlayground('#container', options);

Starter Template​

https://livecodes.io/?template=clojurescript