boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 179 forks source link

Creating a binary executable from a Clojure script #769

Open BuddhiLW opened 2 years ago

BuddhiLW commented 2 years ago

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,

Desktop (please complete the following information):