Fork me on GitHub

Hi… Can any1 give me an example of some code where aot would be really bad?? I never had problem with that, but ppl keeps sayin that is bad


Its hard to explain for ppl in my company, without an example, and i dont have any


if you use aot in a library, you bake in your deps, and force those versions on you library's users

Alex Miller (Clojure team)19:01:43

I don’t think this is really accurate

Alex Miller (Clojure team)19:01:26

You do increase your dependency on a particular version of the Clojure compiler


if you aot compile, you run all your namespaces while building, which can cause bugs that wouldn't happen if you didn't aot compile

Alex Miller (Clojure team)19:01:28

Many of those could be considered bugs in your code too


if you change protocol definitions, aot cache can cause very weird bugs if you forget to fully clean the cache before restarting, or if you reload the new protocol but don't reload code that uses it


well, i will tell them that

Alex Miller (Clojure team)19:01:57

Few responses to those in threads above. I agree with not aot ing libs but I think it’s reasonable thing to consider at app level


So @alexmiller, not at libs, but at services/apps you would recommend to use it then?

Alex Miller (Clojure team)20:01:45

I recommend to consider it when deploying. You may run into some reason it doesnt work but worth trying imo


I see, thanks


I'm playing with Ring and Sente web sockets and I have a question about sessions. In normal REST you return a response with the new session value. Sente's server socket router fn passes the session map to your defined routing multimethod, but I can't figure out how to modify the session from one of my multimethods. For example, something like this doesn't work:

(defmethod msg-handler
  [{:as ev-msg :keys [event id ?data ring-req ?reply-fn send-fn]}]
  (let [{:keys [username password]} ?data
        session (:session ring-req)]
    (when-let [user (authenticate username password)]
        (when ?reply-fn (?reply-fn {:token (jwt/sign user mock-secret)
                                    :exp   (str (time/plus (time/now) (time/seconds 120)))}))
        (assoc session :anything "no bueno")))))


What JRE should I get if I want to use the latest clojure / clj command line tool?


It'll will work with pretty much any JRE @alex-dixon -- what do you have installed?


Thanks. Just intended as a general question / what advice we’d give newcomers. I’m exploring options for making Clojure easier to get started with and looking for something like a sane default / community recommendation


For newcomers who don't already have a JRE installed, I'd just say download the latest stable from Oracle or OpenJDK...


Ok. Thanks. I think Macs come with Java 1.6? In that case would JRE 1.8 still be recommended? Don’t know what JRE is required for Clojure 1.9 TBH…


Clojure itself runs on Java 6 upward. Not all libraries support Java 6 tho'...


That library runs on Java 6 to 9, as well as supporting back to Clojure 1.2.


Whereas (the Contrib JDBC wrapper) only supports back to Clojure 1.7 (but still runs on Java 6 to 9).


That's why there's no recommendations on JRE versions really...


Backward compatibility is a pretty serious thing in the Clojure community. Dropping Java 6 support would be a "big deal". As each library decides to drop support for an old version of Clojure, that's also a "big deal".


And I think Macs don't come with Java at all nowadays @alex-dixon -- it's installed on demand the first time you type java in a Terminal.


@alex-dixon I am not sure I have a Mac without a JVM already installed on which to try this, but I believe if you get a freshly installed Mac with any version of macOS from the last 3 years or so, and type any 'java ...' command in the Terminal, it will offer to install a JVM for you, and it will be Java 1.8.x for some x


There are a few wrinkles with Java 9 and some Clojure tooling (e.g. with not-the-most-recent versions of Leiningen), but other than that, as long as the libraries you are using are happy with the JVM version you are using, you should be good. I regularly run tests of a Clojure tool with multiple JVM versions 1.7 and later with no issues.