Fork me on GitHub
#cljs-dev
<
2022-04-25
>
arohner14:04:41

I wrote a mini-essay in comments that I need to run into a blog post about how AOT works; https://github.com/griffinbank/rules_clojure/blob/main/java/rules_clojure/ClojureWorker.java

dnolen14:04:08

@arohner thanks but in your essay you say this:

dnolen14:04:11

// When loading an AOT'd use of a protocol, the
// definition must be AOT'd and on the classpath (because otherwise
// the definition will be loaded from source, and the source and
// consumer protocol definitions will be in separate classloaders, and therefore be not=

dnolen14:04:16

how is this not a big problem?

dnolen14:04:03

(btw, I'm not interested in whatever workaround you may have come up for this)

arohner14:04:03

Ah sorry, I wasn’t clear. That is a big problem

dnolen14:04:23

so this a deal breaker for @borkdude's comment

borkdude14:04:57

It is only a problem if you use protocols from non-core libraries, since core is already AOT-ed.

borkdude14:04:05

Does CLJS do that?

dnolen14:04:11

we use protocols from other dependencies

borkdude14:04:25

Ah, interesting. Which one for example?

dnolen14:04:46

we would have to audit, but this is simply not interesting at all because who wants to think about this later

borkdude14:04:32

Yes. I would say this is a great reason to not AOT at all when publishing a library. However, as a "tool" it is a different use case.

borkdude15:04:11

I recently had a related problem. I tried to call a Clojure protocol (as interface) from Java but I couldn't since it was not visible in Java. I ended up rewriting that protocol to a Java interface instead.