Chapter 10Java Interop
Clojure’s Java support is both powerful and lean. It’s powerful, in that it brings the expressiveness of Lisp syntax, plus some syntactic sugar tailored to Java. It’s lean, in that it compiles to bytecode without a translation layer and can thus achieve Java-level performance in nearly every case.
Clojure embraces Java and its libraries. Idiomatic Clojure code calls Java libraries directly and doesn’t try to wrap everything under the sun to look like Lisp. This surprises many new Clojure developers but is very pragmatic. Where Java isn’t broken, Clojure doesn’t fix it. In this chapter, you’ll see how Clojure’s access to Java is convenient, elegant, and fast. In addition, you’ll see how to flip the script and call Clojure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access