Clojure is not an object-oriented language. No classes, no mutable state, no inheritance hierarchies, no nil-safety gymnastics. If you're coming from Ruby, that sounds like a completely different world. But Clojure's approach — functions instead of methods, persistent data structures instead of mutable objects, macros instead of metaprogramming hacks, and the REPL as your constant companion — produces code that is radically simple, effortlessly concurrent, and a joy to work with.
This book is built on one idea: the fastest way for a Rubyist to learn Clojure is to map every Clojure concept back to Ruby. Each chapter starts with Ruby code you already understand, then shows the Clojure equivalent. You're not learning from scratch — you're translating.
What You'll Learn
- Set up a Clojure project with Leiningen and master the REPL-driven workflow
- Understand Clojure's syntax — S-expressions, prefix notation, and why everything is data
- Work with immutable, persistent data structures (vectors, maps, sets) that share structure instead of copying
- Write functions as first-class citizens with
defn, fn, higher-order functions, comp, and partial - Master the seq abstraction:
map, filter, reduce, and lazy evaluation - Use powerful destructuring in function parameters and
let bindings - Interop with the entire Java ecosystem — every Java library is a Clojure library
- Manage state safely with atoms, refs, agents, and core.async channels
- Write macros that extend the language itself
- Build and test a real Clojure project from scratch
Prerequisites
You should know Ruby. You don't need to be an expert — if you can read a Ruby class, understand blocks and Enumerable, and follow a begin/rescue block, you have what you need.
You don't need to know Clojure at all. You don't need to know Java. You don't need to know Lisp. Chapter 1 starts from zero parentheses.
Take the Course
Want to go further? The companion course turns this book into a guided learning path with chapter quizzes, a final exam and a certificate of completion: From Ruby to Clojure: The Course