Fork me on GitHub

Got it. Turns out I had a threadpool with a size of 1 somewhere, and that was no bueno.


Oops, yeah, that would do it… Glad you figured it out!


I'm sick of python/hy and want to move my deep learning stack back to Clojure. For the most part all I need is a fast CUDA BLAS library. Is the best clojure has to ofer ?


Getting a no suitable driver exception when using and I'm not sure why. I added the mysql maven dependency to my project structure via maven. Do I need to do something with my project.clj for Lein?


Interesting question, I am in Java and I am implementing AFn and looping with map, calling Clojure from Java. Is Clojure using reflection there?


no.disassemble might help you find your answer - it shows a readable disassembly of the byte code clojure generates


(you could also disassemble an aot compiled clojure function with your IDE)


The question arises because a little JMH benchmark shows that it is slower compared to The function is an identity basically


true, I should look in there


you've been party parroted for the nice suggestion, thanks!


a Java static class that extends AFn seems faster than a AOT-ed namespace that extends AFn


gen class is known to generate slow code


if bronsa is around, he knows more about this


k cool thanks I'll ask him then


try comparing a defn to the other two AFn implementations


Anybody here know how to "de-instrument" a function after debugging in CIDER?


C-M-x the function again


@qqq I would ask that in the numerical-clojure Google group. You may encounter some disagreement, but you'll find out what the options are.


core.matrix might have a BLAS back end.


or try the core.matrix channel here, too.


I came across this quote in a few places: > You can reach a point with Lisp where, between the conceptual simplicity, the > large libraries, and the customization of macros, you are able to write only > code that matters. And, once there, you are able to achieve a very high > degree of focus, such as you would when playing Go, or playing a musical > instrument, or meditating. And then, as with those activities, there can be a > feeling of elation that accompanies that mental state of focus. ... which led me to track down the original source. There's a really interesting Paris Review style Q&A interview between Michael Fogus and Rich Hickey in 2011, as part of the "hackademic journal" called Code Quarterly. You can find the full text of the interview in an unofficial re-post here (Markdown and PDF):


@rduplain excellent, thank you for sharing that link


Nice quote. I'd say though, that my experience has been that writing code full of difficult incidental complexity can perhaps even more easily lead one into what I like to call "fugue" (though that has some perhaps unfortunate connotations.) I think there's an important distinction here- do I have to attain the same mental state later to understand the code I've written 😉.


I've some to think, much as I hate to admit it, that in at least some cases enjoying myself too much when writing code can be a bad sign.


Not to disagree at all with the quote- there is a particular pleasure in having all the pieces fall into place such that things become very simple.


As a matter of personal style, I would say that if code requires as much thought as you suggest, then you are not done working on it.


@rduplain I'd agree- in fact that is to some degree my point.


"only writing code that matters" , to me, means that the code is correct, and the code does not need to be altered in the future. the more i learn about functional programming (using filter, map, reduce, apply, partial) the more i'm able to achieve functional composition of my programs, and the cleaner the code is. not only that, it is very easy to reason about in the future because all the major functional paradigms are applicable in predictable ways. i think the big hurdle is inverting ones' thinking from sequential (for loops and such) to mapping and filtering. it's kind of like riding a bicycle, where the wheels have to be spinning pretty quickly for one to be able to just balance and coast. i think a lot of pre-functional programming stuff made me think very painstakingly about how to get my bike wheels to spin at all, and then maybe get to my destination, whereas the bicycle is already full speed and now i just need to know the actual roadways with clo. /le rant


define:fugue via Google, the second definition which is psychiatric must be your mention of "unfortunate connotations"


hm, very interesting usage of the term. rather different than the musical connotation


@rduplain However I think the state we call "flow" and the psychiatric condition have a lot in common. I like the term, but it is, I suppose prone to mis-interpretation.


I think it is closely related to the musical term, actually.


I'm a big fan of "flow" in the Csíkszentmihályi sense.


Thank you. I'd always assumed there was solid psychology behind "flow" but had never researched it. Your comment prodded me to go look that guy up and read about his work. "Learn something new every day!"


The loss of identity mentioned in the definition of fugue appears to be related to a disorder.


To write a fugue you must be able to keep each melody in mind, while simultaneously bearing in mind the harmony created by the combination of the melodies. as well as observing a number of constraints about how the melodies relate to each other. To write a good fugue you must also be able to hear the entirety of your composition as a whole in your head while writing it, and sprinkle some indefinable magic on top.


