What library/api does the Clojure compiler (which is just a jar/java application) uses to generate the JVM bytecode? I'm curious since the bytecode is being generated at runtime by java and not javac, so its a java program that outputs jvm bytecode.
How is Byte Code generated? Compiler converts the source code or the Java program into the Byte Code(or machine code), and secondly, the Interpreter executes the byte code on the system. The Interpreter can also be called JVM(Java Virtual Machine).
Clojure is the result of all this. It's a LISP functional programming language running on the JVM designed for concurrent programs.
Clojure programs get compiled to Java bytecode and executed within a JVM process. Clojure programs also have access to Java libraries, and you can easily interact with them using Clojure's interop facilities.
JVM runs the bytecode, Java compiler generates it. However, applications can generate the bytecode while they run, but the generated bytecode is again executed by the JVM.
Clojure uses a Java library called ASM to generate bytecode. A fork of a part of the lib is embedded into the clojure project here: https://github.com/clojure/clojure/tree/master/src/jvm/clojure/asm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With