JonyEpsilon / gorilla-repl

A rich REPL for Clojure in the notebook style.

Home Page:http://gorilla-repl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrate Gorilla-REPL with boot

rqcy opened this issue · comments

commented

Hi, boot is, similarly to leiningen, a build tooling for Clojure.

Recently I started to play with its scripting mode [1], which could be very useful for Gorilla REPL. One can declare dependencies directly in a script (without external project file, e.g., projects.clj)!

It would be really cool, if this worked in Gorilla REPL -- just define all dependencies in one of the cells at the top and let them be handled by boot. The Gorilla files would be self-contained and without a need of creating external directory structure and managing project.clj.

What do you think about this idea? Would it be difficult to implement?

[1] https://github.com/boot-clj/boot/wiki/Scripts

I agree that this would be really neat. Unfortunately, I'm having a bit of trouble getting boot set up on my main computer for mysterious reasons. However, from what I can tell, it seems like this wouldn't be too difficult. The leiningen plugin just runs this, so if we can replicate that with boot, it should work.

There are a few integrations of gorilla repl with boot floating around. I think the most active is this one which is itself forked from a version I created. It's a tiny amount of code and when I last used it in 2016 I don't recall it having any issues. I may be getting back into using gorilla a bit more, so I'd be happy to answer questions or help if necessary.

For example, a minimum viable snippet for a boot script that runs gorilla looks like this:

#!/usr/bin/env boot

(set-env! :dependencies '[[sooheon/boot-gorilla "0.1.1-SNAPSHOT"]])

(require '[sooheon.boot-gorilla :refer [gorilla]])

(defn -main [& args]
  (boot (gorilla :block true)))

Then, chmod +x your_script.clj and ./your_script.clj. Make sure you have boot installed on your path and that should be all you need.