SCI (https://github.com/babashka/sci) is a Clojure interpreter that allows you to evaluate Clojure code even inside of the final native binary and is used in all of the above projects.
Feel free to bug me with questions in the graalvm channel on Clojurians Slack.
I want to slap a bunch of side projects on a small VPS. With Go, this is no problem. Scp the binary (which includes an embedded SQLite), configure it to run as a systemd service, add it to my reverse proxy rules.
I’d love to use Clojure for this, but it doesn’t seem well suited to running in a small, shared environment. Or is it now that there’s AOT?
Pretty similar with Clojure, though because it's not the default mode of operation, more stuff will break. Still, we do this all the time and it's mostly fine.
That said, seems like you should be able to do something pretty similar fairly easily with jars and the JVM (you may not want to run lots of JVMs in the method you're describing, since if you're calling these processes in a one-shot, CGI-style fashion, the JVMs startup time and memory requirements is going to be annoying.)
GP also linked babashka which may be closer to your interests, as its an interpreter for small scripts like these, but also comes with a mechanism (pods) for loading dependencies (like SQLite).
I'm running a side project in Clojure (a guess-the-number-of-covid-cases lottery, https://koronalotek.pl) on a small VPS (Scaleway DEV1-S), and it is no problem either. It runs happily in the 2 GB RAM that the server has; I just installed the JVM, configured a nginx reverse proxy, and am using the standard cli-tools in a screen session to run it.
- babashka (https://github.com/babashka/babashka)
- clj-kondo (https://github.com/clj-kondo/clj-kondo)
- jet (https://github.com/borkdude/jet)
SCI (https://github.com/babashka/sci) is a Clojure interpreter that allows you to evaluate Clojure code even inside of the final native binary and is used in all of the above projects.
Feel free to bug me with questions in the graalvm channel on Clojurians Slack.