nasser / magic

Morgan And Grand Iron Clojure
http://nas.sr/magic/
365 stars 17 forks source link

Double compilation during bootstrap #207

Closed nasser closed 2 years ago

nasser commented 4 years ago

The following namespaces are being double compiled during bootstrapping.

skydread1 commented 3 years ago

Explanation

The double compilation occurs when

Example

clojure.core.protocols requires clojure.set

so if the compilation order is

(compile 'clojure.core.protocols)
(compile 'clojure.set)

clojure.set will be compiled twice (once because required in clojure.core.protocols and once on its own.

but if the compilation order is

(compile 'clojure.set)
(compile 'clojure.core.protocols)

clojure.set will be compiled once.

That's my understanding.

nasser commented 3 years ago

if i recall the expected semantics, compile should see that clojure.set was already compiled and not compile it a second time. does it double compile on the JVM?

nasser commented 2 years ago

Fixed by 8d52baab28c7b78c2d16dc4418bae1c59059edb8