The syntax in this reference is Clojure's. Other implementations read the same syntax with the same reader macros, and differ in the host they run on, in which parts of the library they offer, and in their platform feature, the keyword that reader conditionals test.
The implementations
| Dialect | Host and purpose | Files | Reader feature |
|---|---|---|---|
| Clojure | the Java virtual machine; the reference implementation. Compiles to bytecode | .clj, .cljc | :clj |
| ClojureScript | JavaScript; compiled with the Google Closure compiler or shadow-cljs. See ClojureScript and .cljc | .cljs, .cljc | :cljs |
| ClojureCLR | a native implementation of Clojure on the Common Language Runtime of .NET, written in C# and Clojure. It aims to be feature complete and as close to the JVM implementation as possible, and can run as an application or be embedded in a .NET one | .cljr (and .cljc) | :cljr |
Babashka (bb) | a native Clojure interpreter for scripting with fast start-up, a binary built with GraalVM that interprets code with SCI, which implements a substantial subset of Clojure. A self-contained binary: no JVM is needed. Interpreted code is generally not as fast as compiled code, so long-running or loop-heavy scripts may suit the JVM better | .bb (and .clj), bb.edn | :bb (and :clj) |
| SCI | the Small Clojure Interpreter: a library for Clojure and ClojureScript that evaluates Clojure code with a configurable set of namespaces, used to script an application. It is the interpreter inside Babashka | the code it is given | depends on the host |
| Joker | a small Clojure interpreter, linter and formatter written in Go | .joke | its own |
| jank | a Clojure dialect on LLVM with C++ interop: a general-purpose language that wants Clojure's interactive, functional, value-oriented nature with the native runtime of C++. It aims to be strongly compatible with Clojure, with LLVM as its host and C++ as its interop. In alpha | not stated in the README | its own |
| ClojureDart | Clojure that compiles to Dart, for Flutter | .cljd | its own |
An implementation that is not official should use a qualified keyword for its feature, so that unqualified ones stay reserved for the official platforms (:clj, :cljs, :cljr).
How the viewer treats them
- All of the above are read with the same scanner as Clojure:
.cljr,.cljd,.joke,.bootand Babashka scripts are shown as coloured Clojure, each under its own name. - A
.bbfile is shown as a Babashka script when it starts with a shebang line that namesbborbabashka, or when its text begins like Clojure (a form or a comment before one). The extension is also used by BitBake recipes (SUMMARY = "…",inherit,SRC_URI +=); a file with such lines is shown as plain text. - Names of other platforms are plain:
System.Stringand(Console/WriteLine …)in ClojureCLR are read as class names and static calls; a built-in of Babashka (babashka.fs,babashka.process) is coloured as a function when it is called but not as a known library name, because only the standard Clojure namespaces are listed on the standard library page.
Differences from other Lisps
The reference page "Differences with other Lisps" lists, for readers who know Common Lisp or Scheme: Clojure is case sensitive and a Lisp-1; () is not nil; the reader has no side effects; keywords are not symbols; symbols are not storage locations (see vars); nil is not a symbol and t is not syntax, one writes true; the read table is not accessible to programs; let binds sequentially; do is not a loop; there is no tail-call optimisation, so use recur; and syntax-quote resolves symbols, so `x is not the same as 'x, and has auto-gensyms. See Other Lisps for how the viewer tells the Lisp family apart.
Not described
Known, not yet covered
- Reference: only the README of each of Babashka, SCI, Joker, jank and ClojureCLR was downloaded and read; their documentation (the Babashka book, jank book, Joker's standard library, the ClojureCLR wiki), including what each omits from Clojure, is not described.
- Viewer: the library names of these dialects (Babashka's
babashka.fs, Joker'sjoker.*namespaces, ClojureCLR's .NET classes) are not coloured specially, and.bbdetection is by contents only.
Unknown
- Reference: checked against downloaded READMEs and pages: the Joker extension
.joke(Joker README), Babashka's:bbfeature taken together with:clj(Babashka book), SCI's use from Clojure and ClojureScript. Not found in any downloaded page: the extensions.cljd(ClojureDart) and.cljr(ClojureCLR), the description of ClojureDart, Joker's own reader feature, and jank's file extension and feature.
See also
- Tooling – bb.edn and the build tools
- Versions and history – the releases of the JVM implementation