Chapter 9Java Down and Dirty
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 can get right to the metal. Clojure code compiles to bytecode and does not have to go through any special translation layer on the way to Java.
Clojure embraces Java and its libraries. Idiomatic Clojure code calls Java libraries directly and does not 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 will see how Clojure access to Java is convenient, elegant, and fast:
-
Calling Java is simple ...
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