4 ms·
That change in linkage seems like it would have a serious effect on anything that wanted to hook functions (like this library for doing it: https://github.com/t
by Blackthorn 11y ago
That change in linkage seems like it would have a serious effect on anything that wanted to hook functions (like this library for doing it: https://github.com/technomancy/robert-hooke/ https://github.com/technomancy/robert-hooke/). Isn't the point of rebinding that you don't necessarily know what you're going to want to rebind ahead of time?
- brandonbloom 11y agoThere'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.
- puredanger 11y agoMost of the rebinding that people do is at development time from the REPL. When you AOT compile an app for production and deploy it somewhere, you are (usually) not doing that anymore (other than very specific cases that you would typically know ahead of time).