The fastest Clojure REPL in the world – Lumo (by António Nuno Monteiro)
From its announcement
Ideally suited to be used instead of e.g. Bash or Perl, for scripts executed from the (Linux in my case) command prompt. Plus Lumo is multi platform!
Example (an HTTP server for IP logging)
#!/usr/bin/env lumo ;; ;; Adapted from: https://mmcgrana.github.io/2011/09/clojurescript-nodejs.html ;; ;; Twitter: @maridonkers | Google+: +MariDonkers | GitHub: maridonkers ;; (def http (js/require "http")) (def process (js/require "process")) (defn handler [req res] (let [dt (.toISOString (js/Date.)) ip req.connection.remoteAddress] (println (str dt " - " ip)) (.writeHead res 200 (js-obj "Content-Type" "text/html")) (.end res (str "<!DOCTYPE html>" "<html>" "<header><title>IP logger</title></header>" "<body><H1>" ip " was logged at " dt "</H1></body>" "</html>\n")))) (let [host (nth (.-argv process) 3) port (nth (.-argv process) 4) server (.createServer http handler)] (.listen server port host) (println (str "IP logging server running at http://" host ":" port)))
Make the file executable and execute with host and port parameters, e.g. as follows:
And navigate to http://localhost:8000.