Fork me on GitHub

@jayzawrotny Interesting that, so far, it’s a 50/50 split between “other” and A+B.

Eccentric J22:04:08

Wasn’t expecting that! Wanted to know how to best update Sounds like the path forward is to support clj-new and generate a blank version into a separate repo people who use neither can reference.


I think quite a few people take the approach of "clone a similar project and then hack it into what I want" which isn't really how OSS projects are intended to be used but... ¯\(ツ)


Are you aware of the changes both clj-new and lein new have made recently to better support the Clojars VGNs policy?

Eccentric J00:04:38

Oh good, I wasn't aware those libraries made any changes. I'll read up on that. Thanks for the heads up.


LMK if you have any Qs -- I drafted them first for clj-new and then worked with Phil on Leiningen's changes.

Eccentric J01:04:13

Thank you, will probably start focusing on that one I switch blessed + react-blessed -> ink 3.

Eccentric J01:04:26

btw working on it live at for another hour or so. Password is enclojure if you or anyone wishes to see progress or chat.


When I call function A with function B inside it, function B doesn’t evaluate. When I evaluate function B outside function A with cider, it evaluates. Thoughts?


I’m wondering if it’s a lazy evaluation thing, as function B has a map in it; but trying doall and dorun doesn’t help.


@macrobartfast Guess we’d have to see the code?


haha definitely… I’m trying to isolate/reproduce it as it’s a huge bloated not-my-code mess I can’t post here…


I’ll see if I can do that, though.


I was just praying you were psychic, is all.


You would at least need to provide a bit more precision around terms like “doesn’t evaluate” etc, and explain how you reached the conclusions about what is and what is not happening, i.e., what you tried, what behavior you got, what behavior you expected.


Debugging should be a scientific endeavor, after all…


no, totally fair enough… I’ll do my homework.


Are there any downsides to using a library like to unroll core functions for performance? It seems like almost a no-brainer to me to get some extra performance for free.

Ben Sless06:04:10

As the author (hi 🙂 ), I can think of a few: • bugs. You trust me and my library instead of clojure.core which is better tested and has many more eyes looking at it • load time. If you don't AOT compile your code namespaces will take longer to load and an application will be slower to start • API drift. If the API of any function or macro I implemented changes, I have to keep track of it, otherwise the implementation will become incompatible with time.


Hi and thanks for the reply 😄 I'm least worried about the last point given how famously stable Clojure's API has been over the years, and I see how macroexpansions can hurt load times although it's not a concern in my case. Hopefully this library gets more users / contributors to iron out any bugs!

Ben Sless06:04:28

I also copied tests from Clojure's core which helped me catch a few edge cases


I tried applying it to a portion of my code which deals with lots of nested maps, and immediately got a 35% speedup out of nowhere 😮 Always assumed that the JIT was optimizing away things like this in the background, but apparently simple macroexpansion-time analyses like this can have such a big effect

😮 1
Ben Sless09:04:38

It depends on a few things. First, the JIT needs some time to warm up. Secondly, there's only so much the JIT can do whenever iteration is involved. If you do lots of "get-in" you can't JIT away the iteration unless it's a pretty simple case, usually involving numerical computation

Ben Sless12:04:11

btw, I'm very curious about you you checked this


I actually wrote a small macro which uses clojure.walk to replace any function-head invocations with the inlned macros, then used it to wrap a few high-churn functions (according to the flame graph profiler)

(defmacro inline
  "Rewrites clojure.core fns in head positions
  to their inlined macro versions"
  (let [mapping {'get       `inline/get
                 'get-in    `inline/get-in
                 'assoc     `inline/assoc
                 'dissoc    `inline/dissoc
                 'assoc-in  `inline/assoc-in
                 'dissoc-in `inline/dissoc-in
                 'update-in `inline/update-in
                 'merge     `inline/merge}]
      (fn [x]
        ;; Only replace if it's in function head position
        (if (seq? x)
          (if-let [[head & tail] (seq x)]
            (if (contains? mapping head)
              (cons (mapping head) tail)


Total execution time went from about 7 seconds down to 5, I didn't use Criterium to measure rigorously but it was on a long-running REPL with I assume the JIT being fully warmed up.

Ben Sless06:04:50

Interesting. Thank you. Is that a one-off program? I'd be interested in seeing the run-time for a 100 executions before/after inlining, if you find time


Is there a tool for getting a diff of two large CSV’s?


define "large" 😛 There's Not sure if directly calling git diff --no-index a.csv b.csv would be faster/lighter


there is but the files must be sorted


and of course the general diff


Probably a few million rows. But I’m thinking of a solution which could handle large datasets. Perhaps is the solution. Bit of a sledgehammer though


So I have a weird problem where Leiningen checkouts have stopped working since I made some of my (checked out) libraries .cljc instead of .clj. Basically, requiring some.lib-ns from some.other-lib-ns fails when some.lib-ns is in a .cljc file and is part of a library symlinked to checkouts in my project. However, I can still require that ns from a REPL just fine (i.e. (require 'some.lib-ns) works). Any idea what's going on here? Is there anything I can do about it?


FWIW the error I get is

java.lang.Exception: namespace 'some.lib-ns' not found
clojure.lang.Compiler$CompilerException: Syntax error compiling at (some/other_lib_ns.clj:1:1).


I don't think .cljc makes a difference at all lein checkouts basically places an entry into the classpath. You can debug it with e.g. lein classpath, or ps aux | grep java which will show your clojure process + its classpath


if the desired folder is in the classpath, that allows you to rule out some things


Might be a problem with your indexes. Have you tried File -> Invalidate Caches / Restart... ?


FYI: The work to require verified group names on Clojars has been released. See for more details.

👍 3