I'm trying to create a scripting language that compiles to Clojure, to then run it on the JVM. Each individual script, in the same JVM instance, but in an isolated manner.
Yet, when I see the implementation, I see the Clojure environment (namespaces and such) are global, so any alteration to the namespaces one script may make, affects following scripts.
I wonder if there's a way to have multiple temporary, isolated, instances of a Clojure environment in just one JVM. If not, which strategy could I use to avoid polluting global namespaces and potentially having a memory leak.