Skip to content
letronje edited this page Feb 28, 2013 · 9 revisions

To use Drip with Clojure, first you need to download a Clojure jar:

curl http://repo1.maven.org/maven2/org/clojure/clojure/1.4.0/clojure-1.4.0.jar > clojure.jar

Then you can run some code like this:

drip -cp clojure.jar clojure.main -e '(* 6 6)'

Or start a nice Clojure repl quickly with:

rlwrap -a,, -pBlue drip -cp clojure.jar clojure.main

Use with a packaged (standalone) jar is easy. Example:

drip -jar myproject-1.0.0-SNAPSHOT-standalone.jar

Performance

Drip provides a significant speed boost when starting Clojure from the command line.

$ drip kill
$ time drip -cp clojure.jar clojure.main -e '(* 6 6)' # 36    
real    0m1.642s
user    0m2.048s
sys     0m0.115s
$ time drip -cp clojure.jar clojure.main -e '(* 6 6)' # 36    
real    0m0.154s
user    0m0.047s
sys     0m0.051s

Leiningen

You can use Drip with Leiningen to make tasks faster. Just add the following to your ~/.lein/leinrc file:

LEIN_JAVA_CMD=${LEIN_JAVA_CMD-drip}

If you want to temporarily disable or bypass Drip, you can change LEIN_JAVA_CMD for a single command:

LEIN_JAVA_CMD= lein test

Note: Drip doesn't work with Leiningen-2.0.0-preview10. You need to build the latest snapshot version to use with drip.

Clone this wiki locally