Instant Clojure Dialect Commands¶
A single command, no prerequisites, a working local Clojure dialect command.
This installs the dialect (very quickly!) and adds its command directory to
PATH.
You can then run the command by name.
$ source <(curl -sL clojure.cc/get) bb && which bb && bb --version
/tmp/clojure-cc-cmd/bin/bb
babashka v1.13.219
The get script
delegates installation to the
cmd.mk Makefile.
It uses Makes to auto-install both the
dialect and its host language (Java, Go, Python, PHP, etc.) into a local cache
directory.
Your system stays clean.
By default, everything is installed under $TMPDIR/clojure-cc-cmd/ (normally
/tmp/clojure-cc-cmd/). Set PREFIX to choose a different self-contained
location:
$ source <(curl -sL clojure.cc/get) jolt JOLT-VERSION=0.7.1 PREFIX=/tmp/foobar && which jolt && jolt --version
/tmp/foobar/bin/jolt
jolt v0.7.1
This installs the public command as /tmp/foobar/bin/jolt and keeps the
versioned Jolt installation, Makes checkout, dependencies, and caches under
/tmp/foobar/share/. If PREFIX ends in /bin or /bin/, the launcher strips
that component and reports the adjusted prefix on standard error.
Note: For the Fish shell, use:
Quick Dialect Usage¶
This table shows the command for each dialect to start its REPL. You can adjust the command to do other things with the dialect like run a program with it.
| Name | Dialect | Host | REPL Command |
|---|---|---|---|
bb |
Babashka | GraalVM | source <(curl -sL clojure.cc/get) bb && bb |
clj |
Clojure | Java | source <(curl -sL clojure.cc/get) clj && clj |
cljgo |
cljgo | Go | source <(curl -sL clojure.cc/get) cljgo && cljgo repl |
glj |
Glojure | Go | source <(curl -sL clojure.cc/get) glj && glj |
gloat |
Gloat | Go | source <(curl -sL clojure.cc/get) gloat && gloat --repl |
gobb |
Gobb | Go | source <(curl -sL clojure.cc/get) gobb && gobb |
hy |
Hy | Python | source <(curl -sL clojure.cc/get) hy && hy |
janet |
Janet | C | source <(curl -sL clojure.cc/get) janet && janet |
joker |
Joker | Go | source <(curl -sL clojure.cc/get) joker && joker |
jolt |
Jolt | Chez Scheme | source <(curl -sL clojure.cc/get) jolt && jolt |
lein |
Leiningen | Java | source <(curl -sL clojure.cc/get) lein && lein repl |
lg |
let-go | Go | source <(curl -sL clojure.cc/get) lg && lg |
phel |
Phel | PHP | source <(curl -sL clojure.cc/get) phel && phel |
Plus:
| Command | Purpose |
|---|---|
make -f <(curl -sL clojure.cc/cmd.mk) shell |
Start a shell with all of the above installed |
make -f <(curl -sL clojure.cc/cmd.mk) help |
Print the help text |
Gloat REPL Client¶
The Gloat REPL client is more featureful than the plain dialect REPLs, with many modern features including:
- Rainbow syntax highlighting
- Tab completion
- Stateful URL sharing
- Multiline forms and history scrolling
See https://gloathub.org/doc/gloat-repl/ for full details.
gloat can connect to dialect nREPL servers started through these launchers:
| Server | Command |
|---|---|
| Babashka | source <(curl -sL clojure.cc/get) gloat && gloat --repl=+bb |
| Jolt | source <(curl -sL clojure.cc/get) gloat && gloat --repl=+jolt |
| let-go | source <(curl -sL clojure.cc/get) gloat && gloat --repl=+lg |
Examples¶
Launch a Glojure REPL:
Evaluate a let-go expression:
Pin a Babashka version:
Or simplify with a shell function:
ccc() {
local dialect=$1
shift
source <(curl -sL clojure.cc/get) "$dialect" && "$dialect" "$@"
}
ccc clj
ccc bb -e '(+ 1 2 3)'
How it works¶
The sourced launcher delegates to a small Makefile that:
- Shallow-clones makeplus/makes into
$PREFIX/share/makes/. - Loads the language-specific module for the requested dialect.
- Downloads the host language toolchain (Java, Go, Python...).
- Downloads and installs the dialect.
- Creates a command wrapper in
$PREFIX/bin/containing the complete runtime environment.
The get script adds the wrapper directory to PATH. The original Makefile
form prints the wrapper's absolute path without changing the calling shell's
environment. Everything lives under the selected prefix; remove that directory
manually when you no longer need the installation.
See makeplus/makes for the implementation details.
Want more dialects?¶
The launcher currently ships with the dialects listed above. If you'd like to see another Clojure dialect supported here, please open an issue on GitHub.