1.9 KiB
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.
:::info 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
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
import LiveCodes from '../../src/components/LiveCodes.tsx';
export const 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: 'test',
console: 'open',
};
Using React (with JSX):
Starter Template
https://livecodes.io/?template=clojurescript