boot icon indicating copy to clipboard operation
boot copied to clipboard

Creating a binary executable from a Clojure script

Open BuddhiLW opened this issue 2 years ago • 0 comments

Question Can I compile a clojure script, with the boot shebang, and use the binary executable instead of running the start boilerplate evertime?

To Reproduce create a file example.clj,

#!/usr/bin/env boot

(defn -main [& args]
  (println (str "Hello "
                (reduce str (map #(str % ", ") args)))))

Example call,

chmod +x ./example.clj
./example.clj "Peter" "Julian" "Mary"

Outputs:

Hello Peter, Julian, Mary, 

Expected behavior Get an executable that doesn't take 5 seconds to do the same output,

  • with Clojure.
  • without a project folder structure.

Desktop (please complete the following information):

  • OS: Artix Linux

BuddhiLW avatar Dec 12 '21 00:12 BuddhiLW