How Does Clojure's REPL Maintain State in Java?

ankitdixit

Newbie
Joined
Jan 5, 2022
Messages
1
Reaction score
0
Hello Everyone,

I read online that Clojure uses the ASM library to generate JVM Bytecode, I also saw that Clojure has a REPL.

I assume each line of code executed by the REPL is compiled into a Java class using ASM by this https://www.interviewbit.com/online-java-compiler/ and then that class is loaded to execute the code. If this is the case then each line would cause a new class file to be generated, so I'm not sure how local variables declared on one line could be shared with the lines which follow in the REPL.

Does anyone know how Clojure's REPL works? I tried reading the Clojure source code but I don't know much Clojure. Does anyone know about this?
 
Back
Top