But the whole must also be transparently logical to the listener.


bach would have been a great (clojure) programmer. #off-topic ?


Perhaps- I'll stop now 😉.


music composition when done well is the very definition of complecting a design


Music composition is not inherently systematic, is it? The performance of a piece certainly is, especially non-solo performances.


I suppose you can construct systems around it, e.g. the kind that permits jazz players to simply jam with a shared understanding of the governing system.


music theory is extremely systemic


as a musician who believes only in waves, i must humbly disagree


music theory as applied to western instruments that use 12 tones per octave is rich with patterns, but music composition is a different process that must connect what an actual sound is like and the enjoyability. composition is a subset of theory like the universe is a subset of coloring books


the behaviors of waves are also systemic, to the degree of being describable with straightforward math - much more systemic than music theory is


now, if you also believe in human ears - there's another can of worms there, of course


I know what I wanted to say with that originally now; Once your instrument is known to you like the grip of your mug or your spoon, then you can work unimpededly to express yourself.


And so I think that music and flow and also super-smooth-coding derive from the same principle, know your instrument; know its major buttons and keys, but also flip it over and knock on it upside-down and scratch at it and pluck funky bits.


Which of these came first? Bach's music or bach's notes on his music? 😃 However, in programming we can never be apart from the notes, for they are the music. So, sliiightly different in that regard, but still about expressivity


Part of it is that things become automatic, I don't think bach juggled things, I think he learned how to juggle so well he could be asleep and juggling, and then he started whistling, too.


sova what I was getting at when I said composition done well is complecting design, is that good software design involves modularity, reducing scope and side effects and interdependencies to make an easier to understand, more reliable system; while good music composition actually amplifies side effects and scope and interdependencies - for artistic effect. My code is good if I can replace a namespace with a totally different design and nothing breaks, a composition is good if you can't change anything without ruining it.


(though a fan of contemporary electronic dance music might disagree, and point to infinite remixability of a good hook as being equivalent to modular reusability of good code...)


way off topic still, sorry


#off-topic . plus "complect" is not a word.


MW lists it as "obselete," but saying it's "not a word" just is not correct


complect is a word Rich Hickey uses extensively to describe bad design in programming, in his talks about clojure


sure, i studied latin too. the only place u will every see "complect" et al. is in clojure discussions. but it's the classic case of terminological inflation. it means "complicate", no more no less. but using "complect" sounds fancier, as if it meant something more than "complicate", which is plainly not the case.


RH may be a sw genius; that does not make him the arbiter of English usage. quite the opposite, imho.


Sure, but we use it here because we share its definition. Call it 'clojurian jargon' if you'd like 🙂


by using that word I refer to a set of talks that Rich Hickey has made about software design, assuming that most of the people here has read or seen them


mobileink I assume you similarly object to "refactor", "design pattern", etc. ?


no, why? those are ordinary natural English phrases.


fwiw i admit it's a personal peccadilo. i absolutely hate it when tech geeks invwnt bogus new terminology when we already have perfectly adequate language. "decomplect"?? what the hell is wrong with "simplify"?


because usually software that claims to simplify things does so by increasing the complexity of their implementation


decomplect specifically talks about implementation rather than interface


I'm all for using commonplace words, and am no particular fan of "complect" -- but it means more than "complicate" ... things can be complicated without being "fused" or "merging two concepts that should be separate into one"


but there's a practical side to this. by using bizarre and unatural terminilogy like "complect" we make it sound like there is some kind of arcane clojure-fu going on, which is likely ro perplex the noobs. when in fact all we are talikng about is complexity v. simplicity. why fuck it all up with a bunch of stupid pseudo-neoligisms?


@noisesmith so? why do we need an invented term, other than to make it all more impressive.


to be more precise about the meaning - as I said, there's other common usages that mean the exact opposite of what we mean


so it can be clearer to use a term that isn't already in use, if your meaning is distinct


show me one place where "decomplect" could not be replaced by "simplify" (or similar) with no change of meaning.


sure but the meaning (i use the term loosely) of "decomplect" is in no way distinctive. it's just a bullshit version of "simplify".


You mean 'simplect', don't you? (I kid, I kid. 🙂 )


and i'm serious: if anybody can gove me a single example where "decomplect" adds anything to simplify, i'll eat my hat.


@U1YPTG4UF: ooo, that's good, why didn't i think of it?


I can simplify a braid by flattening it so firmly it becomes one solid piece, or I could simplify that braid by unentangling its component parts. Both make it simple, but only one decomposes it.


