nREPL

nREPL’s logo

Overview

nREPL is a Clojure network REPL that provides a REPL server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.

Why nREPL?

nREPL has been designed with the aim of ensuring that it satisfies the requirements of both application developers (in support of activities ranging from interactive remote debugging and experimentation in development contexts through to more advanced use cases such as updating deployed applications) as well as toolmakers (providing a standard way to connect to and introspect running environments as a way of informing user interfaces of all kinds, including "standard" interactive, text-based REPLs).

The default network protocol used is simple, depending neither on JVM or Clojure specifics, thereby allowing (encouraging?) the development of non-Clojure REPL clients. The REPLs operational semantics are such that essentially any non-JVM Clojure implementation should be able to implement it, with allowances for hosts that lack the concurrency primitives to support e.g. asynchronous evaluation, interrupts, etc.

For more information about the motivation, architecture, use cases, and discussion related to nREPL, see the original design notes, available here, and the notes and discussion around its recent redesign.[1]

Status

Despite its modest version number, nREPL is extremely stable at this point. Its communication protocol and API are rock-solid and battle tested and have been powering much of the existing Clojure tooling for several years now.[2]

Given the massive community investment in developing all sorts of tooling on top of nREPL, nREPL’s team pledges to evolve the project only in a responsible manner and backwards-compatible ways.

The migration of nREPL out of Clojure Contrib is probably the only case where we were forced to make breaking changes.[3] Those are detailed in great detail here.

1. It’s not that recent anymore, as the redesign happened in 2012. It marked the beginning of the long-lived nREPL 0.2 series.
2. nREPL had virtually no alternatives before the introduction of the built-in Socket REPL in Clojure 1.8.
3. Apart from removing deprecated code that is.