Join Arthur Ulfeldt for an in-depth discussion in this video What is Clojure?, part of Up and Running with Clojure.
- So you've heard about Clojure somewhere. What's that? Clojure is a wonderful language for building modern, reliable, concurrent and parallel systems, the kind of programs that people are writing today. It's not a language designed for the future, and it's not a language bound in the past. It's really a language that focuses on the problems people are solving today with existing systems as they go forward. Clojure emphasizes simplicity and immutable data as ways around the problems that we as programmers are facing right now.
Clojure is designed to work with your existing system. It's not a goal to introduce a new language to replace the existing code or the existing services. Everything about Clojure is designed to fit into an existing base. You can take the Clojure Java language and you can build just a couple classes in Clojure. Use it where it fits, don't use it where it doesn't. It's not designed to require you to throw out anything else. Clojure is in the functional programming language family, which means it emphasizes functions, those things you learned in math class.
Value in, value out. Clojure is designed to be compact and fast. If I'm writing something in Clojure that's equivalent to a piece in Java, it's usually on the order of about 1/10 to 1/100 the size when I'm finished, and often produces very nearly the exact same performance characteristics. Where does it come up? Many large Web applications are being written in Clojure today. It's also extremely popular for producing Web page and mobile backend APIs for services written on phones or other Web front-ends.
If you learn one, it covers the rest. In fact, the differences between them can be worked around with a few compiler directives here and there. So it's perfectly possible to write a single file that compiles in all three of these languages. But it is not a goal to make one language that runs on all these platforms. It's more important for each language to embrace the platform it runs on. When you're writing Clojure for Java, it's Java string, it's not some least-common-denominator thing that wraps Java string.
Arthur Ulfeldt covers the Leiningen build tool and setting up Clojure to work with the IntelliJ IDEA dev environment. He then reviews the basics of the syntax, including functions, expressions, values, macros, strings, and conditionals. He shows how to structure, compile, and deploy Clojure projects in Leiningen, and pull from Clojure's core library. In the final chapters, Arthur explores references and namespaces and points to resources to learn more about Clojure.
- Installing Leiningen
- Configuring IntelliJ IDEA
- Using REPLs to execute code
- Working with simple and composite values
- Mastering Clojure macros
- Exploring Clojure syntax
- Building a Clojure project with Leiningen
- Mapping, filtering, and reducing
- Binding and destructuring data
- Working with identities