Skip to main content

ClojureScript

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.

Note

Lisp language family supported in LiveCodes includes Common Lisp, Scheme, ClojureScript and Fennel.

Language Info

Name

clojurescript

Extensions

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.2.18

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