Anton Harald
Anton Harald

Reputation: 5964

Having a JVM with Clojure running in the background

Is there a way to have a JVM with Clojure running in the background, which evaluates Clojure code on demand?

The goal is to write some small "scripts" in Clojure, something that one would do with a scripting language like bash for example.

There is a way to write "shebang-style" scripts with the boot building tool, however the execution takes way too long because of the JVM/Clojure startup-time.

Upvotes: 1

Views: 135

Answers (1)

Davyzhu
Davyzhu

Reputation: 1109

Use clojure.tools.nrepl to start a nREPL server that "runs in the background". Then you'll be able to run any "script" by attaching nREPL client to it.

Upvotes: 1

Related Questions