Fork me on GitHub

it was a classic use-case though - to partition a manifold stream


but I had to upgrade manifold to an alpha, because there was a bug preventing stateful transducers from completing correctly


which also made me think that not so many people were using transducers


I had two cases in a python code base where I was like "oh, I need a transducer!" & was gutted


I wrote one in a tech test a while back as well b/c the test had to mock the side effect of a data pipeline and it was a clean way to just smash together a bunch of ops on like a tiny test fixture to demonstrate that the pipeline would eval to the same thing as a known result


but that was a very contrived example, just happened the transducer was a neat one liner


Why are you all owls?


(and "morning!")


Up in the middle of the night!


Ah, yes, some of them were up very late... and you're up pretty darn early for a Saturday... big plans?


I have to medicate an animal, and I try to keep to my work wake up time so that Monday morning doesn't suck 😁


@dominicm no idea why, I've always been so though


Morning :)…


@alex.lynham I thought I saw a python transducers lib, 1 sec


I typically go to bed at 1-2am and sleep in until 8-9 when it's my choice. Feel more alert if I keep that rhythm


7 hours makes me sleepy


@folcon thanks for the link, will have a look. Ended up jury rigging something with a comp function and then having list operations that delegated to granular ops to get a similar result. It was a lot less terse than a transducer, but still much much terser than the standard 'pythonic' solution would have been. Handed over that project to a team of java contractors muddling their way through python so given the absolute brick wall I had explaining the code design in that style (&why it was different from normal python approach) I suspect a transducer would have been a second bridge too far. I have nightmares of the whole thing being rewritten in for loops with classes all over the place already.


Well at least the other day a permie colleague - who had told me that my rambling about lisp had encouraged her to look up her uni fp module (scheme, I think?) - told me she was moving over to that work stream for a bit. She's hella smart so maybe she's the hero that codebase needs


oh, good luck =)…


Well, code is ephemeral really


Given the constraints (python, legacy systems surrounding the edges, big org, lack of engineer hours) it's probably the most elegant thing I've ever designed/built (with some help on the build - a brilliant colleague who now does python but had done some haskell was so much fun to pair with), but unless you're in charge and have people all at a certain level of understanding/a certain mindset, you can't be too precious about what happens when you hand something over


We're just trying to ship things useful to the business after all


Although it is nice when solutions are elegant and scale 🙂


Various versions of scheme seem popular in University. A colleague mentioned PLT Scheme (racket) from University.


Racket is really awesome as an ecosystem - they have so many super interesting toys. I do get the impression it’s not the fastest scheme implementation; but that’s entirely subjective as I haven’t measured anything.


Dr rackets memory usage indicator is usually quite high


Yeah I’ve noticed that too but I don’t know how indicative that is of anything given that Dr Racket is also an IDE


Good attitude :)…


I remember Thing geom creator Karsten Schmidt did a lot of his lib and coding work using literate programming, has anyone found any resources about how he setup his environment or has done it for a while themselves?


I think he's got a lein template to help and a fair bit written up there.


Oh? Got a link?


Can't find the other atm


I've begun to add an .adoc file next its corresponding .clj file, to discuss what the namespace is doing and why. Somehow docstrings aren't enough, and my current gut feel is to leave documentation around for future readers. The XP tendency to avoid comments just feels wrong nowadays, in Clojure at least.


Not against comments, but what’s wrong with just adding the explanation in git commits? Anytime you can just (magit-)blame and you can see the logic that led to that particular line of code. Also it allows you to use “git pickaxe” effectively. This way you’re documenting that particular change as you go rather than writing the code and then writing your reasoning somewhere else (which I guess is the most often brought up argument against documentation). And what do you write in the commits with .adoc approach ? “For what, see the .adoc I’m committing now” ? Thanks


@U3SG7RX7A: You’re spot on about commits being the place to describe the change… I’ve often done this to include various benchmarks etc describing the motivation for the change before/after etc… but they’re not always the best place to describe the wider approach as that often doesn’t correspond to a single commit in my experience.


I thought somewhere someone mentioned that Karsten was rewriting to stop using literate programming… as it was a barrier to others contributing/using the code… could be wrong.


yeah, he has been doing that. The latest stuff has moved away from literate programming (sadly)


@U050CTFRT How do you ensure things stay in sync? Or is this handled by your editor?


Asciidoctor has this nice feature of tagged includes where you can include code snippets. Call-outs can be embedded too.


It's not perfect and requires frequent maintenance, but that's sort of the point.


Using org mode or something else?


Hmm... I pretty much use transducers anywhere I'd use ->>. If there is no reduce step at the end of my thread last, then I use into, if there is then I use transduce.


I think most people get hung up on how they are implemented rather than how easy they are to use.


Yes, that could work, I just don’t really use emacs much these days, cursive works at the moment :)…


That’s interesting @otfrom, I should give that a go as I don’t use them all that much at the moment =)…


Hmmm indeed, that's actually a pretty good heuristic... might have to take that for a spin.


And this post seems to answer my follow up thought of "besides day to day stuff, which has the best performance in what scenario"


I've begun to add an .adoc file next its corresponding .clj file, to discuss what the namespace is doing and why. Somehow docstrings aren't enough, and my current gut feel is to leave documentation around for future readers. The XP tendency to avoid comments just feels wrong nowadays, in Clojure at least.