O'Reilly logo

Clojure Programming by Brian Carper, Christophe Grand, Chas Emerick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Java and JVM Interoperability

Many languages provide their own purpose-built runtime; popular examples of this approach include Python (CPython), Ruby (MRI), and Java (the JVM).[271] In contrast, Clojure is fundamentally a hosted language, meaning that it targets an existing runtime, also the JVM.[272] This means that rather than reimplementing a variety of foundational facilities (e.g., garbage collection, just-in-time compilation, threading, graphics contexts, etc.) and libraries of all sorts (from basics like String handling to esoterica like cryptographic functions), Clojure simply reuses all of the work that’s been done around the JVM.

Aside from simply being an implementation time saver, targeting a mature host is advantageous for the Clojure programmer as well:

  • The JVM core facilities and ecosystem of libraries are backed by significant engineering organizations. This means that they are generally well-tested, widely used, and aggressively optimized, yielding performance characteristics typically required or desired by most practitioners.

  • Being on the JVM means that there are standard routes of interoperability. Programs written in one language can call on functionality provided by libraries written in other languages, all in the same runtime, with the Java interfaces and the Java object model being the lingua franca.

  • The Java and broader JVM communities are huge, guaranteeing the wide availability of libraries for every domain, an abundance of support materials, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required