Fork me on GitHub
#graalvm
<
2021-12-21
>
Karol W贸jcik18:12:09

I'm wondering if not used Clojure functions are trimmed from GraalVM native image artifact? I know that for plain Java it works that way, however I'm not sure about Clojure in this case.

borkdude18:12:26

It also works that way for Clojure

borkdude18:12:27

unless you do dynamic stuff like requiring-resolve at runtime which really can bloat the image

馃憤 1
Karol W贸jcik19:12:23

Thanks for clarification. Now, I understand why some of the libraries that load code dynamically produce large artifacts.

borkdude19:12:19

@karol.wojcik yes, you can avoid this by doing the dynamic require at compile time, i.e. top level, but "inline" it's going to bloat stuff. I've made https://github.com/borkdude/dynaload specifically to address that issue (based on dynaload from spec)

Karol W贸jcik20:12:34

Whoa. I was aware of the existence of this library, but never understood it's purpose. Now it's clear to me why it matters.