This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-05
Channels
- # announcements (2)
- # beginners (44)
- # calva (7)
- # cider (8)
- # cljs-dev (2)
- # clojure (131)
- # clojure-serbia (2)
- # clojure-spec (3)
- # clojure-uk (56)
- # clojurescript (27)
- # cursive (7)
- # datomic (6)
- # fulcro (25)
- # jobs (3)
- # klipse (3)
- # leiningen (2)
- # off-topic (8)
- # overtone (2)
- # pathom (2)
- # portkey (2)
- # re-frame (2)
- # reagent (10)
- # shadow-cljs (44)
- # spacemacs (1)
- # tools-deps (6)
- # uncomplicate (2)
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
Owls?
(and "morning!")
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
@alex.lynham I thought I saw a python transducers lib, 1 sec
https://github.com/cognitect-labs/transducers-python https://github.com/sixty-north/python-transducers
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
@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
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.
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
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'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 http://thi.ng 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 http://thi.ng/geom 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" https://www.reddit.com/r/Clojure/comments/5lhz7q/seq_functions_reducers_transducers_when_do_i_use/
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.