Fork me on GitHub

mogge 😼


Man the Clojure subreddit really is just relentless stanning half the time


You can tell something is over keen when you broadly agree with the sentiments expressed and still want to nope out


til: stanning, verb, be an overzealous or obsessive fan of a particular celebrity


Rich Hickey?


I'm not obsessed with Rich, I'm just his biggest fan.


In other news, I'm attempting to grow an afro


Rich's hair is really quite complex :thinking_face:

😂 4

Rich removed all the complexity from the code and put it in his hair. Same goes for David Nolen and Ambrose Bonnaire-Sergeant.


Would you say his hair is Complect?


I don’t think Rich braids his hair — complect-hair would be dreadlocks right?


@dharrigan Rich's hair is certainly more complect then my hair.


Mine just a bit of plastic 😉


not today @jasonbell... 😉


> You can tell something is over keen when you broadly agree with the sentiments expressed and still want to nope out A colleague of mine I think accurately (if harshly summed this up as): Clojure come for the functional lisp, stay for the stockholm syndrome :rolling_on_the_floor_laughing:. He’s a massive clojure advocate, but was I think a bit worn out by the types vs dynamic types debate; somewhat stoked by the Maybe not talk.


does that colleague’s name begin with ‘s’ and end with something that rhymes with “wat ho!”


:rolling_on_the_floor_laughing: no not him… it’s one I don’t think you’ve met.


Haha it sounds like something he'd say


At the end of the day though Clojure as a language takes a philosophical stance on software development, with a strong sense of what is idiomatic clojure code. That’s totally great, but it doesn’t need to be religion. The clojure philosophies tend to work well within the language and support each other, but that doesn’t mean they’re the only way; or that other languages/approaches objectively wrong. I also don’t think anyone in particular is actually saying that; it’s just that the debates can sometimes give that impression.


Haskell is objectively wrong. It's distinctly missing objects.


Oh I don’t know… Lambda is the ultimate imperative, the ultimate declarative, and I recon the ultimate object 🙂


potentially dumb question, my intuition has always been that

(map (comp fn2 fn1) coll)
would be quicker than
(->> coll
     (map fn1)
     (map fn2))
…a slightly contrived example, but you get the gist. Basically when you have multiple sequential map operations, if the fns (`fn1` and fn2 in this example) are composable I’d generally have assumed that the program will run quicker if you roll them into one step. But is that actually the case?


yes that would usually be true as you’re not creating intermediate sequences in the former case, so you’ll likely get less GC. But you’ll need to measure to be sure it’s true for your case. However if you really want performance, and don’t require laziness you may find transducing is faster still… i.e. something like: (sequence (comp (map fn1) (map fn2)) coll) But again you’ll need to measure on realistic data

Ben Hammond10:08:59

you need pretty big inputs to notice any difference?

Ben Hammond10:08:16

and then ease-of-maintenance becomes more important


agreed on both counts… lazy sequences are pretty quick, so I’d normally default to them as they’re the most idiomatic & flexible option as not all sequence ops have transducible implementations in clojure.core… so I find I usually need to pull in cgrands xforms if I’m doing anything much more complicated than basic map/filter/reduce things (also having x/for is super handy.)


Morning All 👋


@rickmoynihan yeah, I was about to raise transducers haha


okay, so TL;DR - benchmark it, but probably a qualified ‘yes’