Hi, Dimitris - It looks from Clojure source [1] that Clojure compiles to v1.8 class files, so this should be mean you can run in any JVM 1.8 and beyond.
When you say you are deliberating including Clojure as a proper dependency. I've noticed that some Clojure libraries will have Clojure listed as a dependency in their repository POM but it will be marked with scope `provided` which is a way of saying this is a dependency that the JAR is expected to be provided by the library consumer at runtime. I'm not sure why AOT changes the question of whether to include the Clojure jar as a dependency; I think you have this question with non-precompiled/AOT'd libraries, no? I do understand that with AOT your lib will have *.class files in the JAR that directly reference Clojure classes. But in some IDEs -- just having the dependency as provided will suffice to make it available for linking/compiling. [1] https://github.com/clojure/clojure/commit/38705b49fd3dbae11e94c576ef49ff3eb1c47395 ) On Friday, August 23, 2019 at 2:18:35 PM UTC-5, Jim foo.bar wrote: > > Ok, so after a bit of more thinking/reading, I realise now that my > question was somewhat misplaced. > > Any AOT compiled code (not just gen-class), is an artifact of the compiler > used to compile it, and therefore, in some sense, implicitly tied to that > compiler version. However, that's not to say that the produced class > definitely will or won't work with some other version. If my understanding > is correct, it will work for future versions (which is the main point here) > as long as Clojure itself maintains backwards compatibility (in this case > wrt to gen-class). > > I'm still torn on whether to actually add Clojure as a proper dependency - > I think I will probably end up doing so, but I'm not thrilled about it... > > Kind regards, > > Dimitris > > > On 23/08/2019 08:15, dimitris wrote: > > Why would I write the class in Java, when this below works exactly as > expected? > > (ns foo > (:gen-class :name foo.Bar > :extends java.lang.System$LoggerFinder > :constructors {[] []})) > > (let [slm (delay (-> 'foo/system-logger-memo > requiring-resolve > var-get))] > (defn -getLogger > "Returns a subclass of `System$Logger` which routes logging requests > to the `core/*root*` logger." [this name module] > ;; resolve it at runtime (and only once), ;; in order to prevent AOT > leaking out of this ns (@slm))) > > > My question boils down to this: > > Let's say that I used clojure1.10 to compile the above gen-class. Does the > project containing it need to specify Clojure 1.10 as a proper dependency, > or will the end user be able to provide any version of Clojure greater or > equal to 1.10? > > Thanks in advance... > > Kind regards, > > Dimitris > > > On 23/08/2019 02:00, Matching Socks wrote: > > You are considering gen-class as an alternative to writing the > service-provider class in Java and using only methods in Clojure's public > Java API to connect it with an implementation-in-Clojure? > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clo...@googlegroups.com <javascript:> > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clo...@googlegroups.com <javascript:> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clo...@googlegroups.com <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clojure/0660b640-cf91-429b-9a40-1695e7955aef%40googlegroups.com > > <https://groups.google.com/d/msgid/clojure/0660b640-cf91-429b-9a40-1695e7955aef%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/d6430c24-6e97-4b13-ba21-e81a34f5020e%40googlegroups.com.