Fork me on GitHub
#announcements
<
2020-03-12
>
rickmoynihan20:03:35

Interesting — I’d been meaning to look at what would be involved in doing something like this with some of our integrant systems which are essentially dynamically composed from configurations that are loaded through ig/load-namespaces. I’ll need to read this thoroughly to see if I can finally cobble something together. This is like we used to compile clojure code in the good old days! 😁

kszabo20:03:58

I think you can do a simple algorithm like: 1. ig/load-namespaces 2. analyze deps.edn for paths that are pulled in by the current project 3. collect all ns’s loaded from those path’s sources 4. (apply compile (set/difference (all-ns) *1))

seancorfield20:03:15

Please do not have conversations in the #announcements channel.

👍 1
seancorfield20:03:35

Or stick to a single thread under the original announcement.

rickmoynihan20:03:47

Oops sorry sean — I thought this was a different channel!

👍 1
rickmoynihan09:03:48

@U08E8UGF7: That seems a lot more fiddly than what I was thinking. Won’t it be awkward to know what paths/aliases your repl was running with? I was thinking you’d just implement compile-namespaces… probably something like:

(defn compile-namespaces [config keys]
  (doall (->> (ig/dependent-keys config keys)
              (mapcat #(conj (ancestors %) %))
              (mapcat ig/key->namespaces)
              (distinct)
              (compile))))

kszabo09:03:30

The whole point is to not compile the namespaces that you are working in on in the current project, since those will change frequently. You can’t determine where those integrant ns’es are coming from just from the config

kszabo09:03:00

anyway, let’s move this to #integrant

👍 1