"the library is simplified" - this could refer to the interface, the implementation, or the range of use cases supported


"the library is decomplected" - it specifically is separated from other unrelated concerns (in comparison to some complected alternative which integrates the concerns without division)


uh huh. and this could not possibly be the case for "decomplect". rilly?


in fact I can "simplify" my code by drastically reducing line count by complecting it by blindly following the api of something it builds on


the resulting code is simpler - less logic, fewer lines of code; it's more complex, it assumes all the complexity of an underlying layer


i geuss you mean the resulting code is simplicated? (thanks, @U1YPTG4UF !)


oh gosh, what have I done


a great service, my friend! it will be much easier now to mock the "complect" crowd!


Simplify is generic, decomplect is specific; it refers to undoing something, untangling previously tangled concerns. Ironically, the word itself is a careful composition - de- complect 😉


as a highly educated native speaker of English: bullshit. i unnerstand etymology. if you want to go that way, what's wrong with "unfold", which is what "decomplect" wants to mean. except that's not really the point, is it. the pont is simplification.


ie "make less complicated"


because, as any linguist would tell you, words have their meanings via usage in communities, and specific meanings evolve over time - the word is significant because in this context it's been used and we are all familiar with this usage (or if we aren't, it refers to a shared conversation we can catch up on)


I used the term because it was used in a specific way in a talk I'd assumed people had seen


@noisesmith "... it's more complex, it assumes all the complexity of an underlying layer" - guess you mean "it's more complected, it assumes all the complectification of... etc."


I was describing why I would use the term complected - notice I also called it more simple


you hate a word, I guess that's fine but I'd prefer not to be scolded for using a word that was being used correctly in context for an audience that understands it


you see the problem? when you proliferate made-up terminology we do not actually need, it becomes harder to communicate. the result is that discourse becomes needlessly "complected".


all words are made up, period


@noisesmith for the record i don't believe i ever scolded you personally. if i did i apologize, use whatever words you want.


my beef is with the terminology, which imo is more harmful than helpful.


Anti-jargon never goes well 😐


I'm all for using clear language and not using new words when existing ones will do, but decomplect in this case has specific connotations other words do not in the context of this community. All jargon is made for more efficient and less noisy communication.


ok, i agree with that. but tell me what "decomplect" expresses that cannot be expressed with the language we already have. i can't find it.


The best I've got is 'unentwine' or 'untangle' or 'unentangle'


as far as "this community" goes, i guess i thought creating a closed priestly language was a non-goal. i mean we could make up all kinds of opaque terms if we wanted to.


ok, but then why not just say "untangle"? what does "decomplect" add that is not alreadt there?


I don't think too many are made up. Most here have likely seen Hickey's talks, and that philosophy drives much of the thought of Clojure's design and the designs created by its users. So it's only natural they'd carry on its use. There aren't a bunch of other terms like it (though folks seem to jokingly introduce them at the keynotes of various Conj conferences.)


sure, it's already embedded in the community, bo thanks to RH worship. does not mean it's good.


It's a common language, therefore it's pragmatic. 😉


i know i'm fighting a losing battle for literacy in the clojure community. but at least i fought the good fight!


ps. i think it's a big (and completely unnecessary) turn-off for outsiders. but so be it .


I'd argue there's much bigger turnoffs for folks in Clojure and that one piece of common jargon is unlikely to be near the top of the list, and in fact might be a way to introduce folks to new concepts when they first hear it.


guys, I'm looking for cool and fast test runner, any suggestion ?


@noisesmith But.. all abstractions leak. And when you are building them you have to be aware of all the levels you're abstracting over, but also of all the leaks below those.


Ideally, you arrive at a non-leaky abstraction, but you still have to think about what you are abstracting over while you build it.


but artistic designs don't tend to aim for non-leaky abstractions - they usually aim for holism, which in software is the opposite of good design


Sure, and that's the point 😉.


To build that abstraction over a number of leaky layers you must mentally complect them.


You cannot arrive at the abstract without a very firm grasp of the concrete.


Also, your abstraction probably still leaks 😉. They generally do.


