3 ms·
There's a flag to disable the static linking if you need the dynamism.
by brandonbloom 11y ago
There's a flag to disable the static linking if you need the dynamism.
- Blackthorn 11y agoDoes this work with jars you get via deps in your Lein project.clj file, like clojure core?
- puredanger 11y agoDirect linking is a compiler option so it affects any source you are compiling with the flag on. If the dependency jar has source files (.clj) and you transitively AOT compile your app with direct linking, then yes. If the jar has class files (.class) then you won't affect that dependency jars calls within itself or out to other libs. But you can compile your own app to directly link into a compiled dependency if it was compiled with Clojure 1.8 (and has the direct methods to call). Clojure core itself is AOT compiled (that has always been true) with direct linking on. So calls within clojure core itself are direct linked - how you compile your own code to call into them is up to the choices you make when you compile. Code compiled with direct linking actually retains both the direct and dynamic call paths so this is always a compile-time decision.