% Available Clojure Libraries
% John Gabriele
Libraries available for use with Clojure include:
* clojure.core (the fundamental built-in library of the Clojure
language)
* its own standard libraries (these ship with Clojure)
* the contrib libraries (also standard, but they don't ship with Clojure)
as well as:
* 3rd-party Clojure libs (available via Clojars)
* Java standard class library (comes standard with Java)
* 3rd-party JVM libs (available via Maven Central)
* other Java libs
(Installation and usage is covered in the next chapter.)
Synopsis
========
type of lib namespace standard? ships with Clojure/JVM? location
-------------- ---------------- --------- ----------------------- --------------------------------------------
core clojure.core ✓ ✓ built-in
standard lib clojure.\* ✓ ✓ included with Clojure
contrib clojure.\* ✓ projects at github, jars via Maven Central
3rd-party clj (various) projects at github, jars via Clojars
Java std lib (various) ✓ ✓ included with Java
3rd-party JVM (various) jars via Maven Central
-------------- ---------------- --------- ----------------------- --------------------------------------------
Note that the API docs for the built-ins, standard library, and contrib
are all at .
> Also, it appears that the built-ins + standard lib are sometimes
> referred to collectively as the "core libraries".
clojure.core
============
These are Clojure's built-ins, for example, `map` and `filter`. They
are in the clojure.core namespace (but for convenience, and as a
special case, Clojure makes them always available to you by their
short unqualified names).
Standard Library
================
In addition to clojure.core, Clojure comes with a number of standard
libraries. They're all listed (along with their documentation) at
. Their namespace names
all start with "clojure.", for example, clojure.test and
clojure.pprint.
If you [download the Clojure release](http://clojure.org/downloads)
and look in its "clojure-i.j.k/src/clj/clojure" dir, you can see the
source code files for these libs.
Contrib
=======
Clojure also has a number of standard extra libs ("contrib" libraries)
available, which are not distributed with Clojure proper. They all:
* are listed under "Clojure Contrib Libraries" at .
* live at github as separate projects under the same "clojure" org
as Clojure itself.
* have dots in their project names (making their project names *look like* namespace names)
* have namespace names that start with "clojure." (just like core and standard
libs) and go like "clojure.{contrib-project-name}".
For example, clojure.math.combinatorics and clojure.java.jdbc.
* have documentation available at .
* are owned by their author as well as by Rich Hickey, as per the
Clojure CA ("Contributor Agreement").
Some contrib library naming conventions:
Name prefix Description
----------- ------------------------------------------------------
core. language extensions
java. libraries which wrap existing Java libs
tools. for Clojure tooling
data. for working with various data formats and structures
Libraries from Clojars
======================
There are many libraries available for Clojure at
[Clojars](https://clojars.org/). Clojars is the
"[CPAN](http://en.wikipedia.org/wiki/CPAN) for Clojure", except that
only basic information about a given project is displayed at its
clojars page (namely: a short description, project url, and some
technical info necessary for using the project). To read more about a
given project at Clojars, follow the link on its Clojars page (which
usually leads to its github project page displaying the project
README).
> If a given project is hosted at github, but there's no github link
> at its clojars page, you can help the community by contacting the
> author and letting them know their project may be missing a ":url"
> option in its project.clj file (more details on what that means in
> the next chapter).
Some libraries at Clojars may also be part of an "umbrella project"
(for example, [Clojurewerks](http://clojurewerkz.org/)).
Some Notes on Library Naming
----------------------------
Although Clojure libraries often have interesting and unique names,
it's not uncommon to see libs named either with a "clj-" prefix or a
"-clj" suffix. You'll sometimes see this when:
* the given Clojure lib wraps a Java lib and the author wants to
re-use the Java lib's name, or, when
* the Clojure lib implements a well-known spec/standard and the
author wants to re-use the spec's name).
Java Standard Library: JDK
==========================
Clojure can, of course, use Java's built-in "standard class library".
See the [Java documentation](http://docs.oracle.com/javase/8/docs/)
for what's available.
Java interop is fairly simple (though not discussed in
this guide), and --- as with the Clojure standard libraries ---
there's no extra installation required since you already have Java
installed.
Libraries from Maven Central
============================
There are also many JVM libraries available for use by Clojure at
[Maven Central](http://search.maven.org/). Maven Central is the "CPAN
for the JVM". These libs are typically --- though not necessarily ---
written in Java. (Incidentally, the contrib libraries are actually
hosted at Maven Central rather than at Clojars.)
To find the libraries you need, you might browse around at:
*
*
*
Those collections are large, and may host both libraries *and* tools
(with some tools containing component libraries which you might find
useful as well).
> Incidentally, the Clojure on JBoss app server is
> [Immutant](http://immutant.org/).
Other Java Libraries
====================
You can use Java libraries even if they're not listed at Maven
Central, but doing so is beyond the scope of this document.