Not sure of the right channel to ask this in, but: Is Dmitri Sotnikov’s Web Development with Clojure, 2nd Ed ( a good guide to getting a handle on how clientside and serverside Clojure/Script works for developing web apps? (I’m mostly looking for a Clojure/Script version of Michael Hartl’s Ruby on Rails Tutorial (


if you specifically want to do client/server http with clojure, that's the book for you


you might not end up using the exact libraries or designs, but big picture it's the best intro


That’s what I’m looking for, a big picture (and full package) take on writing what is basically an SPA.


yeah - the book has more than that, but will definitely include that, and doesn't have anything you'll regret learning if you want to know how to do a webapp with clojure and clojurescript


Excellent, thanks! Grabbing it soon. I’m by no means a professional developer; I was learning Rails to build it, then Clojure got its hooks in me. Deep.


@jtth Having looked at it but not read it closely I'd ask a couple of questions.


@jtth The big one is how much you want to do with server routing, and how much you want to do with in-client routing, essentially.


Probably more client-side.


Then likely a good read.


Excellent! Thanks.


It covers both sies, but...


For what I'm writing these days, for instance, the Luminus bits would be superfluous.


Just a matter of approcah.


I’ll keep that in mind. I’ve noticed the care (and minimalism) with which clojure programmers select dependencies and libraries.


@noisesmith thanks for your reply, it clears it up. lol at the complect thread xD a whole new string.


@jth A good idea- but I think this crosses language barriers. There comes a point in some apps where you start wanting to not mix logic between server and client (gets more complicated with server-side rendering, but I'll ignore that) and you start wanting to treat servers as pure data endpoints.


This is as true in JS as in Cloure/Clojurescript.


@tagore That’s a trend I’ve started to notice. I (think I) like that architecture.


But it's not the case for every app.


(Yes, Serverside Rendering basically needs a serverside glimpse of what your app shall render as, but that is a good summation @tagore)


Sme thing are still best-written in server-side frameworks. I think the thing to be careful about is mixing the two too much...


For instance I am working on a JS app right now that uses server-side templating to inject data into AngularJS templates. I'd avoid that if possible 😉.


Lordy. That seems complicated. Will avoid!


Hm. That's a very interesting approach. I, for one, enjoy Frankenstein applications. Sometimes the path of least resistance down the mountain of development gets some pretty wild flows.


It does indeed. To the degree that our angular templates us {[ thing ]} for interpolation, because they get passed through two engines, the first of which uses {{ }} for interpolation. No one bothered to explain this to me when I started working there, so on the second day, at lunch, I was like.. you seem to be using Angular syntax that is entirely new to me, and that I can't find documented anywhere... turns out I was not insane, it was just a different templating language mixed in with the Angular templating... don't do that 😉.


Especially since we use it to inject values angular then uses...


Oh man, translating pre-processor stuff in your head...


Well it sounds like you've got a pretty good grip on the lay of the land


Well I've been at the job for a few months now, so I know our wrinkles.


Most places have some- this place is better than most.


Still- I'm inclined to say that you should have one template processor per file 😉


sorry, didn't mean to copy the list.😱


diving into clojure.spec, seems lit


the question disappeared, but I figured it's worth showing the simple clojure.core way to do it:

(reduce (fn [keys-used e]                                                      
          (if (map-entry? e)
            (conj keys-used (key e))                                           
        (tree-seq coll? seq                                                    
                  {:a 0                                                       
                   'foo {1 "foo"                                               
                         "2" [{Double/NaN 22                                   
                               {} nil                                         
                               nil 8}]}}))
=> [:a foo 1 "2" NaN {} nil]


well - relatively simple (probably even simpler in specter)


without using another atom, ist ehre a way to "get info out of a swap!" ? I have an atom, I arm running swap! on the atom. This produces a new value for the atom -- but I also want to get some aux info out. Currently, I have to do something like

(let [ret (atom nil)]
  (swap atm-to-modify
    (... modifies the atom, also puts stuff in ret)
I want to know if there is a variatn fo swap!, where instead of returning new-atom-value, I return [new-atom-value, aux-data]


@qqq the add-watch function allows you to attach a handler function that executes when an atom is modified. this may prove helpful


qqq my preferred way to do this is with a volatile - which is only a small improvement (modifications to ret are guaranteed not to conflict if ret is bound locally (as it should be), and volatiles are faster if you can meet that guarantee)


also, refs can handle this much more naturally (but you probably don't need refs)


@joshjones if qqq's usage is anything like mine, I don't care about arbitrary changes to the atom, but I do care about certain aspects of the state before my alteration was made in that specific scope


of course, if I only care about state after my alteration, I can just use the return value of swap! itself


@qqq I'd use compare-and-set!


oh - I need to remember that one