Back to Blog

Clojure for Beginners: Hello REPL — Install & First Program

Celest KimCelest Kim

Video: Clojure in 5 Minutes: Install, REPL & First Function | Ep 1 by Taught by Celeste AI - AI Coding Coach

Watch full page →

Hello REPL — Install Clojure & Run Your First Expression

Welcome to Clojure for Beginners in Neovim. In this first episode we install Clojure, start the REPL, evaluate our first expressions, then write and run a real .clj file. By the end you will have a working Clojure setup and your first function.

Clojure is a modern Lisp on the JVM with a REPL-driven workflow, immutable data, and world-class concurrency. This 45-episode series takes you from zero to a deployed web app across 9 phases. No prior Lisp or functional programming experience required.

1. Install Clojure

macOS (Homebrew):

brew install clojure/tools/clojure

Linux (official install script):

curl -O https://download.clojure.org/install/linux-install.sh
chmod +x linux-install.sh
sudo ./linux-install.sh

Windows (PowerShell):

iwr -useb download.clojure.org/install/win-install.ps1 | iex

Verify the install:

clj --version
# Clojure CLI version 1.12.x

2. Start the REPL

The REPL is where Clojure development lives — evaluate expressions instantly, no compile step.

clj

(println "Hello, Clojure!")
(+ 1 2 3)          ; returns 6
(* 6 7)            ; returns 42
(* 2 (+ 3 4))      ; returns 14
(str "Clojure" " is " "fun")
(count "hello")    ; returns 5

Exit with Ctrl+D.

3. Write hello.clj

;; Episode 1: Hello REPL
;; Clojure for Beginners in Neovim

(println "Hello, Clojure!")

(defn greet [name]
  (str "Hello, " name "!"))

(println (greet "World"))

(println "2 + 3 =" (+ 2 3))

4. Run the File

clj -M hello.clj

Output:

Hello, Clojure!
Hello, World!
2 + 3 = 5

Inside Neovim you can run it with :!clj -M % — no save-build-run cycle, just save and see results.

Key Takeaways

  1. Prefix notation is the one syntactic rule in Clojure — function first, arguments follow. (+ 1 2 3) instead of 1 + 2 + 3.
  2. defn defines a function; the last expression in the body is the return value. No return keyword.
  3. The REPL is where Clojure lives — evaluate instantly with clj, run files with :!clj -M %.

What's Next

In Episode 2 — S-Expressions & Syntax we dig into the one syntactic rule that powers all of Clojure. We cover prefix notation, variable arity, nesting, and the mind-bending idea that code is data.

Student code: GitHub