4 ms·
I believe Clojure is always compiled.
by wtetzner 4y ago
I believe Clojure is always compiled.
- gleenn 4y agoStart a REPL and you can type code in that is immediately executed, and has no side-effects in terms of classfiles being generated or otherwise. How is that not interpreted?
- wtetzner 4y agoClojure uses a custom classloader to compile and load bytecode at runtime.
- fulafel 4y agoGenerating class files is an optional compilation mode in Clojure. You can also load bytecode and define classes without involving files on the JVM, which is what eval (used by the repl) does https://clojure.org/reference/compilation https://clojure.org/reference/compilation (also see the eval definition at https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3211 https://github.com/clojure/clojure/blob/master/src/clj/cloju... - it calls into the compiler). The JVM could still just interpret the JVM bytecode instead of JIT compiling first of course. Python is also technically compiled like this