Sweet spot: short running scripts (< 5 seconds): use babashka (Clojure interpreter) • Long running performance intensive processes: use JVM Clojure compiler • Compile with GraalVM native-image for fast startup
Clojure Interpreter (sci) • Written in Clojure itself: .cljc -> runs on JVM and ClojureScript. • Leveraged by other native CLIs and ClojureScript projects • Performance: not as good as compiled Clojure or a Truffle interpreter, but good enough for typical bash-like scripts • Yields small images (~11mb) / JS bundles (~120kb gzipped) • Can be used to glue together natively compiled functions using interpreted code
function calls to native and interpreted fns Text to s- expressions S-expressions to "evaluator" forms Push as much work as possible to analyzer instead of evaluator
places • Writing Clojure on the command line • Babashka and sci internals • https://github.com/babashka/babashka • https://github.com/borkdude/sci On Github: Michiel Borkent @borkdude