nasser / magic

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

`datafy` namespace is not available in magic #219

Closed skydread1 closed 3 years ago

skydread1 commented 3 years ago

Problem

The protocols Datafiable and Navigable are not present in clojure.core.protocols.

The namespace datafy is not present in stdlib.

skydread1 commented 3 years ago

What works

I added the Datafiable and Navigable protocols to clojure.core.protocols.

I added the clojure.datafy namespace to stdlib.

I added requiring-resolve to clojure.core because it is called by datafy. I ignored the serialized-require because I did not know how to deal with clojure.lang.RT/REQUIRE_LOCK.

I was able to use datafy in the nostrand repl.

What doesn't not work yet

However, after adding clojure.datafy to the build namespace it is ignored and not build for the bootstrapping.

I was able to generate the clojure.datafy.clj.dll via the nostrand repl and added it to nostrand/references but still, it is ignored while doing the bootstrapping.

skydread1 commented 3 years ago

Update

It is bootstrapping now.

Another issue encountered was the fact that the clojure-clr version was using in datafy.clj

(-> x class .Name symbol) ;; getName

However .Name won't return the fully qualified name so I replaced it by str which seems to do the trick.

nasser commented 3 years ago

merged! thank you!

nasser commented 3 years ago

heads up -- adding vars to clojure.core breaks the bootstrap because we compile clojure.core last. i added a mechanism to build.clj to work around it here. that will have to be updated whenever new vars are introduced to clojure.core until we resolve the load path issue that prevents clojure.core from compiling first during bootstrap.